iclient-maplibregl.js 4.6 MB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500255012550225503255042550525506255072550825509255102551125512255132551425515255162551725518255192552025521255222552325524255252552625527255282552925530255312553225533255342553525536255372553825539255402554125542255432554425545255462554725548255492555025551255522555325554255552555625557255582555925560255612556225563255642556525566255672556825569255702557125572255732557425575255762557725578255792558025581255822558325584255852558625587255882558925590255912559225593255942559525596255972559825599256002560125602256032560425605256062560725608256092561025611256122561325614256152561625617256182561925620256212562225623256242562525626256272562825629256302563125632256332563425635256362563725638256392564025641256422564325644256452564625647256482564925650256512565225653256542565525656256572565825659256602566125662256632566425665256662566725668256692567025671256722567325674256752567625677256782567925680256812568225683256842568525686256872568825689256902569125692256932569425695256962569725698256992570025701257022570325704257052570625707257082570925710257112571225713257142571525716257172571825719257202572125722257232572425725257262572725728257292573025731257322573325734257352573625737257382573925740257412574225743257442574525746257472574825749257502575125752257532575425755257562575725758257592576025761257622576325764257652576625767257682576925770257712577225773257742577525776257772577825779257802578125782257832578425785257862578725788257892579025791257922579325794257952579625797257982579925800258012580225803258042580525806258072580825809258102581125812258132581425815258162581725818258192582025821258222582325824258252582625827258282582925830258312583225833258342583525836258372583825839258402584125842258432584425845258462584725848258492585025851258522585325854258552585625857258582585925860258612586225863258642586525866258672586825869258702587125872258732587425875258762587725878258792588025881258822588325884258852588625887258882588925890258912589225893258942589525896258972589825899259002590125902259032590425905259062590725908259092591025911259122591325914259152591625917259182591925920259212592225923259242592525926259272592825929259302593125932259332593425935259362593725938259392594025941259422594325944259452594625947259482594925950259512595225953259542595525956259572595825959259602596125962259632596425965259662596725968259692597025971259722597325974259752597625977259782597925980259812598225983259842598525986259872598825989259902599125992259932599425995259962599725998259992600026001260022600326004260052600626007260082600926010260112601226013260142601526016260172601826019260202602126022260232602426025260262602726028260292603026031260322603326034260352603626037260382603926040260412604226043260442604526046260472604826049260502605126052260532605426055260562605726058260592606026061260622606326064260652606626067260682606926070260712607226073260742607526076260772607826079260802608126082260832608426085260862608726088260892609026091260922609326094260952609626097260982609926100261012610226103261042610526106261072610826109261102611126112261132611426115261162611726118261192612026121261222612326124261252612626127261282612926130261312613226133261342613526136261372613826139261402614126142261432614426145261462614726148261492615026151261522615326154261552615626157261582615926160261612616226163261642616526166261672616826169261702617126172261732617426175261762617726178261792618026181261822618326184261852618626187261882618926190261912619226193261942619526196261972619826199262002620126202262032620426205262062620726208262092621026211262122621326214262152621626217262182621926220262212622226223262242622526226262272622826229262302623126232262332623426235262362623726238262392624026241262422624326244262452624626247262482624926250262512625226253262542625526256262572625826259262602626126262262632626426265262662626726268262692627026271262722627326274262752627626277262782627926280262812628226283262842628526286262872628826289262902629126292262932629426295262962629726298262992630026301263022630326304263052630626307263082630926310263112631226313263142631526316263172631826319263202632126322263232632426325263262632726328263292633026331263322633326334263352633626337263382633926340263412634226343263442634526346263472634826349263502635126352263532635426355263562635726358263592636026361263622636326364263652636626367263682636926370263712637226373263742637526376263772637826379263802638126382263832638426385263862638726388263892639026391263922639326394263952639626397263982639926400264012640226403264042640526406264072640826409264102641126412264132641426415264162641726418264192642026421264222642326424264252642626427264282642926430264312643226433264342643526436264372643826439264402644126442264432644426445264462644726448264492645026451264522645326454264552645626457264582645926460264612646226463264642646526466264672646826469264702647126472264732647426475264762647726478264792648026481264822648326484264852648626487264882648926490264912649226493264942649526496264972649826499265002650126502265032650426505265062650726508265092651026511265122651326514265152651626517265182651926520265212652226523265242652526526265272652826529265302653126532265332653426535265362653726538265392654026541265422654326544265452654626547265482654926550265512655226553265542655526556265572655826559265602656126562265632656426565265662656726568265692657026571265722657326574265752657626577265782657926580265812658226583265842658526586265872658826589265902659126592265932659426595265962659726598265992660026601266022660326604266052660626607266082660926610266112661226613266142661526616266172661826619266202662126622266232662426625266262662726628266292663026631266322663326634266352663626637266382663926640266412664226643266442664526646266472664826649266502665126652266532665426655266562665726658266592666026661266622666326664266652666626667266682666926670266712667226673266742667526676266772667826679266802668126682266832668426685266862668726688266892669026691266922669326694266952669626697266982669926700267012670226703267042670526706267072670826709267102671126712267132671426715267162671726718267192672026721267222672326724267252672626727267282672926730267312673226733267342673526736267372673826739267402674126742267432674426745267462674726748267492675026751267522675326754267552675626757267582675926760267612676226763267642676526766267672676826769267702677126772267732677426775267762677726778267792678026781267822678326784267852678626787267882678926790267912679226793267942679526796267972679826799268002680126802268032680426805268062680726808268092681026811268122681326814268152681626817268182681926820268212682226823268242682526826268272682826829268302683126832268332683426835268362683726838268392684026841268422684326844268452684626847268482684926850268512685226853268542685526856268572685826859268602686126862268632686426865268662686726868268692687026871268722687326874268752687626877268782687926880268812688226883268842688526886268872688826889268902689126892268932689426895268962689726898268992690026901269022690326904269052690626907269082690926910269112691226913269142691526916269172691826919269202692126922269232692426925269262692726928269292693026931269322693326934269352693626937269382693926940269412694226943269442694526946269472694826949269502695126952269532695426955269562695726958269592696026961269622696326964269652696626967269682696926970269712697226973269742697526976269772697826979269802698126982269832698426985269862698726988269892699026991269922699326994269952699626997269982699927000270012700227003270042700527006270072700827009270102701127012270132701427015270162701727018270192702027021270222702327024270252702627027270282702927030270312703227033270342703527036270372703827039270402704127042270432704427045270462704727048270492705027051270522705327054270552705627057270582705927060270612706227063270642706527066270672706827069270702707127072270732707427075270762707727078270792708027081270822708327084270852708627087270882708927090270912709227093270942709527096270972709827099271002710127102271032710427105271062710727108271092711027111271122711327114271152711627117271182711927120271212712227123271242712527126271272712827129271302713127132271332713427135271362713727138271392714027141271422714327144271452714627147271482714927150271512715227153271542715527156271572715827159271602716127162271632716427165271662716727168271692717027171271722717327174271752717627177271782717927180271812718227183271842718527186271872718827189271902719127192271932719427195271962719727198271992720027201272022720327204272052720627207272082720927210272112721227213272142721527216272172721827219272202722127222272232722427225272262722727228272292723027231272322723327234272352723627237272382723927240272412724227243272442724527246272472724827249272502725127252272532725427255272562725727258272592726027261272622726327264272652726627267272682726927270272712727227273272742727527276272772727827279272802728127282272832728427285272862728727288272892729027291272922729327294272952729627297272982729927300273012730227303273042730527306273072730827309273102731127312273132731427315273162731727318273192732027321273222732327324273252732627327273282732927330273312733227333273342733527336273372733827339273402734127342273432734427345273462734727348273492735027351273522735327354273552735627357273582735927360273612736227363273642736527366273672736827369273702737127372273732737427375273762737727378273792738027381273822738327384273852738627387273882738927390273912739227393273942739527396273972739827399274002740127402274032740427405274062740727408274092741027411274122741327414274152741627417274182741927420274212742227423274242742527426274272742827429274302743127432274332743427435274362743727438274392744027441274422744327444274452744627447274482744927450274512745227453274542745527456274572745827459274602746127462274632746427465274662746727468274692747027471274722747327474274752747627477274782747927480274812748227483274842748527486274872748827489274902749127492274932749427495274962749727498274992750027501275022750327504275052750627507275082750927510275112751227513275142751527516275172751827519275202752127522275232752427525275262752727528275292753027531275322753327534275352753627537275382753927540275412754227543275442754527546275472754827549275502755127552275532755427555275562755727558275592756027561275622756327564275652756627567275682756927570275712757227573275742757527576275772757827579275802758127582275832758427585275862758727588275892759027591275922759327594275952759627597275982759927600276012760227603276042760527606276072760827609276102761127612276132761427615276162761727618276192762027621276222762327624276252762627627276282762927630276312763227633276342763527636276372763827639276402764127642276432764427645276462764727648276492765027651276522765327654276552765627657276582765927660276612766227663276642766527666276672766827669276702767127672276732767427675276762767727678276792768027681276822768327684276852768627687276882768927690276912769227693276942769527696276972769827699277002770127702277032770427705277062770727708277092771027711277122771327714277152771627717277182771927720277212772227723277242772527726277272772827729277302773127732277332773427735277362773727738277392774027741277422774327744277452774627747277482774927750277512775227753277542775527756277572775827759277602776127762277632776427765277662776727768277692777027771277722777327774277752777627777277782777927780277812778227783277842778527786277872778827789277902779127792277932779427795277962779727798277992780027801278022780327804278052780627807278082780927810278112781227813278142781527816278172781827819278202782127822278232782427825278262782727828278292783027831278322783327834278352783627837278382783927840278412784227843278442784527846278472784827849278502785127852278532785427855278562785727858278592786027861278622786327864278652786627867278682786927870278712787227873278742787527876278772787827879278802788127882278832788427885278862788727888278892789027891278922789327894278952789627897278982789927900279012790227903279042790527906279072790827909279102791127912279132791427915279162791727918279192792027921279222792327924279252792627927279282792927930279312793227933279342793527936279372793827939279402794127942279432794427945279462794727948279492795027951279522795327954279552795627957279582795927960279612796227963279642796527966279672796827969279702797127972279732797427975279762797727978279792798027981279822798327984279852798627987279882798927990279912799227993279942799527996279972799827999280002800128002280032800428005280062800728008280092801028011280122801328014280152801628017280182801928020280212802228023280242802528026280272802828029280302803128032280332803428035280362803728038280392804028041280422804328044280452804628047280482804928050280512805228053280542805528056280572805828059280602806128062280632806428065280662806728068280692807028071280722807328074280752807628077280782807928080280812808228083280842808528086280872808828089280902809128092280932809428095280962809728098280992810028101281022810328104281052810628107281082810928110281112811228113281142811528116281172811828119281202812128122281232812428125281262812728128281292813028131281322813328134281352813628137281382813928140281412814228143281442814528146281472814828149281502815128152281532815428155281562815728158281592816028161281622816328164281652816628167281682816928170281712817228173281742817528176281772817828179281802818128182281832818428185281862818728188281892819028191281922819328194281952819628197281982819928200282012820228203282042820528206282072820828209282102821128212282132821428215282162821728218282192822028221282222822328224282252822628227282282822928230282312823228233282342823528236282372823828239282402824128242282432824428245282462824728248282492825028251282522825328254282552825628257282582825928260282612826228263282642826528266282672826828269282702827128272282732827428275282762827728278282792828028281282822828328284282852828628287282882828928290282912829228293282942829528296282972829828299283002830128302283032830428305283062830728308283092831028311283122831328314283152831628317283182831928320283212832228323283242832528326283272832828329283302833128332283332833428335283362833728338283392834028341283422834328344283452834628347283482834928350283512835228353283542835528356283572835828359283602836128362283632836428365283662836728368283692837028371283722837328374283752837628377283782837928380283812838228383283842838528386283872838828389283902839128392283932839428395283962839728398283992840028401284022840328404284052840628407284082840928410284112841228413284142841528416284172841828419284202842128422284232842428425284262842728428284292843028431284322843328434284352843628437284382843928440284412844228443284442844528446284472844828449284502845128452284532845428455284562845728458284592846028461284622846328464284652846628467284682846928470284712847228473284742847528476284772847828479284802848128482284832848428485284862848728488284892849028491284922849328494284952849628497284982849928500285012850228503285042850528506285072850828509285102851128512285132851428515285162851728518285192852028521285222852328524285252852628527285282852928530285312853228533285342853528536285372853828539285402854128542285432854428545285462854728548285492855028551285522855328554285552855628557285582855928560285612856228563285642856528566285672856828569285702857128572285732857428575285762857728578285792858028581285822858328584285852858628587285882858928590285912859228593285942859528596285972859828599286002860128602286032860428605286062860728608286092861028611286122861328614286152861628617286182861928620286212862228623286242862528626286272862828629286302863128632286332863428635286362863728638286392864028641286422864328644286452864628647286482864928650286512865228653286542865528656286572865828659286602866128662286632866428665286662866728668286692867028671286722867328674286752867628677286782867928680286812868228683286842868528686286872868828689286902869128692286932869428695286962869728698286992870028701287022870328704287052870628707287082870928710287112871228713287142871528716287172871828719287202872128722287232872428725287262872728728287292873028731287322873328734287352873628737287382873928740287412874228743287442874528746287472874828749287502875128752287532875428755287562875728758287592876028761287622876328764287652876628767287682876928770287712877228773287742877528776287772877828779287802878128782287832878428785287862878728788287892879028791287922879328794287952879628797287982879928800288012880228803288042880528806288072880828809288102881128812288132881428815288162881728818288192882028821288222882328824288252882628827288282882928830288312883228833288342883528836288372883828839288402884128842288432884428845288462884728848288492885028851288522885328854288552885628857288582885928860288612886228863288642886528866288672886828869288702887128872288732887428875288762887728878288792888028881288822888328884288852888628887288882888928890288912889228893288942889528896288972889828899289002890128902289032890428905289062890728908289092891028911289122891328914289152891628917289182891928920289212892228923289242892528926289272892828929289302893128932289332893428935289362893728938289392894028941289422894328944289452894628947289482894928950289512895228953289542895528956289572895828959289602896128962289632896428965289662896728968289692897028971289722897328974289752897628977289782897928980289812898228983289842898528986289872898828989289902899128992289932899428995289962899728998289992900029001290022900329004290052900629007290082900929010290112901229013290142901529016290172901829019290202902129022290232902429025290262902729028290292903029031290322903329034290352903629037290382903929040290412904229043290442904529046290472904829049290502905129052290532905429055290562905729058290592906029061290622906329064290652906629067290682906929070290712907229073290742907529076290772907829079290802908129082290832908429085290862908729088290892909029091290922909329094290952909629097290982909929100291012910229103291042910529106291072910829109291102911129112291132911429115291162911729118291192912029121291222912329124291252912629127291282912929130291312913229133291342913529136291372913829139291402914129142291432914429145291462914729148291492915029151291522915329154291552915629157291582915929160291612916229163291642916529166291672916829169291702917129172291732917429175291762917729178291792918029181291822918329184291852918629187291882918929190291912919229193291942919529196291972919829199292002920129202292032920429205292062920729208292092921029211292122921329214292152921629217292182921929220292212922229223292242922529226292272922829229292302923129232292332923429235292362923729238292392924029241292422924329244292452924629247292482924929250292512925229253292542925529256292572925829259292602926129262292632926429265292662926729268292692927029271292722927329274292752927629277292782927929280292812928229283292842928529286292872928829289292902929129292292932929429295292962929729298292992930029301293022930329304293052930629307293082930929310293112931229313293142931529316293172931829319293202932129322293232932429325293262932729328293292933029331293322933329334293352933629337293382933929340293412934229343293442934529346293472934829349293502935129352293532935429355293562935729358293592936029361293622936329364293652936629367293682936929370293712937229373293742937529376293772937829379293802938129382293832938429385293862938729388293892939029391293922939329394293952939629397293982939929400294012940229403294042940529406294072940829409294102941129412294132941429415294162941729418294192942029421294222942329424294252942629427294282942929430294312943229433294342943529436294372943829439294402944129442294432944429445294462944729448294492945029451294522945329454294552945629457294582945929460294612946229463294642946529466294672946829469294702947129472294732947429475294762947729478294792948029481294822948329484294852948629487294882948929490294912949229493294942949529496294972949829499295002950129502295032950429505295062950729508295092951029511295122951329514295152951629517295182951929520295212952229523295242952529526295272952829529295302953129532295332953429535295362953729538295392954029541295422954329544295452954629547295482954929550295512955229553295542955529556295572955829559295602956129562295632956429565295662956729568295692957029571295722957329574295752957629577295782957929580295812958229583295842958529586295872958829589295902959129592295932959429595295962959729598295992960029601296022960329604296052960629607296082960929610296112961229613296142961529616296172961829619296202962129622296232962429625296262962729628296292963029631296322963329634296352963629637296382963929640296412964229643296442964529646296472964829649296502965129652296532965429655296562965729658296592966029661296622966329664296652966629667296682966929670296712967229673296742967529676296772967829679296802968129682296832968429685296862968729688296892969029691296922969329694296952969629697296982969929700297012970229703297042970529706297072970829709297102971129712297132971429715297162971729718297192972029721297222972329724297252972629727297282972929730297312973229733297342973529736297372973829739297402974129742297432974429745297462974729748297492975029751297522975329754297552975629757297582975929760297612976229763297642976529766297672976829769297702977129772297732977429775297762977729778297792978029781297822978329784297852978629787297882978929790297912979229793297942979529796297972979829799298002980129802298032980429805298062980729808298092981029811298122981329814298152981629817298182981929820298212982229823298242982529826298272982829829298302983129832298332983429835298362983729838298392984029841298422984329844298452984629847298482984929850298512985229853298542985529856298572985829859298602986129862298632986429865298662986729868298692987029871298722987329874298752987629877298782987929880298812988229883298842988529886298872988829889298902989129892298932989429895298962989729898298992990029901299022990329904299052990629907299082990929910299112991229913299142991529916299172991829919299202992129922299232992429925299262992729928299292993029931299322993329934299352993629937299382993929940299412994229943299442994529946299472994829949299502995129952299532995429955299562995729958299592996029961299622996329964299652996629967299682996929970299712997229973299742997529976299772997829979299802998129982299832998429985299862998729988299892999029991299922999329994299952999629997299982999930000300013000230003300043000530006300073000830009300103001130012300133001430015300163001730018300193002030021300223002330024300253002630027300283002930030300313003230033300343003530036300373003830039300403004130042300433004430045300463004730048300493005030051300523005330054300553005630057300583005930060300613006230063300643006530066300673006830069300703007130072300733007430075300763007730078300793008030081300823008330084300853008630087300883008930090300913009230093300943009530096300973009830099301003010130102301033010430105301063010730108301093011030111301123011330114301153011630117301183011930120301213012230123301243012530126301273012830129301303013130132301333013430135301363013730138301393014030141301423014330144301453014630147301483014930150301513015230153301543015530156301573015830159301603016130162301633016430165301663016730168301693017030171301723017330174301753017630177301783017930180301813018230183301843018530186301873018830189301903019130192301933019430195301963019730198301993020030201302023020330204302053020630207302083020930210302113021230213302143021530216302173021830219302203022130222302233022430225302263022730228302293023030231302323023330234302353023630237302383023930240302413024230243302443024530246302473024830249302503025130252302533025430255302563025730258302593026030261302623026330264302653026630267302683026930270302713027230273302743027530276302773027830279302803028130282302833028430285302863028730288302893029030291302923029330294302953029630297302983029930300303013030230303303043030530306303073030830309303103031130312303133031430315303163031730318303193032030321303223032330324303253032630327303283032930330303313033230333303343033530336303373033830339303403034130342303433034430345303463034730348303493035030351303523035330354303553035630357303583035930360303613036230363303643036530366303673036830369303703037130372303733037430375303763037730378303793038030381303823038330384303853038630387303883038930390303913039230393303943039530396303973039830399304003040130402304033040430405304063040730408304093041030411304123041330414304153041630417304183041930420304213042230423304243042530426304273042830429304303043130432304333043430435304363043730438304393044030441304423044330444304453044630447304483044930450304513045230453304543045530456304573045830459304603046130462304633046430465304663046730468304693047030471304723047330474304753047630477304783047930480304813048230483304843048530486304873048830489304903049130492304933049430495304963049730498304993050030501305023050330504305053050630507305083050930510305113051230513305143051530516305173051830519305203052130522305233052430525305263052730528305293053030531305323053330534305353053630537305383053930540305413054230543305443054530546305473054830549305503055130552305533055430555305563055730558305593056030561305623056330564305653056630567305683056930570305713057230573305743057530576305773057830579305803058130582305833058430585305863058730588305893059030591305923059330594305953059630597305983059930600306013060230603306043060530606306073060830609306103061130612306133061430615306163061730618306193062030621306223062330624306253062630627306283062930630306313063230633306343063530636306373063830639306403064130642306433064430645306463064730648306493065030651306523065330654306553065630657306583065930660306613066230663306643066530666306673066830669306703067130672306733067430675306763067730678306793068030681306823068330684306853068630687306883068930690306913069230693306943069530696306973069830699307003070130702307033070430705307063070730708307093071030711307123071330714307153071630717307183071930720307213072230723307243072530726307273072830729307303073130732307333073430735307363073730738307393074030741307423074330744307453074630747307483074930750307513075230753307543075530756307573075830759307603076130762307633076430765307663076730768307693077030771307723077330774307753077630777307783077930780307813078230783307843078530786307873078830789307903079130792307933079430795307963079730798307993080030801308023080330804308053080630807308083080930810308113081230813308143081530816308173081830819308203082130822308233082430825308263082730828308293083030831308323083330834308353083630837308383083930840308413084230843308443084530846308473084830849308503085130852308533085430855308563085730858308593086030861308623086330864308653086630867308683086930870308713087230873308743087530876308773087830879308803088130882308833088430885308863088730888308893089030891308923089330894308953089630897308983089930900309013090230903309043090530906309073090830909309103091130912309133091430915309163091730918309193092030921309223092330924309253092630927309283092930930309313093230933309343093530936309373093830939309403094130942309433094430945309463094730948309493095030951309523095330954309553095630957309583095930960309613096230963309643096530966309673096830969309703097130972309733097430975309763097730978309793098030981309823098330984309853098630987309883098930990309913099230993309943099530996309973099830999310003100131002310033100431005310063100731008310093101031011310123101331014310153101631017310183101931020310213102231023310243102531026310273102831029310303103131032310333103431035310363103731038310393104031041310423104331044310453104631047310483104931050310513105231053310543105531056310573105831059310603106131062310633106431065310663106731068310693107031071310723107331074310753107631077310783107931080310813108231083310843108531086310873108831089310903109131092310933109431095310963109731098310993110031101311023110331104311053110631107311083110931110311113111231113311143111531116311173111831119311203112131122311233112431125311263112731128311293113031131311323113331134311353113631137311383113931140311413114231143311443114531146311473114831149311503115131152311533115431155311563115731158311593116031161311623116331164311653116631167311683116931170311713117231173311743117531176311773117831179311803118131182311833118431185311863118731188311893119031191311923119331194311953119631197311983119931200312013120231203312043120531206312073120831209312103121131212312133121431215312163121731218312193122031221312223122331224312253122631227312283122931230312313123231233312343123531236312373123831239312403124131242312433124431245312463124731248312493125031251312523125331254312553125631257312583125931260312613126231263312643126531266312673126831269312703127131272312733127431275312763127731278312793128031281312823128331284312853128631287312883128931290312913129231293312943129531296312973129831299313003130131302313033130431305313063130731308313093131031311313123131331314313153131631317313183131931320313213132231323313243132531326313273132831329313303133131332313333133431335313363133731338313393134031341313423134331344313453134631347313483134931350313513135231353313543135531356313573135831359313603136131362313633136431365313663136731368313693137031371313723137331374313753137631377313783137931380313813138231383313843138531386313873138831389313903139131392313933139431395313963139731398313993140031401314023140331404314053140631407314083140931410314113141231413314143141531416314173141831419314203142131422314233142431425314263142731428314293143031431314323143331434314353143631437314383143931440314413144231443314443144531446314473144831449314503145131452314533145431455314563145731458314593146031461314623146331464314653146631467314683146931470314713147231473314743147531476314773147831479314803148131482314833148431485314863148731488314893149031491314923149331494314953149631497314983149931500315013150231503315043150531506315073150831509315103151131512315133151431515315163151731518315193152031521315223152331524315253152631527315283152931530315313153231533315343153531536315373153831539315403154131542315433154431545315463154731548315493155031551315523155331554315553155631557315583155931560315613156231563315643156531566315673156831569315703157131572315733157431575315763157731578315793158031581315823158331584315853158631587315883158931590315913159231593315943159531596315973159831599316003160131602316033160431605316063160731608316093161031611316123161331614316153161631617316183161931620316213162231623316243162531626316273162831629316303163131632316333163431635316363163731638316393164031641316423164331644316453164631647316483164931650316513165231653316543165531656316573165831659316603166131662316633166431665316663166731668316693167031671316723167331674316753167631677316783167931680316813168231683316843168531686316873168831689316903169131692316933169431695316963169731698316993170031701317023170331704317053170631707317083170931710317113171231713317143171531716317173171831719317203172131722317233172431725317263172731728317293173031731317323173331734317353173631737317383173931740317413174231743317443174531746317473174831749317503175131752317533175431755317563175731758317593176031761317623176331764317653176631767317683176931770317713177231773317743177531776317773177831779317803178131782317833178431785317863178731788317893179031791317923179331794317953179631797317983179931800318013180231803318043180531806318073180831809318103181131812318133181431815318163181731818318193182031821318223182331824318253182631827318283182931830318313183231833318343183531836318373183831839318403184131842318433184431845318463184731848318493185031851318523185331854318553185631857318583185931860318613186231863318643186531866318673186831869318703187131872318733187431875318763187731878318793188031881318823188331884318853188631887318883188931890318913189231893318943189531896318973189831899319003190131902319033190431905319063190731908319093191031911319123191331914319153191631917319183191931920319213192231923319243192531926319273192831929319303193131932319333193431935319363193731938319393194031941319423194331944319453194631947319483194931950319513195231953319543195531956319573195831959319603196131962319633196431965319663196731968319693197031971319723197331974319753197631977319783197931980319813198231983319843198531986319873198831989319903199131992319933199431995319963199731998319993200032001320023200332004320053200632007320083200932010320113201232013320143201532016320173201832019320203202132022320233202432025320263202732028320293203032031320323203332034320353203632037320383203932040320413204232043320443204532046320473204832049320503205132052320533205432055320563205732058320593206032061320623206332064320653206632067320683206932070320713207232073320743207532076320773207832079320803208132082320833208432085320863208732088320893209032091320923209332094320953209632097320983209932100321013210232103321043210532106321073210832109321103211132112321133211432115321163211732118321193212032121321223212332124321253212632127321283212932130321313213232133321343213532136321373213832139321403214132142321433214432145321463214732148321493215032151321523215332154321553215632157321583215932160321613216232163321643216532166321673216832169321703217132172321733217432175321763217732178321793218032181321823218332184321853218632187321883218932190321913219232193321943219532196321973219832199322003220132202322033220432205322063220732208322093221032211322123221332214322153221632217322183221932220322213222232223322243222532226322273222832229322303223132232322333223432235322363223732238322393224032241322423224332244322453224632247322483224932250322513225232253322543225532256322573225832259322603226132262322633226432265322663226732268322693227032271322723227332274322753227632277322783227932280322813228232283322843228532286322873228832289322903229132292322933229432295322963229732298322993230032301323023230332304323053230632307323083230932310323113231232313323143231532316323173231832319323203232132322323233232432325323263232732328323293233032331323323233332334323353233632337323383233932340323413234232343323443234532346323473234832349323503235132352323533235432355323563235732358323593236032361323623236332364323653236632367323683236932370323713237232373323743237532376323773237832379323803238132382323833238432385323863238732388323893239032391323923239332394323953239632397323983239932400324013240232403324043240532406324073240832409324103241132412324133241432415324163241732418324193242032421324223242332424324253242632427324283242932430324313243232433324343243532436324373243832439324403244132442324433244432445324463244732448324493245032451324523245332454324553245632457324583245932460324613246232463324643246532466324673246832469324703247132472324733247432475324763247732478324793248032481324823248332484324853248632487324883248932490324913249232493324943249532496324973249832499325003250132502325033250432505325063250732508325093251032511325123251332514325153251632517325183251932520325213252232523325243252532526325273252832529325303253132532325333253432535325363253732538325393254032541325423254332544325453254632547325483254932550325513255232553325543255532556325573255832559325603256132562325633256432565325663256732568325693257032571325723257332574325753257632577325783257932580325813258232583325843258532586325873258832589325903259132592325933259432595325963259732598325993260032601326023260332604326053260632607326083260932610326113261232613326143261532616326173261832619326203262132622326233262432625326263262732628326293263032631326323263332634326353263632637326383263932640326413264232643326443264532646326473264832649326503265132652326533265432655326563265732658326593266032661326623266332664326653266632667326683266932670326713267232673326743267532676326773267832679326803268132682326833268432685326863268732688326893269032691326923269332694326953269632697326983269932700327013270232703327043270532706327073270832709327103271132712327133271432715327163271732718327193272032721327223272332724327253272632727327283272932730327313273232733327343273532736327373273832739327403274132742327433274432745327463274732748327493275032751327523275332754327553275632757327583275932760327613276232763327643276532766327673276832769327703277132772327733277432775327763277732778327793278032781327823278332784327853278632787327883278932790327913279232793327943279532796327973279832799328003280132802328033280432805328063280732808328093281032811328123281332814328153281632817328183281932820328213282232823328243282532826328273282832829328303283132832328333283432835328363283732838328393284032841328423284332844328453284632847328483284932850328513285232853328543285532856328573285832859328603286132862328633286432865328663286732868328693287032871328723287332874328753287632877328783287932880328813288232883328843288532886328873288832889328903289132892328933289432895328963289732898328993290032901329023290332904329053290632907329083290932910329113291232913329143291532916329173291832919329203292132922329233292432925329263292732928329293293032931329323293332934329353293632937329383293932940329413294232943329443294532946329473294832949329503295132952329533295432955329563295732958329593296032961329623296332964329653296632967329683296932970329713297232973329743297532976329773297832979329803298132982329833298432985329863298732988329893299032991329923299332994329953299632997329983299933000330013300233003330043300533006330073300833009330103301133012330133301433015330163301733018330193302033021330223302333024330253302633027330283302933030330313303233033330343303533036330373303833039330403304133042330433304433045330463304733048330493305033051330523305333054330553305633057330583305933060330613306233063330643306533066330673306833069330703307133072330733307433075330763307733078330793308033081330823308333084330853308633087330883308933090330913309233093330943309533096330973309833099331003310133102331033310433105331063310733108331093311033111331123311333114331153311633117331183311933120331213312233123331243312533126331273312833129331303313133132331333313433135331363313733138331393314033141331423314333144331453314633147331483314933150331513315233153331543315533156331573315833159331603316133162331633316433165331663316733168331693317033171331723317333174331753317633177331783317933180331813318233183331843318533186331873318833189331903319133192331933319433195331963319733198331993320033201332023320333204332053320633207332083320933210332113321233213332143321533216332173321833219332203322133222332233322433225332263322733228332293323033231332323323333234332353323633237332383323933240332413324233243332443324533246332473324833249332503325133252332533325433255332563325733258332593326033261332623326333264332653326633267332683326933270332713327233273332743327533276332773327833279332803328133282332833328433285332863328733288332893329033291332923329333294332953329633297332983329933300333013330233303333043330533306333073330833309333103331133312333133331433315333163331733318333193332033321333223332333324333253332633327333283332933330333313333233333333343333533336333373333833339333403334133342333433334433345333463334733348333493335033351333523335333354333553335633357333583335933360333613336233363333643336533366333673336833369333703337133372333733337433375333763337733378333793338033381333823338333384333853338633387333883338933390333913339233393333943339533396333973339833399334003340133402334033340433405334063340733408334093341033411334123341333414334153341633417334183341933420334213342233423334243342533426334273342833429334303343133432334333343433435334363343733438334393344033441334423344333444334453344633447334483344933450334513345233453334543345533456334573345833459334603346133462334633346433465334663346733468334693347033471334723347333474334753347633477334783347933480334813348233483334843348533486334873348833489334903349133492334933349433495334963349733498334993350033501335023350333504335053350633507335083350933510335113351233513335143351533516335173351833519335203352133522335233352433525335263352733528335293353033531335323353333534335353353633537335383353933540335413354233543335443354533546335473354833549335503355133552335533355433555335563355733558335593356033561335623356333564335653356633567335683356933570335713357233573335743357533576335773357833579335803358133582335833358433585335863358733588335893359033591335923359333594335953359633597335983359933600336013360233603336043360533606336073360833609336103361133612336133361433615336163361733618336193362033621336223362333624336253362633627336283362933630336313363233633336343363533636336373363833639336403364133642336433364433645336463364733648336493365033651336523365333654336553365633657336583365933660336613366233663336643366533666336673366833669336703367133672336733367433675336763367733678336793368033681336823368333684336853368633687336883368933690336913369233693336943369533696336973369833699337003370133702337033370433705337063370733708337093371033711337123371333714337153371633717337183371933720337213372233723337243372533726337273372833729337303373133732337333373433735337363373733738337393374033741337423374333744337453374633747337483374933750337513375233753337543375533756337573375833759337603376133762337633376433765337663376733768337693377033771337723377333774337753377633777337783377933780337813378233783337843378533786337873378833789337903379133792337933379433795337963379733798337993380033801338023380333804338053380633807338083380933810338113381233813338143381533816338173381833819338203382133822338233382433825338263382733828338293383033831338323383333834338353383633837338383383933840338413384233843338443384533846338473384833849338503385133852338533385433855338563385733858338593386033861338623386333864338653386633867338683386933870338713387233873338743387533876338773387833879338803388133882338833388433885338863388733888338893389033891338923389333894338953389633897338983389933900339013390233903339043390533906339073390833909339103391133912339133391433915339163391733918339193392033921339223392333924339253392633927339283392933930339313393233933339343393533936339373393833939339403394133942339433394433945339463394733948339493395033951339523395333954339553395633957339583395933960339613396233963339643396533966339673396833969339703397133972339733397433975339763397733978339793398033981339823398333984339853398633987339883398933990339913399233993339943399533996339973399833999340003400134002340033400434005340063400734008340093401034011340123401334014340153401634017340183401934020340213402234023340243402534026340273402834029340303403134032340333403434035340363403734038340393404034041340423404334044340453404634047340483404934050340513405234053340543405534056340573405834059340603406134062340633406434065340663406734068340693407034071340723407334074340753407634077340783407934080340813408234083340843408534086340873408834089340903409134092340933409434095340963409734098340993410034101341023410334104341053410634107341083410934110341113411234113341143411534116341173411834119341203412134122341233412434125341263412734128341293413034131341323413334134341353413634137341383413934140341413414234143341443414534146341473414834149341503415134152341533415434155341563415734158341593416034161341623416334164341653416634167341683416934170341713417234173341743417534176341773417834179341803418134182341833418434185341863418734188341893419034191341923419334194341953419634197341983419934200342013420234203342043420534206342073420834209342103421134212342133421434215342163421734218342193422034221342223422334224342253422634227342283422934230342313423234233342343423534236342373423834239342403424134242342433424434245342463424734248342493425034251342523425334254342553425634257342583425934260342613426234263342643426534266342673426834269342703427134272342733427434275342763427734278342793428034281342823428334284342853428634287342883428934290342913429234293342943429534296342973429834299343003430134302343033430434305343063430734308343093431034311343123431334314343153431634317343183431934320343213432234323343243432534326343273432834329343303433134332343333433434335343363433734338343393434034341343423434334344343453434634347343483434934350343513435234353343543435534356343573435834359343603436134362343633436434365343663436734368343693437034371343723437334374343753437634377343783437934380343813438234383343843438534386343873438834389343903439134392343933439434395343963439734398343993440034401344023440334404344053440634407344083440934410344113441234413344143441534416344173441834419344203442134422344233442434425344263442734428344293443034431344323443334434344353443634437344383443934440344413444234443344443444534446344473444834449344503445134452344533445434455344563445734458344593446034461344623446334464344653446634467344683446934470344713447234473344743447534476344773447834479344803448134482344833448434485344863448734488344893449034491344923449334494344953449634497344983449934500345013450234503345043450534506345073450834509345103451134512345133451434515345163451734518345193452034521345223452334524345253452634527345283452934530345313453234533345343453534536345373453834539345403454134542345433454434545345463454734548345493455034551345523455334554345553455634557345583455934560345613456234563345643456534566345673456834569345703457134572345733457434575345763457734578345793458034581345823458334584345853458634587345883458934590345913459234593345943459534596345973459834599346003460134602346033460434605346063460734608346093461034611346123461334614346153461634617346183461934620346213462234623346243462534626346273462834629346303463134632346333463434635346363463734638346393464034641346423464334644346453464634647346483464934650346513465234653346543465534656346573465834659346603466134662346633466434665346663466734668346693467034671346723467334674346753467634677346783467934680346813468234683346843468534686346873468834689346903469134692346933469434695346963469734698346993470034701347023470334704347053470634707347083470934710347113471234713347143471534716347173471834719347203472134722347233472434725347263472734728347293473034731347323473334734347353473634737347383473934740347413474234743347443474534746347473474834749347503475134752347533475434755347563475734758347593476034761347623476334764347653476634767347683476934770347713477234773347743477534776347773477834779347803478134782347833478434785347863478734788347893479034791347923479334794347953479634797347983479934800348013480234803348043480534806348073480834809348103481134812348133481434815348163481734818348193482034821348223482334824348253482634827348283482934830348313483234833348343483534836348373483834839348403484134842348433484434845348463484734848348493485034851348523485334854348553485634857348583485934860348613486234863348643486534866348673486834869348703487134872348733487434875348763487734878348793488034881348823488334884348853488634887348883488934890348913489234893348943489534896348973489834899349003490134902349033490434905349063490734908349093491034911349123491334914349153491634917349183491934920349213492234923349243492534926349273492834929349303493134932349333493434935349363493734938349393494034941349423494334944349453494634947349483494934950349513495234953349543495534956349573495834959349603496134962349633496434965349663496734968349693497034971349723497334974349753497634977349783497934980349813498234983349843498534986349873498834989349903499134992349933499434995349963499734998349993500035001350023500335004350053500635007350083500935010350113501235013350143501535016350173501835019350203502135022350233502435025350263502735028350293503035031350323503335034350353503635037350383503935040350413504235043350443504535046350473504835049350503505135052350533505435055350563505735058350593506035061350623506335064350653506635067350683506935070350713507235073350743507535076350773507835079350803508135082350833508435085350863508735088350893509035091350923509335094350953509635097350983509935100351013510235103351043510535106351073510835109351103511135112351133511435115351163511735118351193512035121351223512335124351253512635127351283512935130351313513235133351343513535136351373513835139351403514135142351433514435145351463514735148351493515035151351523515335154351553515635157351583515935160351613516235163351643516535166351673516835169351703517135172351733517435175351763517735178351793518035181351823518335184351853518635187351883518935190351913519235193351943519535196351973519835199352003520135202352033520435205352063520735208352093521035211352123521335214352153521635217352183521935220352213522235223352243522535226352273522835229352303523135232352333523435235352363523735238352393524035241352423524335244352453524635247352483524935250352513525235253352543525535256352573525835259352603526135262352633526435265352663526735268352693527035271352723527335274352753527635277352783527935280352813528235283352843528535286352873528835289352903529135292352933529435295352963529735298352993530035301353023530335304353053530635307353083530935310353113531235313353143531535316353173531835319353203532135322353233532435325353263532735328353293533035331353323533335334353353533635337353383533935340353413534235343353443534535346353473534835349353503535135352353533535435355353563535735358353593536035361353623536335364353653536635367353683536935370353713537235373353743537535376353773537835379353803538135382353833538435385353863538735388353893539035391353923539335394353953539635397353983539935400354013540235403354043540535406354073540835409354103541135412354133541435415354163541735418354193542035421354223542335424354253542635427354283542935430354313543235433354343543535436354373543835439354403544135442354433544435445354463544735448354493545035451354523545335454354553545635457354583545935460354613546235463354643546535466354673546835469354703547135472354733547435475354763547735478354793548035481354823548335484354853548635487354883548935490354913549235493354943549535496354973549835499355003550135502355033550435505355063550735508355093551035511355123551335514355153551635517355183551935520355213552235523355243552535526355273552835529355303553135532355333553435535355363553735538355393554035541355423554335544355453554635547355483554935550355513555235553355543555535556355573555835559355603556135562355633556435565355663556735568355693557035571355723557335574355753557635577355783557935580355813558235583355843558535586355873558835589355903559135592355933559435595355963559735598355993560035601356023560335604356053560635607356083560935610356113561235613356143561535616356173561835619356203562135622356233562435625356263562735628356293563035631356323563335634356353563635637356383563935640356413564235643356443564535646356473564835649356503565135652356533565435655356563565735658356593566035661356623566335664356653566635667356683566935670356713567235673356743567535676356773567835679356803568135682356833568435685356863568735688356893569035691356923569335694356953569635697356983569935700357013570235703357043570535706357073570835709357103571135712357133571435715357163571735718357193572035721357223572335724357253572635727357283572935730357313573235733357343573535736357373573835739357403574135742357433574435745357463574735748357493575035751357523575335754357553575635757357583575935760357613576235763357643576535766357673576835769357703577135772357733577435775357763577735778357793578035781357823578335784357853578635787357883578935790357913579235793357943579535796357973579835799358003580135802358033580435805358063580735808358093581035811358123581335814358153581635817358183581935820358213582235823358243582535826358273582835829358303583135832358333583435835358363583735838358393584035841358423584335844358453584635847358483584935850358513585235853358543585535856358573585835859358603586135862358633586435865358663586735868358693587035871358723587335874358753587635877358783587935880358813588235883358843588535886358873588835889358903589135892358933589435895358963589735898358993590035901359023590335904359053590635907359083590935910359113591235913359143591535916359173591835919359203592135922359233592435925359263592735928359293593035931359323593335934359353593635937359383593935940359413594235943359443594535946359473594835949359503595135952359533595435955359563595735958359593596035961359623596335964359653596635967359683596935970359713597235973359743597535976359773597835979359803598135982359833598435985359863598735988359893599035991359923599335994359953599635997359983599936000360013600236003360043600536006360073600836009360103601136012360133601436015360163601736018360193602036021360223602336024360253602636027360283602936030360313603236033360343603536036360373603836039360403604136042360433604436045360463604736048360493605036051360523605336054360553605636057360583605936060360613606236063360643606536066360673606836069360703607136072360733607436075360763607736078360793608036081360823608336084360853608636087360883608936090360913609236093360943609536096360973609836099361003610136102361033610436105361063610736108361093611036111361123611336114361153611636117361183611936120361213612236123361243612536126361273612836129361303613136132361333613436135361363613736138361393614036141361423614336144361453614636147361483614936150361513615236153361543615536156361573615836159361603616136162361633616436165361663616736168361693617036171361723617336174361753617636177361783617936180361813618236183361843618536186361873618836189361903619136192361933619436195361963619736198361993620036201362023620336204362053620636207362083620936210362113621236213362143621536216362173621836219362203622136222362233622436225362263622736228362293623036231362323623336234362353623636237362383623936240362413624236243362443624536246362473624836249362503625136252362533625436255362563625736258362593626036261362623626336264362653626636267362683626936270362713627236273362743627536276362773627836279362803628136282362833628436285362863628736288362893629036291362923629336294362953629636297362983629936300363013630236303363043630536306363073630836309363103631136312363133631436315363163631736318363193632036321363223632336324363253632636327363283632936330363313633236333363343633536336363373633836339363403634136342363433634436345363463634736348363493635036351363523635336354363553635636357363583635936360363613636236363363643636536366363673636836369363703637136372363733637436375363763637736378363793638036381363823638336384363853638636387363883638936390363913639236393363943639536396363973639836399364003640136402364033640436405364063640736408364093641036411364123641336414364153641636417364183641936420364213642236423364243642536426364273642836429364303643136432364333643436435364363643736438364393644036441364423644336444364453644636447364483644936450364513645236453364543645536456364573645836459364603646136462364633646436465364663646736468364693647036471364723647336474364753647636477364783647936480364813648236483364843648536486364873648836489364903649136492364933649436495364963649736498364993650036501365023650336504365053650636507365083650936510365113651236513365143651536516365173651836519365203652136522365233652436525365263652736528365293653036531365323653336534365353653636537365383653936540365413654236543365443654536546365473654836549365503655136552365533655436555365563655736558365593656036561365623656336564365653656636567365683656936570365713657236573365743657536576365773657836579365803658136582365833658436585365863658736588365893659036591365923659336594365953659636597365983659936600366013660236603366043660536606366073660836609366103661136612366133661436615366163661736618366193662036621366223662336624366253662636627366283662936630366313663236633366343663536636366373663836639366403664136642366433664436645366463664736648366493665036651366523665336654366553665636657366583665936660366613666236663366643666536666366673666836669366703667136672366733667436675366763667736678366793668036681366823668336684366853668636687366883668936690366913669236693366943669536696366973669836699367003670136702367033670436705367063670736708367093671036711367123671336714367153671636717367183671936720367213672236723367243672536726367273672836729367303673136732367333673436735367363673736738367393674036741367423674336744367453674636747367483674936750367513675236753367543675536756367573675836759367603676136762367633676436765367663676736768367693677036771367723677336774367753677636777367783677936780367813678236783367843678536786367873678836789367903679136792367933679436795367963679736798367993680036801368023680336804368053680636807368083680936810368113681236813368143681536816368173681836819368203682136822368233682436825368263682736828368293683036831368323683336834368353683636837368383683936840368413684236843368443684536846368473684836849368503685136852368533685436855368563685736858368593686036861368623686336864368653686636867368683686936870368713687236873368743687536876368773687836879368803688136882368833688436885368863688736888368893689036891368923689336894368953689636897368983689936900369013690236903369043690536906369073690836909369103691136912369133691436915369163691736918369193692036921369223692336924369253692636927369283692936930369313693236933369343693536936369373693836939369403694136942369433694436945369463694736948369493695036951369523695336954369553695636957369583695936960369613696236963369643696536966369673696836969369703697136972369733697436975369763697736978369793698036981369823698336984369853698636987369883698936990369913699236993369943699536996369973699836999370003700137002370033700437005370063700737008370093701037011370123701337014370153701637017370183701937020370213702237023370243702537026370273702837029370303703137032370333703437035370363703737038370393704037041370423704337044370453704637047370483704937050370513705237053370543705537056370573705837059370603706137062370633706437065370663706737068370693707037071370723707337074370753707637077370783707937080370813708237083370843708537086370873708837089370903709137092370933709437095370963709737098370993710037101371023710337104371053710637107371083710937110371113711237113371143711537116371173711837119371203712137122371233712437125371263712737128371293713037131371323713337134371353713637137371383713937140371413714237143371443714537146371473714837149371503715137152371533715437155371563715737158371593716037161371623716337164371653716637167371683716937170371713717237173371743717537176371773717837179371803718137182371833718437185371863718737188371893719037191371923719337194371953719637197371983719937200372013720237203372043720537206372073720837209372103721137212372133721437215372163721737218372193722037221372223722337224372253722637227372283722937230372313723237233372343723537236372373723837239372403724137242372433724437245372463724737248372493725037251372523725337254372553725637257372583725937260372613726237263372643726537266372673726837269372703727137272372733727437275372763727737278372793728037281372823728337284372853728637287372883728937290372913729237293372943729537296372973729837299373003730137302373033730437305373063730737308373093731037311373123731337314373153731637317373183731937320373213732237323373243732537326373273732837329373303733137332373333733437335373363733737338373393734037341373423734337344373453734637347373483734937350373513735237353373543735537356373573735837359373603736137362373633736437365373663736737368373693737037371373723737337374373753737637377373783737937380373813738237383373843738537386373873738837389373903739137392373933739437395373963739737398373993740037401374023740337404374053740637407374083740937410374113741237413374143741537416374173741837419374203742137422374233742437425374263742737428374293743037431374323743337434374353743637437374383743937440374413744237443374443744537446374473744837449374503745137452374533745437455374563745737458374593746037461374623746337464374653746637467374683746937470374713747237473374743747537476374773747837479374803748137482374833748437485374863748737488374893749037491374923749337494374953749637497374983749937500375013750237503375043750537506375073750837509375103751137512375133751437515375163751737518375193752037521375223752337524375253752637527375283752937530375313753237533375343753537536375373753837539375403754137542375433754437545375463754737548375493755037551375523755337554375553755637557375583755937560375613756237563375643756537566375673756837569375703757137572375733757437575375763757737578375793758037581375823758337584375853758637587375883758937590375913759237593375943759537596375973759837599376003760137602376033760437605376063760737608376093761037611376123761337614376153761637617376183761937620376213762237623376243762537626376273762837629376303763137632376333763437635376363763737638376393764037641376423764337644376453764637647376483764937650376513765237653376543765537656376573765837659376603766137662376633766437665376663766737668376693767037671376723767337674376753767637677376783767937680376813768237683376843768537686376873768837689376903769137692376933769437695376963769737698376993770037701377023770337704377053770637707377083770937710377113771237713377143771537716377173771837719377203772137722377233772437725377263772737728377293773037731377323773337734377353773637737377383773937740377413774237743377443774537746377473774837749377503775137752377533775437755377563775737758377593776037761377623776337764377653776637767377683776937770377713777237773377743777537776377773777837779377803778137782377833778437785377863778737788377893779037791377923779337794377953779637797377983779937800378013780237803378043780537806378073780837809378103781137812378133781437815378163781737818378193782037821378223782337824378253782637827378283782937830378313783237833378343783537836378373783837839378403784137842378433784437845378463784737848378493785037851378523785337854378553785637857378583785937860378613786237863378643786537866378673786837869378703787137872378733787437875378763787737878378793788037881378823788337884378853788637887378883788937890378913789237893378943789537896378973789837899379003790137902379033790437905379063790737908379093791037911379123791337914379153791637917379183791937920379213792237923379243792537926379273792837929379303793137932379333793437935379363793737938379393794037941379423794337944379453794637947379483794937950379513795237953379543795537956379573795837959379603796137962379633796437965379663796737968379693797037971379723797337974379753797637977379783797937980379813798237983379843798537986379873798837989379903799137992379933799437995379963799737998379993800038001380023800338004380053800638007380083800938010380113801238013380143801538016380173801838019380203802138022380233802438025380263802738028380293803038031380323803338034380353803638037380383803938040380413804238043380443804538046380473804838049380503805138052380533805438055380563805738058380593806038061380623806338064380653806638067380683806938070380713807238073380743807538076380773807838079380803808138082380833808438085380863808738088380893809038091380923809338094380953809638097380983809938100381013810238103381043810538106381073810838109381103811138112381133811438115381163811738118381193812038121381223812338124381253812638127381283812938130381313813238133381343813538136381373813838139381403814138142381433814438145381463814738148381493815038151381523815338154381553815638157381583815938160381613816238163381643816538166381673816838169381703817138172381733817438175381763817738178381793818038181381823818338184381853818638187381883818938190381913819238193381943819538196381973819838199382003820138202382033820438205382063820738208382093821038211382123821338214382153821638217382183821938220382213822238223382243822538226382273822838229382303823138232382333823438235382363823738238382393824038241382423824338244382453824638247382483824938250382513825238253382543825538256382573825838259382603826138262382633826438265382663826738268382693827038271382723827338274382753827638277382783827938280382813828238283382843828538286382873828838289382903829138292382933829438295382963829738298382993830038301383023830338304383053830638307383083830938310383113831238313383143831538316383173831838319383203832138322383233832438325383263832738328383293833038331383323833338334383353833638337383383833938340383413834238343383443834538346383473834838349383503835138352383533835438355383563835738358383593836038361383623836338364383653836638367383683836938370383713837238373383743837538376383773837838379383803838138382383833838438385383863838738388383893839038391383923839338394383953839638397383983839938400384013840238403384043840538406384073840838409384103841138412384133841438415384163841738418384193842038421384223842338424384253842638427384283842938430384313843238433384343843538436384373843838439384403844138442384433844438445384463844738448384493845038451384523845338454384553845638457384583845938460384613846238463384643846538466384673846838469384703847138472384733847438475384763847738478384793848038481384823848338484384853848638487384883848938490384913849238493384943849538496384973849838499385003850138502385033850438505385063850738508385093851038511385123851338514385153851638517385183851938520385213852238523385243852538526385273852838529385303853138532385333853438535385363853738538385393854038541385423854338544385453854638547385483854938550385513855238553385543855538556385573855838559385603856138562385633856438565385663856738568385693857038571385723857338574385753857638577385783857938580385813858238583385843858538586385873858838589385903859138592385933859438595385963859738598385993860038601386023860338604386053860638607386083860938610386113861238613386143861538616386173861838619386203862138622386233862438625386263862738628386293863038631386323863338634386353863638637386383863938640386413864238643386443864538646386473864838649386503865138652386533865438655386563865738658386593866038661386623866338664386653866638667386683866938670386713867238673386743867538676386773867838679386803868138682386833868438685386863868738688386893869038691386923869338694386953869638697386983869938700387013870238703387043870538706387073870838709387103871138712387133871438715387163871738718387193872038721387223872338724387253872638727387283872938730387313873238733387343873538736387373873838739387403874138742387433874438745387463874738748387493875038751387523875338754387553875638757387583875938760387613876238763387643876538766387673876838769387703877138772387733877438775387763877738778387793878038781387823878338784387853878638787387883878938790387913879238793387943879538796387973879838799388003880138802388033880438805388063880738808388093881038811388123881338814388153881638817388183881938820388213882238823388243882538826388273882838829388303883138832388333883438835388363883738838388393884038841388423884338844388453884638847388483884938850388513885238853388543885538856388573885838859388603886138862388633886438865388663886738868388693887038871388723887338874388753887638877388783887938880388813888238883388843888538886388873888838889388903889138892388933889438895388963889738898388993890038901389023890338904389053890638907389083890938910389113891238913389143891538916389173891838919389203892138922389233892438925389263892738928389293893038931389323893338934389353893638937389383893938940389413894238943389443894538946389473894838949389503895138952389533895438955389563895738958389593896038961389623896338964389653896638967389683896938970389713897238973389743897538976389773897838979389803898138982389833898438985389863898738988389893899038991389923899338994389953899638997389983899939000390013900239003390043900539006390073900839009390103901139012390133901439015390163901739018390193902039021390223902339024390253902639027390283902939030390313903239033390343903539036390373903839039390403904139042390433904439045390463904739048390493905039051390523905339054390553905639057390583905939060390613906239063390643906539066390673906839069390703907139072390733907439075390763907739078390793908039081390823908339084390853908639087390883908939090390913909239093390943909539096390973909839099391003910139102391033910439105391063910739108391093911039111391123911339114391153911639117391183911939120391213912239123391243912539126391273912839129391303913139132391333913439135391363913739138391393914039141391423914339144391453914639147391483914939150391513915239153391543915539156391573915839159391603916139162391633916439165391663916739168391693917039171391723917339174391753917639177391783917939180391813918239183391843918539186391873918839189391903919139192391933919439195391963919739198391993920039201392023920339204392053920639207392083920939210392113921239213392143921539216392173921839219392203922139222392233922439225392263922739228392293923039231392323923339234392353923639237392383923939240392413924239243392443924539246392473924839249392503925139252392533925439255392563925739258392593926039261392623926339264392653926639267392683926939270392713927239273392743927539276392773927839279392803928139282392833928439285392863928739288392893929039291392923929339294392953929639297392983929939300393013930239303393043930539306393073930839309393103931139312393133931439315393163931739318393193932039321393223932339324393253932639327393283932939330393313933239333393343933539336393373933839339393403934139342393433934439345393463934739348393493935039351393523935339354393553935639357393583935939360393613936239363393643936539366393673936839369393703937139372393733937439375393763937739378393793938039381393823938339384393853938639387393883938939390393913939239393393943939539396393973939839399394003940139402394033940439405394063940739408394093941039411394123941339414394153941639417394183941939420394213942239423394243942539426394273942839429394303943139432394333943439435394363943739438394393944039441394423944339444394453944639447394483944939450394513945239453394543945539456394573945839459394603946139462394633946439465394663946739468394693947039471394723947339474394753947639477394783947939480394813948239483394843948539486394873948839489394903949139492394933949439495394963949739498394993950039501395023950339504395053950639507395083950939510395113951239513395143951539516395173951839519395203952139522395233952439525395263952739528395293953039531395323953339534395353953639537395383953939540395413954239543395443954539546395473954839549395503955139552395533955439555395563955739558395593956039561395623956339564395653956639567395683956939570395713957239573395743957539576395773957839579395803958139582395833958439585395863958739588395893959039591395923959339594395953959639597395983959939600396013960239603396043960539606396073960839609396103961139612396133961439615396163961739618396193962039621396223962339624396253962639627396283962939630396313963239633396343963539636396373963839639396403964139642396433964439645396463964739648396493965039651396523965339654396553965639657396583965939660396613966239663396643966539666396673966839669396703967139672396733967439675396763967739678396793968039681396823968339684396853968639687396883968939690396913969239693396943969539696396973969839699397003970139702397033970439705397063970739708397093971039711397123971339714397153971639717397183971939720397213972239723397243972539726397273972839729397303973139732397333973439735397363973739738397393974039741397423974339744397453974639747397483974939750397513975239753397543975539756397573975839759397603976139762397633976439765397663976739768397693977039771397723977339774397753977639777397783977939780397813978239783397843978539786397873978839789397903979139792397933979439795397963979739798397993980039801398023980339804398053980639807398083980939810398113981239813398143981539816398173981839819398203982139822398233982439825398263982739828398293983039831398323983339834398353983639837398383983939840398413984239843398443984539846398473984839849398503985139852398533985439855398563985739858398593986039861398623986339864398653986639867398683986939870398713987239873398743987539876398773987839879398803988139882398833988439885398863988739888398893989039891398923989339894398953989639897398983989939900399013990239903399043990539906399073990839909399103991139912399133991439915399163991739918399193992039921399223992339924399253992639927399283992939930399313993239933399343993539936399373993839939399403994139942399433994439945399463994739948399493995039951399523995339954399553995639957399583995939960399613996239963399643996539966399673996839969399703997139972399733997439975399763997739978399793998039981399823998339984399853998639987399883998939990399913999239993399943999539996399973999839999400004000140002400034000440005400064000740008400094001040011400124001340014400154001640017400184001940020400214002240023400244002540026400274002840029400304003140032400334003440035400364003740038400394004040041400424004340044400454004640047400484004940050400514005240053400544005540056400574005840059400604006140062400634006440065400664006740068400694007040071400724007340074400754007640077400784007940080400814008240083400844008540086400874008840089400904009140092400934009440095400964009740098400994010040101401024010340104401054010640107401084010940110401114011240113401144011540116401174011840119401204012140122401234012440125401264012740128401294013040131401324013340134401354013640137401384013940140401414014240143401444014540146401474014840149401504015140152401534015440155401564015740158401594016040161401624016340164401654016640167401684016940170401714017240173401744017540176401774017840179401804018140182401834018440185401864018740188401894019040191401924019340194401954019640197401984019940200402014020240203402044020540206402074020840209402104021140212402134021440215402164021740218402194022040221402224022340224402254022640227402284022940230402314023240233402344023540236402374023840239402404024140242402434024440245402464024740248402494025040251402524025340254402554025640257402584025940260402614026240263402644026540266402674026840269402704027140272402734027440275402764027740278402794028040281402824028340284402854028640287402884028940290402914029240293402944029540296402974029840299403004030140302403034030440305403064030740308403094031040311403124031340314403154031640317403184031940320403214032240323403244032540326403274032840329403304033140332403334033440335403364033740338403394034040341403424034340344403454034640347403484034940350403514035240353403544035540356403574035840359403604036140362403634036440365403664036740368403694037040371403724037340374403754037640377403784037940380403814038240383403844038540386403874038840389403904039140392403934039440395403964039740398403994040040401404024040340404404054040640407404084040940410404114041240413404144041540416404174041840419404204042140422404234042440425404264042740428404294043040431404324043340434404354043640437404384043940440404414044240443404444044540446404474044840449404504045140452404534045440455404564045740458404594046040461404624046340464404654046640467404684046940470404714047240473404744047540476404774047840479404804048140482404834048440485404864048740488404894049040491404924049340494404954049640497404984049940500405014050240503405044050540506405074050840509405104051140512405134051440515405164051740518405194052040521405224052340524405254052640527405284052940530405314053240533405344053540536405374053840539405404054140542405434054440545405464054740548405494055040551405524055340554405554055640557405584055940560405614056240563405644056540566405674056840569405704057140572405734057440575405764057740578405794058040581405824058340584405854058640587405884058940590405914059240593405944059540596405974059840599406004060140602406034060440605406064060740608406094061040611406124061340614406154061640617406184061940620406214062240623406244062540626406274062840629406304063140632406334063440635406364063740638406394064040641406424064340644406454064640647406484064940650406514065240653406544065540656406574065840659406604066140662406634066440665406664066740668406694067040671406724067340674406754067640677406784067940680406814068240683406844068540686406874068840689406904069140692406934069440695406964069740698406994070040701407024070340704407054070640707407084070940710407114071240713407144071540716407174071840719407204072140722407234072440725407264072740728407294073040731407324073340734407354073640737407384073940740407414074240743407444074540746407474074840749407504075140752407534075440755407564075740758407594076040761407624076340764407654076640767407684076940770407714077240773407744077540776407774077840779407804078140782407834078440785407864078740788407894079040791407924079340794407954079640797407984079940800408014080240803408044080540806408074080840809408104081140812408134081440815408164081740818408194082040821408224082340824408254082640827408284082940830408314083240833408344083540836408374083840839408404084140842408434084440845408464084740848408494085040851408524085340854408554085640857408584085940860408614086240863408644086540866408674086840869408704087140872408734087440875408764087740878408794088040881408824088340884408854088640887408884088940890408914089240893408944089540896408974089840899409004090140902409034090440905409064090740908409094091040911409124091340914409154091640917409184091940920409214092240923409244092540926409274092840929409304093140932409334093440935409364093740938409394094040941409424094340944409454094640947409484094940950409514095240953409544095540956409574095840959409604096140962409634096440965409664096740968409694097040971409724097340974409754097640977409784097940980409814098240983409844098540986409874098840989409904099140992409934099440995409964099740998409994100041001410024100341004410054100641007410084100941010410114101241013410144101541016410174101841019410204102141022410234102441025410264102741028410294103041031410324103341034410354103641037410384103941040410414104241043410444104541046410474104841049410504105141052410534105441055410564105741058410594106041061410624106341064410654106641067410684106941070410714107241073410744107541076410774107841079410804108141082410834108441085410864108741088410894109041091410924109341094410954109641097410984109941100411014110241103411044110541106411074110841109411104111141112411134111441115411164111741118411194112041121411224112341124411254112641127411284112941130411314113241133411344113541136411374113841139411404114141142411434114441145411464114741148411494115041151411524115341154411554115641157411584115941160411614116241163411644116541166411674116841169411704117141172411734117441175411764117741178411794118041181411824118341184411854118641187411884118941190411914119241193411944119541196411974119841199412004120141202412034120441205412064120741208412094121041211412124121341214412154121641217412184121941220412214122241223412244122541226412274122841229412304123141232412334123441235412364123741238412394124041241412424124341244412454124641247412484124941250412514125241253412544125541256412574125841259412604126141262412634126441265412664126741268412694127041271412724127341274412754127641277412784127941280412814128241283412844128541286412874128841289412904129141292412934129441295412964129741298412994130041301413024130341304413054130641307413084130941310413114131241313413144131541316413174131841319413204132141322413234132441325413264132741328413294133041331413324133341334413354133641337413384133941340413414134241343413444134541346413474134841349413504135141352413534135441355413564135741358413594136041361413624136341364413654136641367413684136941370413714137241373413744137541376413774137841379413804138141382413834138441385413864138741388413894139041391413924139341394413954139641397413984139941400414014140241403414044140541406414074140841409414104141141412414134141441415414164141741418414194142041421414224142341424414254142641427414284142941430414314143241433414344143541436414374143841439414404144141442414434144441445414464144741448414494145041451414524145341454414554145641457414584145941460414614146241463414644146541466414674146841469414704147141472414734147441475414764147741478414794148041481414824148341484414854148641487414884148941490414914149241493414944149541496414974149841499415004150141502415034150441505415064150741508415094151041511415124151341514415154151641517415184151941520415214152241523415244152541526415274152841529415304153141532415334153441535415364153741538415394154041541415424154341544415454154641547415484154941550415514155241553415544155541556415574155841559415604156141562415634156441565415664156741568415694157041571415724157341574415754157641577415784157941580415814158241583415844158541586415874158841589415904159141592415934159441595415964159741598415994160041601416024160341604416054160641607416084160941610416114161241613416144161541616416174161841619416204162141622416234162441625416264162741628416294163041631416324163341634416354163641637416384163941640416414164241643416444164541646416474164841649416504165141652416534165441655416564165741658416594166041661416624166341664416654166641667416684166941670416714167241673416744167541676416774167841679416804168141682416834168441685416864168741688416894169041691416924169341694416954169641697416984169941700417014170241703417044170541706417074170841709417104171141712417134171441715417164171741718417194172041721417224172341724417254172641727417284172941730417314173241733417344173541736417374173841739417404174141742417434174441745417464174741748417494175041751417524175341754417554175641757417584175941760417614176241763417644176541766417674176841769417704177141772417734177441775417764177741778417794178041781417824178341784417854178641787417884178941790417914179241793417944179541796417974179841799418004180141802418034180441805418064180741808418094181041811418124181341814418154181641817418184181941820418214182241823418244182541826418274182841829418304183141832418334183441835418364183741838418394184041841418424184341844418454184641847418484184941850418514185241853418544185541856418574185841859418604186141862418634186441865418664186741868418694187041871418724187341874418754187641877418784187941880418814188241883418844188541886418874188841889418904189141892418934189441895418964189741898418994190041901419024190341904419054190641907419084190941910419114191241913419144191541916419174191841919419204192141922419234192441925419264192741928419294193041931419324193341934419354193641937419384193941940419414194241943419444194541946419474194841949419504195141952419534195441955419564195741958419594196041961419624196341964419654196641967419684196941970419714197241973419744197541976419774197841979419804198141982419834198441985419864198741988419894199041991419924199341994419954199641997419984199942000420014200242003420044200542006420074200842009420104201142012420134201442015420164201742018420194202042021420224202342024420254202642027420284202942030420314203242033420344203542036420374203842039420404204142042420434204442045420464204742048420494205042051420524205342054420554205642057420584205942060420614206242063420644206542066420674206842069420704207142072420734207442075420764207742078420794208042081420824208342084420854208642087420884208942090420914209242093420944209542096420974209842099421004210142102421034210442105421064210742108421094211042111421124211342114421154211642117421184211942120421214212242123421244212542126421274212842129421304213142132421334213442135421364213742138421394214042141421424214342144421454214642147421484214942150421514215242153421544215542156421574215842159421604216142162421634216442165421664216742168421694217042171421724217342174421754217642177421784217942180421814218242183421844218542186421874218842189421904219142192421934219442195421964219742198421994220042201422024220342204422054220642207422084220942210422114221242213422144221542216422174221842219422204222142222422234222442225422264222742228422294223042231422324223342234422354223642237422384223942240422414224242243422444224542246422474224842249422504225142252422534225442255422564225742258422594226042261422624226342264422654226642267422684226942270422714227242273422744227542276422774227842279422804228142282422834228442285422864228742288422894229042291422924229342294422954229642297422984229942300423014230242303423044230542306423074230842309423104231142312423134231442315423164231742318423194232042321423224232342324423254232642327423284232942330423314233242333423344233542336423374233842339423404234142342423434234442345423464234742348423494235042351423524235342354423554235642357423584235942360423614236242363423644236542366423674236842369423704237142372423734237442375423764237742378423794238042381423824238342384423854238642387423884238942390423914239242393423944239542396423974239842399424004240142402424034240442405424064240742408424094241042411424124241342414424154241642417424184241942420424214242242423424244242542426424274242842429424304243142432424334243442435424364243742438424394244042441424424244342444424454244642447424484244942450424514245242453424544245542456424574245842459424604246142462424634246442465424664246742468424694247042471424724247342474424754247642477424784247942480424814248242483424844248542486424874248842489424904249142492424934249442495424964249742498424994250042501425024250342504425054250642507425084250942510425114251242513425144251542516425174251842519425204252142522425234252442525425264252742528425294253042531425324253342534425354253642537425384253942540425414254242543425444254542546425474254842549425504255142552425534255442555425564255742558425594256042561425624256342564425654256642567425684256942570425714257242573425744257542576425774257842579425804258142582425834258442585425864258742588425894259042591425924259342594425954259642597425984259942600426014260242603426044260542606426074260842609426104261142612426134261442615426164261742618426194262042621426224262342624426254262642627426284262942630426314263242633426344263542636426374263842639426404264142642426434264442645426464264742648426494265042651426524265342654426554265642657426584265942660426614266242663426644266542666426674266842669426704267142672426734267442675426764267742678426794268042681426824268342684426854268642687426884268942690426914269242693426944269542696426974269842699427004270142702427034270442705427064270742708427094271042711427124271342714427154271642717427184271942720427214272242723427244272542726427274272842729427304273142732427334273442735427364273742738427394274042741427424274342744427454274642747427484274942750427514275242753427544275542756427574275842759427604276142762427634276442765427664276742768427694277042771427724277342774427754277642777427784277942780427814278242783427844278542786427874278842789427904279142792427934279442795427964279742798427994280042801428024280342804428054280642807428084280942810428114281242813428144281542816428174281842819428204282142822428234282442825428264282742828428294283042831428324283342834428354283642837428384283942840428414284242843428444284542846428474284842849428504285142852428534285442855428564285742858428594286042861428624286342864428654286642867428684286942870428714287242873428744287542876428774287842879428804288142882428834288442885428864288742888428894289042891428924289342894428954289642897428984289942900429014290242903429044290542906429074290842909429104291142912429134291442915429164291742918429194292042921429224292342924429254292642927429284292942930429314293242933429344293542936429374293842939429404294142942429434294442945429464294742948429494295042951429524295342954429554295642957429584295942960429614296242963429644296542966429674296842969429704297142972429734297442975429764297742978429794298042981429824298342984429854298642987429884298942990429914299242993429944299542996429974299842999430004300143002430034300443005430064300743008430094301043011430124301343014430154301643017430184301943020430214302243023430244302543026430274302843029430304303143032430334303443035430364303743038430394304043041430424304343044430454304643047430484304943050430514305243053430544305543056430574305843059430604306143062430634306443065430664306743068430694307043071430724307343074430754307643077430784307943080430814308243083430844308543086430874308843089430904309143092430934309443095430964309743098430994310043101431024310343104431054310643107431084310943110431114311243113431144311543116431174311843119431204312143122431234312443125431264312743128431294313043131431324313343134431354313643137431384313943140431414314243143431444314543146431474314843149431504315143152431534315443155431564315743158431594316043161431624316343164431654316643167431684316943170431714317243173431744317543176431774317843179431804318143182431834318443185431864318743188431894319043191431924319343194431954319643197431984319943200432014320243203432044320543206432074320843209432104321143212432134321443215432164321743218432194322043221432224322343224432254322643227432284322943230432314323243233432344323543236432374323843239432404324143242432434324443245432464324743248432494325043251432524325343254432554325643257432584325943260432614326243263432644326543266432674326843269432704327143272432734327443275432764327743278432794328043281432824328343284432854328643287432884328943290432914329243293432944329543296432974329843299433004330143302433034330443305433064330743308433094331043311433124331343314433154331643317433184331943320433214332243323433244332543326433274332843329433304333143332433334333443335433364333743338433394334043341433424334343344433454334643347433484334943350433514335243353433544335543356433574335843359433604336143362433634336443365433664336743368433694337043371433724337343374433754337643377433784337943380433814338243383433844338543386433874338843389433904339143392433934339443395433964339743398433994340043401434024340343404434054340643407434084340943410434114341243413434144341543416434174341843419434204342143422434234342443425434264342743428434294343043431434324343343434434354343643437434384343943440434414344243443434444344543446434474344843449434504345143452434534345443455434564345743458434594346043461434624346343464434654346643467434684346943470434714347243473434744347543476434774347843479434804348143482434834348443485434864348743488434894349043491434924349343494434954349643497434984349943500435014350243503435044350543506435074350843509435104351143512435134351443515435164351743518435194352043521435224352343524435254352643527435284352943530435314353243533435344353543536435374353843539435404354143542435434354443545435464354743548435494355043551435524355343554435554355643557435584355943560435614356243563435644356543566435674356843569435704357143572435734357443575435764357743578435794358043581435824358343584435854358643587435884358943590435914359243593435944359543596435974359843599436004360143602436034360443605436064360743608436094361043611436124361343614436154361643617436184361943620436214362243623436244362543626436274362843629436304363143632436334363443635436364363743638436394364043641436424364343644436454364643647436484364943650436514365243653436544365543656436574365843659436604366143662436634366443665436664366743668436694367043671436724367343674436754367643677436784367943680436814368243683436844368543686436874368843689436904369143692436934369443695436964369743698436994370043701437024370343704437054370643707437084370943710437114371243713437144371543716437174371843719437204372143722437234372443725437264372743728437294373043731437324373343734437354373643737437384373943740437414374243743437444374543746437474374843749437504375143752437534375443755437564375743758437594376043761437624376343764437654376643767437684376943770437714377243773437744377543776437774377843779437804378143782437834378443785437864378743788437894379043791437924379343794437954379643797437984379943800438014380243803438044380543806438074380843809438104381143812438134381443815438164381743818438194382043821438224382343824438254382643827438284382943830438314383243833438344383543836438374383843839438404384143842438434384443845438464384743848438494385043851438524385343854438554385643857438584385943860438614386243863438644386543866438674386843869438704387143872438734387443875438764387743878438794388043881438824388343884438854388643887438884388943890438914389243893438944389543896438974389843899439004390143902439034390443905439064390743908439094391043911439124391343914439154391643917439184391943920439214392243923439244392543926439274392843929439304393143932439334393443935439364393743938439394394043941439424394343944439454394643947439484394943950439514395243953439544395543956439574395843959439604396143962439634396443965439664396743968439694397043971439724397343974439754397643977439784397943980439814398243983439844398543986439874398843989439904399143992439934399443995439964399743998439994400044001440024400344004440054400644007440084400944010440114401244013440144401544016440174401844019440204402144022440234402444025440264402744028440294403044031440324403344034440354403644037440384403944040440414404244043440444404544046440474404844049440504405144052440534405444055440564405744058440594406044061440624406344064440654406644067440684406944070440714407244073440744407544076440774407844079440804408144082440834408444085440864408744088440894409044091440924409344094440954409644097440984409944100441014410244103441044410544106441074410844109441104411144112441134411444115441164411744118441194412044121441224412344124441254412644127441284412944130441314413244133441344413544136441374413844139441404414144142441434414444145441464414744148441494415044151441524415344154441554415644157441584415944160441614416244163441644416544166441674416844169441704417144172441734417444175441764417744178441794418044181441824418344184441854418644187441884418944190441914419244193441944419544196441974419844199442004420144202442034420444205442064420744208442094421044211442124421344214442154421644217442184421944220442214422244223442244422544226442274422844229442304423144232442334423444235442364423744238442394424044241442424424344244442454424644247442484424944250442514425244253442544425544256442574425844259442604426144262442634426444265442664426744268442694427044271442724427344274442754427644277442784427944280442814428244283442844428544286442874428844289442904429144292442934429444295442964429744298442994430044301443024430344304443054430644307443084430944310443114431244313443144431544316443174431844319443204432144322443234432444325443264432744328443294433044331443324433344334443354433644337443384433944340443414434244343443444434544346443474434844349443504435144352443534435444355443564435744358443594436044361443624436344364443654436644367443684436944370443714437244373443744437544376443774437844379443804438144382443834438444385443864438744388443894439044391443924439344394443954439644397443984439944400444014440244403444044440544406444074440844409444104441144412444134441444415444164441744418444194442044421444224442344424444254442644427444284442944430444314443244433444344443544436444374443844439444404444144442444434444444445444464444744448444494445044451444524445344454444554445644457444584445944460444614446244463444644446544466444674446844469444704447144472444734447444475444764447744478444794448044481444824448344484444854448644487444884448944490444914449244493444944449544496444974449844499445004450144502445034450444505445064450744508445094451044511445124451344514445154451644517445184451944520445214452244523445244452544526445274452844529445304453144532445334453444535445364453744538445394454044541445424454344544445454454644547445484454944550445514455244553445544455544556445574455844559445604456144562445634456444565445664456744568445694457044571445724457344574445754457644577445784457944580445814458244583445844458544586445874458844589445904459144592445934459444595445964459744598445994460044601446024460344604446054460644607446084460944610446114461244613446144461544616446174461844619446204462144622446234462444625446264462744628446294463044631446324463344634446354463644637446384463944640446414464244643446444464544646446474464844649446504465144652446534465444655446564465744658446594466044661446624466344664446654466644667446684466944670446714467244673446744467544676446774467844679446804468144682446834468444685446864468744688446894469044691446924469344694446954469644697446984469944700447014470244703447044470544706447074470844709447104471144712447134471444715447164471744718447194472044721447224472344724447254472644727447284472944730447314473244733447344473544736447374473844739447404474144742447434474444745447464474744748447494475044751447524475344754447554475644757447584475944760447614476244763447644476544766447674476844769447704477144772447734477444775447764477744778447794478044781447824478344784447854478644787447884478944790447914479244793447944479544796447974479844799448004480144802448034480444805448064480744808448094481044811448124481344814448154481644817448184481944820448214482244823448244482544826448274482844829448304483144832448334483444835448364483744838448394484044841448424484344844448454484644847448484484944850448514485244853448544485544856448574485844859448604486144862448634486444865448664486744868448694487044871448724487344874448754487644877448784487944880448814488244883448844488544886448874488844889448904489144892448934489444895448964489744898448994490044901449024490344904449054490644907449084490944910449114491244913449144491544916449174491844919449204492144922449234492444925449264492744928449294493044931449324493344934449354493644937449384493944940449414494244943449444494544946449474494844949449504495144952449534495444955449564495744958449594496044961449624496344964449654496644967449684496944970449714497244973449744497544976449774497844979449804498144982449834498444985449864498744988449894499044991449924499344994449954499644997449984499945000450014500245003450044500545006450074500845009450104501145012450134501445015450164501745018450194502045021450224502345024450254502645027450284502945030450314503245033450344503545036450374503845039450404504145042450434504445045450464504745048450494505045051450524505345054450554505645057450584505945060450614506245063450644506545066450674506845069450704507145072450734507445075450764507745078450794508045081450824508345084450854508645087450884508945090450914509245093450944509545096450974509845099451004510145102451034510445105451064510745108451094511045111451124511345114451154511645117451184511945120451214512245123451244512545126451274512845129451304513145132451334513445135451364513745138451394514045141451424514345144451454514645147451484514945150451514515245153451544515545156451574515845159451604516145162451634516445165451664516745168451694517045171451724517345174451754517645177451784517945180451814518245183451844518545186451874518845189451904519145192451934519445195451964519745198451994520045201452024520345204452054520645207452084520945210452114521245213452144521545216452174521845219452204522145222452234522445225452264522745228452294523045231452324523345234452354523645237452384523945240452414524245243452444524545246452474524845249452504525145252452534525445255452564525745258452594526045261452624526345264452654526645267452684526945270452714527245273452744527545276452774527845279452804528145282452834528445285452864528745288452894529045291452924529345294452954529645297452984529945300453014530245303453044530545306453074530845309453104531145312453134531445315453164531745318453194532045321453224532345324453254532645327453284532945330453314533245333453344533545336453374533845339453404534145342453434534445345453464534745348453494535045351453524535345354453554535645357453584535945360453614536245363453644536545366453674536845369453704537145372453734537445375453764537745378453794538045381453824538345384453854538645387453884538945390453914539245393453944539545396453974539845399454004540145402454034540445405454064540745408454094541045411454124541345414454154541645417454184541945420454214542245423454244542545426454274542845429454304543145432454334543445435454364543745438454394544045441454424544345444454454544645447454484544945450454514545245453454544545545456454574545845459454604546145462454634546445465454664546745468454694547045471454724547345474454754547645477454784547945480454814548245483454844548545486454874548845489454904549145492454934549445495454964549745498454994550045501455024550345504455054550645507455084550945510455114551245513455144551545516455174551845519455204552145522455234552445525455264552745528455294553045531455324553345534455354553645537455384553945540455414554245543455444554545546455474554845549455504555145552455534555445555455564555745558455594556045561455624556345564455654556645567455684556945570455714557245573455744557545576455774557845579455804558145582455834558445585455864558745588455894559045591455924559345594455954559645597455984559945600456014560245603456044560545606456074560845609456104561145612456134561445615456164561745618456194562045621456224562345624456254562645627456284562945630456314563245633456344563545636456374563845639456404564145642456434564445645456464564745648456494565045651456524565345654456554565645657456584565945660456614566245663456644566545666456674566845669456704567145672456734567445675456764567745678456794568045681456824568345684456854568645687456884568945690456914569245693456944569545696456974569845699457004570145702457034570445705457064570745708457094571045711457124571345714457154571645717457184571945720457214572245723457244572545726457274572845729457304573145732457334573445735457364573745738457394574045741457424574345744457454574645747457484574945750457514575245753457544575545756457574575845759457604576145762457634576445765457664576745768457694577045771457724577345774457754577645777457784577945780457814578245783457844578545786457874578845789457904579145792457934579445795457964579745798457994580045801458024580345804458054580645807458084580945810458114581245813458144581545816458174581845819458204582145822458234582445825458264582745828458294583045831458324583345834458354583645837458384583945840458414584245843458444584545846458474584845849458504585145852458534585445855458564585745858458594586045861458624586345864458654586645867458684586945870458714587245873458744587545876458774587845879458804588145882458834588445885458864588745888458894589045891458924589345894458954589645897458984589945900459014590245903459044590545906459074590845909459104591145912459134591445915459164591745918459194592045921459224592345924459254592645927459284592945930459314593245933459344593545936459374593845939459404594145942459434594445945459464594745948459494595045951459524595345954459554595645957459584595945960459614596245963459644596545966459674596845969459704597145972459734597445975459764597745978459794598045981459824598345984459854598645987459884598945990459914599245993459944599545996459974599845999460004600146002460034600446005460064600746008460094601046011460124601346014460154601646017460184601946020460214602246023460244602546026460274602846029460304603146032460334603446035460364603746038460394604046041460424604346044460454604646047460484604946050460514605246053460544605546056460574605846059460604606146062460634606446065460664606746068460694607046071460724607346074460754607646077460784607946080460814608246083460844608546086460874608846089460904609146092460934609446095460964609746098460994610046101461024610346104461054610646107461084610946110461114611246113461144611546116461174611846119461204612146122461234612446125461264612746128461294613046131461324613346134461354613646137461384613946140461414614246143461444614546146461474614846149461504615146152461534615446155461564615746158461594616046161461624616346164461654616646167461684616946170461714617246173461744617546176461774617846179461804618146182461834618446185461864618746188461894619046191461924619346194461954619646197461984619946200462014620246203462044620546206462074620846209462104621146212462134621446215462164621746218462194622046221462224622346224462254622646227462284622946230462314623246233462344623546236462374623846239462404624146242462434624446245462464624746248462494625046251462524625346254462554625646257462584625946260462614626246263462644626546266462674626846269462704627146272462734627446275462764627746278462794628046281462824628346284462854628646287462884628946290462914629246293462944629546296462974629846299463004630146302463034630446305463064630746308463094631046311463124631346314463154631646317463184631946320463214632246323463244632546326463274632846329463304633146332463334633446335463364633746338463394634046341463424634346344463454634646347463484634946350463514635246353463544635546356463574635846359463604636146362463634636446365463664636746368463694637046371463724637346374463754637646377463784637946380463814638246383463844638546386463874638846389463904639146392463934639446395463964639746398463994640046401464024640346404464054640646407464084640946410464114641246413464144641546416464174641846419464204642146422464234642446425464264642746428464294643046431464324643346434464354643646437464384643946440464414644246443464444644546446464474644846449464504645146452464534645446455464564645746458464594646046461464624646346464464654646646467464684646946470464714647246473464744647546476464774647846479464804648146482464834648446485464864648746488464894649046491464924649346494464954649646497464984649946500465014650246503465044650546506465074650846509465104651146512465134651446515465164651746518465194652046521465224652346524465254652646527465284652946530465314653246533465344653546536465374653846539465404654146542465434654446545465464654746548465494655046551465524655346554465554655646557465584655946560465614656246563465644656546566465674656846569465704657146572465734657446575465764657746578465794658046581465824658346584465854658646587465884658946590465914659246593465944659546596465974659846599466004660146602466034660446605466064660746608466094661046611466124661346614466154661646617466184661946620466214662246623466244662546626466274662846629466304663146632466334663446635466364663746638466394664046641466424664346644466454664646647466484664946650466514665246653466544665546656466574665846659466604666146662466634666446665466664666746668466694667046671466724667346674466754667646677466784667946680466814668246683466844668546686466874668846689466904669146692466934669446695466964669746698466994670046701467024670346704467054670646707467084670946710467114671246713467144671546716467174671846719467204672146722467234672446725467264672746728467294673046731467324673346734467354673646737467384673946740467414674246743467444674546746467474674846749467504675146752467534675446755467564675746758467594676046761467624676346764467654676646767467684676946770467714677246773467744677546776467774677846779467804678146782467834678446785467864678746788467894679046791467924679346794467954679646797467984679946800468014680246803468044680546806468074680846809468104681146812468134681446815468164681746818468194682046821468224682346824468254682646827468284682946830468314683246833468344683546836468374683846839468404684146842468434684446845468464684746848468494685046851468524685346854468554685646857468584685946860468614686246863468644686546866468674686846869468704687146872468734687446875468764687746878468794688046881468824688346884468854688646887468884688946890468914689246893468944689546896468974689846899469004690146902469034690446905469064690746908469094691046911469124691346914469154691646917469184691946920469214692246923469244692546926469274692846929469304693146932469334693446935469364693746938469394694046941469424694346944469454694646947469484694946950469514695246953469544695546956469574695846959469604696146962469634696446965469664696746968469694697046971469724697346974469754697646977469784697946980469814698246983469844698546986469874698846989469904699146992469934699446995469964699746998469994700047001470024700347004470054700647007470084700947010470114701247013470144701547016470174701847019470204702147022470234702447025470264702747028470294703047031470324703347034470354703647037470384703947040470414704247043470444704547046470474704847049470504705147052470534705447055470564705747058470594706047061470624706347064470654706647067470684706947070470714707247073470744707547076470774707847079470804708147082470834708447085470864708747088470894709047091470924709347094470954709647097470984709947100471014710247103471044710547106471074710847109471104711147112471134711447115471164711747118471194712047121471224712347124471254712647127471284712947130471314713247133471344713547136471374713847139471404714147142471434714447145471464714747148471494715047151471524715347154471554715647157471584715947160471614716247163471644716547166471674716847169471704717147172471734717447175471764717747178471794718047181471824718347184471854718647187471884718947190471914719247193471944719547196471974719847199472004720147202472034720447205472064720747208472094721047211472124721347214472154721647217472184721947220472214722247223472244722547226472274722847229472304723147232472334723447235472364723747238472394724047241472424724347244472454724647247472484724947250472514725247253472544725547256472574725847259472604726147262472634726447265472664726747268472694727047271472724727347274472754727647277472784727947280472814728247283472844728547286472874728847289472904729147292472934729447295472964729747298472994730047301473024730347304473054730647307473084730947310473114731247313473144731547316473174731847319473204732147322473234732447325473264732747328473294733047331473324733347334473354733647337473384733947340473414734247343473444734547346473474734847349473504735147352473534735447355473564735747358473594736047361473624736347364473654736647367473684736947370473714737247373473744737547376473774737847379473804738147382473834738447385473864738747388473894739047391473924739347394473954739647397473984739947400474014740247403474044740547406474074740847409474104741147412474134741447415474164741747418474194742047421474224742347424474254742647427474284742947430474314743247433474344743547436474374743847439474404744147442474434744447445474464744747448474494745047451474524745347454474554745647457474584745947460474614746247463474644746547466474674746847469474704747147472474734747447475474764747747478474794748047481474824748347484474854748647487474884748947490474914749247493474944749547496474974749847499475004750147502475034750447505475064750747508475094751047511475124751347514475154751647517475184751947520475214752247523475244752547526475274752847529475304753147532475334753447535475364753747538475394754047541475424754347544475454754647547475484754947550475514755247553475544755547556475574755847559475604756147562475634756447565475664756747568475694757047571475724757347574475754757647577475784757947580475814758247583475844758547586475874758847589475904759147592475934759447595475964759747598475994760047601476024760347604476054760647607476084760947610476114761247613476144761547616476174761847619476204762147622476234762447625476264762747628476294763047631476324763347634476354763647637476384763947640476414764247643476444764547646476474764847649476504765147652476534765447655476564765747658476594766047661476624766347664476654766647667476684766947670476714767247673476744767547676476774767847679476804768147682476834768447685476864768747688476894769047691476924769347694476954769647697476984769947700477014770247703477044770547706477074770847709477104771147712477134771447715477164771747718477194772047721477224772347724477254772647727477284772947730477314773247733477344773547736477374773847739477404774147742477434774447745477464774747748477494775047751477524775347754477554775647757477584775947760477614776247763477644776547766477674776847769477704777147772477734777447775477764777747778477794778047781477824778347784477854778647787477884778947790477914779247793477944779547796477974779847799478004780147802478034780447805478064780747808478094781047811478124781347814478154781647817478184781947820478214782247823478244782547826478274782847829478304783147832478334783447835478364783747838478394784047841478424784347844478454784647847478484784947850478514785247853478544785547856478574785847859478604786147862478634786447865478664786747868478694787047871478724787347874478754787647877478784787947880478814788247883478844788547886478874788847889478904789147892478934789447895478964789747898478994790047901479024790347904479054790647907479084790947910479114791247913479144791547916479174791847919479204792147922479234792447925479264792747928479294793047931479324793347934479354793647937479384793947940479414794247943479444794547946479474794847949479504795147952479534795447955479564795747958479594796047961479624796347964479654796647967479684796947970479714797247973479744797547976479774797847979479804798147982479834798447985479864798747988479894799047991479924799347994479954799647997479984799948000480014800248003480044800548006480074800848009480104801148012480134801448015480164801748018480194802048021480224802348024480254802648027480284802948030480314803248033480344803548036480374803848039480404804148042480434804448045480464804748048480494805048051480524805348054480554805648057480584805948060480614806248063480644806548066480674806848069480704807148072480734807448075480764807748078480794808048081480824808348084480854808648087480884808948090480914809248093480944809548096480974809848099481004810148102481034810448105481064810748108481094811048111481124811348114481154811648117481184811948120481214812248123481244812548126481274812848129481304813148132481334813448135481364813748138481394814048141481424814348144481454814648147481484814948150481514815248153481544815548156481574815848159481604816148162481634816448165481664816748168481694817048171481724817348174481754817648177481784817948180481814818248183481844818548186481874818848189481904819148192481934819448195481964819748198481994820048201482024820348204482054820648207482084820948210482114821248213482144821548216482174821848219482204822148222482234822448225482264822748228482294823048231482324823348234482354823648237482384823948240482414824248243482444824548246482474824848249482504825148252482534825448255482564825748258482594826048261482624826348264482654826648267482684826948270482714827248273482744827548276482774827848279482804828148282482834828448285482864828748288482894829048291482924829348294482954829648297482984829948300483014830248303483044830548306483074830848309483104831148312483134831448315483164831748318483194832048321483224832348324483254832648327483284832948330483314833248333483344833548336483374833848339483404834148342483434834448345483464834748348483494835048351483524835348354483554835648357483584835948360483614836248363483644836548366483674836848369483704837148372483734837448375483764837748378483794838048381483824838348384483854838648387483884838948390483914839248393483944839548396483974839848399484004840148402484034840448405484064840748408484094841048411484124841348414484154841648417484184841948420484214842248423484244842548426484274842848429484304843148432484334843448435484364843748438484394844048441484424844348444484454844648447484484844948450484514845248453484544845548456484574845848459484604846148462484634846448465484664846748468484694847048471484724847348474484754847648477484784847948480484814848248483484844848548486484874848848489484904849148492484934849448495484964849748498484994850048501485024850348504485054850648507485084850948510485114851248513485144851548516485174851848519485204852148522485234852448525485264852748528485294853048531485324853348534485354853648537485384853948540485414854248543485444854548546485474854848549485504855148552485534855448555485564855748558485594856048561485624856348564485654856648567485684856948570485714857248573485744857548576485774857848579485804858148582485834858448585485864858748588485894859048591485924859348594485954859648597485984859948600486014860248603486044860548606486074860848609486104861148612486134861448615486164861748618486194862048621486224862348624486254862648627486284862948630486314863248633486344863548636486374863848639486404864148642486434864448645486464864748648486494865048651486524865348654486554865648657486584865948660486614866248663486644866548666486674866848669486704867148672486734867448675486764867748678486794868048681486824868348684486854868648687486884868948690486914869248693486944869548696486974869848699487004870148702487034870448705487064870748708487094871048711487124871348714487154871648717487184871948720487214872248723487244872548726487274872848729487304873148732487334873448735487364873748738487394874048741487424874348744487454874648747487484874948750487514875248753487544875548756487574875848759487604876148762487634876448765487664876748768487694877048771487724877348774487754877648777487784877948780487814878248783487844878548786487874878848789487904879148792487934879448795487964879748798487994880048801488024880348804488054880648807488084880948810488114881248813488144881548816488174881848819488204882148822488234882448825488264882748828488294883048831488324883348834488354883648837488384883948840488414884248843488444884548846488474884848849488504885148852488534885448855488564885748858488594886048861488624886348864488654886648867488684886948870488714887248873488744887548876488774887848879488804888148882488834888448885488864888748888488894889048891488924889348894488954889648897488984889948900489014890248903489044890548906489074890848909489104891148912489134891448915489164891748918489194892048921489224892348924489254892648927489284892948930489314893248933489344893548936489374893848939489404894148942489434894448945489464894748948489494895048951489524895348954489554895648957489584895948960489614896248963489644896548966489674896848969489704897148972489734897448975489764897748978489794898048981489824898348984489854898648987489884898948990489914899248993489944899548996489974899848999490004900149002490034900449005490064900749008490094901049011490124901349014490154901649017490184901949020490214902249023490244902549026490274902849029490304903149032490334903449035490364903749038490394904049041490424904349044490454904649047490484904949050490514905249053490544905549056490574905849059490604906149062490634906449065490664906749068490694907049071490724907349074490754907649077490784907949080490814908249083490844908549086490874908849089490904909149092490934909449095490964909749098490994910049101491024910349104491054910649107491084910949110491114911249113491144911549116491174911849119491204912149122491234912449125491264912749128491294913049131491324913349134491354913649137491384913949140491414914249143491444914549146491474914849149491504915149152491534915449155491564915749158491594916049161491624916349164491654916649167491684916949170491714917249173491744917549176491774917849179491804918149182491834918449185491864918749188491894919049191491924919349194491954919649197491984919949200492014920249203492044920549206492074920849209492104921149212492134921449215492164921749218492194922049221492224922349224492254922649227492284922949230492314923249233492344923549236492374923849239492404924149242492434924449245492464924749248492494925049251492524925349254492554925649257492584925949260492614926249263492644926549266492674926849269492704927149272492734927449275492764927749278492794928049281492824928349284492854928649287492884928949290492914929249293492944929549296492974929849299493004930149302493034930449305493064930749308493094931049311493124931349314493154931649317493184931949320493214932249323493244932549326493274932849329493304933149332493334933449335493364933749338493394934049341493424934349344493454934649347493484934949350493514935249353493544935549356493574935849359493604936149362493634936449365493664936749368493694937049371493724937349374493754937649377493784937949380493814938249383493844938549386493874938849389493904939149392493934939449395493964939749398493994940049401494024940349404494054940649407494084940949410494114941249413494144941549416494174941849419494204942149422494234942449425494264942749428494294943049431494324943349434494354943649437494384943949440494414944249443494444944549446494474944849449494504945149452494534945449455494564945749458494594946049461494624946349464494654946649467494684946949470494714947249473494744947549476494774947849479494804948149482494834948449485494864948749488494894949049491494924949349494494954949649497494984949949500495014950249503495044950549506495074950849509495104951149512495134951449515495164951749518495194952049521495224952349524495254952649527495284952949530495314953249533495344953549536495374953849539495404954149542495434954449545495464954749548495494955049551495524955349554495554955649557495584955949560495614956249563495644956549566495674956849569495704957149572495734957449575495764957749578495794958049581495824958349584495854958649587495884958949590495914959249593495944959549596495974959849599496004960149602496034960449605496064960749608496094961049611496124961349614496154961649617496184961949620496214962249623496244962549626496274962849629496304963149632496334963449635496364963749638496394964049641496424964349644496454964649647496484964949650496514965249653496544965549656496574965849659496604966149662496634966449665496664966749668496694967049671496724967349674496754967649677496784967949680496814968249683496844968549686496874968849689496904969149692496934969449695496964969749698496994970049701497024970349704497054970649707497084970949710497114971249713497144971549716497174971849719497204972149722497234972449725497264972749728497294973049731497324973349734497354973649737497384973949740497414974249743497444974549746497474974849749497504975149752497534975449755497564975749758497594976049761497624976349764497654976649767497684976949770497714977249773497744977549776497774977849779497804978149782497834978449785497864978749788497894979049791497924979349794497954979649797497984979949800498014980249803498044980549806498074980849809498104981149812498134981449815498164981749818498194982049821498224982349824498254982649827498284982949830498314983249833498344983549836498374983849839498404984149842498434984449845498464984749848498494985049851498524985349854498554985649857498584985949860498614986249863498644986549866498674986849869498704987149872498734987449875498764987749878498794988049881498824988349884498854988649887498884988949890498914989249893498944989549896498974989849899499004990149902499034990449905499064990749908499094991049911499124991349914499154991649917499184991949920499214992249923499244992549926499274992849929499304993149932499334993449935499364993749938499394994049941499424994349944499454994649947499484994949950499514995249953499544995549956499574995849959499604996149962499634996449965499664996749968499694997049971499724997349974499754997649977499784997949980499814998249983499844998549986499874998849989499904999149992499934999449995499964999749998499995000050001500025000350004500055000650007500085000950010500115001250013500145001550016500175001850019500205002150022500235002450025500265002750028500295003050031500325003350034500355003650037500385003950040500415004250043500445004550046500475004850049500505005150052500535005450055500565005750058500595006050061500625006350064500655006650067500685006950070500715007250073500745007550076500775007850079500805008150082500835008450085500865008750088500895009050091500925009350094500955009650097500985009950100501015010250103501045010550106501075010850109501105011150112501135011450115501165011750118501195012050121501225012350124501255012650127501285012950130501315013250133501345013550136501375013850139501405014150142501435014450145501465014750148501495015050151501525015350154501555015650157501585015950160501615016250163501645016550166501675016850169501705017150172501735017450175501765017750178501795018050181501825018350184501855018650187501885018950190501915019250193501945019550196501975019850199502005020150202502035020450205502065020750208502095021050211502125021350214502155021650217502185021950220502215022250223502245022550226502275022850229502305023150232502335023450235502365023750238502395024050241502425024350244502455024650247502485024950250502515025250253502545025550256502575025850259502605026150262502635026450265502665026750268502695027050271502725027350274502755027650277502785027950280502815028250283502845028550286502875028850289502905029150292502935029450295502965029750298502995030050301503025030350304503055030650307503085030950310503115031250313503145031550316503175031850319503205032150322503235032450325503265032750328503295033050331503325033350334503355033650337503385033950340503415034250343503445034550346503475034850349503505035150352503535035450355503565035750358503595036050361503625036350364503655036650367503685036950370503715037250373503745037550376503775037850379503805038150382503835038450385503865038750388503895039050391503925039350394503955039650397503985039950400504015040250403504045040550406504075040850409504105041150412504135041450415504165041750418504195042050421504225042350424504255042650427504285042950430504315043250433504345043550436504375043850439504405044150442504435044450445504465044750448504495045050451504525045350454504555045650457504585045950460504615046250463504645046550466504675046850469504705047150472504735047450475504765047750478504795048050481504825048350484504855048650487504885048950490504915049250493504945049550496504975049850499505005050150502505035050450505505065050750508505095051050511505125051350514505155051650517505185051950520505215052250523505245052550526505275052850529505305053150532505335053450535505365053750538505395054050541505425054350544505455054650547505485054950550505515055250553505545055550556505575055850559505605056150562505635056450565505665056750568505695057050571505725057350574505755057650577505785057950580505815058250583505845058550586505875058850589505905059150592505935059450595505965059750598505995060050601506025060350604506055060650607506085060950610506115061250613506145061550616506175061850619506205062150622506235062450625506265062750628506295063050631506325063350634506355063650637506385063950640506415064250643506445064550646506475064850649506505065150652506535065450655506565065750658506595066050661506625066350664506655066650667506685066950670506715067250673506745067550676506775067850679506805068150682506835068450685506865068750688506895069050691506925069350694506955069650697506985069950700507015070250703507045070550706507075070850709507105071150712507135071450715507165071750718507195072050721507225072350724507255072650727507285072950730507315073250733507345073550736507375073850739507405074150742507435074450745507465074750748507495075050751507525075350754507555075650757507585075950760507615076250763507645076550766507675076850769507705077150772507735077450775507765077750778507795078050781507825078350784507855078650787507885078950790507915079250793507945079550796507975079850799508005080150802508035080450805508065080750808508095081050811508125081350814508155081650817508185081950820508215082250823508245082550826508275082850829508305083150832508335083450835508365083750838508395084050841508425084350844508455084650847508485084950850508515085250853508545085550856508575085850859508605086150862508635086450865508665086750868508695087050871508725087350874508755087650877508785087950880508815088250883508845088550886508875088850889508905089150892508935089450895508965089750898508995090050901509025090350904509055090650907509085090950910509115091250913509145091550916509175091850919509205092150922509235092450925509265092750928509295093050931509325093350934509355093650937509385093950940509415094250943509445094550946509475094850949509505095150952509535095450955509565095750958509595096050961509625096350964509655096650967509685096950970509715097250973509745097550976509775097850979509805098150982509835098450985509865098750988509895099050991509925099350994509955099650997509985099951000510015100251003510045100551006510075100851009510105101151012510135101451015510165101751018510195102051021510225102351024510255102651027510285102951030510315103251033510345103551036510375103851039510405104151042510435104451045510465104751048510495105051051510525105351054510555105651057510585105951060510615106251063510645106551066510675106851069510705107151072510735107451075510765107751078510795108051081510825108351084510855108651087510885108951090510915109251093510945109551096510975109851099511005110151102511035110451105511065110751108511095111051111511125111351114511155111651117511185111951120511215112251123511245112551126511275112851129511305113151132511335113451135511365113751138511395114051141511425114351144511455114651147511485114951150511515115251153511545115551156511575115851159511605116151162511635116451165511665116751168511695117051171511725117351174511755117651177511785117951180511815118251183511845118551186511875118851189511905119151192511935119451195511965119751198511995120051201512025120351204512055120651207512085120951210512115121251213512145121551216512175121851219512205122151222512235122451225512265122751228512295123051231512325123351234512355123651237512385123951240512415124251243512445124551246512475124851249512505125151252512535125451255512565125751258512595126051261512625126351264512655126651267512685126951270512715127251273512745127551276512775127851279512805128151282512835128451285512865128751288512895129051291512925129351294512955129651297512985129951300513015130251303513045130551306513075130851309513105131151312513135131451315513165131751318513195132051321513225132351324513255132651327513285132951330513315133251333513345133551336513375133851339513405134151342513435134451345513465134751348513495135051351513525135351354513555135651357513585135951360513615136251363513645136551366513675136851369513705137151372513735137451375513765137751378513795138051381513825138351384513855138651387513885138951390513915139251393513945139551396513975139851399514005140151402514035140451405514065140751408514095141051411514125141351414514155141651417514185141951420514215142251423514245142551426514275142851429514305143151432514335143451435514365143751438514395144051441514425144351444514455144651447514485144951450514515145251453514545145551456514575145851459514605146151462514635146451465514665146751468514695147051471514725147351474514755147651477514785147951480514815148251483514845148551486514875148851489514905149151492514935149451495514965149751498514995150051501515025150351504515055150651507515085150951510515115151251513515145151551516515175151851519515205152151522515235152451525515265152751528515295153051531515325153351534515355153651537515385153951540515415154251543515445154551546515475154851549515505155151552515535155451555515565155751558515595156051561515625156351564515655156651567515685156951570515715157251573515745157551576515775157851579515805158151582515835158451585515865158751588515895159051591515925159351594515955159651597515985159951600516015160251603516045160551606516075160851609516105161151612516135161451615516165161751618516195162051621516225162351624516255162651627516285162951630516315163251633516345163551636516375163851639516405164151642516435164451645516465164751648516495165051651516525165351654516555165651657516585165951660516615166251663516645166551666516675166851669516705167151672516735167451675516765167751678516795168051681516825168351684516855168651687516885168951690516915169251693516945169551696516975169851699517005170151702517035170451705517065170751708517095171051711517125171351714517155171651717517185171951720517215172251723517245172551726517275172851729517305173151732517335173451735517365173751738517395174051741517425174351744517455174651747517485174951750517515175251753517545175551756517575175851759517605176151762517635176451765517665176751768517695177051771517725177351774517755177651777517785177951780517815178251783517845178551786517875178851789517905179151792517935179451795517965179751798517995180051801518025180351804518055180651807518085180951810518115181251813518145181551816518175181851819518205182151822518235182451825518265182751828518295183051831518325183351834518355183651837518385183951840518415184251843518445184551846518475184851849518505185151852518535185451855518565185751858518595186051861518625186351864518655186651867518685186951870518715187251873518745187551876518775187851879518805188151882518835188451885518865188751888518895189051891518925189351894518955189651897518985189951900519015190251903519045190551906519075190851909519105191151912519135191451915519165191751918519195192051921519225192351924519255192651927519285192951930519315193251933519345193551936519375193851939519405194151942519435194451945519465194751948519495195051951519525195351954519555195651957519585195951960519615196251963519645196551966519675196851969519705197151972519735197451975519765197751978519795198051981519825198351984519855198651987519885198951990519915199251993519945199551996519975199851999520005200152002520035200452005520065200752008520095201052011520125201352014520155201652017520185201952020520215202252023520245202552026520275202852029520305203152032520335203452035520365203752038520395204052041520425204352044520455204652047520485204952050520515205252053520545205552056520575205852059520605206152062520635206452065520665206752068520695207052071520725207352074520755207652077520785207952080520815208252083520845208552086520875208852089520905209152092520935209452095520965209752098520995210052101521025210352104521055210652107521085210952110521115211252113521145211552116521175211852119521205212152122521235212452125521265212752128521295213052131521325213352134521355213652137521385213952140521415214252143521445214552146521475214852149521505215152152521535215452155521565215752158521595216052161521625216352164521655216652167521685216952170521715217252173521745217552176521775217852179521805218152182521835218452185521865218752188521895219052191521925219352194521955219652197521985219952200522015220252203522045220552206522075220852209522105221152212522135221452215522165221752218522195222052221522225222352224522255222652227522285222952230522315223252233522345223552236522375223852239522405224152242522435224452245522465224752248522495225052251522525225352254522555225652257522585225952260522615226252263522645226552266522675226852269522705227152272522735227452275522765227752278522795228052281522825228352284522855228652287522885228952290522915229252293522945229552296522975229852299523005230152302523035230452305523065230752308523095231052311523125231352314523155231652317523185231952320523215232252323523245232552326523275232852329523305233152332523335233452335523365233752338523395234052341523425234352344523455234652347523485234952350523515235252353523545235552356523575235852359523605236152362523635236452365523665236752368523695237052371523725237352374523755237652377523785237952380523815238252383523845238552386523875238852389523905239152392523935239452395523965239752398523995240052401524025240352404524055240652407524085240952410524115241252413524145241552416524175241852419524205242152422524235242452425524265242752428524295243052431524325243352434524355243652437524385243952440524415244252443524445244552446524475244852449524505245152452524535245452455524565245752458524595246052461524625246352464524655246652467524685246952470524715247252473524745247552476524775247852479524805248152482524835248452485524865248752488524895249052491524925249352494524955249652497524985249952500525015250252503525045250552506525075250852509525105251152512525135251452515525165251752518525195252052521525225252352524525255252652527525285252952530525315253252533525345253552536525375253852539525405254152542525435254452545525465254752548525495255052551525525255352554525555255652557525585255952560525615256252563525645256552566525675256852569525705257152572525735257452575525765257752578525795258052581525825258352584525855258652587525885258952590525915259252593525945259552596525975259852599526005260152602526035260452605526065260752608526095261052611526125261352614526155261652617526185261952620526215262252623526245262552626526275262852629526305263152632526335263452635526365263752638526395264052641526425264352644526455264652647526485264952650526515265252653526545265552656526575265852659526605266152662526635266452665526665266752668526695267052671526725267352674526755267652677526785267952680526815268252683526845268552686526875268852689526905269152692526935269452695526965269752698526995270052701527025270352704527055270652707527085270952710527115271252713527145271552716527175271852719527205272152722527235272452725527265272752728527295273052731527325273352734527355273652737527385273952740527415274252743527445274552746527475274852749527505275152752527535275452755527565275752758527595276052761527625276352764527655276652767527685276952770527715277252773527745277552776527775277852779527805278152782527835278452785527865278752788527895279052791527925279352794527955279652797527985279952800528015280252803528045280552806528075280852809528105281152812528135281452815528165281752818528195282052821528225282352824528255282652827528285282952830528315283252833528345283552836528375283852839528405284152842528435284452845528465284752848528495285052851528525285352854528555285652857528585285952860528615286252863528645286552866528675286852869528705287152872528735287452875528765287752878528795288052881528825288352884528855288652887528885288952890528915289252893528945289552896528975289852899529005290152902529035290452905529065290752908529095291052911529125291352914529155291652917529185291952920529215292252923529245292552926529275292852929529305293152932529335293452935529365293752938529395294052941529425294352944529455294652947529485294952950529515295252953529545295552956529575295852959529605296152962529635296452965529665296752968529695297052971529725297352974529755297652977529785297952980529815298252983529845298552986529875298852989529905299152992529935299452995529965299752998529995300053001530025300353004530055300653007530085300953010530115301253013530145301553016530175301853019530205302153022530235302453025530265302753028530295303053031530325303353034530355303653037530385303953040530415304253043530445304553046530475304853049530505305153052530535305453055530565305753058530595306053061530625306353064530655306653067530685306953070530715307253073530745307553076530775307853079530805308153082530835308453085530865308753088530895309053091530925309353094530955309653097530985309953100531015310253103531045310553106531075310853109531105311153112531135311453115531165311753118531195312053121531225312353124531255312653127531285312953130531315313253133531345313553136531375313853139531405314153142531435314453145531465314753148531495315053151531525315353154531555315653157531585315953160531615316253163531645316553166531675316853169531705317153172531735317453175531765317753178531795318053181531825318353184531855318653187531885318953190531915319253193531945319553196531975319853199532005320153202532035320453205532065320753208532095321053211532125321353214532155321653217532185321953220532215322253223532245322553226532275322853229532305323153232532335323453235532365323753238532395324053241532425324353244532455324653247532485324953250532515325253253532545325553256532575325853259532605326153262532635326453265532665326753268532695327053271532725327353274532755327653277532785327953280532815328253283532845328553286532875328853289532905329153292532935329453295532965329753298532995330053301533025330353304533055330653307533085330953310533115331253313533145331553316533175331853319533205332153322533235332453325533265332753328533295333053331533325333353334533355333653337533385333953340533415334253343533445334553346533475334853349533505335153352533535335453355533565335753358533595336053361533625336353364533655336653367533685336953370533715337253373533745337553376533775337853379533805338153382533835338453385533865338753388533895339053391533925339353394533955339653397533985339953400534015340253403534045340553406534075340853409534105341153412534135341453415534165341753418534195342053421534225342353424534255342653427534285342953430534315343253433534345343553436534375343853439534405344153442534435344453445534465344753448534495345053451534525345353454534555345653457534585345953460534615346253463534645346553466534675346853469534705347153472534735347453475534765347753478534795348053481534825348353484534855348653487534885348953490534915349253493534945349553496534975349853499535005350153502535035350453505535065350753508535095351053511535125351353514535155351653517535185351953520535215352253523535245352553526535275352853529535305353153532535335353453535535365353753538535395354053541535425354353544535455354653547535485354953550535515355253553535545355553556535575355853559535605356153562535635356453565535665356753568535695357053571535725357353574535755357653577535785357953580535815358253583535845358553586535875358853589535905359153592535935359453595535965359753598535995360053601536025360353604536055360653607536085360953610536115361253613536145361553616536175361853619536205362153622536235362453625536265362753628536295363053631536325363353634536355363653637536385363953640536415364253643536445364553646536475364853649536505365153652536535365453655536565365753658536595366053661536625366353664536655366653667536685366953670536715367253673536745367553676536775367853679536805368153682536835368453685536865368753688536895369053691536925369353694536955369653697536985369953700537015370253703537045370553706537075370853709537105371153712537135371453715537165371753718537195372053721537225372353724537255372653727537285372953730537315373253733537345373553736537375373853739537405374153742537435374453745537465374753748537495375053751537525375353754537555375653757537585375953760537615376253763537645376553766537675376853769537705377153772537735377453775537765377753778537795378053781537825378353784537855378653787537885378953790537915379253793537945379553796537975379853799538005380153802538035380453805538065380753808538095381053811538125381353814538155381653817538185381953820538215382253823538245382553826538275382853829538305383153832538335383453835538365383753838538395384053841538425384353844538455384653847538485384953850538515385253853538545385553856538575385853859538605386153862538635386453865538665386753868538695387053871538725387353874538755387653877538785387953880538815388253883538845388553886538875388853889538905389153892538935389453895538965389753898538995390053901539025390353904539055390653907539085390953910539115391253913539145391553916539175391853919539205392153922539235392453925539265392753928539295393053931539325393353934539355393653937539385393953940539415394253943539445394553946539475394853949539505395153952539535395453955539565395753958539595396053961539625396353964539655396653967539685396953970539715397253973539745397553976539775397853979539805398153982539835398453985539865398753988539895399053991539925399353994539955399653997539985399954000540015400254003540045400554006540075400854009540105401154012540135401454015540165401754018540195402054021540225402354024540255402654027540285402954030540315403254033540345403554036540375403854039540405404154042540435404454045540465404754048540495405054051540525405354054540555405654057540585405954060540615406254063540645406554066540675406854069540705407154072540735407454075540765407754078540795408054081540825408354084540855408654087540885408954090540915409254093540945409554096540975409854099541005410154102541035410454105541065410754108541095411054111541125411354114541155411654117541185411954120541215412254123541245412554126541275412854129541305413154132541335413454135541365413754138541395414054141541425414354144541455414654147541485414954150541515415254153541545415554156541575415854159541605416154162541635416454165541665416754168541695417054171541725417354174541755417654177541785417954180541815418254183541845418554186541875418854189541905419154192541935419454195541965419754198541995420054201542025420354204542055420654207542085420954210542115421254213542145421554216542175421854219542205422154222542235422454225542265422754228542295423054231542325423354234542355423654237542385423954240542415424254243542445424554246542475424854249542505425154252542535425454255542565425754258542595426054261542625426354264542655426654267542685426954270542715427254273542745427554276542775427854279542805428154282542835428454285542865428754288542895429054291542925429354294542955429654297542985429954300543015430254303543045430554306543075430854309543105431154312543135431454315543165431754318543195432054321543225432354324543255432654327543285432954330543315433254333543345433554336543375433854339543405434154342543435434454345543465434754348543495435054351543525435354354543555435654357543585435954360543615436254363543645436554366543675436854369543705437154372543735437454375543765437754378543795438054381543825438354384543855438654387543885438954390543915439254393543945439554396543975439854399544005440154402544035440454405544065440754408544095441054411544125441354414544155441654417544185441954420544215442254423544245442554426544275442854429544305443154432544335443454435544365443754438544395444054441544425444354444544455444654447544485444954450544515445254453544545445554456544575445854459544605446154462544635446454465544665446754468544695447054471544725447354474544755447654477544785447954480544815448254483544845448554486544875448854489544905449154492544935449454495544965449754498544995450054501545025450354504545055450654507545085450954510545115451254513545145451554516545175451854519545205452154522545235452454525545265452754528545295453054531545325453354534545355453654537545385453954540545415454254543545445454554546545475454854549545505455154552545535455454555545565455754558545595456054561545625456354564545655456654567545685456954570545715457254573545745457554576545775457854579545805458154582545835458454585545865458754588545895459054591545925459354594545955459654597545985459954600546015460254603546045460554606546075460854609546105461154612546135461454615546165461754618546195462054621546225462354624546255462654627546285462954630546315463254633546345463554636546375463854639546405464154642546435464454645546465464754648546495465054651546525465354654546555465654657546585465954660546615466254663546645466554666546675466854669546705467154672546735467454675546765467754678546795468054681546825468354684546855468654687546885468954690546915469254693546945469554696546975469854699547005470154702547035470454705547065470754708547095471054711547125471354714547155471654717547185471954720547215472254723547245472554726547275472854729547305473154732547335473454735547365473754738547395474054741547425474354744547455474654747547485474954750547515475254753547545475554756547575475854759547605476154762547635476454765547665476754768547695477054771547725477354774547755477654777547785477954780547815478254783547845478554786547875478854789547905479154792547935479454795547965479754798547995480054801548025480354804548055480654807548085480954810548115481254813548145481554816548175481854819548205482154822548235482454825548265482754828548295483054831548325483354834548355483654837548385483954840548415484254843548445484554846548475484854849548505485154852548535485454855548565485754858548595486054861548625486354864548655486654867548685486954870548715487254873548745487554876548775487854879548805488154882548835488454885548865488754888548895489054891548925489354894548955489654897548985489954900549015490254903549045490554906549075490854909549105491154912549135491454915549165491754918549195492054921549225492354924549255492654927549285492954930549315493254933549345493554936549375493854939549405494154942549435494454945549465494754948549495495054951549525495354954549555495654957549585495954960549615496254963549645496554966549675496854969549705497154972549735497454975549765497754978549795498054981549825498354984549855498654987549885498954990549915499254993549945499554996549975499854999550005500155002550035500455005550065500755008550095501055011550125501355014550155501655017550185501955020550215502255023550245502555026550275502855029550305503155032550335503455035550365503755038550395504055041550425504355044550455504655047550485504955050550515505255053550545505555056550575505855059550605506155062550635506455065550665506755068550695507055071550725507355074550755507655077550785507955080550815508255083550845508555086550875508855089550905509155092550935509455095550965509755098550995510055101551025510355104551055510655107551085510955110551115511255113551145511555116551175511855119551205512155122551235512455125551265512755128551295513055131551325513355134551355513655137551385513955140551415514255143551445514555146551475514855149551505515155152551535515455155551565515755158551595516055161551625516355164551655516655167551685516955170551715517255173551745517555176551775517855179551805518155182551835518455185551865518755188551895519055191551925519355194551955519655197551985519955200552015520255203552045520555206552075520855209552105521155212552135521455215552165521755218552195522055221552225522355224552255522655227552285522955230552315523255233552345523555236552375523855239552405524155242552435524455245552465524755248552495525055251552525525355254552555525655257552585525955260552615526255263552645526555266552675526855269552705527155272552735527455275552765527755278552795528055281552825528355284552855528655287552885528955290552915529255293552945529555296552975529855299553005530155302553035530455305553065530755308553095531055311553125531355314553155531655317553185531955320553215532255323553245532555326553275532855329553305533155332553335533455335553365533755338553395534055341553425534355344553455534655347553485534955350553515535255353553545535555356553575535855359553605536155362553635536455365553665536755368553695537055371553725537355374553755537655377553785537955380553815538255383553845538555386553875538855389553905539155392553935539455395553965539755398553995540055401554025540355404554055540655407554085540955410554115541255413554145541555416554175541855419554205542155422554235542455425554265542755428554295543055431554325543355434554355543655437554385543955440554415544255443554445544555446554475544855449554505545155452554535545455455554565545755458554595546055461554625546355464554655546655467554685546955470554715547255473554745547555476554775547855479554805548155482554835548455485554865548755488554895549055491554925549355494554955549655497554985549955500555015550255503555045550555506555075550855509555105551155512555135551455515555165551755518555195552055521555225552355524555255552655527555285552955530555315553255533555345553555536555375553855539555405554155542555435554455545555465554755548555495555055551555525555355554555555555655557555585555955560555615556255563555645556555566555675556855569555705557155572555735557455575555765557755578555795558055581555825558355584555855558655587555885558955590555915559255593555945559555596555975559855599556005560155602556035560455605556065560755608556095561055611556125561355614556155561655617556185561955620556215562255623556245562555626556275562855629556305563155632556335563455635556365563755638556395564055641556425564355644556455564655647556485564955650556515565255653556545565555656556575565855659556605566155662556635566455665556665566755668556695567055671556725567355674556755567655677556785567955680556815568255683556845568555686556875568855689556905569155692556935569455695556965569755698556995570055701557025570355704557055570655707557085570955710557115571255713557145571555716557175571855719557205572155722557235572455725557265572755728557295573055731557325573355734557355573655737557385573955740557415574255743557445574555746557475574855749557505575155752557535575455755557565575755758557595576055761557625576355764557655576655767557685576955770557715577255773557745577555776557775577855779557805578155782557835578455785557865578755788557895579055791557925579355794557955579655797557985579955800558015580255803558045580555806558075580855809558105581155812558135581455815558165581755818558195582055821558225582355824558255582655827558285582955830558315583255833558345583555836558375583855839558405584155842558435584455845558465584755848558495585055851558525585355854558555585655857558585585955860558615586255863558645586555866558675586855869558705587155872558735587455875558765587755878558795588055881558825588355884558855588655887558885588955890558915589255893558945589555896558975589855899559005590155902559035590455905559065590755908559095591055911559125591355914559155591655917559185591955920559215592255923559245592555926559275592855929559305593155932559335593455935559365593755938559395594055941559425594355944559455594655947559485594955950559515595255953559545595555956559575595855959559605596155962559635596455965559665596755968559695597055971559725597355974559755597655977559785597955980559815598255983559845598555986559875598855989559905599155992559935599455995559965599755998559995600056001560025600356004560055600656007560085600956010560115601256013560145601556016560175601856019560205602156022560235602456025560265602756028560295603056031560325603356034560355603656037560385603956040560415604256043560445604556046560475604856049560505605156052560535605456055560565605756058560595606056061560625606356064560655606656067560685606956070560715607256073560745607556076560775607856079560805608156082560835608456085560865608756088560895609056091560925609356094560955609656097560985609956100561015610256103561045610556106561075610856109561105611156112561135611456115561165611756118561195612056121561225612356124561255612656127561285612956130561315613256133561345613556136561375613856139561405614156142561435614456145561465614756148561495615056151561525615356154561555615656157561585615956160561615616256163561645616556166561675616856169561705617156172561735617456175561765617756178561795618056181561825618356184561855618656187561885618956190561915619256193561945619556196561975619856199562005620156202562035620456205562065620756208562095621056211562125621356214562155621656217562185621956220562215622256223562245622556226562275622856229562305623156232562335623456235562365623756238562395624056241562425624356244562455624656247562485624956250562515625256253562545625556256562575625856259562605626156262562635626456265562665626756268562695627056271562725627356274562755627656277562785627956280562815628256283562845628556286562875628856289562905629156292562935629456295562965629756298562995630056301563025630356304563055630656307563085630956310563115631256313563145631556316563175631856319563205632156322563235632456325563265632756328563295633056331563325633356334563355633656337563385633956340563415634256343563445634556346563475634856349563505635156352563535635456355563565635756358563595636056361563625636356364563655636656367563685636956370563715637256373563745637556376563775637856379563805638156382563835638456385563865638756388563895639056391563925639356394563955639656397563985639956400564015640256403564045640556406564075640856409564105641156412564135641456415564165641756418564195642056421564225642356424564255642656427564285642956430564315643256433564345643556436564375643856439564405644156442564435644456445564465644756448564495645056451564525645356454564555645656457564585645956460564615646256463564645646556466564675646856469564705647156472564735647456475564765647756478564795648056481564825648356484564855648656487564885648956490564915649256493564945649556496564975649856499565005650156502565035650456505565065650756508565095651056511565125651356514565155651656517565185651956520565215652256523565245652556526565275652856529565305653156532565335653456535565365653756538565395654056541565425654356544565455654656547565485654956550565515655256553565545655556556565575655856559565605656156562565635656456565565665656756568565695657056571565725657356574565755657656577565785657956580565815658256583565845658556586565875658856589565905659156592565935659456595565965659756598565995660056601566025660356604566055660656607566085660956610566115661256613566145661556616566175661856619566205662156622566235662456625566265662756628566295663056631566325663356634566355663656637566385663956640566415664256643566445664556646566475664856649566505665156652566535665456655566565665756658566595666056661566625666356664566655666656667566685666956670566715667256673566745667556676566775667856679566805668156682566835668456685566865668756688566895669056691566925669356694566955669656697566985669956700567015670256703567045670556706567075670856709567105671156712567135671456715567165671756718567195672056721567225672356724567255672656727567285672956730567315673256733567345673556736567375673856739567405674156742567435674456745567465674756748567495675056751567525675356754567555675656757567585675956760567615676256763567645676556766567675676856769567705677156772567735677456775567765677756778567795678056781567825678356784567855678656787567885678956790567915679256793567945679556796567975679856799568005680156802568035680456805568065680756808568095681056811568125681356814568155681656817568185681956820568215682256823568245682556826568275682856829568305683156832568335683456835568365683756838568395684056841568425684356844568455684656847568485684956850568515685256853568545685556856568575685856859568605686156862568635686456865568665686756868568695687056871568725687356874568755687656877568785687956880568815688256883568845688556886568875688856889568905689156892568935689456895568965689756898568995690056901569025690356904569055690656907569085690956910569115691256913569145691556916569175691856919569205692156922569235692456925569265692756928569295693056931569325693356934569355693656937569385693956940569415694256943569445694556946569475694856949569505695156952569535695456955569565695756958569595696056961569625696356964569655696656967569685696956970569715697256973569745697556976569775697856979569805698156982569835698456985569865698756988569895699056991569925699356994569955699656997569985699957000570015700257003570045700557006570075700857009570105701157012570135701457015570165701757018570195702057021570225702357024570255702657027570285702957030570315703257033570345703557036570375703857039570405704157042570435704457045570465704757048570495705057051570525705357054570555705657057570585705957060570615706257063570645706557066570675706857069570705707157072570735707457075570765707757078570795708057081570825708357084570855708657087570885708957090570915709257093570945709557096570975709857099571005710157102571035710457105571065710757108571095711057111571125711357114571155711657117571185711957120571215712257123571245712557126571275712857129571305713157132571335713457135571365713757138571395714057141571425714357144571455714657147571485714957150571515715257153571545715557156571575715857159571605716157162571635716457165571665716757168571695717057171571725717357174571755717657177571785717957180571815718257183571845718557186571875718857189571905719157192571935719457195571965719757198571995720057201572025720357204572055720657207572085720957210572115721257213572145721557216572175721857219572205722157222572235722457225572265722757228572295723057231572325723357234572355723657237572385723957240572415724257243572445724557246572475724857249572505725157252572535725457255572565725757258572595726057261572625726357264572655726657267572685726957270572715727257273572745727557276572775727857279572805728157282572835728457285572865728757288572895729057291572925729357294572955729657297572985729957300573015730257303573045730557306573075730857309573105731157312573135731457315573165731757318573195732057321573225732357324573255732657327573285732957330573315733257333573345733557336573375733857339573405734157342573435734457345573465734757348573495735057351573525735357354573555735657357573585735957360573615736257363573645736557366573675736857369573705737157372573735737457375573765737757378573795738057381573825738357384573855738657387573885738957390573915739257393573945739557396573975739857399574005740157402574035740457405574065740757408574095741057411574125741357414574155741657417574185741957420574215742257423574245742557426574275742857429574305743157432574335743457435574365743757438574395744057441574425744357444574455744657447574485744957450574515745257453574545745557456574575745857459574605746157462574635746457465574665746757468574695747057471574725747357474574755747657477574785747957480574815748257483574845748557486574875748857489574905749157492574935749457495574965749757498574995750057501575025750357504575055750657507575085750957510575115751257513575145751557516575175751857519575205752157522575235752457525575265752757528575295753057531575325753357534575355753657537575385753957540575415754257543575445754557546575475754857549575505755157552575535755457555575565755757558575595756057561575625756357564575655756657567575685756957570575715757257573575745757557576575775757857579575805758157582575835758457585575865758757588575895759057591575925759357594575955759657597575985759957600576015760257603576045760557606576075760857609576105761157612576135761457615576165761757618576195762057621576225762357624576255762657627576285762957630576315763257633576345763557636576375763857639576405764157642576435764457645576465764757648576495765057651576525765357654576555765657657576585765957660576615766257663576645766557666576675766857669576705767157672576735767457675576765767757678576795768057681576825768357684576855768657687576885768957690576915769257693576945769557696576975769857699577005770157702577035770457705577065770757708577095771057711577125771357714577155771657717577185771957720577215772257723577245772557726577275772857729577305773157732577335773457735577365773757738577395774057741577425774357744577455774657747577485774957750577515775257753577545775557756577575775857759577605776157762577635776457765577665776757768577695777057771577725777357774577755777657777577785777957780577815778257783577845778557786577875778857789577905779157792577935779457795577965779757798577995780057801578025780357804578055780657807578085780957810578115781257813578145781557816578175781857819578205782157822578235782457825578265782757828578295783057831578325783357834578355783657837578385783957840578415784257843578445784557846578475784857849578505785157852578535785457855578565785757858578595786057861578625786357864578655786657867578685786957870578715787257873578745787557876578775787857879578805788157882578835788457885578865788757888578895789057891578925789357894578955789657897578985789957900579015790257903579045790557906579075790857909579105791157912579135791457915579165791757918579195792057921579225792357924579255792657927579285792957930579315793257933579345793557936579375793857939579405794157942579435794457945579465794757948579495795057951579525795357954579555795657957579585795957960579615796257963579645796557966579675796857969579705797157972579735797457975579765797757978579795798057981579825798357984579855798657987579885798957990579915799257993579945799557996579975799857999580005800158002580035800458005580065800758008580095801058011580125801358014580155801658017580185801958020580215802258023580245802558026580275802858029580305803158032580335803458035580365803758038580395804058041580425804358044580455804658047580485804958050580515805258053580545805558056580575805858059580605806158062580635806458065580665806758068580695807058071580725807358074580755807658077580785807958080580815808258083580845808558086580875808858089580905809158092580935809458095580965809758098580995810058101581025810358104581055810658107581085810958110581115811258113581145811558116581175811858119581205812158122581235812458125581265812758128581295813058131581325813358134581355813658137581385813958140581415814258143581445814558146581475814858149581505815158152581535815458155581565815758158581595816058161581625816358164581655816658167581685816958170581715817258173581745817558176581775817858179581805818158182581835818458185581865818758188581895819058191581925819358194581955819658197581985819958200582015820258203582045820558206582075820858209582105821158212582135821458215582165821758218582195822058221582225822358224582255822658227582285822958230582315823258233582345823558236582375823858239582405824158242582435824458245582465824758248582495825058251582525825358254582555825658257582585825958260582615826258263582645826558266582675826858269582705827158272582735827458275582765827758278582795828058281582825828358284582855828658287582885828958290582915829258293582945829558296582975829858299583005830158302583035830458305583065830758308583095831058311583125831358314583155831658317583185831958320583215832258323583245832558326583275832858329583305833158332583335833458335583365833758338583395834058341583425834358344583455834658347583485834958350583515835258353583545835558356583575835858359583605836158362583635836458365583665836758368583695837058371583725837358374583755837658377583785837958380583815838258383583845838558386583875838858389583905839158392583935839458395583965839758398583995840058401584025840358404584055840658407584085840958410584115841258413584145841558416584175841858419584205842158422584235842458425584265842758428584295843058431584325843358434584355843658437584385843958440584415844258443584445844558446584475844858449584505845158452584535845458455584565845758458584595846058461584625846358464584655846658467584685846958470584715847258473584745847558476584775847858479584805848158482584835848458485584865848758488584895849058491584925849358494584955849658497584985849958500585015850258503585045850558506585075850858509585105851158512585135851458515585165851758518585195852058521585225852358524585255852658527585285852958530585315853258533585345853558536585375853858539585405854158542585435854458545585465854758548585495855058551585525855358554585555855658557585585855958560585615856258563585645856558566585675856858569585705857158572585735857458575585765857758578585795858058581585825858358584585855858658587585885858958590585915859258593585945859558596585975859858599586005860158602586035860458605586065860758608586095861058611586125861358614586155861658617586185861958620586215862258623586245862558626586275862858629586305863158632586335863458635586365863758638586395864058641586425864358644586455864658647586485864958650586515865258653586545865558656586575865858659586605866158662586635866458665586665866758668586695867058671586725867358674586755867658677586785867958680586815868258683586845868558686586875868858689586905869158692586935869458695586965869758698586995870058701587025870358704587055870658707587085870958710587115871258713587145871558716587175871858719587205872158722587235872458725587265872758728587295873058731587325873358734587355873658737587385873958740587415874258743587445874558746587475874858749587505875158752587535875458755587565875758758587595876058761587625876358764587655876658767587685876958770587715877258773587745877558776587775877858779587805878158782587835878458785587865878758788587895879058791587925879358794587955879658797587985879958800588015880258803588045880558806588075880858809588105881158812588135881458815588165881758818588195882058821588225882358824588255882658827588285882958830588315883258833588345883558836588375883858839588405884158842588435884458845588465884758848588495885058851588525885358854588555885658857588585885958860588615886258863588645886558866588675886858869588705887158872588735887458875588765887758878588795888058881588825888358884588855888658887588885888958890588915889258893588945889558896588975889858899589005890158902589035890458905589065890758908589095891058911589125891358914589155891658917589185891958920589215892258923589245892558926589275892858929589305893158932589335893458935589365893758938589395894058941589425894358944589455894658947589485894958950589515895258953589545895558956589575895858959589605896158962589635896458965589665896758968589695897058971589725897358974589755897658977589785897958980589815898258983589845898558986589875898858989589905899158992589935899458995589965899758998589995900059001590025900359004590055900659007590085900959010590115901259013590145901559016590175901859019590205902159022590235902459025590265902759028590295903059031590325903359034590355903659037590385903959040590415904259043590445904559046590475904859049590505905159052590535905459055590565905759058590595906059061590625906359064590655906659067590685906959070590715907259073590745907559076590775907859079590805908159082590835908459085590865908759088590895909059091590925909359094590955909659097590985909959100591015910259103591045910559106591075910859109591105911159112591135911459115591165911759118591195912059121591225912359124591255912659127591285912959130591315913259133591345913559136591375913859139591405914159142591435914459145591465914759148591495915059151591525915359154591555915659157591585915959160591615916259163591645916559166591675916859169591705917159172591735917459175591765917759178591795918059181591825918359184591855918659187591885918959190591915919259193591945919559196591975919859199592005920159202592035920459205592065920759208592095921059211592125921359214592155921659217592185921959220592215922259223592245922559226592275922859229592305923159232592335923459235592365923759238592395924059241592425924359244592455924659247592485924959250592515925259253592545925559256592575925859259592605926159262592635926459265592665926759268592695927059271592725927359274592755927659277592785927959280592815928259283592845928559286592875928859289592905929159292592935929459295592965929759298592995930059301593025930359304593055930659307593085930959310593115931259313593145931559316593175931859319593205932159322593235932459325593265932759328593295933059331593325933359334593355933659337593385933959340593415934259343593445934559346593475934859349593505935159352593535935459355593565935759358593595936059361593625936359364593655936659367593685936959370593715937259373593745937559376593775937859379593805938159382593835938459385593865938759388593895939059391593925939359394593955939659397593985939959400594015940259403594045940559406594075940859409594105941159412594135941459415594165941759418594195942059421594225942359424594255942659427594285942959430594315943259433594345943559436594375943859439594405944159442594435944459445594465944759448594495945059451594525945359454594555945659457594585945959460594615946259463594645946559466594675946859469594705947159472594735947459475594765947759478594795948059481594825948359484594855948659487594885948959490594915949259493594945949559496594975949859499595005950159502595035950459505595065950759508595095951059511595125951359514595155951659517595185951959520595215952259523595245952559526595275952859529595305953159532595335953459535595365953759538595395954059541595425954359544595455954659547595485954959550595515955259553595545955559556595575955859559595605956159562595635956459565595665956759568595695957059571595725957359574595755957659577595785957959580595815958259583595845958559586595875958859589595905959159592595935959459595595965959759598595995960059601596025960359604596055960659607596085960959610596115961259613596145961559616596175961859619596205962159622596235962459625596265962759628596295963059631596325963359634596355963659637596385963959640596415964259643596445964559646596475964859649596505965159652596535965459655596565965759658596595966059661596625966359664596655966659667596685966959670596715967259673596745967559676596775967859679596805968159682596835968459685596865968759688596895969059691596925969359694596955969659697596985969959700597015970259703597045970559706597075970859709597105971159712597135971459715597165971759718597195972059721597225972359724597255972659727597285972959730597315973259733597345973559736597375973859739597405974159742597435974459745597465974759748597495975059751597525975359754597555975659757597585975959760597615976259763597645976559766597675976859769597705977159772597735977459775597765977759778597795978059781597825978359784597855978659787597885978959790597915979259793597945979559796597975979859799598005980159802598035980459805598065980759808598095981059811598125981359814598155981659817598185981959820598215982259823598245982559826598275982859829598305983159832598335983459835598365983759838598395984059841598425984359844598455984659847598485984959850598515985259853598545985559856598575985859859598605986159862598635986459865598665986759868598695987059871598725987359874598755987659877598785987959880598815988259883598845988559886598875988859889598905989159892598935989459895598965989759898598995990059901599025990359904599055990659907599085990959910599115991259913599145991559916599175991859919599205992159922599235992459925599265992759928599295993059931599325993359934599355993659937599385993959940599415994259943599445994559946599475994859949599505995159952599535995459955599565995759958599595996059961599625996359964599655996659967599685996959970599715997259973599745997559976599775997859979599805998159982599835998459985599865998759988599895999059991599925999359994599955999659997599985999960000600016000260003600046000560006600076000860009600106001160012600136001460015600166001760018600196002060021600226002360024600256002660027600286002960030600316003260033600346003560036600376003860039600406004160042600436004460045600466004760048600496005060051600526005360054600556005660057600586005960060600616006260063600646006560066600676006860069600706007160072600736007460075600766007760078600796008060081600826008360084600856008660087600886008960090600916009260093600946009560096600976009860099601006010160102601036010460105601066010760108601096011060111601126011360114601156011660117601186011960120601216012260123601246012560126601276012860129601306013160132601336013460135601366013760138601396014060141601426014360144601456014660147601486014960150601516015260153601546015560156601576015860159601606016160162601636016460165601666016760168601696017060171601726017360174601756017660177601786017960180601816018260183601846018560186601876018860189601906019160192601936019460195601966019760198601996020060201602026020360204602056020660207602086020960210602116021260213602146021560216602176021860219602206022160222602236022460225602266022760228602296023060231602326023360234602356023660237602386023960240602416024260243602446024560246602476024860249602506025160252602536025460255602566025760258602596026060261602626026360264602656026660267602686026960270602716027260273602746027560276602776027860279602806028160282602836028460285602866028760288602896029060291602926029360294602956029660297602986029960300603016030260303603046030560306603076030860309603106031160312603136031460315603166031760318603196032060321603226032360324603256032660327603286032960330603316033260333603346033560336603376033860339603406034160342603436034460345603466034760348603496035060351603526035360354603556035660357603586035960360603616036260363603646036560366603676036860369603706037160372603736037460375603766037760378603796038060381603826038360384603856038660387603886038960390603916039260393603946039560396603976039860399604006040160402604036040460405604066040760408604096041060411604126041360414604156041660417604186041960420604216042260423604246042560426604276042860429604306043160432604336043460435604366043760438604396044060441604426044360444604456044660447604486044960450604516045260453604546045560456604576045860459604606046160462604636046460465604666046760468604696047060471604726047360474604756047660477604786047960480604816048260483604846048560486604876048860489604906049160492604936049460495604966049760498604996050060501605026050360504605056050660507605086050960510605116051260513605146051560516605176051860519605206052160522605236052460525605266052760528605296053060531605326053360534605356053660537605386053960540605416054260543605446054560546605476054860549605506055160552605536055460555605566055760558605596056060561605626056360564605656056660567605686056960570605716057260573605746057560576605776057860579605806058160582605836058460585605866058760588605896059060591605926059360594605956059660597605986059960600606016060260603606046060560606606076060860609606106061160612606136061460615606166061760618606196062060621606226062360624606256062660627606286062960630606316063260633606346063560636606376063860639606406064160642606436064460645606466064760648606496065060651606526065360654606556065660657606586065960660606616066260663606646066560666606676066860669606706067160672606736067460675606766067760678606796068060681606826068360684606856068660687606886068960690606916069260693606946069560696606976069860699607006070160702607036070460705607066070760708607096071060711607126071360714607156071660717607186071960720607216072260723607246072560726607276072860729607306073160732607336073460735607366073760738607396074060741607426074360744607456074660747607486074960750607516075260753607546075560756607576075860759607606076160762607636076460765607666076760768607696077060771607726077360774607756077660777607786077960780607816078260783607846078560786607876078860789607906079160792607936079460795607966079760798607996080060801608026080360804608056080660807608086080960810608116081260813608146081560816608176081860819608206082160822608236082460825608266082760828608296083060831608326083360834608356083660837608386083960840608416084260843608446084560846608476084860849608506085160852608536085460855608566085760858608596086060861608626086360864608656086660867608686086960870608716087260873608746087560876608776087860879608806088160882608836088460885608866088760888608896089060891608926089360894608956089660897608986089960900609016090260903609046090560906609076090860909609106091160912609136091460915609166091760918609196092060921609226092360924609256092660927609286092960930609316093260933609346093560936609376093860939609406094160942609436094460945609466094760948609496095060951609526095360954609556095660957609586095960960609616096260963609646096560966609676096860969609706097160972609736097460975609766097760978609796098060981609826098360984609856098660987609886098960990609916099260993609946099560996609976099860999610006100161002610036100461005610066100761008610096101061011610126101361014610156101661017610186101961020610216102261023610246102561026610276102861029610306103161032610336103461035610366103761038610396104061041610426104361044610456104661047610486104961050610516105261053610546105561056610576105861059610606106161062610636106461065610666106761068610696107061071610726107361074610756107661077610786107961080610816108261083610846108561086610876108861089610906109161092610936109461095610966109761098610996110061101611026110361104611056110661107611086110961110611116111261113611146111561116611176111861119611206112161122611236112461125611266112761128611296113061131611326113361134611356113661137611386113961140611416114261143611446114561146611476114861149611506115161152611536115461155611566115761158611596116061161611626116361164611656116661167611686116961170611716117261173611746117561176611776117861179611806118161182611836118461185611866118761188611896119061191611926119361194611956119661197611986119961200612016120261203612046120561206612076120861209612106121161212612136121461215612166121761218612196122061221612226122361224612256122661227612286122961230612316123261233612346123561236612376123861239612406124161242612436124461245612466124761248612496125061251612526125361254612556125661257612586125961260612616126261263612646126561266612676126861269612706127161272612736127461275612766127761278612796128061281612826128361284612856128661287612886128961290612916129261293612946129561296612976129861299613006130161302613036130461305613066130761308613096131061311613126131361314613156131661317613186131961320613216132261323613246132561326613276132861329613306133161332613336133461335613366133761338613396134061341613426134361344613456134661347613486134961350613516135261353613546135561356613576135861359613606136161362613636136461365613666136761368613696137061371613726137361374613756137661377613786137961380613816138261383613846138561386613876138861389613906139161392613936139461395613966139761398613996140061401614026140361404614056140661407614086140961410614116141261413614146141561416614176141861419614206142161422614236142461425614266142761428614296143061431614326143361434614356143661437614386143961440614416144261443614446144561446614476144861449614506145161452614536145461455614566145761458614596146061461614626146361464614656146661467614686146961470614716147261473614746147561476614776147861479614806148161482614836148461485614866148761488614896149061491614926149361494614956149661497614986149961500615016150261503615046150561506615076150861509615106151161512615136151461515615166151761518615196152061521615226152361524615256152661527615286152961530615316153261533615346153561536615376153861539615406154161542615436154461545615466154761548615496155061551615526155361554615556155661557615586155961560615616156261563615646156561566615676156861569615706157161572615736157461575615766157761578615796158061581615826158361584615856158661587615886158961590615916159261593615946159561596615976159861599616006160161602616036160461605616066160761608616096161061611616126161361614616156161661617616186161961620616216162261623616246162561626616276162861629616306163161632616336163461635616366163761638616396164061641616426164361644616456164661647616486164961650616516165261653616546165561656616576165861659616606166161662616636166461665616666166761668616696167061671616726167361674616756167661677616786167961680616816168261683616846168561686616876168861689616906169161692616936169461695616966169761698616996170061701617026170361704617056170661707617086170961710617116171261713617146171561716617176171861719617206172161722617236172461725617266172761728617296173061731617326173361734617356173661737617386173961740617416174261743617446174561746617476174861749617506175161752617536175461755617566175761758617596176061761617626176361764617656176661767617686176961770617716177261773617746177561776617776177861779617806178161782617836178461785617866178761788617896179061791617926179361794617956179661797617986179961800618016180261803618046180561806618076180861809618106181161812618136181461815618166181761818618196182061821618226182361824618256182661827618286182961830618316183261833618346183561836618376183861839618406184161842618436184461845618466184761848618496185061851618526185361854618556185661857618586185961860618616186261863618646186561866618676186861869618706187161872618736187461875618766187761878618796188061881618826188361884618856188661887618886188961890618916189261893618946189561896618976189861899619006190161902619036190461905619066190761908619096191061911619126191361914619156191661917619186191961920619216192261923619246192561926619276192861929619306193161932619336193461935619366193761938619396194061941619426194361944619456194661947619486194961950619516195261953619546195561956619576195861959619606196161962619636196461965619666196761968619696197061971619726197361974619756197661977619786197961980619816198261983619846198561986619876198861989619906199161992619936199461995619966199761998619996200062001620026200362004620056200662007620086200962010620116201262013620146201562016620176201862019620206202162022620236202462025620266202762028620296203062031620326203362034620356203662037620386203962040620416204262043620446204562046620476204862049620506205162052620536205462055620566205762058620596206062061620626206362064620656206662067620686206962070620716207262073620746207562076620776207862079620806208162082620836208462085620866208762088620896209062091620926209362094620956209662097620986209962100621016210262103621046210562106621076210862109621106211162112621136211462115621166211762118621196212062121621226212362124621256212662127621286212962130621316213262133621346213562136621376213862139621406214162142621436214462145621466214762148621496215062151621526215362154621556215662157621586215962160621616216262163621646216562166621676216862169621706217162172621736217462175621766217762178621796218062181621826218362184621856218662187621886218962190621916219262193621946219562196621976219862199622006220162202622036220462205622066220762208622096221062211622126221362214622156221662217622186221962220622216222262223622246222562226622276222862229622306223162232622336223462235622366223762238622396224062241622426224362244622456224662247622486224962250622516225262253622546225562256622576225862259622606226162262622636226462265622666226762268622696227062271622726227362274622756227662277622786227962280622816228262283622846228562286622876228862289622906229162292622936229462295622966229762298622996230062301623026230362304623056230662307623086230962310623116231262313623146231562316623176231862319623206232162322623236232462325623266232762328623296233062331623326233362334623356233662337623386233962340623416234262343623446234562346623476234862349623506235162352623536235462355623566235762358623596236062361623626236362364623656236662367623686236962370623716237262373623746237562376623776237862379623806238162382623836238462385623866238762388623896239062391623926239362394623956239662397623986239962400624016240262403624046240562406624076240862409624106241162412624136241462415624166241762418624196242062421624226242362424624256242662427624286242962430624316243262433624346243562436624376243862439624406244162442624436244462445624466244762448624496245062451624526245362454624556245662457624586245962460624616246262463624646246562466624676246862469624706247162472624736247462475624766247762478624796248062481624826248362484624856248662487624886248962490624916249262493624946249562496624976249862499625006250162502625036250462505625066250762508625096251062511625126251362514625156251662517625186251962520625216252262523625246252562526625276252862529625306253162532625336253462535625366253762538625396254062541625426254362544625456254662547625486254962550625516255262553625546255562556625576255862559625606256162562625636256462565625666256762568625696257062571625726257362574625756257662577625786257962580625816258262583625846258562586625876258862589625906259162592625936259462595625966259762598625996260062601626026260362604626056260662607626086260962610626116261262613626146261562616626176261862619626206262162622626236262462625626266262762628626296263062631626326263362634626356263662637626386263962640626416264262643626446264562646626476264862649626506265162652626536265462655626566265762658626596266062661626626266362664626656266662667626686266962670626716267262673626746267562676626776267862679626806268162682626836268462685626866268762688626896269062691626926269362694626956269662697626986269962700627016270262703627046270562706627076270862709627106271162712627136271462715627166271762718627196272062721627226272362724627256272662727627286272962730627316273262733627346273562736627376273862739627406274162742627436274462745627466274762748627496275062751627526275362754627556275662757627586275962760627616276262763627646276562766627676276862769627706277162772627736277462775627766277762778627796278062781627826278362784627856278662787627886278962790627916279262793627946279562796627976279862799628006280162802628036280462805628066280762808628096281062811628126281362814628156281662817628186281962820628216282262823628246282562826628276282862829628306283162832628336283462835628366283762838628396284062841628426284362844628456284662847628486284962850628516285262853628546285562856628576285862859628606286162862628636286462865628666286762868628696287062871628726287362874628756287662877628786287962880628816288262883628846288562886628876288862889628906289162892628936289462895628966289762898628996290062901629026290362904629056290662907629086290962910629116291262913629146291562916629176291862919629206292162922629236292462925629266292762928629296293062931629326293362934629356293662937629386293962940629416294262943629446294562946629476294862949629506295162952629536295462955629566295762958629596296062961629626296362964629656296662967629686296962970629716297262973629746297562976629776297862979629806298162982629836298462985629866298762988629896299062991629926299362994629956299662997629986299963000630016300263003630046300563006630076300863009630106301163012630136301463015630166301763018630196302063021630226302363024630256302663027630286302963030630316303263033630346303563036630376303863039630406304163042630436304463045630466304763048630496305063051630526305363054630556305663057630586305963060630616306263063630646306563066630676306863069630706307163072630736307463075630766307763078630796308063081630826308363084630856308663087630886308963090630916309263093630946309563096630976309863099631006310163102631036310463105631066310763108631096311063111631126311363114631156311663117631186311963120631216312263123631246312563126631276312863129631306313163132631336313463135631366313763138631396314063141631426314363144631456314663147631486314963150631516315263153631546315563156631576315863159631606316163162631636316463165631666316763168631696317063171631726317363174631756317663177631786317963180631816318263183631846318563186631876318863189631906319163192631936319463195631966319763198631996320063201632026320363204632056320663207632086320963210632116321263213632146321563216632176321863219632206322163222632236322463225632266322763228632296323063231632326323363234632356323663237632386323963240632416324263243632446324563246632476324863249632506325163252632536325463255632566325763258632596326063261632626326363264632656326663267632686326963270632716327263273632746327563276632776327863279632806328163282632836328463285632866328763288632896329063291632926329363294632956329663297632986329963300633016330263303633046330563306633076330863309633106331163312633136331463315633166331763318633196332063321633226332363324633256332663327633286332963330633316333263333633346333563336633376333863339633406334163342633436334463345633466334763348633496335063351633526335363354633556335663357633586335963360633616336263363633646336563366633676336863369633706337163372633736337463375633766337763378633796338063381633826338363384633856338663387633886338963390633916339263393633946339563396633976339863399634006340163402634036340463405634066340763408634096341063411634126341363414634156341663417634186341963420634216342263423634246342563426634276342863429634306343163432634336343463435634366343763438634396344063441634426344363444634456344663447634486344963450634516345263453634546345563456634576345863459634606346163462634636346463465634666346763468634696347063471634726347363474634756347663477634786347963480634816348263483634846348563486634876348863489634906349163492634936349463495634966349763498634996350063501635026350363504635056350663507635086350963510635116351263513635146351563516635176351863519635206352163522635236352463525635266352763528635296353063531635326353363534635356353663537635386353963540635416354263543635446354563546635476354863549635506355163552635536355463555635566355763558635596356063561635626356363564635656356663567635686356963570635716357263573635746357563576635776357863579635806358163582635836358463585635866358763588635896359063591635926359363594635956359663597635986359963600636016360263603636046360563606636076360863609636106361163612636136361463615636166361763618636196362063621636226362363624636256362663627636286362963630636316363263633636346363563636636376363863639636406364163642636436364463645636466364763648636496365063651636526365363654636556365663657636586365963660636616366263663636646366563666636676366863669636706367163672636736367463675636766367763678636796368063681636826368363684636856368663687636886368963690636916369263693636946369563696636976369863699637006370163702637036370463705637066370763708637096371063711637126371363714637156371663717637186371963720637216372263723637246372563726637276372863729637306373163732637336373463735637366373763738637396374063741637426374363744637456374663747637486374963750637516375263753637546375563756637576375863759637606376163762637636376463765637666376763768637696377063771637726377363774637756377663777637786377963780637816378263783637846378563786637876378863789637906379163792637936379463795637966379763798637996380063801638026380363804638056380663807638086380963810638116381263813638146381563816638176381863819638206382163822638236382463825638266382763828638296383063831638326383363834638356383663837638386383963840638416384263843638446384563846638476384863849638506385163852638536385463855638566385763858638596386063861638626386363864638656386663867638686386963870638716387263873638746387563876638776387863879638806388163882638836388463885638866388763888638896389063891638926389363894638956389663897638986389963900639016390263903639046390563906639076390863909639106391163912639136391463915639166391763918639196392063921639226392363924639256392663927639286392963930639316393263933639346393563936639376393863939639406394163942639436394463945639466394763948639496395063951639526395363954639556395663957639586395963960639616396263963639646396563966639676396863969639706397163972639736397463975639766397763978639796398063981639826398363984639856398663987639886398963990639916399263993639946399563996639976399863999640006400164002640036400464005640066400764008640096401064011640126401364014640156401664017640186401964020640216402264023640246402564026640276402864029640306403164032640336403464035640366403764038640396404064041640426404364044640456404664047640486404964050640516405264053640546405564056640576405864059640606406164062640636406464065640666406764068640696407064071640726407364074640756407664077640786407964080640816408264083640846408564086640876408864089640906409164092640936409464095640966409764098640996410064101641026410364104641056410664107641086410964110641116411264113641146411564116641176411864119641206412164122641236412464125641266412764128641296413064131641326413364134641356413664137641386413964140641416414264143641446414564146641476414864149641506415164152641536415464155641566415764158641596416064161641626416364164641656416664167641686416964170641716417264173641746417564176641776417864179641806418164182641836418464185641866418764188641896419064191641926419364194641956419664197641986419964200642016420264203642046420564206642076420864209642106421164212642136421464215642166421764218642196422064221642226422364224642256422664227642286422964230642316423264233642346423564236642376423864239642406424164242642436424464245642466424764248642496425064251642526425364254642556425664257642586425964260642616426264263642646426564266642676426864269642706427164272642736427464275642766427764278642796428064281642826428364284642856428664287642886428964290642916429264293642946429564296642976429864299643006430164302643036430464305643066430764308643096431064311643126431364314643156431664317643186431964320643216432264323643246432564326643276432864329643306433164332643336433464335643366433764338643396434064341643426434364344643456434664347643486434964350643516435264353643546435564356643576435864359643606436164362643636436464365643666436764368643696437064371643726437364374643756437664377643786437964380643816438264383643846438564386643876438864389643906439164392643936439464395643966439764398643996440064401644026440364404644056440664407644086440964410644116441264413644146441564416644176441864419644206442164422644236442464425644266442764428644296443064431644326443364434644356443664437644386443964440644416444264443644446444564446644476444864449644506445164452644536445464455644566445764458644596446064461644626446364464644656446664467644686446964470644716447264473644746447564476644776447864479644806448164482644836448464485644866448764488644896449064491644926449364494644956449664497644986449964500645016450264503645046450564506645076450864509645106451164512645136451464515645166451764518645196452064521645226452364524645256452664527645286452964530645316453264533645346453564536645376453864539645406454164542645436454464545645466454764548645496455064551645526455364554645556455664557645586455964560645616456264563645646456564566645676456864569645706457164572645736457464575645766457764578645796458064581645826458364584645856458664587645886458964590645916459264593645946459564596645976459864599646006460164602646036460464605646066460764608646096461064611646126461364614646156461664617646186461964620646216462264623646246462564626646276462864629646306463164632646336463464635646366463764638646396464064641646426464364644646456464664647646486464964650646516465264653646546465564656646576465864659646606466164662646636466464665646666466764668646696467064671646726467364674646756467664677646786467964680646816468264683646846468564686646876468864689646906469164692646936469464695646966469764698646996470064701647026470364704647056470664707647086470964710647116471264713647146471564716647176471864719647206472164722647236472464725647266472764728647296473064731647326473364734647356473664737647386473964740647416474264743647446474564746647476474864749647506475164752647536475464755647566475764758647596476064761647626476364764647656476664767647686476964770647716477264773647746477564776647776477864779647806478164782647836478464785647866478764788647896479064791647926479364794647956479664797647986479964800648016480264803648046480564806648076480864809648106481164812648136481464815648166481764818648196482064821648226482364824648256482664827648286482964830648316483264833648346483564836648376483864839648406484164842648436484464845648466484764848648496485064851648526485364854648556485664857648586485964860648616486264863648646486564866648676486864869648706487164872648736487464875648766487764878648796488064881648826488364884648856488664887648886488964890648916489264893648946489564896648976489864899649006490164902649036490464905649066490764908649096491064911649126491364914649156491664917649186491964920649216492264923649246492564926649276492864929649306493164932649336493464935649366493764938649396494064941649426494364944649456494664947649486494964950649516495264953649546495564956649576495864959649606496164962649636496464965649666496764968649696497064971649726497364974649756497664977649786497964980649816498264983649846498564986649876498864989649906499164992649936499464995649966499764998649996500065001650026500365004650056500665007650086500965010650116501265013650146501565016650176501865019650206502165022650236502465025650266502765028650296503065031650326503365034650356503665037650386503965040650416504265043650446504565046650476504865049650506505165052650536505465055650566505765058650596506065061650626506365064650656506665067650686506965070650716507265073650746507565076650776507865079650806508165082650836508465085650866508765088650896509065091650926509365094650956509665097650986509965100651016510265103651046510565106651076510865109651106511165112651136511465115651166511765118651196512065121651226512365124651256512665127651286512965130651316513265133651346513565136651376513865139651406514165142651436514465145651466514765148651496515065151651526515365154651556515665157651586515965160651616516265163651646516565166651676516865169651706517165172651736517465175651766517765178651796518065181651826518365184651856518665187651886518965190651916519265193651946519565196651976519865199652006520165202652036520465205652066520765208652096521065211652126521365214652156521665217652186521965220652216522265223652246522565226652276522865229652306523165232652336523465235652366523765238652396524065241652426524365244652456524665247652486524965250652516525265253652546525565256652576525865259652606526165262652636526465265652666526765268652696527065271652726527365274652756527665277652786527965280652816528265283652846528565286652876528865289652906529165292652936529465295652966529765298652996530065301653026530365304653056530665307653086530965310653116531265313653146531565316653176531865319653206532165322653236532465325653266532765328653296533065331653326533365334653356533665337653386533965340653416534265343653446534565346653476534865349653506535165352653536535465355653566535765358653596536065361653626536365364653656536665367653686536965370653716537265373653746537565376653776537865379653806538165382653836538465385653866538765388653896539065391653926539365394653956539665397653986539965400654016540265403654046540565406654076540865409654106541165412654136541465415654166541765418654196542065421654226542365424654256542665427654286542965430654316543265433654346543565436654376543865439654406544165442654436544465445654466544765448654496545065451654526545365454654556545665457654586545965460654616546265463654646546565466654676546865469654706547165472654736547465475654766547765478654796548065481654826548365484654856548665487654886548965490654916549265493654946549565496654976549865499655006550165502655036550465505655066550765508655096551065511655126551365514655156551665517655186551965520655216552265523655246552565526655276552865529655306553165532655336553465535655366553765538655396554065541655426554365544655456554665547655486554965550655516555265553655546555565556655576555865559655606556165562655636556465565655666556765568655696557065571655726557365574655756557665577655786557965580655816558265583655846558565586655876558865589655906559165592655936559465595655966559765598655996560065601656026560365604656056560665607656086560965610656116561265613656146561565616656176561865619656206562165622656236562465625656266562765628656296563065631656326563365634656356563665637656386563965640656416564265643656446564565646656476564865649656506565165652656536565465655656566565765658656596566065661656626566365664656656566665667656686566965670656716567265673656746567565676656776567865679656806568165682656836568465685656866568765688656896569065691656926569365694656956569665697656986569965700657016570265703657046570565706657076570865709657106571165712657136571465715657166571765718657196572065721657226572365724657256572665727657286572965730657316573265733657346573565736657376573865739657406574165742657436574465745657466574765748657496575065751657526575365754657556575665757657586575965760657616576265763657646576565766657676576865769657706577165772657736577465775657766577765778657796578065781657826578365784657856578665787657886578965790657916579265793657946579565796657976579865799658006580165802658036580465805658066580765808658096581065811658126581365814658156581665817658186581965820658216582265823658246582565826658276582865829658306583165832658336583465835658366583765838658396584065841658426584365844658456584665847658486584965850658516585265853658546585565856658576585865859658606586165862658636586465865658666586765868658696587065871658726587365874658756587665877658786587965880658816588265883658846588565886658876588865889658906589165892658936589465895658966589765898658996590065901659026590365904659056590665907659086590965910659116591265913659146591565916659176591865919659206592165922659236592465925659266592765928659296593065931659326593365934659356593665937659386593965940659416594265943659446594565946659476594865949659506595165952659536595465955659566595765958659596596065961659626596365964659656596665967659686596965970659716597265973659746597565976659776597865979659806598165982659836598465985659866598765988659896599065991659926599365994659956599665997659986599966000660016600266003660046600566006660076600866009660106601166012660136601466015660166601766018660196602066021660226602366024660256602666027660286602966030660316603266033660346603566036660376603866039660406604166042660436604466045660466604766048660496605066051660526605366054660556605666057660586605966060660616606266063660646606566066660676606866069660706607166072660736607466075660766607766078660796608066081660826608366084660856608666087660886608966090660916609266093660946609566096660976609866099661006610166102661036610466105661066610766108661096611066111661126611366114661156611666117661186611966120661216612266123661246612566126661276612866129661306613166132661336613466135661366613766138661396614066141661426614366144661456614666147661486614966150661516615266153661546615566156661576615866159661606616166162661636616466165661666616766168661696617066171661726617366174661756617666177661786617966180661816618266183661846618566186661876618866189661906619166192661936619466195661966619766198661996620066201662026620366204662056620666207662086620966210662116621266213662146621566216662176621866219662206622166222662236622466225662266622766228662296623066231662326623366234662356623666237662386623966240662416624266243662446624566246662476624866249662506625166252662536625466255662566625766258662596626066261662626626366264662656626666267662686626966270662716627266273662746627566276662776627866279662806628166282662836628466285662866628766288662896629066291662926629366294662956629666297662986629966300663016630266303663046630566306663076630866309663106631166312663136631466315663166631766318663196632066321663226632366324663256632666327663286632966330663316633266333663346633566336663376633866339663406634166342663436634466345663466634766348663496635066351663526635366354663556635666357663586635966360663616636266363663646636566366663676636866369663706637166372663736637466375663766637766378663796638066381663826638366384663856638666387663886638966390663916639266393663946639566396663976639866399664006640166402664036640466405664066640766408664096641066411664126641366414664156641666417664186641966420664216642266423664246642566426664276642866429664306643166432664336643466435664366643766438664396644066441664426644366444664456644666447664486644966450664516645266453664546645566456664576645866459664606646166462664636646466465664666646766468664696647066471664726647366474664756647666477664786647966480664816648266483664846648566486664876648866489664906649166492664936649466495664966649766498664996650066501665026650366504665056650666507665086650966510665116651266513665146651566516665176651866519665206652166522665236652466525665266652766528665296653066531665326653366534665356653666537665386653966540665416654266543665446654566546665476654866549665506655166552665536655466555665566655766558665596656066561665626656366564665656656666567665686656966570665716657266573665746657566576665776657866579665806658166582665836658466585665866658766588665896659066591665926659366594665956659666597665986659966600666016660266603666046660566606666076660866609666106661166612666136661466615666166661766618666196662066621666226662366624666256662666627666286662966630666316663266633666346663566636666376663866639666406664166642666436664466645666466664766648666496665066651666526665366654666556665666657666586665966660666616666266663666646666566666666676666866669666706667166672666736667466675666766667766678666796668066681666826668366684666856668666687666886668966690666916669266693666946669566696666976669866699667006670166702667036670466705667066670766708667096671066711667126671366714667156671666717667186671966720667216672266723667246672566726667276672866729667306673166732667336673466735667366673766738667396674066741667426674366744667456674666747667486674966750667516675266753667546675566756667576675866759667606676166762667636676466765667666676766768667696677066771667726677366774667756677666777667786677966780667816678266783667846678566786667876678866789667906679166792667936679466795667966679766798667996680066801668026680366804668056680666807668086680966810668116681266813668146681566816668176681866819668206682166822668236682466825668266682766828668296683066831668326683366834668356683666837668386683966840668416684266843668446684566846668476684866849668506685166852668536685466855668566685766858668596686066861668626686366864668656686666867668686686966870668716687266873668746687566876668776687866879668806688166882668836688466885668866688766888668896689066891668926689366894668956689666897668986689966900669016690266903669046690566906669076690866909669106691166912669136691466915669166691766918669196692066921669226692366924669256692666927669286692966930669316693266933669346693566936669376693866939669406694166942669436694466945669466694766948669496695066951669526695366954669556695666957669586695966960669616696266963669646696566966669676696866969669706697166972669736697466975669766697766978669796698066981669826698366984669856698666987669886698966990669916699266993669946699566996669976699866999670006700167002670036700467005670066700767008670096701067011670126701367014670156701667017670186701967020670216702267023670246702567026670276702867029670306703167032670336703467035670366703767038670396704067041670426704367044670456704667047670486704967050670516705267053670546705567056670576705867059670606706167062670636706467065670666706767068670696707067071670726707367074670756707667077670786707967080670816708267083670846708567086670876708867089670906709167092670936709467095670966709767098670996710067101671026710367104671056710667107671086710967110671116711267113671146711567116671176711867119671206712167122671236712467125671266712767128671296713067131671326713367134671356713667137671386713967140671416714267143671446714567146671476714867149671506715167152671536715467155671566715767158671596716067161671626716367164671656716667167671686716967170671716717267173671746717567176671776717867179671806718167182671836718467185671866718767188671896719067191671926719367194671956719667197671986719967200672016720267203672046720567206672076720867209672106721167212672136721467215672166721767218672196722067221672226722367224672256722667227672286722967230672316723267233672346723567236672376723867239672406724167242672436724467245672466724767248672496725067251672526725367254672556725667257672586725967260672616726267263672646726567266672676726867269672706727167272672736727467275672766727767278672796728067281672826728367284672856728667287672886728967290672916729267293672946729567296672976729867299673006730167302673036730467305673066730767308673096731067311673126731367314673156731667317673186731967320673216732267323673246732567326673276732867329673306733167332673336733467335673366733767338673396734067341673426734367344673456734667347673486734967350673516735267353673546735567356673576735867359673606736167362673636736467365673666736767368673696737067371673726737367374673756737667377673786737967380673816738267383673846738567386673876738867389673906739167392673936739467395673966739767398673996740067401674026740367404674056740667407674086740967410674116741267413674146741567416674176741867419674206742167422674236742467425674266742767428674296743067431674326743367434674356743667437674386743967440674416744267443674446744567446674476744867449674506745167452674536745467455674566745767458674596746067461674626746367464674656746667467674686746967470674716747267473674746747567476674776747867479674806748167482674836748467485674866748767488674896749067491674926749367494674956749667497674986749967500675016750267503675046750567506675076750867509675106751167512675136751467515675166751767518675196752067521675226752367524675256752667527675286752967530675316753267533675346753567536675376753867539675406754167542675436754467545675466754767548675496755067551675526755367554675556755667557675586755967560675616756267563675646756567566675676756867569675706757167572675736757467575675766757767578675796758067581675826758367584675856758667587675886758967590675916759267593675946759567596675976759867599676006760167602676036760467605676066760767608676096761067611676126761367614676156761667617676186761967620676216762267623676246762567626676276762867629676306763167632676336763467635676366763767638676396764067641676426764367644676456764667647676486764967650676516765267653676546765567656676576765867659676606766167662676636766467665676666766767668676696767067671676726767367674676756767667677676786767967680676816768267683676846768567686676876768867689676906769167692676936769467695676966769767698676996770067701677026770367704677056770667707677086770967710677116771267713677146771567716677176771867719677206772167722677236772467725677266772767728677296773067731677326773367734677356773667737677386773967740677416774267743677446774567746677476774867749677506775167752677536775467755677566775767758677596776067761677626776367764677656776667767677686776967770677716777267773677746777567776677776777867779677806778167782677836778467785677866778767788677896779067791677926779367794677956779667797677986779967800678016780267803678046780567806678076780867809678106781167812678136781467815678166781767818678196782067821678226782367824678256782667827678286782967830678316783267833678346783567836678376783867839678406784167842678436784467845678466784767848678496785067851678526785367854678556785667857678586785967860678616786267863678646786567866678676786867869678706787167872678736787467875678766787767878678796788067881678826788367884678856788667887678886788967890678916789267893678946789567896678976789867899679006790167902679036790467905679066790767908679096791067911679126791367914679156791667917679186791967920679216792267923679246792567926679276792867929679306793167932679336793467935679366793767938679396794067941679426794367944679456794667947679486794967950679516795267953679546795567956679576795867959679606796167962679636796467965679666796767968679696797067971679726797367974679756797667977679786797967980679816798267983679846798567986679876798867989679906799167992679936799467995679966799767998679996800068001680026800368004680056800668007680086800968010680116801268013680146801568016680176801868019680206802168022680236802468025680266802768028680296803068031680326803368034680356803668037680386803968040680416804268043680446804568046680476804868049680506805168052680536805468055680566805768058680596806068061680626806368064680656806668067680686806968070680716807268073680746807568076680776807868079680806808168082680836808468085680866808768088680896809068091680926809368094680956809668097680986809968100681016810268103681046810568106681076810868109681106811168112681136811468115681166811768118681196812068121681226812368124681256812668127681286812968130681316813268133681346813568136681376813868139681406814168142681436814468145681466814768148681496815068151681526815368154681556815668157681586815968160681616816268163681646816568166681676816868169681706817168172681736817468175681766817768178681796818068181681826818368184681856818668187681886818968190681916819268193681946819568196681976819868199682006820168202682036820468205682066820768208682096821068211682126821368214682156821668217682186821968220682216822268223682246822568226682276822868229682306823168232682336823468235682366823768238682396824068241682426824368244682456824668247682486824968250682516825268253682546825568256682576825868259682606826168262682636826468265682666826768268682696827068271682726827368274682756827668277682786827968280682816828268283682846828568286682876828868289682906829168292682936829468295682966829768298682996830068301683026830368304683056830668307683086830968310683116831268313683146831568316683176831868319683206832168322683236832468325683266832768328683296833068331683326833368334683356833668337683386833968340683416834268343683446834568346683476834868349683506835168352683536835468355683566835768358683596836068361683626836368364683656836668367683686836968370683716837268373683746837568376683776837868379683806838168382683836838468385683866838768388683896839068391683926839368394683956839668397683986839968400684016840268403684046840568406684076840868409684106841168412684136841468415684166841768418684196842068421684226842368424684256842668427684286842968430684316843268433684346843568436684376843868439684406844168442684436844468445684466844768448684496845068451684526845368454684556845668457684586845968460684616846268463684646846568466684676846868469684706847168472684736847468475684766847768478684796848068481684826848368484684856848668487684886848968490684916849268493684946849568496684976849868499685006850168502685036850468505685066850768508685096851068511685126851368514685156851668517685186851968520685216852268523685246852568526685276852868529685306853168532685336853468535685366853768538685396854068541685426854368544685456854668547685486854968550685516855268553685546855568556685576855868559685606856168562685636856468565685666856768568685696857068571685726857368574685756857668577685786857968580685816858268583685846858568586685876858868589685906859168592685936859468595685966859768598685996860068601686026860368604686056860668607686086860968610686116861268613686146861568616686176861868619686206862168622686236862468625686266862768628686296863068631686326863368634686356863668637686386863968640686416864268643686446864568646686476864868649686506865168652686536865468655686566865768658686596866068661686626866368664686656866668667686686866968670686716867268673686746867568676686776867868679686806868168682686836868468685686866868768688686896869068691686926869368694686956869668697686986869968700687016870268703687046870568706687076870868709687106871168712687136871468715687166871768718687196872068721687226872368724687256872668727687286872968730687316873268733687346873568736687376873868739687406874168742687436874468745687466874768748687496875068751687526875368754687556875668757687586875968760687616876268763687646876568766687676876868769687706877168772687736877468775687766877768778687796878068781687826878368784687856878668787687886878968790687916879268793687946879568796687976879868799688006880168802688036880468805688066880768808688096881068811688126881368814688156881668817688186881968820688216882268823688246882568826688276882868829688306883168832688336883468835688366883768838688396884068841688426884368844688456884668847688486884968850688516885268853688546885568856688576885868859688606886168862688636886468865688666886768868688696887068871688726887368874688756887668877688786887968880688816888268883688846888568886688876888868889688906889168892688936889468895688966889768898688996890068901689026890368904689056890668907689086890968910689116891268913689146891568916689176891868919689206892168922689236892468925689266892768928689296893068931689326893368934689356893668937689386893968940689416894268943689446894568946689476894868949689506895168952689536895468955689566895768958689596896068961689626896368964689656896668967689686896968970689716897268973689746897568976689776897868979689806898168982689836898468985689866898768988689896899068991689926899368994689956899668997689986899969000690016900269003690046900569006690076900869009690106901169012690136901469015690166901769018690196902069021690226902369024690256902669027690286902969030690316903269033690346903569036690376903869039690406904169042690436904469045690466904769048690496905069051690526905369054690556905669057690586905969060690616906269063690646906569066690676906869069690706907169072690736907469075690766907769078690796908069081690826908369084690856908669087690886908969090690916909269093690946909569096690976909869099691006910169102691036910469105691066910769108691096911069111691126911369114691156911669117691186911969120691216912269123691246912569126691276912869129691306913169132691336913469135691366913769138691396914069141691426914369144691456914669147691486914969150691516915269153691546915569156691576915869159691606916169162691636916469165691666916769168691696917069171691726917369174691756917669177691786917969180691816918269183691846918569186691876918869189691906919169192691936919469195691966919769198691996920069201692026920369204692056920669207692086920969210692116921269213692146921569216692176921869219692206922169222692236922469225692266922769228692296923069231692326923369234692356923669237692386923969240692416924269243692446924569246692476924869249692506925169252692536925469255692566925769258692596926069261692626926369264692656926669267692686926969270692716927269273692746927569276692776927869279692806928169282692836928469285692866928769288692896929069291692926929369294692956929669297692986929969300693016930269303693046930569306693076930869309693106931169312693136931469315693166931769318693196932069321693226932369324693256932669327693286932969330693316933269333693346933569336693376933869339693406934169342693436934469345693466934769348693496935069351693526935369354693556935669357693586935969360693616936269363693646936569366693676936869369693706937169372693736937469375693766937769378693796938069381693826938369384693856938669387693886938969390693916939269393693946939569396693976939869399694006940169402694036940469405694066940769408694096941069411694126941369414694156941669417694186941969420694216942269423694246942569426694276942869429694306943169432694336943469435694366943769438694396944069441694426944369444694456944669447694486944969450694516945269453694546945569456694576945869459694606946169462694636946469465694666946769468694696947069471694726947369474694756947669477694786947969480694816948269483694846948569486694876948869489694906949169492694936949469495694966949769498694996950069501695026950369504695056950669507695086950969510695116951269513695146951569516695176951869519695206952169522695236952469525695266952769528695296953069531695326953369534695356953669537695386953969540695416954269543695446954569546695476954869549695506955169552695536955469555695566955769558695596956069561695626956369564695656956669567695686956969570695716957269573695746957569576695776957869579695806958169582695836958469585695866958769588695896959069591695926959369594695956959669597695986959969600696016960269603696046960569606696076960869609696106961169612696136961469615696166961769618696196962069621696226962369624696256962669627696286962969630696316963269633696346963569636696376963869639696406964169642696436964469645696466964769648696496965069651696526965369654696556965669657696586965969660696616966269663696646966569666696676966869669696706967169672696736967469675696766967769678696796968069681696826968369684696856968669687696886968969690696916969269693696946969569696696976969869699697006970169702697036970469705697066970769708697096971069711697126971369714697156971669717697186971969720697216972269723697246972569726697276972869729697306973169732697336973469735697366973769738697396974069741697426974369744697456974669747697486974969750697516975269753697546975569756697576975869759697606976169762697636976469765697666976769768697696977069771697726977369774697756977669777697786977969780697816978269783697846978569786697876978869789697906979169792697936979469795697966979769798697996980069801698026980369804698056980669807698086980969810698116981269813698146981569816698176981869819698206982169822698236982469825698266982769828698296983069831698326983369834698356983669837698386983969840698416984269843698446984569846698476984869849698506985169852698536985469855698566985769858698596986069861698626986369864698656986669867698686986969870698716987269873698746987569876698776987869879698806988169882698836988469885698866988769888698896989069891698926989369894698956989669897698986989969900699016990269903699046990569906699076990869909699106991169912699136991469915699166991769918699196992069921699226992369924699256992669927699286992969930699316993269933699346993569936699376993869939699406994169942699436994469945699466994769948699496995069951699526995369954699556995669957699586995969960699616996269963699646996569966699676996869969699706997169972699736997469975699766997769978699796998069981699826998369984699856998669987699886998969990699916999269993699946999569996699976999869999700007000170002700037000470005700067000770008700097001070011700127001370014700157001670017700187001970020700217002270023700247002570026700277002870029700307003170032700337003470035700367003770038700397004070041700427004370044700457004670047700487004970050700517005270053700547005570056700577005870059700607006170062700637006470065700667006770068700697007070071700727007370074700757007670077700787007970080700817008270083700847008570086700877008870089700907009170092700937009470095700967009770098700997010070101701027010370104701057010670107701087010970110701117011270113701147011570116701177011870119701207012170122701237012470125701267012770128701297013070131701327013370134701357013670137701387013970140701417014270143701447014570146701477014870149701507015170152701537015470155701567015770158701597016070161701627016370164701657016670167701687016970170701717017270173701747017570176701777017870179701807018170182701837018470185701867018770188701897019070191701927019370194701957019670197701987019970200702017020270203702047020570206702077020870209702107021170212702137021470215702167021770218702197022070221702227022370224702257022670227702287022970230702317023270233702347023570236702377023870239702407024170242702437024470245702467024770248702497025070251702527025370254702557025670257702587025970260702617026270263702647026570266702677026870269702707027170272702737027470275702767027770278702797028070281702827028370284702857028670287702887028970290702917029270293702947029570296702977029870299703007030170302703037030470305703067030770308703097031070311703127031370314703157031670317703187031970320703217032270323703247032570326703277032870329703307033170332703337033470335703367033770338703397034070341703427034370344703457034670347703487034970350703517035270353703547035570356703577035870359703607036170362703637036470365703667036770368703697037070371703727037370374703757037670377703787037970380703817038270383703847038570386703877038870389703907039170392703937039470395703967039770398703997040070401704027040370404704057040670407704087040970410704117041270413704147041570416704177041870419704207042170422704237042470425704267042770428704297043070431704327043370434704357043670437704387043970440704417044270443704447044570446704477044870449704507045170452704537045470455704567045770458704597046070461704627046370464704657046670467704687046970470704717047270473704747047570476704777047870479704807048170482704837048470485704867048770488704897049070491704927049370494704957049670497704987049970500705017050270503705047050570506705077050870509705107051170512705137051470515705167051770518705197052070521705227052370524705257052670527705287052970530705317053270533705347053570536705377053870539705407054170542705437054470545705467054770548705497055070551705527055370554705557055670557705587055970560705617056270563705647056570566705677056870569705707057170572705737057470575705767057770578705797058070581705827058370584705857058670587705887058970590705917059270593705947059570596705977059870599706007060170602706037060470605706067060770608706097061070611706127061370614706157061670617706187061970620706217062270623706247062570626706277062870629706307063170632706337063470635706367063770638706397064070641706427064370644706457064670647706487064970650706517065270653706547065570656706577065870659706607066170662706637066470665706667066770668706697067070671706727067370674706757067670677706787067970680706817068270683706847068570686706877068870689706907069170692706937069470695706967069770698706997070070701707027070370704707057070670707707087070970710707117071270713707147071570716707177071870719707207072170722707237072470725707267072770728707297073070731707327073370734707357073670737707387073970740707417074270743707447074570746707477074870749707507075170752707537075470755707567075770758707597076070761707627076370764707657076670767707687076970770707717077270773707747077570776707777077870779707807078170782707837078470785707867078770788707897079070791707927079370794707957079670797707987079970800708017080270803708047080570806708077080870809708107081170812708137081470815708167081770818708197082070821708227082370824708257082670827708287082970830708317083270833708347083570836708377083870839708407084170842708437084470845708467084770848708497085070851708527085370854708557085670857708587085970860708617086270863708647086570866708677086870869708707087170872708737087470875708767087770878708797088070881708827088370884708857088670887708887088970890708917089270893708947089570896708977089870899709007090170902709037090470905709067090770908709097091070911709127091370914709157091670917709187091970920709217092270923709247092570926709277092870929709307093170932709337093470935709367093770938709397094070941709427094370944709457094670947709487094970950709517095270953709547095570956709577095870959709607096170962709637096470965709667096770968709697097070971709727097370974709757097670977709787097970980709817098270983709847098570986709877098870989709907099170992709937099470995709967099770998709997100071001710027100371004710057100671007710087100971010710117101271013710147101571016710177101871019710207102171022710237102471025710267102771028710297103071031710327103371034710357103671037710387103971040710417104271043710447104571046710477104871049710507105171052710537105471055710567105771058710597106071061710627106371064710657106671067710687106971070710717107271073710747107571076710777107871079710807108171082710837108471085710867108771088710897109071091710927109371094710957109671097710987109971100711017110271103711047110571106711077110871109711107111171112711137111471115711167111771118711197112071121711227112371124711257112671127711287112971130711317113271133711347113571136711377113871139711407114171142711437114471145711467114771148711497115071151711527115371154711557115671157711587115971160711617116271163711647116571166711677116871169711707117171172711737117471175711767117771178711797118071181711827118371184711857118671187711887118971190711917119271193711947119571196711977119871199712007120171202712037120471205712067120771208712097121071211712127121371214712157121671217712187121971220712217122271223712247122571226712277122871229712307123171232712337123471235712367123771238712397124071241712427124371244712457124671247712487124971250712517125271253712547125571256712577125871259712607126171262712637126471265712667126771268712697127071271712727127371274712757127671277712787127971280712817128271283712847128571286712877128871289712907129171292712937129471295712967129771298712997130071301713027130371304713057130671307713087130971310713117131271313713147131571316713177131871319713207132171322713237132471325713267132771328713297133071331713327133371334713357133671337713387133971340713417134271343713447134571346713477134871349713507135171352713537135471355713567135771358713597136071361713627136371364713657136671367713687136971370713717137271373713747137571376713777137871379713807138171382713837138471385713867138771388713897139071391713927139371394713957139671397713987139971400714017140271403714047140571406714077140871409714107141171412714137141471415714167141771418714197142071421714227142371424714257142671427714287142971430714317143271433714347143571436714377143871439714407144171442714437144471445714467144771448714497145071451714527145371454714557145671457714587145971460714617146271463714647146571466714677146871469714707147171472714737147471475714767147771478714797148071481714827148371484714857148671487714887148971490714917149271493714947149571496714977149871499715007150171502715037150471505715067150771508715097151071511715127151371514715157151671517715187151971520715217152271523715247152571526715277152871529715307153171532715337153471535715367153771538715397154071541715427154371544715457154671547715487154971550715517155271553715547155571556715577155871559715607156171562715637156471565715667156771568715697157071571715727157371574715757157671577715787157971580715817158271583715847158571586715877158871589715907159171592715937159471595715967159771598715997160071601716027160371604716057160671607716087160971610716117161271613716147161571616716177161871619716207162171622716237162471625716267162771628716297163071631716327163371634716357163671637716387163971640716417164271643716447164571646716477164871649716507165171652716537165471655716567165771658716597166071661716627166371664716657166671667716687166971670716717167271673716747167571676716777167871679716807168171682716837168471685716867168771688716897169071691716927169371694716957169671697716987169971700717017170271703717047170571706717077170871709717107171171712717137171471715717167171771718717197172071721717227172371724717257172671727717287172971730717317173271733717347173571736717377173871739717407174171742717437174471745717467174771748717497175071751717527175371754717557175671757717587175971760717617176271763717647176571766717677176871769717707177171772717737177471775717767177771778717797178071781717827178371784717857178671787717887178971790717917179271793717947179571796717977179871799718007180171802718037180471805718067180771808718097181071811718127181371814718157181671817718187181971820718217182271823718247182571826718277182871829718307183171832718337183471835718367183771838718397184071841718427184371844718457184671847718487184971850718517185271853718547185571856718577185871859718607186171862718637186471865718667186771868718697187071871718727187371874718757187671877718787187971880718817188271883718847188571886718877188871889718907189171892718937189471895718967189771898718997190071901719027190371904719057190671907719087190971910719117191271913719147191571916719177191871919719207192171922719237192471925719267192771928719297193071931719327193371934719357193671937719387193971940719417194271943719447194571946719477194871949719507195171952719537195471955719567195771958719597196071961719627196371964719657196671967719687196971970719717197271973719747197571976719777197871979719807198171982719837198471985719867198771988719897199071991719927199371994719957199671997719987199972000720017200272003720047200572006720077200872009720107201172012720137201472015720167201772018720197202072021720227202372024720257202672027720287202972030720317203272033720347203572036720377203872039720407204172042720437204472045720467204772048720497205072051720527205372054720557205672057720587205972060720617206272063720647206572066720677206872069720707207172072720737207472075720767207772078720797208072081720827208372084720857208672087720887208972090720917209272093720947209572096720977209872099721007210172102721037210472105721067210772108721097211072111721127211372114721157211672117721187211972120721217212272123721247212572126721277212872129721307213172132721337213472135721367213772138721397214072141721427214372144721457214672147721487214972150721517215272153721547215572156721577215872159721607216172162721637216472165721667216772168721697217072171721727217372174721757217672177721787217972180721817218272183721847218572186721877218872189721907219172192721937219472195721967219772198721997220072201722027220372204722057220672207722087220972210722117221272213722147221572216722177221872219722207222172222722237222472225722267222772228722297223072231722327223372234722357223672237722387223972240722417224272243722447224572246722477224872249722507225172252722537225472255722567225772258722597226072261722627226372264722657226672267722687226972270722717227272273722747227572276722777227872279722807228172282722837228472285722867228772288722897229072291722927229372294722957229672297722987229972300723017230272303723047230572306723077230872309723107231172312723137231472315723167231772318723197232072321723227232372324723257232672327723287232972330723317233272333723347233572336723377233872339723407234172342723437234472345723467234772348723497235072351723527235372354723557235672357723587235972360723617236272363723647236572366723677236872369723707237172372723737237472375723767237772378723797238072381723827238372384723857238672387723887238972390723917239272393723947239572396723977239872399724007240172402724037240472405724067240772408724097241072411724127241372414724157241672417724187241972420724217242272423724247242572426724277242872429724307243172432724337243472435724367243772438724397244072441724427244372444724457244672447724487244972450724517245272453724547245572456724577245872459724607246172462724637246472465724667246772468724697247072471724727247372474724757247672477724787247972480724817248272483724847248572486724877248872489724907249172492724937249472495724967249772498724997250072501725027250372504725057250672507725087250972510725117251272513725147251572516725177251872519725207252172522725237252472525725267252772528725297253072531725327253372534725357253672537725387253972540725417254272543725447254572546725477254872549725507255172552725537255472555725567255772558725597256072561725627256372564725657256672567725687256972570725717257272573725747257572576725777257872579725807258172582725837258472585725867258772588725897259072591725927259372594725957259672597725987259972600726017260272603726047260572606726077260872609726107261172612726137261472615726167261772618726197262072621726227262372624726257262672627726287262972630726317263272633726347263572636726377263872639726407264172642726437264472645726467264772648726497265072651726527265372654726557265672657726587265972660726617266272663726647266572666726677266872669726707267172672726737267472675726767267772678726797268072681726827268372684726857268672687726887268972690726917269272693726947269572696726977269872699727007270172702727037270472705727067270772708727097271072711727127271372714727157271672717727187271972720727217272272723727247272572726727277272872729727307273172732727337273472735727367273772738727397274072741727427274372744727457274672747727487274972750727517275272753727547275572756727577275872759727607276172762727637276472765727667276772768727697277072771727727277372774727757277672777727787277972780727817278272783727847278572786727877278872789727907279172792727937279472795727967279772798727997280072801728027280372804728057280672807728087280972810728117281272813728147281572816728177281872819728207282172822728237282472825728267282772828728297283072831728327283372834728357283672837728387283972840728417284272843728447284572846728477284872849728507285172852728537285472855728567285772858728597286072861728627286372864728657286672867728687286972870728717287272873728747287572876728777287872879728807288172882728837288472885728867288772888728897289072891728927289372894728957289672897728987289972900729017290272903729047290572906729077290872909729107291172912729137291472915729167291772918729197292072921729227292372924729257292672927729287292972930729317293272933729347293572936729377293872939729407294172942729437294472945729467294772948729497295072951729527295372954729557295672957729587295972960729617296272963729647296572966729677296872969729707297172972729737297472975729767297772978729797298072981729827298372984729857298672987729887298972990729917299272993729947299572996729977299872999730007300173002730037300473005730067300773008730097301073011730127301373014730157301673017730187301973020730217302273023730247302573026730277302873029730307303173032730337303473035730367303773038730397304073041730427304373044730457304673047730487304973050730517305273053730547305573056730577305873059730607306173062730637306473065730667306773068730697307073071730727307373074730757307673077730787307973080730817308273083730847308573086730877308873089730907309173092730937309473095730967309773098730997310073101731027310373104731057310673107731087310973110731117311273113731147311573116731177311873119731207312173122731237312473125731267312773128731297313073131731327313373134731357313673137731387313973140731417314273143731447314573146731477314873149731507315173152731537315473155731567315773158731597316073161731627316373164731657316673167731687316973170731717317273173731747317573176731777317873179731807318173182731837318473185731867318773188731897319073191731927319373194731957319673197731987319973200732017320273203732047320573206732077320873209732107321173212732137321473215732167321773218732197322073221732227322373224732257322673227732287322973230732317323273233732347323573236732377323873239732407324173242732437324473245732467324773248732497325073251732527325373254732557325673257732587325973260732617326273263732647326573266732677326873269732707327173272732737327473275732767327773278732797328073281732827328373284732857328673287732887328973290732917329273293732947329573296732977329873299733007330173302733037330473305733067330773308733097331073311733127331373314733157331673317733187331973320733217332273323733247332573326733277332873329733307333173332733337333473335733367333773338733397334073341733427334373344733457334673347733487334973350733517335273353733547335573356733577335873359733607336173362733637336473365733667336773368733697337073371733727337373374733757337673377733787337973380733817338273383733847338573386733877338873389733907339173392733937339473395733967339773398733997340073401734027340373404734057340673407734087340973410734117341273413734147341573416734177341873419734207342173422734237342473425734267342773428734297343073431734327343373434734357343673437734387343973440734417344273443734447344573446734477344873449734507345173452734537345473455734567345773458734597346073461734627346373464734657346673467734687346973470734717347273473734747347573476734777347873479734807348173482734837348473485734867348773488734897349073491734927349373494734957349673497734987349973500735017350273503735047350573506735077350873509735107351173512735137351473515735167351773518735197352073521735227352373524735257352673527735287352973530735317353273533735347353573536735377353873539735407354173542735437354473545735467354773548735497355073551735527355373554735557355673557735587355973560735617356273563735647356573566735677356873569735707357173572735737357473575735767357773578735797358073581735827358373584735857358673587735887358973590735917359273593735947359573596735977359873599736007360173602736037360473605736067360773608736097361073611736127361373614736157361673617736187361973620736217362273623736247362573626736277362873629736307363173632736337363473635736367363773638736397364073641736427364373644736457364673647736487364973650736517365273653736547365573656736577365873659736607366173662736637366473665736667366773668736697367073671736727367373674736757367673677736787367973680736817368273683736847368573686736877368873689736907369173692736937369473695736967369773698736997370073701737027370373704737057370673707737087370973710737117371273713737147371573716737177371873719737207372173722737237372473725737267372773728737297373073731737327373373734737357373673737737387373973740737417374273743737447374573746737477374873749737507375173752737537375473755737567375773758737597376073761737627376373764737657376673767737687376973770737717377273773737747377573776737777377873779737807378173782737837378473785737867378773788737897379073791737927379373794737957379673797737987379973800738017380273803738047380573806738077380873809738107381173812738137381473815738167381773818738197382073821738227382373824738257382673827738287382973830738317383273833738347383573836738377383873839738407384173842738437384473845738467384773848738497385073851738527385373854738557385673857738587385973860738617386273863738647386573866738677386873869738707387173872738737387473875738767387773878738797388073881738827388373884738857388673887738887388973890738917389273893738947389573896738977389873899739007390173902739037390473905739067390773908739097391073911739127391373914739157391673917739187391973920739217392273923739247392573926739277392873929739307393173932739337393473935739367393773938739397394073941739427394373944739457394673947739487394973950739517395273953739547395573956739577395873959739607396173962739637396473965739667396773968739697397073971739727397373974739757397673977739787397973980739817398273983739847398573986739877398873989739907399173992739937399473995739967399773998739997400074001740027400374004740057400674007740087400974010740117401274013740147401574016740177401874019740207402174022740237402474025740267402774028740297403074031740327403374034740357403674037740387403974040740417404274043740447404574046740477404874049740507405174052740537405474055740567405774058740597406074061740627406374064740657406674067740687406974070740717407274073740747407574076740777407874079740807408174082740837408474085740867408774088740897409074091740927409374094740957409674097740987409974100741017410274103741047410574106741077410874109741107411174112741137411474115741167411774118741197412074121741227412374124741257412674127741287412974130741317413274133741347413574136741377413874139741407414174142741437414474145741467414774148741497415074151741527415374154741557415674157741587415974160741617416274163741647416574166741677416874169741707417174172741737417474175741767417774178741797418074181741827418374184741857418674187741887418974190741917419274193741947419574196741977419874199742007420174202742037420474205742067420774208742097421074211742127421374214742157421674217742187421974220742217422274223742247422574226742277422874229742307423174232742337423474235742367423774238742397424074241742427424374244742457424674247742487424974250742517425274253742547425574256742577425874259742607426174262742637426474265742667426774268742697427074271742727427374274742757427674277742787427974280742817428274283742847428574286742877428874289742907429174292742937429474295742967429774298742997430074301743027430374304743057430674307743087430974310743117431274313743147431574316743177431874319743207432174322743237432474325743267432774328743297433074331743327433374334743357433674337743387433974340743417434274343743447434574346743477434874349743507435174352743537435474355743567435774358743597436074361743627436374364743657436674367743687436974370743717437274373743747437574376743777437874379743807438174382743837438474385743867438774388743897439074391743927439374394743957439674397743987439974400744017440274403744047440574406744077440874409744107441174412744137441474415744167441774418744197442074421744227442374424744257442674427744287442974430744317443274433744347443574436744377443874439744407444174442744437444474445744467444774448744497445074451744527445374454744557445674457744587445974460744617446274463744647446574466744677446874469744707447174472744737447474475744767447774478744797448074481744827448374484744857448674487744887448974490744917449274493744947449574496744977449874499745007450174502745037450474505745067450774508745097451074511745127451374514745157451674517745187451974520745217452274523745247452574526745277452874529745307453174532745337453474535745367453774538745397454074541745427454374544745457454674547745487454974550745517455274553745547455574556745577455874559745607456174562745637456474565745667456774568745697457074571745727457374574745757457674577745787457974580745817458274583745847458574586745877458874589745907459174592745937459474595745967459774598745997460074601746027460374604746057460674607746087460974610746117461274613746147461574616746177461874619746207462174622746237462474625746267462774628746297463074631746327463374634746357463674637746387463974640746417464274643746447464574646746477464874649746507465174652746537465474655746567465774658746597466074661746627466374664746657466674667746687466974670746717467274673746747467574676746777467874679746807468174682746837468474685746867468774688746897469074691746927469374694746957469674697746987469974700747017470274703747047470574706747077470874709747107471174712747137471474715747167471774718747197472074721747227472374724747257472674727747287472974730747317473274733747347473574736747377473874739747407474174742747437474474745747467474774748747497475074751747527475374754747557475674757747587475974760747617476274763747647476574766747677476874769747707477174772747737477474775747767477774778747797478074781747827478374784747857478674787747887478974790747917479274793747947479574796747977479874799748007480174802748037480474805748067480774808748097481074811748127481374814748157481674817748187481974820748217482274823748247482574826748277482874829748307483174832748337483474835748367483774838748397484074841748427484374844748457484674847748487484974850748517485274853748547485574856748577485874859748607486174862748637486474865748667486774868748697487074871748727487374874748757487674877748787487974880748817488274883748847488574886748877488874889748907489174892748937489474895748967489774898748997490074901749027490374904749057490674907749087490974910749117491274913749147491574916749177491874919749207492174922749237492474925749267492774928749297493074931749327493374934749357493674937749387493974940749417494274943749447494574946749477494874949749507495174952749537495474955749567495774958749597496074961749627496374964749657496674967749687496974970749717497274973749747497574976749777497874979749807498174982749837498474985749867498774988749897499074991749927499374994749957499674997749987499975000750017500275003750047500575006750077500875009750107501175012750137501475015750167501775018750197502075021750227502375024750257502675027750287502975030750317503275033750347503575036750377503875039750407504175042750437504475045750467504775048750497505075051750527505375054750557505675057750587505975060750617506275063750647506575066750677506875069750707507175072750737507475075750767507775078750797508075081750827508375084750857508675087750887508975090750917509275093750947509575096750977509875099751007510175102751037510475105751067510775108751097511075111751127511375114751157511675117751187511975120751217512275123751247512575126751277512875129751307513175132751337513475135751367513775138751397514075141751427514375144751457514675147751487514975150751517515275153751547515575156751577515875159751607516175162751637516475165751667516775168751697517075171751727517375174751757517675177751787517975180751817518275183751847518575186751877518875189751907519175192751937519475195751967519775198751997520075201752027520375204752057520675207752087520975210752117521275213752147521575216752177521875219752207522175222752237522475225752267522775228752297523075231752327523375234752357523675237752387523975240752417524275243752447524575246752477524875249752507525175252752537525475255752567525775258752597526075261752627526375264752657526675267752687526975270752717527275273752747527575276752777527875279752807528175282752837528475285752867528775288752897529075291752927529375294752957529675297752987529975300753017530275303753047530575306753077530875309753107531175312753137531475315753167531775318753197532075321753227532375324753257532675327753287532975330753317533275333753347533575336753377533875339753407534175342753437534475345753467534775348753497535075351753527535375354753557535675357753587535975360753617536275363753647536575366753677536875369753707537175372753737537475375753767537775378753797538075381753827538375384753857538675387753887538975390753917539275393753947539575396753977539875399754007540175402754037540475405754067540775408754097541075411754127541375414754157541675417754187541975420754217542275423754247542575426754277542875429754307543175432754337543475435754367543775438754397544075441754427544375444754457544675447754487544975450754517545275453754547545575456754577545875459754607546175462754637546475465754667546775468754697547075471754727547375474754757547675477754787547975480754817548275483754847548575486754877548875489754907549175492754937549475495754967549775498754997550075501755027550375504755057550675507755087550975510755117551275513755147551575516755177551875519755207552175522755237552475525755267552775528755297553075531755327553375534755357553675537755387553975540755417554275543755447554575546755477554875549755507555175552755537555475555755567555775558755597556075561755627556375564755657556675567755687556975570755717557275573755747557575576755777557875579755807558175582755837558475585755867558775588755897559075591755927559375594755957559675597755987559975600756017560275603756047560575606756077560875609756107561175612756137561475615756167561775618756197562075621756227562375624756257562675627756287562975630756317563275633756347563575636756377563875639756407564175642756437564475645756467564775648756497565075651756527565375654756557565675657756587565975660756617566275663756647566575666756677566875669756707567175672756737567475675756767567775678756797568075681756827568375684756857568675687756887568975690756917569275693756947569575696756977569875699757007570175702757037570475705757067570775708757097571075711757127571375714757157571675717757187571975720757217572275723757247572575726757277572875729757307573175732757337573475735757367573775738757397574075741757427574375744757457574675747757487574975750757517575275753757547575575756757577575875759757607576175762757637576475765757667576775768757697577075771757727577375774757757577675777757787577975780757817578275783757847578575786757877578875789757907579175792757937579475795757967579775798757997580075801758027580375804758057580675807758087580975810758117581275813758147581575816758177581875819758207582175822758237582475825758267582775828758297583075831758327583375834758357583675837758387583975840758417584275843758447584575846758477584875849758507585175852758537585475855758567585775858758597586075861758627586375864758657586675867758687586975870758717587275873758747587575876758777587875879758807588175882758837588475885758867588775888758897589075891758927589375894758957589675897758987589975900759017590275903759047590575906759077590875909759107591175912759137591475915759167591775918759197592075921759227592375924759257592675927759287592975930759317593275933759347593575936759377593875939759407594175942759437594475945759467594775948759497595075951759527595375954759557595675957759587595975960759617596275963759647596575966759677596875969759707597175972759737597475975759767597775978759797598075981759827598375984759857598675987759887598975990759917599275993759947599575996759977599875999760007600176002760037600476005760067600776008760097601076011760127601376014760157601676017760187601976020760217602276023760247602576026760277602876029760307603176032760337603476035760367603776038760397604076041760427604376044760457604676047760487604976050760517605276053760547605576056760577605876059760607606176062760637606476065760667606776068760697607076071760727607376074760757607676077760787607976080760817608276083760847608576086760877608876089760907609176092760937609476095760967609776098760997610076101761027610376104761057610676107761087610976110761117611276113761147611576116761177611876119761207612176122761237612476125761267612776128761297613076131761327613376134761357613676137761387613976140761417614276143761447614576146761477614876149761507615176152761537615476155761567615776158761597616076161761627616376164761657616676167761687616976170761717617276173761747617576176761777617876179761807618176182761837618476185761867618776188761897619076191761927619376194761957619676197761987619976200762017620276203762047620576206762077620876209762107621176212762137621476215762167621776218762197622076221762227622376224762257622676227762287622976230762317623276233762347623576236762377623876239762407624176242762437624476245762467624776248762497625076251762527625376254762557625676257762587625976260762617626276263762647626576266762677626876269762707627176272762737627476275762767627776278762797628076281762827628376284762857628676287762887628976290762917629276293762947629576296762977629876299763007630176302763037630476305763067630776308763097631076311763127631376314763157631676317763187631976320763217632276323763247632576326763277632876329763307633176332763337633476335763367633776338763397634076341763427634376344763457634676347763487634976350763517635276353763547635576356763577635876359763607636176362763637636476365763667636776368763697637076371763727637376374763757637676377763787637976380763817638276383763847638576386763877638876389763907639176392763937639476395763967639776398763997640076401764027640376404764057640676407764087640976410764117641276413764147641576416764177641876419764207642176422764237642476425764267642776428764297643076431764327643376434764357643676437764387643976440764417644276443764447644576446764477644876449764507645176452764537645476455764567645776458764597646076461764627646376464764657646676467764687646976470764717647276473764747647576476764777647876479764807648176482764837648476485764867648776488764897649076491764927649376494764957649676497764987649976500765017650276503765047650576506765077650876509765107651176512765137651476515765167651776518765197652076521765227652376524765257652676527765287652976530765317653276533765347653576536765377653876539765407654176542765437654476545765467654776548765497655076551765527655376554765557655676557765587655976560765617656276563765647656576566765677656876569765707657176572765737657476575765767657776578765797658076581765827658376584765857658676587765887658976590765917659276593765947659576596765977659876599766007660176602766037660476605766067660776608766097661076611766127661376614766157661676617766187661976620766217662276623766247662576626766277662876629766307663176632766337663476635766367663776638766397664076641766427664376644766457664676647766487664976650766517665276653766547665576656766577665876659766607666176662766637666476665766667666776668766697667076671766727667376674766757667676677766787667976680766817668276683766847668576686766877668876689766907669176692766937669476695766967669776698766997670076701767027670376704767057670676707767087670976710767117671276713767147671576716767177671876719767207672176722767237672476725767267672776728767297673076731767327673376734767357673676737767387673976740767417674276743767447674576746767477674876749767507675176752767537675476755767567675776758767597676076761767627676376764767657676676767767687676976770767717677276773767747677576776767777677876779767807678176782767837678476785767867678776788767897679076791767927679376794767957679676797767987679976800768017680276803768047680576806768077680876809768107681176812768137681476815768167681776818768197682076821768227682376824768257682676827768287682976830768317683276833768347683576836768377683876839768407684176842768437684476845768467684776848768497685076851768527685376854768557685676857768587685976860768617686276863768647686576866768677686876869768707687176872768737687476875768767687776878768797688076881768827688376884768857688676887768887688976890768917689276893768947689576896768977689876899769007690176902769037690476905769067690776908769097691076911769127691376914769157691676917769187691976920769217692276923769247692576926769277692876929769307693176932769337693476935769367693776938769397694076941769427694376944769457694676947769487694976950769517695276953769547695576956769577695876959769607696176962769637696476965769667696776968769697697076971769727697376974769757697676977769787697976980769817698276983769847698576986769877698876989769907699176992769937699476995769967699776998769997700077001770027700377004770057700677007770087700977010770117701277013770147701577016770177701877019770207702177022770237702477025770267702777028770297703077031770327703377034770357703677037770387703977040770417704277043770447704577046770477704877049770507705177052770537705477055770567705777058770597706077061770627706377064770657706677067770687706977070770717707277073770747707577076770777707877079770807708177082770837708477085770867708777088770897709077091770927709377094770957709677097770987709977100771017710277103771047710577106771077710877109771107711177112771137711477115771167711777118771197712077121771227712377124771257712677127771287712977130771317713277133771347713577136771377713877139771407714177142771437714477145771467714777148771497715077151771527715377154771557715677157771587715977160771617716277163771647716577166771677716877169771707717177172771737717477175771767717777178771797718077181771827718377184771857718677187771887718977190771917719277193771947719577196771977719877199772007720177202772037720477205772067720777208772097721077211772127721377214772157721677217772187721977220772217722277223772247722577226772277722877229772307723177232772337723477235772367723777238772397724077241772427724377244772457724677247772487724977250772517725277253772547725577256772577725877259772607726177262772637726477265772667726777268772697727077271772727727377274772757727677277772787727977280772817728277283772847728577286772877728877289772907729177292772937729477295772967729777298772997730077301773027730377304773057730677307773087730977310773117731277313773147731577316773177731877319773207732177322773237732477325773267732777328773297733077331773327733377334773357733677337773387733977340773417734277343773447734577346773477734877349773507735177352773537735477355773567735777358773597736077361773627736377364773657736677367773687736977370773717737277373773747737577376773777737877379773807738177382773837738477385773867738777388773897739077391773927739377394773957739677397773987739977400774017740277403774047740577406774077740877409774107741177412774137741477415774167741777418774197742077421774227742377424774257742677427774287742977430774317743277433774347743577436774377743877439774407744177442774437744477445774467744777448774497745077451774527745377454774557745677457774587745977460774617746277463774647746577466774677746877469774707747177472774737747477475774767747777478774797748077481774827748377484774857748677487774887748977490774917749277493774947749577496774977749877499775007750177502775037750477505775067750777508775097751077511775127751377514775157751677517775187751977520775217752277523775247752577526775277752877529775307753177532775337753477535775367753777538775397754077541775427754377544775457754677547775487754977550775517755277553775547755577556775577755877559775607756177562775637756477565775667756777568775697757077571775727757377574775757757677577775787757977580775817758277583775847758577586775877758877589775907759177592775937759477595775967759777598775997760077601776027760377604776057760677607776087760977610776117761277613776147761577616776177761877619776207762177622776237762477625776267762777628776297763077631776327763377634776357763677637776387763977640776417764277643776447764577646776477764877649776507765177652776537765477655776567765777658776597766077661776627766377664776657766677667776687766977670776717767277673776747767577676776777767877679776807768177682776837768477685776867768777688776897769077691776927769377694776957769677697776987769977700777017770277703777047770577706777077770877709777107771177712777137771477715777167771777718777197772077721777227772377724777257772677727777287772977730777317773277733777347773577736777377773877739777407774177742777437774477745777467774777748777497775077751777527775377754777557775677757777587775977760777617776277763777647776577766777677776877769777707777177772777737777477775777767777777778777797778077781777827778377784777857778677787777887778977790777917779277793777947779577796777977779877799778007780177802778037780477805778067780777808778097781077811778127781377814778157781677817778187781977820778217782277823778247782577826778277782877829778307783177832778337783477835778367783777838778397784077841778427784377844778457784677847778487784977850778517785277853778547785577856778577785877859778607786177862778637786477865778667786777868778697787077871778727787377874778757787677877778787787977880778817788277883778847788577886778877788877889778907789177892778937789477895778967789777898778997790077901779027790377904779057790677907779087790977910779117791277913779147791577916779177791877919779207792177922779237792477925779267792777928779297793077931779327793377934779357793677937779387793977940779417794277943779447794577946779477794877949779507795177952779537795477955779567795777958779597796077961779627796377964779657796677967779687796977970779717797277973779747797577976779777797877979779807798177982779837798477985779867798777988779897799077991779927799377994779957799677997779987799978000780017800278003780047800578006780077800878009780107801178012780137801478015780167801778018780197802078021780227802378024780257802678027780287802978030780317803278033780347803578036780377803878039780407804178042780437804478045780467804778048780497805078051780527805378054780557805678057780587805978060780617806278063780647806578066780677806878069780707807178072780737807478075780767807778078780797808078081780827808378084780857808678087780887808978090780917809278093780947809578096780977809878099781007810178102781037810478105781067810778108781097811078111781127811378114781157811678117781187811978120781217812278123781247812578126781277812878129781307813178132781337813478135781367813778138781397814078141781427814378144781457814678147781487814978150781517815278153781547815578156781577815878159781607816178162781637816478165781667816778168781697817078171781727817378174781757817678177781787817978180781817818278183781847818578186781877818878189781907819178192781937819478195781967819778198781997820078201782027820378204782057820678207782087820978210782117821278213782147821578216782177821878219782207822178222782237822478225782267822778228782297823078231782327823378234782357823678237782387823978240782417824278243782447824578246782477824878249782507825178252782537825478255782567825778258782597826078261782627826378264782657826678267782687826978270782717827278273782747827578276782777827878279782807828178282782837828478285782867828778288782897829078291782927829378294782957829678297782987829978300783017830278303783047830578306783077830878309783107831178312783137831478315783167831778318783197832078321783227832378324783257832678327783287832978330783317833278333783347833578336783377833878339783407834178342783437834478345783467834778348783497835078351783527835378354783557835678357783587835978360783617836278363783647836578366783677836878369783707837178372783737837478375783767837778378783797838078381783827838378384783857838678387783887838978390783917839278393783947839578396783977839878399784007840178402784037840478405784067840778408784097841078411784127841378414784157841678417784187841978420784217842278423784247842578426784277842878429784307843178432784337843478435784367843778438784397844078441784427844378444784457844678447784487844978450784517845278453784547845578456784577845878459784607846178462784637846478465784667846778468784697847078471784727847378474784757847678477784787847978480784817848278483784847848578486784877848878489784907849178492784937849478495784967849778498784997850078501785027850378504785057850678507785087850978510785117851278513785147851578516785177851878519785207852178522785237852478525785267852778528785297853078531785327853378534785357853678537785387853978540785417854278543785447854578546785477854878549785507855178552785537855478555785567855778558785597856078561785627856378564785657856678567785687856978570785717857278573785747857578576785777857878579785807858178582785837858478585785867858778588785897859078591785927859378594785957859678597785987859978600786017860278603786047860578606786077860878609786107861178612786137861478615786167861778618786197862078621786227862378624786257862678627786287862978630786317863278633786347863578636786377863878639786407864178642786437864478645786467864778648786497865078651786527865378654786557865678657786587865978660786617866278663786647866578666786677866878669786707867178672786737867478675786767867778678786797868078681786827868378684786857868678687786887868978690786917869278693786947869578696786977869878699787007870178702787037870478705787067870778708787097871078711787127871378714787157871678717787187871978720787217872278723787247872578726787277872878729787307873178732787337873478735787367873778738787397874078741787427874378744787457874678747787487874978750787517875278753787547875578756787577875878759787607876178762787637876478765787667876778768787697877078771787727877378774787757877678777787787877978780787817878278783787847878578786787877878878789787907879178792787937879478795787967879778798787997880078801788027880378804788057880678807788087880978810788117881278813788147881578816788177881878819788207882178822788237882478825788267882778828788297883078831788327883378834788357883678837788387883978840788417884278843788447884578846788477884878849788507885178852788537885478855788567885778858788597886078861788627886378864788657886678867788687886978870788717887278873788747887578876788777887878879788807888178882788837888478885788867888778888788897889078891788927889378894788957889678897788987889978900789017890278903789047890578906789077890878909789107891178912789137891478915789167891778918789197892078921789227892378924789257892678927789287892978930789317893278933789347893578936789377893878939789407894178942789437894478945789467894778948789497895078951789527895378954789557895678957789587895978960789617896278963789647896578966789677896878969789707897178972789737897478975789767897778978789797898078981789827898378984789857898678987789887898978990789917899278993789947899578996789977899878999790007900179002790037900479005790067900779008790097901079011790127901379014790157901679017790187901979020790217902279023790247902579026790277902879029790307903179032790337903479035790367903779038790397904079041790427904379044790457904679047790487904979050790517905279053790547905579056790577905879059790607906179062790637906479065790667906779068790697907079071790727907379074790757907679077790787907979080790817908279083790847908579086790877908879089790907909179092790937909479095790967909779098790997910079101791027910379104791057910679107791087910979110791117911279113791147911579116791177911879119791207912179122791237912479125791267912779128791297913079131791327913379134791357913679137791387913979140791417914279143791447914579146791477914879149791507915179152791537915479155791567915779158791597916079161791627916379164791657916679167791687916979170791717917279173791747917579176791777917879179791807918179182791837918479185791867918779188791897919079191791927919379194791957919679197791987919979200792017920279203792047920579206792077920879209792107921179212792137921479215792167921779218792197922079221792227922379224792257922679227792287922979230792317923279233792347923579236792377923879239792407924179242792437924479245792467924779248792497925079251792527925379254792557925679257792587925979260792617926279263792647926579266792677926879269792707927179272792737927479275792767927779278792797928079281792827928379284792857928679287792887928979290792917929279293792947929579296792977929879299793007930179302793037930479305793067930779308793097931079311793127931379314793157931679317793187931979320793217932279323793247932579326793277932879329793307933179332793337933479335793367933779338793397934079341793427934379344793457934679347793487934979350793517935279353793547935579356793577935879359793607936179362793637936479365793667936779368793697937079371793727937379374793757937679377793787937979380793817938279383793847938579386793877938879389793907939179392793937939479395793967939779398793997940079401794027940379404794057940679407794087940979410794117941279413794147941579416794177941879419794207942179422794237942479425794267942779428794297943079431794327943379434794357943679437794387943979440794417944279443794447944579446794477944879449794507945179452794537945479455794567945779458794597946079461794627946379464794657946679467794687946979470794717947279473794747947579476794777947879479794807948179482794837948479485794867948779488794897949079491794927949379494794957949679497794987949979500795017950279503795047950579506795077950879509795107951179512795137951479515795167951779518795197952079521795227952379524795257952679527795287952979530795317953279533795347953579536795377953879539795407954179542795437954479545795467954779548795497955079551795527955379554795557955679557795587955979560795617956279563795647956579566795677956879569795707957179572795737957479575795767957779578795797958079581795827958379584795857958679587795887958979590795917959279593795947959579596795977959879599796007960179602796037960479605796067960779608796097961079611796127961379614796157961679617796187961979620796217962279623796247962579626796277962879629796307963179632796337963479635796367963779638796397964079641796427964379644796457964679647796487964979650796517965279653796547965579656796577965879659796607966179662796637966479665796667966779668796697967079671796727967379674796757967679677796787967979680796817968279683796847968579686796877968879689796907969179692796937969479695796967969779698796997970079701797027970379704797057970679707797087970979710797117971279713797147971579716797177971879719797207972179722797237972479725797267972779728797297973079731797327973379734797357973679737797387973979740797417974279743797447974579746797477974879749797507975179752797537975479755797567975779758797597976079761797627976379764797657976679767797687976979770797717977279773797747977579776797777977879779797807978179782797837978479785797867978779788797897979079791797927979379794797957979679797797987979979800798017980279803798047980579806798077980879809798107981179812798137981479815798167981779818798197982079821798227982379824798257982679827798287982979830798317983279833798347983579836798377983879839798407984179842798437984479845798467984779848798497985079851798527985379854798557985679857798587985979860798617986279863798647986579866798677986879869798707987179872798737987479875798767987779878798797988079881798827988379884798857988679887798887988979890798917989279893798947989579896798977989879899799007990179902799037990479905799067990779908799097991079911799127991379914799157991679917799187991979920799217992279923799247992579926799277992879929799307993179932799337993479935799367993779938799397994079941799427994379944799457994679947799487994979950799517995279953799547995579956799577995879959799607996179962799637996479965799667996779968799697997079971799727997379974799757997679977799787997979980799817998279983799847998579986799877998879989799907999179992799937999479995799967999779998799998000080001800028000380004800058000680007800088000980010800118001280013800148001580016800178001880019800208002180022800238002480025800268002780028800298003080031800328003380034800358003680037800388003980040800418004280043800448004580046800478004880049800508005180052800538005480055800568005780058800598006080061800628006380064800658006680067800688006980070800718007280073800748007580076800778007880079800808008180082800838008480085800868008780088800898009080091800928009380094800958009680097800988009980100801018010280103801048010580106801078010880109801108011180112801138011480115801168011780118801198012080121801228012380124801258012680127801288012980130801318013280133801348013580136801378013880139801408014180142801438014480145801468014780148801498015080151801528015380154801558015680157801588015980160801618016280163801648016580166801678016880169801708017180172801738017480175801768017780178801798018080181801828018380184801858018680187801888018980190801918019280193801948019580196801978019880199802008020180202802038020480205802068020780208802098021080211802128021380214802158021680217802188021980220802218022280223802248022580226802278022880229802308023180232802338023480235802368023780238802398024080241802428024380244802458024680247802488024980250802518025280253802548025580256802578025880259802608026180262802638026480265802668026780268802698027080271802728027380274802758027680277802788027980280802818028280283802848028580286802878028880289802908029180292802938029480295802968029780298802998030080301803028030380304803058030680307803088030980310803118031280313803148031580316803178031880319803208032180322803238032480325803268032780328803298033080331803328033380334803358033680337803388033980340803418034280343803448034580346803478034880349803508035180352803538035480355803568035780358803598036080361803628036380364803658036680367803688036980370803718037280373803748037580376803778037880379803808038180382803838038480385803868038780388803898039080391803928039380394803958039680397803988039980400804018040280403804048040580406804078040880409804108041180412804138041480415804168041780418804198042080421804228042380424804258042680427804288042980430804318043280433804348043580436804378043880439804408044180442804438044480445804468044780448804498045080451804528045380454804558045680457804588045980460804618046280463804648046580466804678046880469804708047180472804738047480475804768047780478804798048080481804828048380484804858048680487804888048980490804918049280493804948049580496804978049880499805008050180502805038050480505805068050780508805098051080511805128051380514805158051680517805188051980520805218052280523805248052580526805278052880529805308053180532805338053480535805368053780538805398054080541805428054380544805458054680547805488054980550805518055280553805548055580556805578055880559805608056180562805638056480565805668056780568805698057080571805728057380574805758057680577805788057980580805818058280583805848058580586805878058880589805908059180592805938059480595805968059780598805998060080601806028060380604806058060680607806088060980610806118061280613806148061580616806178061880619806208062180622806238062480625806268062780628806298063080631806328063380634806358063680637806388063980640806418064280643806448064580646806478064880649806508065180652806538065480655806568065780658806598066080661806628066380664806658066680667806688066980670806718067280673806748067580676806778067880679806808068180682806838068480685806868068780688806898069080691806928069380694806958069680697806988069980700807018070280703807048070580706807078070880709807108071180712807138071480715807168071780718807198072080721807228072380724807258072680727807288072980730807318073280733807348073580736807378073880739807408074180742807438074480745807468074780748807498075080751807528075380754807558075680757807588075980760807618076280763807648076580766807678076880769807708077180772807738077480775807768077780778807798078080781807828078380784807858078680787807888078980790807918079280793807948079580796807978079880799808008080180802808038080480805808068080780808808098081080811808128081380814808158081680817808188081980820808218082280823808248082580826808278082880829808308083180832808338083480835808368083780838808398084080841808428084380844808458084680847808488084980850808518085280853808548085580856808578085880859808608086180862808638086480865808668086780868808698087080871808728087380874808758087680877808788087980880808818088280883808848088580886808878088880889808908089180892808938089480895808968089780898808998090080901809028090380904809058090680907809088090980910809118091280913809148091580916809178091880919809208092180922809238092480925809268092780928809298093080931809328093380934809358093680937809388093980940809418094280943809448094580946809478094880949809508095180952809538095480955809568095780958809598096080961809628096380964809658096680967809688096980970809718097280973809748097580976809778097880979809808098180982809838098480985809868098780988809898099080991809928099380994809958099680997809988099981000810018100281003810048100581006810078100881009810108101181012810138101481015810168101781018810198102081021810228102381024810258102681027810288102981030810318103281033810348103581036810378103881039810408104181042810438104481045810468104781048810498105081051810528105381054810558105681057810588105981060810618106281063810648106581066810678106881069810708107181072810738107481075810768107781078810798108081081810828108381084810858108681087810888108981090810918109281093810948109581096810978109881099811008110181102811038110481105811068110781108811098111081111811128111381114811158111681117811188111981120811218112281123811248112581126811278112881129811308113181132811338113481135811368113781138811398114081141811428114381144811458114681147811488114981150811518115281153811548115581156811578115881159811608116181162811638116481165811668116781168811698117081171811728117381174811758117681177811788117981180811818118281183811848118581186811878118881189811908119181192811938119481195811968119781198811998120081201812028120381204812058120681207812088120981210812118121281213812148121581216812178121881219812208122181222812238122481225812268122781228812298123081231812328123381234812358123681237812388123981240812418124281243812448124581246812478124881249812508125181252812538125481255812568125781258812598126081261812628126381264812658126681267812688126981270812718127281273812748127581276812778127881279812808128181282812838128481285812868128781288812898129081291812928129381294812958129681297812988129981300813018130281303813048130581306813078130881309813108131181312813138131481315813168131781318813198132081321813228132381324813258132681327813288132981330813318133281333813348133581336813378133881339813408134181342813438134481345813468134781348813498135081351813528135381354813558135681357813588135981360813618136281363813648136581366813678136881369813708137181372813738137481375813768137781378813798138081381813828138381384813858138681387813888138981390813918139281393813948139581396813978139881399814008140181402814038140481405814068140781408814098141081411814128141381414814158141681417814188141981420814218142281423814248142581426814278142881429814308143181432814338143481435814368143781438814398144081441814428144381444814458144681447814488144981450814518145281453814548145581456814578145881459814608146181462814638146481465814668146781468814698147081471814728147381474814758147681477814788147981480814818148281483814848148581486814878148881489814908149181492814938149481495814968149781498814998150081501815028150381504815058150681507815088150981510815118151281513815148151581516815178151881519815208152181522815238152481525815268152781528815298153081531815328153381534815358153681537815388153981540815418154281543815448154581546815478154881549815508155181552815538155481555815568155781558815598156081561815628156381564815658156681567815688156981570815718157281573815748157581576815778157881579815808158181582815838158481585815868158781588815898159081591815928159381594815958159681597815988159981600816018160281603816048160581606816078160881609816108161181612816138161481615816168161781618816198162081621816228162381624816258162681627816288162981630816318163281633816348163581636816378163881639816408164181642816438164481645816468164781648816498165081651816528165381654816558165681657816588165981660816618166281663816648166581666816678166881669816708167181672816738167481675816768167781678816798168081681816828168381684816858168681687816888168981690816918169281693816948169581696816978169881699817008170181702817038170481705817068170781708817098171081711817128171381714817158171681717817188171981720817218172281723817248172581726817278172881729817308173181732817338173481735817368173781738817398174081741817428174381744817458174681747817488174981750817518175281753817548175581756817578175881759817608176181762817638176481765817668176781768817698177081771817728177381774817758177681777817788177981780817818178281783817848178581786817878178881789817908179181792817938179481795817968179781798817998180081801818028180381804818058180681807818088180981810818118181281813818148181581816818178181881819818208182181822818238182481825818268182781828818298183081831818328183381834818358183681837818388183981840818418184281843818448184581846818478184881849818508185181852818538185481855818568185781858818598186081861818628186381864818658186681867818688186981870818718187281873818748187581876818778187881879818808188181882818838188481885818868188781888818898189081891818928189381894818958189681897818988189981900819018190281903819048190581906819078190881909819108191181912819138191481915819168191781918819198192081921819228192381924819258192681927819288192981930819318193281933819348193581936819378193881939819408194181942819438194481945819468194781948819498195081951819528195381954819558195681957819588195981960819618196281963819648196581966819678196881969819708197181972819738197481975819768197781978819798198081981819828198381984819858198681987819888198981990819918199281993819948199581996819978199881999820008200182002820038200482005820068200782008820098201082011820128201382014820158201682017820188201982020820218202282023820248202582026820278202882029820308203182032820338203482035820368203782038820398204082041820428204382044820458204682047820488204982050820518205282053820548205582056820578205882059820608206182062820638206482065820668206782068820698207082071820728207382074820758207682077820788207982080820818208282083820848208582086820878208882089820908209182092820938209482095820968209782098820998210082101821028210382104821058210682107821088210982110821118211282113821148211582116821178211882119821208212182122821238212482125821268212782128821298213082131821328213382134821358213682137821388213982140821418214282143821448214582146821478214882149821508215182152821538215482155821568215782158821598216082161821628216382164821658216682167821688216982170821718217282173821748217582176821778217882179821808218182182821838218482185821868218782188821898219082191821928219382194821958219682197821988219982200822018220282203822048220582206822078220882209822108221182212822138221482215822168221782218822198222082221822228222382224822258222682227822288222982230822318223282233822348223582236822378223882239822408224182242822438224482245822468224782248822498225082251822528225382254822558225682257822588225982260822618226282263822648226582266822678226882269822708227182272822738227482275822768227782278822798228082281822828228382284822858228682287822888228982290822918229282293822948229582296822978229882299823008230182302823038230482305823068230782308823098231082311823128231382314823158231682317823188231982320823218232282323823248232582326823278232882329823308233182332823338233482335823368233782338823398234082341823428234382344823458234682347823488234982350823518235282353823548235582356823578235882359823608236182362823638236482365823668236782368823698237082371823728237382374823758237682377823788237982380823818238282383823848238582386823878238882389823908239182392823938239482395823968239782398823998240082401824028240382404824058240682407824088240982410824118241282413824148241582416824178241882419824208242182422824238242482425824268242782428824298243082431824328243382434824358243682437824388243982440824418244282443824448244582446824478244882449824508245182452824538245482455824568245782458824598246082461824628246382464824658246682467824688246982470824718247282473824748247582476824778247882479824808248182482824838248482485824868248782488824898249082491824928249382494824958249682497824988249982500825018250282503825048250582506825078250882509825108251182512825138251482515825168251782518825198252082521825228252382524825258252682527825288252982530825318253282533825348253582536825378253882539825408254182542825438254482545825468254782548825498255082551825528255382554825558255682557825588255982560825618256282563825648256582566825678256882569825708257182572825738257482575825768257782578825798258082581825828258382584825858258682587825888258982590825918259282593825948259582596825978259882599826008260182602826038260482605826068260782608826098261082611826128261382614826158261682617826188261982620826218262282623826248262582626826278262882629826308263182632826338263482635826368263782638826398264082641826428264382644826458264682647826488264982650826518265282653826548265582656826578265882659826608266182662826638266482665826668266782668826698267082671826728267382674826758267682677826788267982680826818268282683826848268582686826878268882689826908269182692826938269482695826968269782698826998270082701827028270382704827058270682707827088270982710827118271282713827148271582716827178271882719827208272182722827238272482725827268272782728827298273082731827328273382734827358273682737827388273982740827418274282743827448274582746827478274882749827508275182752827538275482755827568275782758827598276082761827628276382764827658276682767827688276982770827718277282773827748277582776827778277882779827808278182782827838278482785827868278782788827898279082791827928279382794827958279682797827988279982800828018280282803828048280582806828078280882809828108281182812828138281482815828168281782818828198282082821828228282382824828258282682827828288282982830828318283282833828348283582836828378283882839828408284182842828438284482845828468284782848828498285082851828528285382854828558285682857828588285982860828618286282863828648286582866828678286882869828708287182872828738287482875828768287782878828798288082881828828288382884828858288682887828888288982890828918289282893828948289582896828978289882899829008290182902829038290482905829068290782908829098291082911829128291382914829158291682917829188291982920829218292282923829248292582926829278292882929829308293182932829338293482935829368293782938829398294082941829428294382944829458294682947829488294982950829518295282953829548295582956829578295882959829608296182962829638296482965829668296782968829698297082971829728297382974829758297682977829788297982980829818298282983829848298582986829878298882989829908299182992829938299482995829968299782998829998300083001830028300383004830058300683007830088300983010830118301283013830148301583016830178301883019830208302183022830238302483025830268302783028830298303083031830328303383034830358303683037830388303983040830418304283043830448304583046830478304883049830508305183052830538305483055830568305783058830598306083061830628306383064830658306683067830688306983070830718307283073830748307583076830778307883079830808308183082830838308483085830868308783088830898309083091830928309383094830958309683097830988309983100831018310283103831048310583106831078310883109831108311183112831138311483115831168311783118831198312083121831228312383124831258312683127831288312983130831318313283133831348313583136831378313883139831408314183142831438314483145831468314783148831498315083151831528315383154831558315683157831588315983160831618316283163831648316583166831678316883169831708317183172831738317483175831768317783178831798318083181831828318383184831858318683187831888318983190831918319283193831948319583196831978319883199832008320183202832038320483205832068320783208832098321083211832128321383214832158321683217832188321983220832218322283223832248322583226832278322883229832308323183232832338323483235832368323783238832398324083241832428324383244832458324683247832488324983250832518325283253832548325583256832578325883259832608326183262832638326483265832668326783268832698327083271832728327383274832758327683277832788327983280832818328283283832848328583286832878328883289832908329183292832938329483295832968329783298832998330083301833028330383304833058330683307833088330983310833118331283313833148331583316833178331883319833208332183322833238332483325833268332783328833298333083331833328333383334833358333683337833388333983340833418334283343833448334583346833478334883349833508335183352833538335483355833568335783358833598336083361833628336383364833658336683367833688336983370833718337283373833748337583376833778337883379833808338183382833838338483385833868338783388833898339083391833928339383394833958339683397833988339983400834018340283403834048340583406834078340883409834108341183412834138341483415834168341783418834198342083421834228342383424834258342683427834288342983430834318343283433834348343583436834378343883439834408344183442834438344483445834468344783448834498345083451834528345383454834558345683457834588345983460834618346283463834648346583466834678346883469834708347183472834738347483475834768347783478834798348083481834828348383484834858348683487834888348983490834918349283493834948349583496834978349883499835008350183502835038350483505835068350783508835098351083511835128351383514835158351683517835188351983520835218352283523835248352583526835278352883529835308353183532835338353483535835368353783538835398354083541835428354383544835458354683547835488354983550835518355283553835548355583556835578355883559835608356183562835638356483565835668356783568835698357083571835728357383574835758357683577835788357983580835818358283583835848358583586835878358883589835908359183592835938359483595835968359783598835998360083601836028360383604836058360683607836088360983610836118361283613836148361583616836178361883619836208362183622836238362483625836268362783628836298363083631836328363383634836358363683637836388363983640836418364283643836448364583646836478364883649836508365183652836538365483655836568365783658836598366083661836628366383664836658366683667836688366983670836718367283673836748367583676836778367883679836808368183682836838368483685836868368783688836898369083691836928369383694836958369683697836988369983700837018370283703837048370583706837078370883709837108371183712837138371483715837168371783718837198372083721837228372383724837258372683727837288372983730837318373283733837348373583736837378373883739837408374183742837438374483745837468374783748837498375083751837528375383754837558375683757837588375983760837618376283763837648376583766837678376883769837708377183772837738377483775837768377783778837798378083781837828378383784837858378683787837888378983790837918379283793837948379583796837978379883799838008380183802838038380483805838068380783808838098381083811838128381383814838158381683817838188381983820838218382283823838248382583826838278382883829838308383183832838338383483835838368383783838838398384083841838428384383844838458384683847838488384983850838518385283853838548385583856838578385883859838608386183862838638386483865838668386783868838698387083871838728387383874838758387683877838788387983880838818388283883838848388583886838878388883889838908389183892838938389483895838968389783898838998390083901839028390383904839058390683907839088390983910839118391283913839148391583916839178391883919839208392183922839238392483925839268392783928839298393083931839328393383934839358393683937839388393983940839418394283943839448394583946839478394883949839508395183952839538395483955839568395783958839598396083961839628396383964839658396683967839688396983970839718397283973839748397583976839778397883979839808398183982839838398483985839868398783988839898399083991839928399383994839958399683997839988399984000840018400284003840048400584006840078400884009840108401184012840138401484015840168401784018840198402084021840228402384024840258402684027840288402984030840318403284033840348403584036840378403884039840408404184042840438404484045840468404784048840498405084051840528405384054840558405684057840588405984060840618406284063840648406584066840678406884069840708407184072840738407484075840768407784078840798408084081840828408384084840858408684087840888408984090840918409284093840948409584096840978409884099841008410184102841038410484105841068410784108841098411084111841128411384114841158411684117841188411984120841218412284123841248412584126841278412884129841308413184132841338413484135841368413784138841398414084141841428414384144841458414684147841488414984150841518415284153841548415584156841578415884159841608416184162841638416484165841668416784168841698417084171841728417384174841758417684177841788417984180841818418284183841848418584186841878418884189841908419184192841938419484195841968419784198841998420084201842028420384204842058420684207842088420984210842118421284213842148421584216842178421884219842208422184222842238422484225842268422784228842298423084231842328423384234842358423684237842388423984240842418424284243842448424584246842478424884249842508425184252842538425484255842568425784258842598426084261842628426384264842658426684267842688426984270842718427284273842748427584276842778427884279842808428184282842838428484285842868428784288842898429084291842928429384294842958429684297842988429984300843018430284303843048430584306843078430884309843108431184312843138431484315843168431784318843198432084321843228432384324843258432684327843288432984330843318433284333843348433584336843378433884339843408434184342843438434484345843468434784348843498435084351843528435384354843558435684357843588435984360843618436284363843648436584366843678436884369843708437184372843738437484375843768437784378843798438084381843828438384384843858438684387843888438984390843918439284393843948439584396843978439884399844008440184402844038440484405844068440784408844098441084411844128441384414844158441684417844188441984420844218442284423844248442584426844278442884429844308443184432844338443484435844368443784438844398444084441844428444384444844458444684447844488444984450844518445284453844548445584456844578445884459844608446184462844638446484465844668446784468844698447084471844728447384474844758447684477844788447984480844818448284483844848448584486844878448884489844908449184492844938449484495844968449784498844998450084501845028450384504845058450684507845088450984510845118451284513845148451584516845178451884519845208452184522845238452484525845268452784528845298453084531845328453384534845358453684537845388453984540845418454284543845448454584546845478454884549845508455184552845538455484555845568455784558845598456084561845628456384564845658456684567845688456984570845718457284573845748457584576845778457884579845808458184582845838458484585845868458784588845898459084591845928459384594845958459684597845988459984600846018460284603846048460584606846078460884609846108461184612846138461484615846168461784618846198462084621846228462384624846258462684627846288462984630846318463284633846348463584636846378463884639846408464184642846438464484645846468464784648846498465084651846528465384654846558465684657846588465984660846618466284663846648466584666846678466884669846708467184672846738467484675846768467784678846798468084681846828468384684846858468684687846888468984690846918469284693846948469584696846978469884699847008470184702847038470484705847068470784708847098471084711847128471384714847158471684717847188471984720847218472284723847248472584726847278472884729847308473184732847338473484735847368473784738847398474084741847428474384744847458474684747847488474984750847518475284753847548475584756847578475884759847608476184762847638476484765847668476784768847698477084771847728477384774847758477684777847788477984780847818478284783847848478584786847878478884789847908479184792847938479484795847968479784798847998480084801848028480384804848058480684807848088480984810848118481284813848148481584816848178481884819848208482184822848238482484825848268482784828848298483084831848328483384834848358483684837848388483984840848418484284843848448484584846848478484884849848508485184852848538485484855848568485784858848598486084861848628486384864848658486684867848688486984870848718487284873848748487584876848778487884879848808488184882848838488484885848868488784888848898489084891848928489384894848958489684897848988489984900849018490284903849048490584906849078490884909849108491184912849138491484915849168491784918849198492084921849228492384924849258492684927849288492984930849318493284933849348493584936849378493884939849408494184942849438494484945849468494784948849498495084951849528495384954849558495684957849588495984960849618496284963849648496584966849678496884969849708497184972849738497484975849768497784978849798498084981849828498384984849858498684987849888498984990849918499284993849948499584996849978499884999850008500185002850038500485005850068500785008850098501085011850128501385014850158501685017850188501985020850218502285023850248502585026850278502885029850308503185032850338503485035850368503785038850398504085041850428504385044850458504685047850488504985050850518505285053850548505585056850578505885059850608506185062850638506485065850668506785068850698507085071850728507385074850758507685077850788507985080850818508285083850848508585086850878508885089850908509185092850938509485095850968509785098850998510085101851028510385104851058510685107851088510985110851118511285113851148511585116851178511885119851208512185122851238512485125851268512785128851298513085131851328513385134851358513685137851388513985140851418514285143851448514585146851478514885149851508515185152851538515485155851568515785158851598516085161851628516385164851658516685167851688516985170851718517285173851748517585176851778517885179851808518185182851838518485185851868518785188851898519085191851928519385194851958519685197851988519985200852018520285203852048520585206852078520885209852108521185212852138521485215852168521785218852198522085221852228522385224852258522685227852288522985230852318523285233852348523585236852378523885239852408524185242852438524485245852468524785248852498525085251852528525385254852558525685257852588525985260852618526285263852648526585266852678526885269852708527185272852738527485275852768527785278852798528085281852828528385284852858528685287852888528985290852918529285293852948529585296852978529885299853008530185302853038530485305853068530785308853098531085311853128531385314853158531685317853188531985320853218532285323853248532585326853278532885329853308533185332853338533485335853368533785338853398534085341853428534385344853458534685347853488534985350853518535285353853548535585356853578535885359853608536185362853638536485365853668536785368853698537085371853728537385374853758537685377853788537985380853818538285383853848538585386853878538885389853908539185392853938539485395853968539785398853998540085401854028540385404854058540685407854088540985410854118541285413854148541585416854178541885419854208542185422854238542485425854268542785428854298543085431854328543385434854358543685437854388543985440854418544285443854448544585446854478544885449854508545185452854538545485455854568545785458854598546085461854628546385464854658546685467854688546985470854718547285473854748547585476854778547885479854808548185482854838548485485854868548785488854898549085491854928549385494854958549685497854988549985500855018550285503855048550585506855078550885509855108551185512855138551485515855168551785518855198552085521855228552385524855258552685527855288552985530855318553285533855348553585536855378553885539855408554185542855438554485545855468554785548855498555085551855528555385554855558555685557855588555985560855618556285563855648556585566855678556885569855708557185572855738557485575855768557785578855798558085581855828558385584855858558685587855888558985590855918559285593855948559585596855978559885599856008560185602856038560485605856068560785608856098561085611856128561385614856158561685617856188561985620856218562285623856248562585626856278562885629856308563185632856338563485635856368563785638856398564085641856428564385644856458564685647856488564985650856518565285653856548565585656856578565885659856608566185662856638566485665856668566785668856698567085671856728567385674856758567685677856788567985680856818568285683856848568585686856878568885689856908569185692856938569485695856968569785698856998570085701857028570385704857058570685707857088570985710857118571285713857148571585716857178571885719857208572185722857238572485725857268572785728857298573085731857328573385734857358573685737857388573985740857418574285743857448574585746857478574885749857508575185752857538575485755857568575785758857598576085761857628576385764857658576685767857688576985770857718577285773857748577585776857778577885779857808578185782857838578485785857868578785788857898579085791857928579385794857958579685797857988579985800858018580285803858048580585806858078580885809858108581185812858138581485815858168581785818858198582085821858228582385824858258582685827858288582985830858318583285833858348583585836858378583885839858408584185842858438584485845858468584785848858498585085851858528585385854858558585685857858588585985860858618586285863858648586585866858678586885869858708587185872858738587485875858768587785878858798588085881858828588385884858858588685887858888588985890858918589285893858948589585896858978589885899859008590185902859038590485905859068590785908859098591085911859128591385914859158591685917859188591985920859218592285923859248592585926859278592885929859308593185932859338593485935859368593785938859398594085941859428594385944859458594685947859488594985950859518595285953859548595585956859578595885959859608596185962859638596485965859668596785968859698597085971859728597385974859758597685977859788597985980859818598285983859848598585986859878598885989859908599185992859938599485995859968599785998859998600086001860028600386004860058600686007860088600986010860118601286013860148601586016860178601886019860208602186022860238602486025860268602786028860298603086031860328603386034860358603686037860388603986040860418604286043860448604586046860478604886049860508605186052860538605486055860568605786058860598606086061860628606386064860658606686067860688606986070860718607286073860748607586076860778607886079860808608186082860838608486085860868608786088860898609086091860928609386094860958609686097860988609986100861018610286103861048610586106861078610886109861108611186112861138611486115861168611786118861198612086121861228612386124861258612686127861288612986130861318613286133861348613586136861378613886139861408614186142861438614486145861468614786148861498615086151861528615386154861558615686157861588615986160861618616286163861648616586166861678616886169861708617186172861738617486175861768617786178861798618086181861828618386184861858618686187861888618986190861918619286193861948619586196861978619886199862008620186202862038620486205862068620786208862098621086211862128621386214862158621686217862188621986220862218622286223862248622586226862278622886229862308623186232862338623486235862368623786238862398624086241862428624386244862458624686247862488624986250862518625286253862548625586256862578625886259862608626186262862638626486265862668626786268862698627086271862728627386274862758627686277862788627986280862818628286283862848628586286862878628886289862908629186292862938629486295862968629786298862998630086301863028630386304863058630686307863088630986310863118631286313863148631586316863178631886319863208632186322863238632486325863268632786328863298633086331863328633386334863358633686337863388633986340863418634286343863448634586346863478634886349863508635186352863538635486355863568635786358863598636086361863628636386364863658636686367863688636986370863718637286373863748637586376863778637886379863808638186382863838638486385863868638786388863898639086391863928639386394863958639686397863988639986400864018640286403864048640586406864078640886409864108641186412864138641486415864168641786418864198642086421864228642386424864258642686427864288642986430864318643286433864348643586436864378643886439864408644186442864438644486445864468644786448864498645086451864528645386454864558645686457864588645986460864618646286463864648646586466864678646886469864708647186472864738647486475864768647786478864798648086481864828648386484864858648686487864888648986490864918649286493864948649586496864978649886499865008650186502865038650486505865068650786508865098651086511865128651386514865158651686517865188651986520865218652286523865248652586526865278652886529865308653186532865338653486535865368653786538865398654086541865428654386544865458654686547865488654986550865518655286553865548655586556865578655886559865608656186562865638656486565865668656786568865698657086571865728657386574865758657686577865788657986580865818658286583865848658586586865878658886589865908659186592865938659486595865968659786598865998660086601866028660386604866058660686607866088660986610866118661286613866148661586616866178661886619866208662186622866238662486625866268662786628866298663086631866328663386634866358663686637866388663986640866418664286643866448664586646866478664886649866508665186652866538665486655866568665786658866598666086661866628666386664866658666686667866688666986670866718667286673866748667586676866778667886679866808668186682866838668486685866868668786688866898669086691866928669386694866958669686697866988669986700867018670286703867048670586706867078670886709867108671186712867138671486715867168671786718867198672086721867228672386724867258672686727867288672986730867318673286733867348673586736867378673886739867408674186742867438674486745867468674786748867498675086751867528675386754867558675686757867588675986760867618676286763867648676586766867678676886769867708677186772867738677486775867768677786778867798678086781867828678386784867858678686787867888678986790867918679286793867948679586796867978679886799868008680186802868038680486805868068680786808868098681086811868128681386814868158681686817868188681986820868218682286823868248682586826868278682886829868308683186832868338683486835868368683786838868398684086841868428684386844868458684686847868488684986850868518685286853868548685586856868578685886859868608686186862868638686486865868668686786868868698687086871868728687386874868758687686877868788687986880868818688286883868848688586886868878688886889868908689186892868938689486895868968689786898868998690086901869028690386904869058690686907869088690986910869118691286913869148691586916869178691886919869208692186922869238692486925869268692786928869298693086931869328693386934869358693686937869388693986940869418694286943869448694586946869478694886949869508695186952869538695486955869568695786958869598696086961869628696386964869658696686967869688696986970869718697286973869748697586976869778697886979869808698186982869838698486985869868698786988869898699086991869928699386994869958699686997869988699987000870018700287003870048700587006870078700887009870108701187012870138701487015870168701787018870198702087021870228702387024870258702687027870288702987030870318703287033870348703587036870378703887039870408704187042870438704487045870468704787048870498705087051870528705387054870558705687057870588705987060870618706287063870648706587066870678706887069870708707187072870738707487075870768707787078870798708087081870828708387084870858708687087870888708987090870918709287093870948709587096870978709887099871008710187102871038710487105871068710787108871098711087111871128711387114871158711687117871188711987120871218712287123871248712587126871278712887129871308713187132871338713487135871368713787138871398714087141871428714387144871458714687147871488714987150871518715287153871548715587156871578715887159871608716187162871638716487165871668716787168871698717087171871728717387174871758717687177871788717987180871818718287183871848718587186871878718887189871908719187192871938719487195871968719787198871998720087201872028720387204872058720687207872088720987210872118721287213872148721587216872178721887219872208722187222872238722487225872268722787228872298723087231872328723387234872358723687237872388723987240872418724287243872448724587246872478724887249872508725187252872538725487255872568725787258872598726087261872628726387264872658726687267872688726987270872718727287273872748727587276872778727887279872808728187282872838728487285872868728787288872898729087291872928729387294872958729687297872988729987300873018730287303873048730587306873078730887309873108731187312873138731487315873168731787318873198732087321873228732387324873258732687327873288732987330873318733287333873348733587336873378733887339873408734187342873438734487345873468734787348873498735087351873528735387354873558735687357873588735987360873618736287363873648736587366873678736887369873708737187372873738737487375873768737787378873798738087381873828738387384873858738687387873888738987390873918739287393873948739587396873978739887399874008740187402874038740487405874068740787408874098741087411874128741387414874158741687417874188741987420874218742287423874248742587426874278742887429874308743187432874338743487435874368743787438874398744087441874428744387444874458744687447874488744987450874518745287453874548745587456874578745887459874608746187462874638746487465874668746787468874698747087471874728747387474874758747687477874788747987480874818748287483874848748587486874878748887489874908749187492874938749487495874968749787498874998750087501875028750387504875058750687507875088750987510875118751287513875148751587516875178751887519875208752187522875238752487525875268752787528875298753087531875328753387534875358753687537875388753987540875418754287543875448754587546875478754887549875508755187552875538755487555875568755787558875598756087561875628756387564875658756687567875688756987570875718757287573875748757587576875778757887579875808758187582875838758487585875868758787588875898759087591875928759387594875958759687597875988759987600876018760287603876048760587606876078760887609876108761187612876138761487615876168761787618876198762087621876228762387624876258762687627876288762987630876318763287633876348763587636876378763887639876408764187642876438764487645876468764787648876498765087651876528765387654876558765687657876588765987660876618766287663876648766587666876678766887669876708767187672876738767487675876768767787678876798768087681876828768387684876858768687687876888768987690876918769287693876948769587696876978769887699877008770187702877038770487705877068770787708877098771087711877128771387714877158771687717877188771987720877218772287723877248772587726877278772887729877308773187732877338773487735877368773787738877398774087741877428774387744877458774687747877488774987750877518775287753877548775587756877578775887759877608776187762877638776487765877668776787768877698777087771877728777387774877758777687777877788777987780877818778287783877848778587786877878778887789877908779187792877938779487795877968779787798877998780087801878028780387804878058780687807878088780987810878118781287813878148781587816878178781887819878208782187822878238782487825878268782787828878298783087831878328783387834878358783687837878388783987840878418784287843878448784587846878478784887849878508785187852878538785487855878568785787858878598786087861878628786387864878658786687867878688786987870878718787287873878748787587876878778787887879878808788187882878838788487885878868788787888878898789087891878928789387894878958789687897878988789987900879018790287903879048790587906879078790887909879108791187912879138791487915879168791787918879198792087921879228792387924879258792687927879288792987930879318793287933879348793587936879378793887939879408794187942879438794487945879468794787948879498795087951879528795387954879558795687957879588795987960879618796287963879648796587966879678796887969879708797187972879738797487975879768797787978879798798087981879828798387984879858798687987879888798987990879918799287993879948799587996879978799887999880008800188002880038800488005880068800788008880098801088011880128801388014880158801688017880188801988020880218802288023880248802588026880278802888029880308803188032880338803488035880368803788038880398804088041880428804388044880458804688047880488804988050880518805288053880548805588056880578805888059880608806188062880638806488065880668806788068880698807088071880728807388074880758807688077880788807988080880818808288083880848808588086880878808888089880908809188092880938809488095880968809788098880998810088101881028810388104881058810688107881088810988110881118811288113881148811588116881178811888119881208812188122881238812488125881268812788128881298813088131881328813388134881358813688137881388813988140881418814288143881448814588146881478814888149881508815188152881538815488155881568815788158881598816088161881628816388164881658816688167881688816988170881718817288173881748817588176881778817888179881808818188182881838818488185881868818788188881898819088191881928819388194881958819688197881988819988200882018820288203882048820588206882078820888209882108821188212882138821488215882168821788218882198822088221882228822388224882258822688227882288822988230882318823288233882348823588236882378823888239882408824188242882438824488245882468824788248882498825088251882528825388254882558825688257882588825988260882618826288263882648826588266882678826888269882708827188272882738827488275882768827788278882798828088281882828828388284882858828688287882888828988290882918829288293882948829588296882978829888299883008830188302883038830488305883068830788308883098831088311883128831388314883158831688317883188831988320883218832288323883248832588326883278832888329883308833188332883338833488335883368833788338883398834088341883428834388344883458834688347883488834988350883518835288353883548835588356883578835888359883608836188362883638836488365883668836788368883698837088371883728837388374883758837688377883788837988380883818838288383883848838588386883878838888389883908839188392883938839488395883968839788398883998840088401884028840388404884058840688407884088840988410884118841288413884148841588416884178841888419884208842188422884238842488425884268842788428884298843088431884328843388434884358843688437884388843988440884418844288443884448844588446884478844888449884508845188452884538845488455884568845788458884598846088461884628846388464884658846688467884688846988470884718847288473884748847588476884778847888479884808848188482884838848488485884868848788488884898849088491884928849388494884958849688497884988849988500885018850288503885048850588506885078850888509885108851188512885138851488515885168851788518885198852088521885228852388524885258852688527885288852988530885318853288533885348853588536885378853888539885408854188542885438854488545885468854788548885498855088551885528855388554885558855688557885588855988560885618856288563885648856588566885678856888569885708857188572885738857488575885768857788578885798858088581885828858388584885858858688587885888858988590885918859288593885948859588596885978859888599886008860188602886038860488605886068860788608886098861088611886128861388614886158861688617886188861988620886218862288623886248862588626886278862888629886308863188632886338863488635886368863788638886398864088641886428864388644886458864688647886488864988650886518865288653886548865588656886578865888659886608866188662886638866488665886668866788668886698867088671886728867388674886758867688677886788867988680886818868288683886848868588686886878868888689886908869188692886938869488695886968869788698886998870088701887028870388704887058870688707887088870988710887118871288713887148871588716887178871888719887208872188722887238872488725887268872788728887298873088731887328873388734887358873688737887388873988740887418874288743887448874588746887478874888749887508875188752887538875488755887568875788758887598876088761887628876388764887658876688767887688876988770887718877288773887748877588776887778877888779887808878188782887838878488785887868878788788887898879088791887928879388794887958879688797887988879988800888018880288803888048880588806888078880888809888108881188812888138881488815888168881788818888198882088821888228882388824888258882688827888288882988830888318883288833888348883588836888378883888839888408884188842888438884488845888468884788848888498885088851888528885388854888558885688857888588885988860888618886288863888648886588866888678886888869888708887188872888738887488875888768887788878888798888088881888828888388884888858888688887888888888988890888918889288893888948889588896888978889888899889008890188902889038890488905889068890788908889098891088911889128891388914889158891688917889188891988920889218892288923889248892588926889278892888929889308893188932889338893488935889368893788938889398894088941889428894388944889458894688947889488894988950889518895288953889548895588956889578895888959889608896188962889638896488965889668896788968889698897088971889728897388974889758897688977889788897988980889818898288983889848898588986889878898888989889908899188992889938899488995889968899788998889998900089001890028900389004890058900689007890088900989010890118901289013890148901589016890178901889019890208902189022890238902489025890268902789028890298903089031890328903389034890358903689037890388903989040890418904289043890448904589046890478904889049890508905189052890538905489055890568905789058890598906089061890628906389064890658906689067890688906989070890718907289073890748907589076890778907889079890808908189082890838908489085890868908789088890898909089091890928909389094890958909689097890988909989100891018910289103891048910589106891078910889109891108911189112891138911489115891168911789118891198912089121891228912389124891258912689127891288912989130891318913289133891348913589136891378913889139891408914189142891438914489145891468914789148891498915089151891528915389154891558915689157891588915989160891618916289163891648916589166891678916889169891708917189172891738917489175891768917789178891798918089181891828918389184891858918689187891888918989190891918919289193891948919589196891978919889199892008920189202892038920489205892068920789208892098921089211892128921389214892158921689217892188921989220892218922289223892248922589226892278922889229892308923189232892338923489235892368923789238892398924089241892428924389244892458924689247892488924989250892518925289253892548925589256892578925889259892608926189262892638926489265892668926789268892698927089271892728927389274892758927689277892788927989280892818928289283892848928589286892878928889289892908929189292892938929489295892968929789298892998930089301893028930389304893058930689307893088930989310893118931289313893148931589316893178931889319893208932189322893238932489325893268932789328893298933089331893328933389334893358933689337893388933989340893418934289343893448934589346893478934889349893508935189352893538935489355893568935789358893598936089361893628936389364893658936689367893688936989370893718937289373893748937589376893778937889379893808938189382893838938489385893868938789388893898939089391893928939389394893958939689397893988939989400894018940289403894048940589406894078940889409894108941189412894138941489415894168941789418894198942089421894228942389424894258942689427894288942989430894318943289433894348943589436894378943889439894408944189442894438944489445894468944789448894498945089451894528945389454894558945689457894588945989460894618946289463894648946589466894678946889469894708947189472894738947489475894768947789478894798948089481894828948389484894858948689487894888948989490894918949289493894948949589496894978949889499895008950189502895038950489505895068950789508895098951089511895128951389514895158951689517895188951989520895218952289523895248952589526895278952889529895308953189532895338953489535895368953789538895398954089541895428954389544895458954689547895488954989550895518955289553895548955589556895578955889559895608956189562895638956489565895668956789568895698957089571895728957389574895758957689577895788957989580895818958289583895848958589586895878958889589895908959189592895938959489595895968959789598895998960089601896028960389604896058960689607896088960989610896118961289613896148961589616896178961889619896208962189622896238962489625896268962789628896298963089631896328963389634896358963689637896388963989640896418964289643896448964589646896478964889649896508965189652896538965489655896568965789658896598966089661896628966389664896658966689667896688966989670896718967289673896748967589676896778967889679896808968189682896838968489685896868968789688896898969089691896928969389694896958969689697896988969989700897018970289703897048970589706897078970889709897108971189712897138971489715897168971789718897198972089721897228972389724897258972689727897288972989730897318973289733897348973589736897378973889739897408974189742897438974489745897468974789748897498975089751897528975389754897558975689757897588975989760897618976289763897648976589766897678976889769897708977189772897738977489775897768977789778897798978089781897828978389784897858978689787897888978989790897918979289793897948979589796897978979889799898008980189802898038980489805898068980789808898098981089811898128981389814898158981689817898188981989820898218982289823898248982589826898278982889829898308983189832898338983489835898368983789838898398984089841898428984389844898458984689847898488984989850898518985289853898548985589856898578985889859898608986189862898638986489865898668986789868898698987089871898728987389874898758987689877898788987989880898818988289883898848988589886898878988889889898908989189892898938989489895898968989789898898998990089901899028990389904899058990689907899088990989910899118991289913899148991589916899178991889919899208992189922899238992489925899268992789928899298993089931899328993389934899358993689937899388993989940899418994289943899448994589946899478994889949899508995189952899538995489955899568995789958899598996089961899628996389964899658996689967899688996989970899718997289973899748997589976899778997889979899808998189982899838998489985899868998789988899898999089991899928999389994899958999689997899988999990000900019000290003900049000590006900079000890009900109001190012900139001490015900169001790018900199002090021900229002390024900259002690027900289002990030900319003290033900349003590036900379003890039900409004190042900439004490045900469004790048900499005090051900529005390054900559005690057900589005990060900619006290063900649006590066900679006890069900709007190072900739007490075900769007790078900799008090081900829008390084900859008690087900889008990090900919009290093900949009590096900979009890099901009010190102901039010490105901069010790108901099011090111901129011390114901159011690117901189011990120901219012290123901249012590126901279012890129901309013190132901339013490135901369013790138901399014090141901429014390144901459014690147901489014990150901519015290153901549015590156901579015890159901609016190162901639016490165901669016790168901699017090171901729017390174901759017690177901789017990180901819018290183901849018590186901879018890189901909019190192901939019490195901969019790198901999020090201902029020390204902059020690207902089020990210902119021290213902149021590216902179021890219902209022190222902239022490225902269022790228902299023090231902329023390234902359023690237902389023990240902419024290243902449024590246902479024890249902509025190252902539025490255902569025790258902599026090261902629026390264902659026690267902689026990270902719027290273902749027590276902779027890279902809028190282902839028490285902869028790288902899029090291902929029390294902959029690297902989029990300903019030290303903049030590306903079030890309903109031190312903139031490315903169031790318903199032090321903229032390324903259032690327903289032990330903319033290333903349033590336903379033890339903409034190342903439034490345903469034790348903499035090351903529035390354903559035690357903589035990360903619036290363903649036590366903679036890369903709037190372903739037490375903769037790378903799038090381903829038390384903859038690387903889038990390903919039290393903949039590396903979039890399904009040190402904039040490405904069040790408904099041090411904129041390414904159041690417904189041990420904219042290423904249042590426904279042890429904309043190432904339043490435904369043790438904399044090441904429044390444904459044690447904489044990450904519045290453904549045590456904579045890459904609046190462904639046490465904669046790468904699047090471904729047390474904759047690477904789047990480904819048290483904849048590486904879048890489904909049190492904939049490495904969049790498904999050090501905029050390504905059050690507905089050990510905119051290513905149051590516905179051890519905209052190522905239052490525905269052790528905299053090531905329053390534905359053690537905389053990540905419054290543905449054590546905479054890549905509055190552905539055490555905569055790558905599056090561905629056390564905659056690567905689056990570905719057290573905749057590576905779057890579905809058190582905839058490585905869058790588905899059090591905929059390594905959059690597905989059990600906019060290603906049060590606906079060890609906109061190612906139061490615906169061790618906199062090621906229062390624906259062690627906289062990630906319063290633906349063590636906379063890639906409064190642906439064490645906469064790648906499065090651906529065390654906559065690657906589065990660906619066290663906649066590666906679066890669906709067190672906739067490675906769067790678906799068090681906829068390684906859068690687906889068990690906919069290693906949069590696906979069890699907009070190702907039070490705907069070790708907099071090711907129071390714907159071690717907189071990720907219072290723907249072590726907279072890729907309073190732907339073490735907369073790738907399074090741907429074390744907459074690747907489074990750907519075290753907549075590756907579075890759907609076190762907639076490765907669076790768907699077090771907729077390774907759077690777907789077990780907819078290783907849078590786907879078890789907909079190792907939079490795907969079790798907999080090801908029080390804908059080690807908089080990810908119081290813908149081590816908179081890819908209082190822908239082490825908269082790828908299083090831908329083390834908359083690837908389083990840908419084290843908449084590846908479084890849908509085190852908539085490855908569085790858908599086090861908629086390864908659086690867908689086990870908719087290873908749087590876908779087890879908809088190882908839088490885908869088790888908899089090891908929089390894908959089690897908989089990900909019090290903909049090590906909079090890909909109091190912909139091490915909169091790918909199092090921909229092390924909259092690927909289092990930909319093290933909349093590936909379093890939909409094190942909439094490945909469094790948909499095090951909529095390954909559095690957909589095990960909619096290963909649096590966909679096890969909709097190972909739097490975909769097790978909799098090981909829098390984909859098690987909889098990990909919099290993909949099590996909979099890999910009100191002910039100491005910069100791008910099101091011910129101391014910159101691017910189101991020910219102291023910249102591026910279102891029910309103191032910339103491035910369103791038910399104091041910429104391044910459104691047910489104991050910519105291053910549105591056910579105891059910609106191062910639106491065910669106791068910699107091071910729107391074910759107691077910789107991080910819108291083910849108591086910879108891089910909109191092910939109491095910969109791098910999110091101911029110391104911059110691107911089110991110911119111291113911149111591116911179111891119911209112191122911239112491125911269112791128911299113091131911329113391134911359113691137911389113991140911419114291143911449114591146911479114891149911509115191152911539115491155911569115791158911599116091161911629116391164911659116691167911689116991170911719117291173911749117591176911779117891179911809118191182911839118491185911869118791188911899119091191911929119391194911959119691197911989119991200912019120291203912049120591206912079120891209912109121191212912139121491215912169121791218912199122091221912229122391224912259122691227912289122991230912319123291233912349123591236912379123891239912409124191242912439124491245912469124791248912499125091251912529125391254912559125691257912589125991260912619126291263912649126591266912679126891269912709127191272912739127491275912769127791278912799128091281912829128391284912859128691287912889128991290912919129291293912949129591296912979129891299913009130191302913039130491305913069130791308913099131091311913129131391314913159131691317913189131991320913219132291323913249132591326913279132891329913309133191332913339133491335913369133791338913399134091341913429134391344913459134691347913489134991350913519135291353913549135591356913579135891359913609136191362913639136491365913669136791368913699137091371913729137391374913759137691377913789137991380913819138291383913849138591386913879138891389913909139191392913939139491395913969139791398913999140091401914029140391404914059140691407914089140991410914119141291413914149141591416914179141891419914209142191422914239142491425914269142791428914299143091431914329143391434914359143691437914389143991440914419144291443914449144591446914479144891449914509145191452914539145491455914569145791458914599146091461914629146391464914659146691467914689146991470914719147291473914749147591476914779147891479914809148191482914839148491485914869148791488914899149091491914929149391494914959149691497914989149991500915019150291503915049150591506915079150891509915109151191512915139151491515915169151791518915199152091521915229152391524915259152691527915289152991530915319153291533915349153591536915379153891539915409154191542915439154491545915469154791548915499155091551915529155391554915559155691557915589155991560915619156291563915649156591566915679156891569915709157191572915739157491575915769157791578915799158091581915829158391584915859158691587915889158991590915919159291593915949159591596915979159891599916009160191602916039160491605916069160791608916099161091611916129161391614916159161691617916189161991620916219162291623916249162591626916279162891629916309163191632916339163491635916369163791638916399164091641916429164391644916459164691647916489164991650916519165291653916549165591656916579165891659916609166191662916639166491665916669166791668916699167091671916729167391674916759167691677916789167991680916819168291683916849168591686916879168891689916909169191692916939169491695916969169791698916999170091701917029170391704917059170691707917089170991710917119171291713917149171591716917179171891719917209172191722917239172491725917269172791728917299173091731917329173391734917359173691737917389173991740917419174291743917449174591746917479174891749917509175191752917539175491755917569175791758917599176091761917629176391764917659176691767917689176991770917719177291773917749177591776917779177891779917809178191782917839178491785917869178791788917899179091791917929179391794917959179691797917989179991800918019180291803918049180591806918079180891809918109181191812918139181491815918169181791818918199182091821918229182391824918259182691827918289182991830918319183291833918349183591836918379183891839918409184191842918439184491845918469184791848918499185091851918529185391854918559185691857918589185991860918619186291863918649186591866918679186891869918709187191872918739187491875918769187791878918799188091881918829188391884918859188691887918889188991890918919189291893918949189591896918979189891899919009190191902919039190491905919069190791908919099191091911919129191391914919159191691917919189191991920919219192291923919249192591926919279192891929919309193191932919339193491935919369193791938919399194091941919429194391944919459194691947919489194991950919519195291953919549195591956919579195891959919609196191962919639196491965919669196791968919699197091971919729197391974919759197691977919789197991980919819198291983919849198591986919879198891989919909199191992919939199491995919969199791998919999200092001920029200392004920059200692007920089200992010920119201292013920149201592016920179201892019920209202192022920239202492025920269202792028920299203092031920329203392034920359203692037920389203992040920419204292043920449204592046920479204892049920509205192052920539205492055920569205792058920599206092061920629206392064920659206692067920689206992070920719207292073920749207592076920779207892079920809208192082920839208492085920869208792088920899209092091920929209392094920959209692097920989209992100921019210292103921049210592106921079210892109921109211192112921139211492115921169211792118921199212092121921229212392124921259212692127921289212992130921319213292133921349213592136921379213892139921409214192142921439214492145921469214792148921499215092151921529215392154921559215692157921589215992160921619216292163921649216592166921679216892169921709217192172921739217492175921769217792178921799218092181921829218392184921859218692187921889218992190921919219292193921949219592196921979219892199922009220192202922039220492205922069220792208922099221092211922129221392214922159221692217922189221992220922219222292223922249222592226922279222892229922309223192232922339223492235922369223792238922399224092241922429224392244922459224692247922489224992250922519225292253922549225592256922579225892259922609226192262922639226492265922669226792268922699227092271922729227392274922759227692277922789227992280922819228292283922849228592286922879228892289922909229192292922939229492295922969229792298922999230092301923029230392304923059230692307923089230992310923119231292313923149231592316923179231892319923209232192322923239232492325923269232792328923299233092331923329233392334923359233692337923389233992340923419234292343923449234592346923479234892349923509235192352923539235492355923569235792358923599236092361923629236392364923659236692367923689236992370923719237292373923749237592376923779237892379923809238192382923839238492385923869238792388923899239092391923929239392394923959239692397923989239992400924019240292403924049240592406924079240892409924109241192412924139241492415924169241792418924199242092421924229242392424924259242692427924289242992430924319243292433924349243592436924379243892439924409244192442924439244492445924469244792448924499245092451924529245392454924559245692457924589245992460924619246292463924649246592466924679246892469924709247192472924739247492475924769247792478924799248092481924829248392484924859248692487924889248992490924919249292493924949249592496924979249892499925009250192502925039250492505925069250792508925099251092511925129251392514925159251692517925189251992520925219252292523925249252592526925279252892529925309253192532925339253492535925369253792538925399254092541925429254392544925459254692547925489254992550925519255292553925549255592556925579255892559925609256192562925639256492565925669256792568925699257092571925729257392574925759257692577925789257992580925819258292583925849258592586925879258892589925909259192592925939259492595925969259792598925999260092601926029260392604926059260692607926089260992610926119261292613926149261592616926179261892619926209262192622926239262492625926269262792628926299263092631926329263392634926359263692637926389263992640926419264292643926449264592646926479264892649926509265192652926539265492655926569265792658926599266092661926629266392664926659266692667926689266992670926719267292673926749267592676926779267892679926809268192682926839268492685926869268792688926899269092691926929269392694926959269692697926989269992700927019270292703927049270592706927079270892709927109271192712927139271492715927169271792718927199272092721927229272392724927259272692727927289272992730927319273292733927349273592736927379273892739927409274192742927439274492745927469274792748927499275092751927529275392754927559275692757927589275992760927619276292763927649276592766927679276892769927709277192772927739277492775927769277792778927799278092781927829278392784927859278692787927889278992790927919279292793927949279592796927979279892799928009280192802928039280492805928069280792808928099281092811928129281392814928159281692817928189281992820928219282292823928249282592826928279282892829928309283192832928339283492835928369283792838928399284092841928429284392844928459284692847928489284992850928519285292853928549285592856928579285892859928609286192862928639286492865928669286792868928699287092871928729287392874928759287692877928789287992880928819288292883928849288592886928879288892889928909289192892928939289492895928969289792898928999290092901929029290392904929059290692907929089290992910929119291292913929149291592916929179291892919929209292192922929239292492925929269292792928929299293092931929329293392934929359293692937929389293992940929419294292943929449294592946929479294892949929509295192952929539295492955929569295792958929599296092961929629296392964929659296692967929689296992970929719297292973929749297592976929779297892979929809298192982929839298492985929869298792988929899299092991929929299392994929959299692997929989299993000930019300293003930049300593006930079300893009930109301193012930139301493015930169301793018930199302093021930229302393024930259302693027930289302993030930319303293033930349303593036930379303893039930409304193042930439304493045930469304793048930499305093051930529305393054930559305693057930589305993060930619306293063930649306593066930679306893069930709307193072930739307493075930769307793078930799308093081930829308393084930859308693087930889308993090930919309293093930949309593096930979309893099931009310193102931039310493105931069310793108931099311093111931129311393114931159311693117931189311993120931219312293123931249312593126931279312893129931309313193132931339313493135931369313793138931399314093141931429314393144931459314693147931489314993150931519315293153931549315593156931579315893159931609316193162931639316493165931669316793168931699317093171931729317393174931759317693177931789317993180931819318293183931849318593186931879318893189931909319193192931939319493195931969319793198931999320093201932029320393204932059320693207932089320993210932119321293213932149321593216932179321893219932209322193222932239322493225932269322793228932299323093231932329323393234932359323693237932389323993240932419324293243932449324593246932479324893249932509325193252932539325493255932569325793258932599326093261932629326393264932659326693267932689326993270932719327293273932749327593276932779327893279932809328193282932839328493285932869328793288932899329093291932929329393294932959329693297932989329993300933019330293303933049330593306933079330893309933109331193312933139331493315933169331793318933199332093321933229332393324933259332693327933289332993330933319333293333933349333593336933379333893339933409334193342933439334493345933469334793348933499335093351933529335393354933559335693357933589335993360933619336293363933649336593366933679336893369933709337193372933739337493375933769337793378933799338093381933829338393384933859338693387933889338993390933919339293393933949339593396933979339893399934009340193402934039340493405934069340793408934099341093411934129341393414934159341693417934189341993420934219342293423934249342593426934279342893429934309343193432934339343493435934369343793438934399344093441934429344393444934459344693447934489344993450934519345293453934549345593456934579345893459934609346193462934639346493465934669346793468934699347093471934729347393474934759347693477934789347993480934819348293483934849348593486934879348893489934909349193492934939349493495934969349793498934999350093501935029350393504935059350693507935089350993510935119351293513935149351593516935179351893519935209352193522935239352493525935269352793528935299353093531935329353393534935359353693537935389353993540935419354293543935449354593546935479354893549935509355193552935539355493555935569355793558935599356093561935629356393564935659356693567935689356993570935719357293573935749357593576935779357893579935809358193582935839358493585935869358793588935899359093591935929359393594935959359693597935989359993600936019360293603936049360593606936079360893609936109361193612936139361493615936169361793618936199362093621936229362393624936259362693627936289362993630936319363293633936349363593636936379363893639936409364193642936439364493645936469364793648936499365093651936529365393654936559365693657936589365993660936619366293663936649366593666936679366893669936709367193672936739367493675936769367793678936799368093681936829368393684936859368693687936889368993690936919369293693936949369593696936979369893699937009370193702937039370493705937069370793708937099371093711937129371393714937159371693717937189371993720937219372293723937249372593726937279372893729937309373193732937339373493735937369373793738937399374093741937429374393744937459374693747937489374993750937519375293753937549375593756937579375893759937609376193762937639376493765937669376793768937699377093771937729377393774937759377693777937789377993780937819378293783937849378593786937879378893789937909379193792937939379493795937969379793798937999380093801938029380393804938059380693807938089380993810938119381293813938149381593816938179381893819938209382193822938239382493825938269382793828938299383093831938329383393834938359383693837938389383993840938419384293843938449384593846938479384893849938509385193852938539385493855938569385793858938599386093861938629386393864938659386693867938689386993870938719387293873938749387593876938779387893879938809388193882938839388493885938869388793888938899389093891938929389393894938959389693897938989389993900939019390293903939049390593906939079390893909939109391193912939139391493915939169391793918939199392093921939229392393924939259392693927939289392993930939319393293933939349393593936939379393893939939409394193942939439394493945939469394793948939499395093951939529395393954939559395693957939589395993960939619396293963939649396593966939679396893969939709397193972939739397493975939769397793978939799398093981939829398393984939859398693987939889398993990939919399293993939949399593996939979399893999940009400194002940039400494005940069400794008940099401094011940129401394014940159401694017940189401994020940219402294023940249402594026940279402894029940309403194032940339403494035940369403794038940399404094041940429404394044940459404694047940489404994050940519405294053940549405594056940579405894059940609406194062940639406494065940669406794068940699407094071940729407394074940759407694077940789407994080940819408294083940849408594086940879408894089940909409194092940939409494095940969409794098940999410094101941029410394104941059410694107941089410994110941119411294113941149411594116941179411894119941209412194122941239412494125941269412794128941299413094131941329413394134941359413694137941389413994140941419414294143941449414594146941479414894149941509415194152941539415494155941569415794158941599416094161941629416394164941659416694167941689416994170941719417294173941749417594176941779417894179941809418194182941839418494185941869418794188941899419094191941929419394194941959419694197941989419994200942019420294203942049420594206942079420894209942109421194212942139421494215942169421794218942199422094221942229422394224942259422694227942289422994230942319423294233942349423594236942379423894239942409424194242942439424494245942469424794248942499425094251942529425394254942559425694257942589425994260942619426294263942649426594266942679426894269942709427194272942739427494275942769427794278942799428094281942829428394284942859428694287942889428994290942919429294293942949429594296942979429894299943009430194302943039430494305943069430794308943099431094311943129431394314943159431694317943189431994320943219432294323943249432594326943279432894329943309433194332943339433494335943369433794338943399434094341943429434394344943459434694347943489434994350943519435294353943549435594356943579435894359943609436194362943639436494365943669436794368943699437094371943729437394374943759437694377943789437994380943819438294383943849438594386943879438894389943909439194392943939439494395943969439794398943999440094401944029440394404944059440694407944089440994410944119441294413944149441594416944179441894419944209442194422944239442494425944269442794428944299443094431944329443394434944359443694437944389443994440944419444294443944449444594446944479444894449944509445194452944539445494455944569445794458944599446094461944629446394464944659446694467944689446994470944719447294473944749447594476944779447894479944809448194482944839448494485944869448794488944899449094491944929449394494944959449694497944989449994500945019450294503945049450594506945079450894509945109451194512945139451494515945169451794518945199452094521945229452394524945259452694527945289452994530945319453294533945349453594536945379453894539945409454194542945439454494545945469454794548945499455094551945529455394554945559455694557945589455994560945619456294563945649456594566945679456894569945709457194572945739457494575945769457794578945799458094581945829458394584945859458694587945889458994590945919459294593945949459594596945979459894599946009460194602946039460494605946069460794608946099461094611946129461394614946159461694617946189461994620946219462294623946249462594626946279462894629946309463194632946339463494635946369463794638946399464094641946429464394644946459464694647946489464994650946519465294653946549465594656946579465894659946609466194662946639466494665946669466794668946699467094671946729467394674946759467694677946789467994680946819468294683946849468594686946879468894689946909469194692946939469494695946969469794698946999470094701947029470394704947059470694707947089470994710947119471294713947149471594716947179471894719947209472194722947239472494725947269472794728947299473094731947329473394734947359473694737947389473994740947419474294743947449474594746947479474894749947509475194752947539475494755947569475794758947599476094761947629476394764947659476694767947689476994770947719477294773947749477594776947779477894779947809478194782947839478494785947869478794788947899479094791947929479394794947959479694797947989479994800948019480294803948049480594806948079480894809948109481194812948139481494815948169481794818948199482094821948229482394824948259482694827948289482994830948319483294833948349483594836948379483894839948409484194842948439484494845948469484794848948499485094851948529485394854948559485694857948589485994860948619486294863948649486594866948679486894869948709487194872948739487494875948769487794878948799488094881948829488394884948859488694887948889488994890948919489294893948949489594896948979489894899949009490194902949039490494905949069490794908949099491094911949129491394914949159491694917949189491994920949219492294923949249492594926949279492894929949309493194932949339493494935949369493794938949399494094941949429494394944949459494694947949489494994950949519495294953949549495594956949579495894959949609496194962949639496494965949669496794968949699497094971949729497394974949759497694977949789497994980949819498294983949849498594986949879498894989949909499194992949939499494995949969499794998949999500095001950029500395004950059500695007950089500995010950119501295013950149501595016950179501895019950209502195022950239502495025950269502795028950299503095031950329503395034950359503695037950389503995040950419504295043950449504595046950479504895049950509505195052950539505495055950569505795058950599506095061950629506395064950659506695067950689506995070950719507295073950749507595076950779507895079950809508195082950839508495085950869508795088950899509095091950929509395094950959509695097950989509995100951019510295103951049510595106951079510895109951109511195112951139511495115951169511795118951199512095121951229512395124951259512695127951289512995130951319513295133951349513595136951379513895139951409514195142951439514495145951469514795148951499515095151951529515395154951559515695157951589515995160951619516295163951649516595166951679516895169951709517195172951739517495175951769517795178951799518095181951829518395184951859518695187951889518995190951919519295193951949519595196951979519895199952009520195202952039520495205952069520795208952099521095211952129521395214952159521695217952189521995220952219522295223952249522595226952279522895229952309523195232952339523495235952369523795238952399524095241952429524395244952459524695247952489524995250952519525295253952549525595256952579525895259952609526195262952639526495265952669526795268952699527095271952729527395274952759527695277952789527995280952819528295283952849528595286952879528895289952909529195292952939529495295952969529795298952999530095301953029530395304953059530695307953089530995310953119531295313953149531595316953179531895319953209532195322953239532495325953269532795328953299533095331953329533395334953359533695337953389533995340953419534295343953449534595346953479534895349953509535195352953539535495355953569535795358953599536095361953629536395364953659536695367953689536995370953719537295373953749537595376953779537895379953809538195382953839538495385953869538795388953899539095391953929539395394953959539695397953989539995400954019540295403954049540595406954079540895409954109541195412954139541495415954169541795418954199542095421954229542395424954259542695427954289542995430954319543295433954349543595436954379543895439954409544195442954439544495445954469544795448954499545095451954529545395454954559545695457954589545995460954619546295463954649546595466954679546895469954709547195472954739547495475954769547795478954799548095481954829548395484954859548695487954889548995490954919549295493954949549595496954979549895499955009550195502955039550495505955069550795508955099551095511955129551395514955159551695517955189551995520955219552295523955249552595526955279552895529955309553195532955339553495535955369553795538955399554095541955429554395544955459554695547955489554995550955519555295553955549555595556955579555895559955609556195562955639556495565955669556795568955699557095571955729557395574955759557695577955789557995580955819558295583955849558595586955879558895589955909559195592955939559495595955969559795598955999560095601956029560395604956059560695607956089560995610956119561295613956149561595616956179561895619956209562195622956239562495625956269562795628956299563095631956329563395634956359563695637956389563995640956419564295643956449564595646956479564895649956509565195652956539565495655956569565795658956599566095661956629566395664956659566695667956689566995670956719567295673956749567595676956779567895679956809568195682956839568495685956869568795688956899569095691956929569395694956959569695697956989569995700957019570295703957049570595706957079570895709957109571195712957139571495715957169571795718957199572095721957229572395724957259572695727957289572995730957319573295733957349573595736957379573895739957409574195742957439574495745957469574795748957499575095751957529575395754957559575695757957589575995760957619576295763957649576595766957679576895769957709577195772957739577495775957769577795778957799578095781957829578395784957859578695787957889578995790957919579295793957949579595796957979579895799958009580195802958039580495805958069580795808958099581095811958129581395814958159581695817958189581995820958219582295823958249582595826958279582895829958309583195832958339583495835958369583795838958399584095841958429584395844958459584695847958489584995850958519585295853958549585595856958579585895859958609586195862958639586495865958669586795868958699587095871958729587395874958759587695877958789587995880958819588295883958849588595886958879588895889958909589195892958939589495895958969589795898958999590095901959029590395904959059590695907959089590995910959119591295913959149591595916959179591895919959209592195922959239592495925959269592795928959299593095931959329593395934959359593695937959389593995940959419594295943959449594595946959479594895949959509595195952959539595495955959569595795958959599596095961959629596395964959659596695967959689596995970959719597295973959749597595976959779597895979959809598195982959839598495985959869598795988959899599095991959929599395994959959599695997959989599996000960019600296003960049600596006960079600896009960109601196012960139601496015960169601796018960199602096021960229602396024960259602696027960289602996030960319603296033960349603596036960379603896039960409604196042960439604496045960469604796048960499605096051960529605396054960559605696057960589605996060960619606296063960649606596066960679606896069960709607196072960739607496075960769607796078960799608096081960829608396084960859608696087960889608996090960919609296093960949609596096960979609896099961009610196102961039610496105961069610796108961099611096111961129611396114961159611696117961189611996120961219612296123961249612596126961279612896129961309613196132961339613496135961369613796138961399614096141961429614396144961459614696147961489614996150961519615296153961549615596156961579615896159961609616196162961639616496165961669616796168961699617096171961729617396174961759617696177961789617996180961819618296183961849618596186961879618896189961909619196192961939619496195961969619796198961999620096201962029620396204962059620696207962089620996210962119621296213962149621596216962179621896219962209622196222962239622496225962269622796228962299623096231962329623396234962359623696237962389623996240962419624296243962449624596246962479624896249962509625196252962539625496255962569625796258962599626096261962629626396264962659626696267962689626996270962719627296273962749627596276962779627896279962809628196282962839628496285962869628796288962899629096291962929629396294962959629696297962989629996300963019630296303963049630596306963079630896309963109631196312963139631496315963169631796318963199632096321963229632396324963259632696327963289632996330963319633296333963349633596336963379633896339963409634196342963439634496345963469634796348963499635096351963529635396354963559635696357963589635996360963619636296363963649636596366963679636896369963709637196372963739637496375963769637796378963799638096381963829638396384963859638696387963889638996390963919639296393963949639596396963979639896399964009640196402964039640496405964069640796408964099641096411964129641396414964159641696417964189641996420964219642296423964249642596426964279642896429964309643196432964339643496435964369643796438964399644096441964429644396444964459644696447964489644996450964519645296453964549645596456964579645896459964609646196462964639646496465964669646796468964699647096471964729647396474964759647696477964789647996480964819648296483964849648596486964879648896489964909649196492964939649496495964969649796498964999650096501965029650396504965059650696507965089650996510965119651296513965149651596516965179651896519965209652196522965239652496525965269652796528965299653096531965329653396534965359653696537965389653996540965419654296543965449654596546965479654896549965509655196552965539655496555965569655796558965599656096561965629656396564965659656696567965689656996570965719657296573965749657596576965779657896579965809658196582965839658496585965869658796588965899659096591965929659396594965959659696597965989659996600966019660296603966049660596606966079660896609966109661196612966139661496615966169661796618966199662096621966229662396624966259662696627966289662996630966319663296633966349663596636966379663896639966409664196642966439664496645966469664796648966499665096651966529665396654966559665696657966589665996660966619666296663966649666596666966679666896669966709667196672966739667496675966769667796678966799668096681966829668396684966859668696687966889668996690966919669296693966949669596696966979669896699967009670196702967039670496705967069670796708967099671096711967129671396714967159671696717967189671996720967219672296723967249672596726967279672896729967309673196732967339673496735967369673796738967399674096741967429674396744967459674696747967489674996750967519675296753967549675596756967579675896759967609676196762967639676496765967669676796768967699677096771967729677396774967759677696777967789677996780967819678296783967849678596786967879678896789967909679196792967939679496795967969679796798967999680096801968029680396804968059680696807968089680996810968119681296813968149681596816968179681896819968209682196822968239682496825968269682796828968299683096831968329683396834968359683696837968389683996840968419684296843968449684596846968479684896849968509685196852968539685496855968569685796858968599686096861968629686396864968659686696867968689686996870968719687296873968749687596876968779687896879968809688196882968839688496885968869688796888968899689096891968929689396894968959689696897968989689996900969019690296903969049690596906969079690896909969109691196912969139691496915969169691796918969199692096921969229692396924969259692696927969289692996930969319693296933969349693596936969379693896939969409694196942969439694496945969469694796948969499695096951969529695396954969559695696957969589695996960969619696296963969649696596966969679696896969969709697196972969739697496975969769697796978969799698096981969829698396984969859698696987969889698996990969919699296993969949699596996969979699896999970009700197002970039700497005970069700797008970099701097011970129701397014970159701697017970189701997020970219702297023970249702597026970279702897029970309703197032970339703497035970369703797038970399704097041970429704397044970459704697047970489704997050970519705297053970549705597056970579705897059970609706197062970639706497065970669706797068970699707097071970729707397074970759707697077970789707997080970819708297083970849708597086970879708897089970909709197092970939709497095970969709797098970999710097101971029710397104971059710697107971089710997110971119711297113971149711597116971179711897119971209712197122971239712497125971269712797128971299713097131971329713397134971359713697137971389713997140971419714297143971449714597146971479714897149971509715197152971539715497155971569715797158971599716097161971629716397164971659716697167971689716997170971719717297173971749717597176971779717897179971809718197182971839718497185971869718797188971899719097191971929719397194971959719697197971989719997200972019720297203972049720597206972079720897209972109721197212972139721497215972169721797218972199722097221972229722397224972259722697227972289722997230972319723297233972349723597236972379723897239972409724197242972439724497245972469724797248972499725097251972529725397254972559725697257972589725997260972619726297263972649726597266972679726897269972709727197272972739727497275972769727797278972799728097281972829728397284972859728697287972889728997290972919729297293972949729597296972979729897299973009730197302973039730497305973069730797308973099731097311973129731397314973159731697317973189731997320973219732297323973249732597326973279732897329973309733197332973339733497335973369733797338973399734097341973429734397344973459734697347973489734997350973519735297353973549735597356973579735897359973609736197362973639736497365973669736797368973699737097371973729737397374973759737697377973789737997380973819738297383973849738597386973879738897389973909739197392973939739497395973969739797398973999740097401974029740397404974059740697407974089740997410974119741297413974149741597416974179741897419974209742197422974239742497425974269742797428974299743097431974329743397434974359743697437974389743997440974419744297443974449744597446974479744897449974509745197452974539745497455974569745797458974599746097461974629746397464974659746697467974689746997470974719747297473974749747597476974779747897479974809748197482974839748497485974869748797488974899749097491974929749397494974959749697497974989749997500975019750297503975049750597506975079750897509975109751197512975139751497515975169751797518975199752097521975229752397524975259752697527975289752997530975319753297533975349753597536975379753897539975409754197542975439754497545975469754797548975499755097551975529755397554975559755697557975589755997560975619756297563975649756597566975679756897569975709757197572975739757497575975769757797578975799758097581975829758397584975859758697587975889758997590975919759297593975949759597596975979759897599976009760197602976039760497605976069760797608976099761097611976129761397614976159761697617976189761997620976219762297623976249762597626976279762897629976309763197632976339763497635976369763797638976399764097641976429764397644976459764697647976489764997650976519765297653976549765597656976579765897659976609766197662976639766497665976669766797668976699767097671976729767397674976759767697677976789767997680976819768297683976849768597686976879768897689976909769197692976939769497695976969769797698976999770097701977029770397704977059770697707977089770997710977119771297713977149771597716977179771897719977209772197722977239772497725977269772797728977299773097731977329773397734977359773697737977389773997740977419774297743977449774597746977479774897749977509775197752977539775497755977569775797758977599776097761977629776397764977659776697767977689776997770977719777297773977749777597776977779777897779977809778197782977839778497785977869778797788977899779097791977929779397794977959779697797977989779997800978019780297803978049780597806978079780897809978109781197812978139781497815978169781797818978199782097821978229782397824978259782697827978289782997830978319783297833978349783597836978379783897839978409784197842978439784497845978469784797848978499785097851978529785397854978559785697857978589785997860978619786297863978649786597866978679786897869978709787197872978739787497875978769787797878978799788097881978829788397884978859788697887978889788997890978919789297893978949789597896978979789897899979009790197902979039790497905979069790797908979099791097911979129791397914979159791697917979189791997920979219792297923979249792597926979279792897929979309793197932979339793497935979369793797938979399794097941979429794397944979459794697947979489794997950979519795297953979549795597956979579795897959979609796197962979639796497965979669796797968979699797097971979729797397974979759797697977979789797997980979819798297983979849798597986979879798897989979909799197992979939799497995979969799797998979999800098001980029800398004980059800698007980089800998010980119801298013980149801598016980179801898019980209802198022980239802498025980269802798028980299803098031980329803398034980359803698037980389803998040980419804298043980449804598046980479804898049980509805198052980539805498055980569805798058980599806098061980629806398064980659806698067980689806998070980719807298073980749807598076980779807898079980809808198082980839808498085980869808798088980899809098091980929809398094980959809698097980989809998100981019810298103981049810598106981079810898109981109811198112981139811498115981169811798118981199812098121981229812398124981259812698127981289812998130981319813298133981349813598136981379813898139981409814198142981439814498145981469814798148981499815098151981529815398154981559815698157981589815998160981619816298163981649816598166981679816898169981709817198172981739817498175981769817798178981799818098181981829818398184981859818698187981889818998190981919819298193981949819598196981979819898199982009820198202982039820498205982069820798208982099821098211982129821398214982159821698217982189821998220982219822298223982249822598226982279822898229982309823198232982339823498235982369823798238982399824098241982429824398244982459824698247982489824998250982519825298253982549825598256982579825898259982609826198262982639826498265982669826798268982699827098271982729827398274982759827698277982789827998280982819828298283982849828598286982879828898289982909829198292982939829498295982969829798298982999830098301983029830398304983059830698307983089830998310983119831298313983149831598316983179831898319983209832198322983239832498325983269832798328983299833098331983329833398334983359833698337983389833998340983419834298343983449834598346983479834898349983509835198352983539835498355983569835798358983599836098361983629836398364983659836698367983689836998370983719837298373983749837598376983779837898379983809838198382983839838498385983869838798388983899839098391983929839398394983959839698397983989839998400984019840298403984049840598406984079840898409984109841198412984139841498415984169841798418984199842098421984229842398424984259842698427984289842998430984319843298433984349843598436984379843898439984409844198442984439844498445984469844798448984499845098451984529845398454984559845698457984589845998460984619846298463984649846598466984679846898469984709847198472984739847498475984769847798478984799848098481984829848398484984859848698487984889848998490984919849298493984949849598496984979849898499985009850198502985039850498505985069850798508985099851098511985129851398514985159851698517985189851998520985219852298523985249852598526985279852898529985309853198532985339853498535985369853798538985399854098541985429854398544985459854698547985489854998550985519855298553985549855598556985579855898559985609856198562985639856498565985669856798568985699857098571985729857398574985759857698577985789857998580985819858298583985849858598586985879858898589985909859198592985939859498595985969859798598985999860098601986029860398604986059860698607986089860998610986119861298613986149861598616986179861898619986209862198622986239862498625986269862798628986299863098631986329863398634986359863698637986389863998640986419864298643986449864598646986479864898649986509865198652986539865498655986569865798658986599866098661986629866398664986659866698667986689866998670986719867298673986749867598676986779867898679986809868198682986839868498685986869868798688986899869098691986929869398694986959869698697986989869998700987019870298703987049870598706987079870898709987109871198712987139871498715987169871798718987199872098721987229872398724987259872698727987289872998730987319873298733987349873598736987379873898739987409874198742987439874498745987469874798748987499875098751987529875398754987559875698757987589875998760987619876298763987649876598766987679876898769987709877198772987739877498775987769877798778987799878098781987829878398784987859878698787987889878998790987919879298793987949879598796987979879898799988009880198802988039880498805988069880798808988099881098811988129881398814988159881698817988189881998820988219882298823988249882598826988279882898829988309883198832988339883498835988369883798838988399884098841988429884398844988459884698847988489884998850988519885298853988549885598856988579885898859988609886198862988639886498865988669886798868988699887098871988729887398874988759887698877988789887998880988819888298883988849888598886988879888898889988909889198892988939889498895988969889798898988999890098901989029890398904989059890698907989089890998910989119891298913989149891598916989179891898919989209892198922989239892498925989269892798928989299893098931989329893398934989359893698937989389893998940989419894298943989449894598946989479894898949989509895198952989539895498955989569895798958989599896098961989629896398964989659896698967989689896998970989719897298973989749897598976989779897898979989809898198982989839898498985989869898798988989899899098991989929899398994989959899698997989989899999000990019900299003990049900599006990079900899009990109901199012990139901499015990169901799018990199902099021990229902399024990259902699027990289902999030990319903299033990349903599036990379903899039990409904199042990439904499045990469904799048990499905099051990529905399054990559905699057990589905999060990619906299063990649906599066990679906899069990709907199072990739907499075990769907799078990799908099081990829908399084990859908699087990889908999090990919909299093990949909599096990979909899099991009910199102991039910499105991069910799108991099911099111991129911399114991159911699117991189911999120991219912299123991249912599126991279912899129991309913199132991339913499135991369913799138991399914099141991429914399144991459914699147991489914999150991519915299153991549915599156991579915899159991609916199162991639916499165991669916799168991699917099171991729917399174991759917699177991789917999180991819918299183991849918599186991879918899189991909919199192991939919499195991969919799198991999920099201992029920399204992059920699207992089920999210992119921299213992149921599216992179921899219992209922199222992239922499225992269922799228992299923099231992329923399234992359923699237992389923999240992419924299243992449924599246992479924899249992509925199252992539925499255992569925799258992599926099261992629926399264992659926699267992689926999270992719927299273992749927599276992779927899279992809928199282992839928499285992869928799288992899929099291992929929399294992959929699297992989929999300993019930299303993049930599306993079930899309993109931199312993139931499315993169931799318993199932099321993229932399324993259932699327993289932999330993319933299333993349933599336993379933899339993409934199342993439934499345993469934799348993499935099351993529935399354993559935699357993589935999360993619936299363993649936599366993679936899369993709937199372993739937499375993769937799378993799938099381993829938399384993859938699387993889938999390993919939299393993949939599396993979939899399994009940199402994039940499405994069940799408994099941099411994129941399414994159941699417994189941999420994219942299423994249942599426994279942899429994309943199432994339943499435994369943799438994399944099441994429944399444994459944699447994489944999450994519945299453994549945599456994579945899459994609946199462994639946499465994669946799468994699947099471994729947399474994759947699477994789947999480994819948299483994849948599486994879948899489994909949199492994939949499495994969949799498994999950099501995029950399504995059950699507995089950999510995119951299513995149951599516995179951899519995209952199522995239952499525995269952799528995299953099531995329953399534995359953699537995389953999540995419954299543995449954599546995479954899549995509955199552995539955499555995569955799558995599956099561995629956399564995659956699567995689956999570995719957299573995749957599576995779957899579995809958199582995839958499585995869958799588995899959099591995929959399594995959959699597995989959999600996019960299603996049960599606996079960899609996109961199612996139961499615996169961799618996199962099621996229962399624996259962699627996289962999630996319963299633996349963599636996379963899639996409964199642996439964499645996469964799648996499965099651996529965399654996559965699657996589965999660996619966299663996649966599666996679966899669996709967199672996739967499675996769967799678996799968099681996829968399684996859968699687996889968999690996919969299693996949969599696996979969899699997009970199702997039970499705997069970799708997099971099711997129971399714997159971699717997189971999720997219972299723997249972599726997279972899729997309973199732997339973499735997369973799738997399974099741997429974399744997459974699747997489974999750997519975299753997549975599756997579975899759997609976199762997639976499765997669976799768997699977099771997729977399774997759977699777997789977999780997819978299783997849978599786997879978899789997909979199792997939979499795997969979799798997999980099801998029980399804998059980699807998089980999810998119981299813998149981599816998179981899819998209982199822998239982499825998269982799828998299983099831998329983399834998359983699837998389983999840998419984299843998449984599846998479984899849998509985199852998539985499855998569985799858998599986099861998629986399864998659986699867998689986999870998719987299873998749987599876998779987899879998809988199882998839988499885998869988799888998899989099891998929989399894998959989699897998989989999900999019990299903999049990599906999079990899909999109991199912999139991499915999169991799918999199992099921999229992399924999259992699927999289992999930999319993299933999349993599936999379993899939999409994199942999439994499945999469994799948999499995099951999529995399954999559995699957999589995999960999619996299963999649996599966999679996899969999709997199972999739997499975999769997799978999799998099981999829998399984999859998699987999889998999990999919999299993999949999599996999979999899999100000100001100002100003100004100005100006100007100008100009100010100011100012100013100014100015100016100017100018100019100020100021100022100023100024100025100026100027100028100029100030100031100032100033100034100035100036100037100038100039100040100041100042100043100044100045100046100047100048100049100050100051100052100053100054100055100056100057100058100059100060100061100062100063100064100065100066100067100068100069100070100071100072100073100074100075100076100077100078100079100080100081100082100083100084100085100086100087100088100089100090100091100092100093100094100095100096100097100098100099100100100101100102100103100104100105100106100107100108100109100110100111100112100113100114100115100116100117100118100119100120100121100122100123100124100125100126100127100128100129100130100131100132100133100134100135100136100137100138100139100140100141100142100143100144100145100146100147100148100149100150100151100152100153100154100155100156100157100158100159100160100161100162100163100164100165100166100167100168100169100170100171100172100173100174100175100176100177100178100179100180100181100182100183100184100185100186100187100188100189100190100191100192100193100194100195100196100197100198100199100200100201100202100203100204100205100206100207100208100209100210100211100212100213100214100215100216100217100218100219100220100221100222100223100224100225100226100227100228100229100230100231100232100233100234100235100236100237100238100239100240100241100242100243100244100245100246100247100248100249100250100251100252100253100254100255100256100257100258100259100260100261100262100263100264100265100266100267100268100269100270100271100272100273100274100275100276100277100278100279100280100281100282100283100284100285100286100287100288100289100290100291100292100293100294100295100296100297100298100299100300100301100302100303100304100305100306100307100308100309100310100311100312100313100314100315100316100317100318100319100320100321100322100323100324100325100326100327100328100329100330100331100332100333100334100335100336100337100338100339100340100341100342100343100344100345100346100347100348100349100350100351100352100353100354100355100356100357100358100359100360100361100362100363100364100365100366100367100368100369100370100371100372100373100374100375100376100377100378100379100380100381100382100383100384100385100386100387100388100389100390100391100392100393100394100395100396100397100398100399100400100401100402100403100404100405100406100407100408100409100410100411100412100413100414100415100416100417100418100419100420100421100422100423100424100425100426100427100428100429100430100431100432100433100434100435100436100437100438100439100440100441100442100443100444100445100446100447100448100449100450100451100452100453100454100455100456100457100458100459100460100461100462100463100464100465100466100467100468100469100470100471100472100473100474100475100476100477100478100479100480100481100482100483100484100485100486100487100488100489100490100491100492100493100494100495100496100497100498100499100500100501100502100503100504100505100506100507100508100509100510100511100512100513100514100515100516100517100518100519100520100521100522100523100524100525100526100527100528100529100530100531100532100533100534100535100536100537100538100539100540100541100542100543100544100545100546100547100548100549100550100551100552100553100554100555100556100557100558100559100560100561100562100563100564100565100566100567100568100569100570100571100572100573100574100575100576100577100578100579100580100581100582100583100584100585100586100587100588100589100590100591100592100593100594100595100596100597100598100599100600100601100602100603100604100605100606100607100608100609100610100611100612100613100614100615100616100617100618100619100620100621100622100623100624100625100626100627100628100629100630100631100632100633100634100635100636100637100638100639100640100641100642100643100644100645100646100647100648100649100650100651100652100653100654100655100656100657100658100659100660100661100662100663100664100665100666100667100668100669100670100671100672100673100674100675100676100677100678100679100680100681100682100683100684100685100686100687100688100689100690100691100692100693100694100695100696100697100698100699100700100701100702100703100704100705100706100707100708100709100710100711100712100713100714100715100716100717100718100719100720100721100722100723100724100725100726100727100728100729100730100731100732100733100734100735100736100737100738100739100740100741100742100743100744100745100746100747100748100749100750100751100752100753100754100755100756100757100758100759100760100761100762100763100764100765100766100767100768100769100770100771100772100773100774100775100776100777100778100779100780100781100782100783100784100785100786100787100788100789100790100791100792100793100794100795100796100797100798100799100800100801100802100803100804100805100806100807100808100809100810100811100812100813100814100815100816100817100818100819100820100821100822100823100824100825100826100827100828100829100830100831100832100833100834100835100836100837100838100839100840100841100842100843100844100845100846100847100848100849100850100851100852100853100854100855100856100857100858100859100860100861100862100863100864100865100866100867100868100869100870100871100872100873100874100875100876100877100878100879100880100881100882100883100884100885100886100887100888100889100890100891100892100893100894100895100896100897100898100899100900100901100902100903100904100905100906100907100908100909100910100911100912100913100914100915100916100917100918100919100920100921100922100923100924100925100926100927100928100929100930100931100932100933100934100935100936100937100938100939100940100941100942100943100944100945100946100947100948100949100950100951100952100953100954100955100956100957100958100959100960100961100962100963100964100965100966100967100968100969100970100971100972100973100974100975100976100977100978100979100980100981100982100983100984100985100986100987100988100989100990100991100992100993100994100995100996100997100998100999101000101001101002101003101004101005101006101007101008101009101010101011101012101013101014101015101016101017101018101019101020101021101022101023101024101025101026101027101028101029101030101031101032101033101034101035101036101037101038101039101040101041101042101043101044101045101046101047101048101049101050101051101052101053101054101055101056101057101058101059101060101061101062101063101064101065101066101067101068101069101070101071101072101073101074101075101076101077101078101079101080101081101082101083101084101085101086101087101088101089101090101091101092101093101094101095101096101097101098101099101100101101101102101103101104101105101106101107101108101109101110101111101112101113101114101115101116101117101118101119101120101121101122101123101124101125101126101127101128101129101130101131101132101133101134101135101136101137101138101139101140101141101142101143101144101145101146101147101148101149101150101151101152101153101154101155101156101157101158101159101160101161101162101163101164101165101166101167101168101169101170101171101172101173101174101175101176101177101178101179101180101181101182101183101184101185101186101187101188101189101190101191101192101193101194101195101196101197101198101199101200101201101202101203101204101205101206101207101208101209101210101211101212101213101214101215101216101217101218101219101220101221101222101223101224101225101226101227101228101229101230101231101232101233101234101235101236101237101238101239101240101241101242101243101244101245101246101247101248101249101250101251101252101253101254101255101256101257101258101259101260101261101262101263101264101265101266101267101268101269101270101271101272
  1. /*!
  2. *
  3. * iclient-maplibregl
  4. * Copyright© 2000 - 2023 SuperMap Software Co.Ltd
  5. * license: Apache-2.0
  6. * version: v11.1.0
  7. *
  8. */
  9. /******/ (function() { // webpackBootstrap
  10. /******/ var __webpack_modules__ = ({
  11. /***/ 5023:
  12. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  13. "use strict";
  14. var parent = __webpack_require__(6727);
  15. module.exports = parent;
  16. /***/ }),
  17. /***/ 3123:
  18. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  19. "use strict";
  20. var parent = __webpack_require__(8690);
  21. module.exports = parent;
  22. /***/ }),
  23. /***/ 879:
  24. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  25. "use strict";
  26. __webpack_require__(7422);
  27. var path = __webpack_require__(97);
  28. module.exports = path.Object.assign;
  29. /***/ }),
  30. /***/ 3723:
  31. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  32. "use strict";
  33. __webpack_require__(4835);
  34. var WrappedWellKnownSymbolModule = __webpack_require__(8384);
  35. module.exports = WrappedWellKnownSymbolModule.f('asyncIterator');
  36. /***/ }),
  37. /***/ 5980:
  38. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  39. "use strict";
  40. var isCallable = __webpack_require__(729);
  41. var tryToString = __webpack_require__(8434);
  42. var $TypeError = TypeError;
  43. // `Assert: IsCallable(argument) is true`
  44. module.exports = function (argument) {
  45. if (isCallable(argument)) return argument;
  46. throw $TypeError(tryToString(argument) + ' is not a function');
  47. };
  48. /***/ }),
  49. /***/ 7563:
  50. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  51. "use strict";
  52. var isObject = __webpack_require__(691);
  53. var $String = String;
  54. var $TypeError = TypeError;
  55. // `Assert: Type(argument) is Object`
  56. module.exports = function (argument) {
  57. if (isObject(argument)) return argument;
  58. throw $TypeError($String(argument) + ' is not an object');
  59. };
  60. /***/ }),
  61. /***/ 8632:
  62. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  63. "use strict";
  64. var toIndexedObject = __webpack_require__(6462);
  65. var toAbsoluteIndex = __webpack_require__(5333);
  66. var lengthOfArrayLike = __webpack_require__(6803);
  67. // `Array.prototype.{ indexOf, includes }` methods implementation
  68. var createMethod = function createMethod(IS_INCLUDES) {
  69. return function ($this, el, fromIndex) {
  70. var O = toIndexedObject($this);
  71. var length = lengthOfArrayLike(O);
  72. var index = toAbsoluteIndex(fromIndex, length);
  73. var value;
  74. // Array#includes uses SameValueZero equality algorithm
  75. // eslint-disable-next-line no-self-compare -- NaN check
  76. if (IS_INCLUDES && el != el) while (length > index) {
  77. value = O[index++];
  78. // eslint-disable-next-line no-self-compare -- NaN check
  79. if (value != value) return true;
  80. // Array#indexOf ignores holes, Array#includes - not
  81. } else for (; length > index; index++) {
  82. if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
  83. }
  84. return !IS_INCLUDES && -1;
  85. };
  86. };
  87. module.exports = {
  88. // `Array.prototype.includes` method
  89. // https://tc39.es/ecma262/#sec-array.prototype.includes
  90. includes: createMethod(true),
  91. // `Array.prototype.indexOf` method
  92. // https://tc39.es/ecma262/#sec-array.prototype.indexof
  93. indexOf: createMethod(false)
  94. };
  95. /***/ }),
  96. /***/ 2177:
  97. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  98. "use strict";
  99. var uncurryThis = __webpack_require__(9738);
  100. var toString = uncurryThis({}.toString);
  101. var stringSlice = uncurryThis(''.slice);
  102. module.exports = function (it) {
  103. return stringSlice(toString(it), 8, -1);
  104. };
  105. /***/ }),
  106. /***/ 9029:
  107. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  108. "use strict";
  109. var hasOwn = __webpack_require__(1675);
  110. var ownKeys = __webpack_require__(9402);
  111. var getOwnPropertyDescriptorModule = __webpack_require__(7238);
  112. var definePropertyModule = __webpack_require__(704);
  113. module.exports = function (target, source, exceptions) {
  114. var keys = ownKeys(source);
  115. var defineProperty = definePropertyModule.f;
  116. var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
  117. for (var i = 0; i < keys.length; i++) {
  118. var key = keys[i];
  119. if (!hasOwn(target, key) && !(exceptions && hasOwn(exceptions, key))) {
  120. defineProperty(target, key, getOwnPropertyDescriptor(source, key));
  121. }
  122. }
  123. };
  124. /***/ }),
  125. /***/ 8268:
  126. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  127. "use strict";
  128. var DESCRIPTORS = __webpack_require__(6539);
  129. var definePropertyModule = __webpack_require__(704);
  130. var createPropertyDescriptor = __webpack_require__(4925);
  131. module.exports = DESCRIPTORS ? function (object, key, value) {
  132. return definePropertyModule.f(object, key, createPropertyDescriptor(1, value));
  133. } : function (object, key, value) {
  134. object[key] = value;
  135. return object;
  136. };
  137. /***/ }),
  138. /***/ 4925:
  139. /***/ (function(module) {
  140. "use strict";
  141. module.exports = function (bitmap, value) {
  142. return {
  143. enumerable: !(bitmap & 1),
  144. configurable: !(bitmap & 2),
  145. writable: !(bitmap & 4),
  146. value: value
  147. };
  148. };
  149. /***/ }),
  150. /***/ 7454:
  151. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  152. "use strict";
  153. var isCallable = __webpack_require__(729);
  154. var definePropertyModule = __webpack_require__(704);
  155. var makeBuiltIn = __webpack_require__(7948);
  156. var defineGlobalProperty = __webpack_require__(161);
  157. module.exports = function (O, key, value, options) {
  158. if (!options) options = {};
  159. var simple = options.enumerable;
  160. var name = options.name !== undefined ? options.name : key;
  161. if (isCallable(value)) makeBuiltIn(value, name, options);
  162. if (options.global) {
  163. if (simple) O[key] = value;else defineGlobalProperty(key, value);
  164. } else {
  165. try {
  166. if (!options.unsafe) delete O[key];else if (O[key]) simple = true;
  167. } catch (error) {/* empty */}
  168. if (simple) O[key] = value;else definePropertyModule.f(O, key, {
  169. value: value,
  170. enumerable: false,
  171. configurable: !options.nonConfigurable,
  172. writable: !options.nonWritable
  173. });
  174. }
  175. return O;
  176. };
  177. /***/ }),
  178. /***/ 161:
  179. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  180. "use strict";
  181. var global = __webpack_require__(5835);
  182. // eslint-disable-next-line es/no-object-defineproperty -- safe
  183. var defineProperty = Object.defineProperty;
  184. module.exports = function (key, value) {
  185. try {
  186. defineProperty(global, key, {
  187. value: value,
  188. configurable: true,
  189. writable: true
  190. });
  191. } catch (error) {
  192. global[key] = value;
  193. }
  194. return value;
  195. };
  196. /***/ }),
  197. /***/ 6539:
  198. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  199. "use strict";
  200. var fails = __webpack_require__(6583);
  201. // Detect IE8's incomplete defineProperty implementation
  202. module.exports = !fails(function () {
  203. // eslint-disable-next-line es/no-object-defineproperty -- required for testing
  204. return Object.defineProperty({}, 1, {
  205. get: function get() {
  206. return 7;
  207. }
  208. })[1] != 7;
  209. });
  210. /***/ }),
  211. /***/ 9967:
  212. /***/ (function(module) {
  213. "use strict";
  214. function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
  215. var documentAll = (typeof document === "undefined" ? "undefined" : _typeof(document)) == 'object' && document.all;
  216. // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot
  217. // eslint-disable-next-line unicorn/no-typeof-undefined -- required for testing
  218. var IS_HTMLDDA = typeof documentAll == 'undefined' && documentAll !== undefined;
  219. module.exports = {
  220. all: documentAll,
  221. IS_HTMLDDA: IS_HTMLDDA
  222. };
  223. /***/ }),
  224. /***/ 3343:
  225. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  226. "use strict";
  227. var global = __webpack_require__(5835);
  228. var isObject = __webpack_require__(691);
  229. var document = global.document;
  230. // typeof document.createElement is 'object' in old IE
  231. var EXISTS = isObject(document) && isObject(document.createElement);
  232. module.exports = function (it) {
  233. return EXISTS ? document.createElement(it) : {};
  234. };
  235. /***/ }),
  236. /***/ 1785:
  237. /***/ (function(module) {
  238. "use strict";
  239. module.exports = typeof navigator != 'undefined' && String(navigator.userAgent) || '';
  240. /***/ }),
  241. /***/ 9282:
  242. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  243. "use strict";
  244. var global = __webpack_require__(5835);
  245. var userAgent = __webpack_require__(1785);
  246. var process = global.process;
  247. var Deno = global.Deno;
  248. var versions = process && process.versions || Deno && Deno.version;
  249. var v8 = versions && versions.v8;
  250. var match, version;
  251. if (v8) {
  252. match = v8.split('.');
  253. // in old Chrome, versions of V8 isn't V8 = Chrome / 10
  254. // but their correct versions are not interesting for us
  255. version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
  256. }
  257. // BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
  258. // so check `userAgent` even if `.v8` exists, but 0
  259. if (!version && userAgent) {
  260. match = userAgent.match(/Edge\/(\d+)/);
  261. if (!match || match[1] >= 74) {
  262. match = userAgent.match(/Chrome\/(\d+)/);
  263. if (match) version = +match[1];
  264. }
  265. }
  266. module.exports = version;
  267. /***/ }),
  268. /***/ 8525:
  269. /***/ (function(module) {
  270. "use strict";
  271. // IE8- don't enum bug keys
  272. module.exports = ['constructor', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'toLocaleString', 'toString', 'valueOf'];
  273. /***/ }),
  274. /***/ 7926:
  275. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  276. "use strict";
  277. function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
  278. var global = __webpack_require__(5835);
  279. var getOwnPropertyDescriptor = (__webpack_require__(7238).f);
  280. var createNonEnumerableProperty = __webpack_require__(8268);
  281. var defineBuiltIn = __webpack_require__(7454);
  282. var defineGlobalProperty = __webpack_require__(161);
  283. var copyConstructorProperties = __webpack_require__(9029);
  284. var isForced = __webpack_require__(3175);
  285. /*
  286. options.target - name of the target object
  287. options.global - target is the global object
  288. options.stat - export as static methods of target
  289. options.proto - export as prototype methods of target
  290. options.real - real prototype method for the `pure` version
  291. options.forced - export even if the native feature is available
  292. options.bind - bind methods to the target, required for the `pure` version
  293. options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
  294. options.unsafe - use the simple assignment of property instead of delete + defineProperty
  295. options.sham - add a flag to not completely full polyfills
  296. options.enumerable - export as enumerable property
  297. options.dontCallGetSet - prevent calling a getter on target
  298. options.name - the .name of the function if it does not match the key
  299. */
  300. module.exports = function (options, source) {
  301. var TARGET = options.target;
  302. var GLOBAL = options.global;
  303. var STATIC = options.stat;
  304. var FORCED, target, key, targetProperty, sourceProperty, descriptor;
  305. if (GLOBAL) {
  306. target = global;
  307. } else if (STATIC) {
  308. target = global[TARGET] || defineGlobalProperty(TARGET, {});
  309. } else {
  310. target = (global[TARGET] || {}).prototype;
  311. }
  312. if (target) for (key in source) {
  313. sourceProperty = source[key];
  314. if (options.dontCallGetSet) {
  315. descriptor = getOwnPropertyDescriptor(target, key);
  316. targetProperty = descriptor && descriptor.value;
  317. } else targetProperty = target[key];
  318. FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
  319. // contained in target
  320. if (!FORCED && targetProperty !== undefined) {
  321. if (_typeof(sourceProperty) == _typeof(targetProperty)) continue;
  322. copyConstructorProperties(sourceProperty, targetProperty);
  323. }
  324. // add a flag to not completely full polyfills
  325. if (options.sham || targetProperty && targetProperty.sham) {
  326. createNonEnumerableProperty(sourceProperty, 'sham', true);
  327. }
  328. defineBuiltIn(target, key, sourceProperty, options);
  329. }
  330. };
  331. /***/ }),
  332. /***/ 6583:
  333. /***/ (function(module) {
  334. "use strict";
  335. module.exports = function (exec) {
  336. try {
  337. return !!exec();
  338. } catch (error) {
  339. return true;
  340. }
  341. };
  342. /***/ }),
  343. /***/ 9096:
  344. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  345. "use strict";
  346. var fails = __webpack_require__(6583);
  347. module.exports = !fails(function () {
  348. // eslint-disable-next-line es/no-function-prototype-bind -- safe
  349. var test = function () {/* empty */}.bind();
  350. // eslint-disable-next-line no-prototype-builtins -- safe
  351. return typeof test != 'function' || test.hasOwnProperty('prototype');
  352. });
  353. /***/ }),
  354. /***/ 5057:
  355. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  356. "use strict";
  357. var NATIVE_BIND = __webpack_require__(9096);
  358. var call = Function.prototype.call;
  359. module.exports = NATIVE_BIND ? call.bind(call) : function () {
  360. return call.apply(call, arguments);
  361. };
  362. /***/ }),
  363. /***/ 1864:
  364. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  365. "use strict";
  366. var DESCRIPTORS = __webpack_require__(6539);
  367. var hasOwn = __webpack_require__(1675);
  368. var FunctionPrototype = Function.prototype;
  369. // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
  370. var getDescriptor = DESCRIPTORS && Object.getOwnPropertyDescriptor;
  371. var EXISTS = hasOwn(FunctionPrototype, 'name');
  372. // additional protection from minified / mangled / dropped function names
  373. var PROPER = EXISTS && function something() {/* empty */}.name === 'something';
  374. var CONFIGURABLE = EXISTS && (!DESCRIPTORS || DESCRIPTORS && getDescriptor(FunctionPrototype, 'name').configurable);
  375. module.exports = {
  376. EXISTS: EXISTS,
  377. PROPER: PROPER,
  378. CONFIGURABLE: CONFIGURABLE
  379. };
  380. /***/ }),
  381. /***/ 9738:
  382. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  383. "use strict";
  384. var NATIVE_BIND = __webpack_require__(9096);
  385. var FunctionPrototype = Function.prototype;
  386. var call = FunctionPrototype.call;
  387. var uncurryThisWithBind = NATIVE_BIND && FunctionPrototype.bind.bind(call, call);
  388. module.exports = NATIVE_BIND ? uncurryThisWithBind : function (fn) {
  389. return function () {
  390. return call.apply(fn, arguments);
  391. };
  392. };
  393. /***/ }),
  394. /***/ 8078:
  395. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  396. "use strict";
  397. var global = __webpack_require__(5835);
  398. var isCallable = __webpack_require__(729);
  399. var aFunction = function aFunction(argument) {
  400. return isCallable(argument) ? argument : undefined;
  401. };
  402. module.exports = function (namespace, method) {
  403. return arguments.length < 2 ? aFunction(global[namespace]) : global[namespace] && global[namespace][method];
  404. };
  405. /***/ }),
  406. /***/ 2337:
  407. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  408. "use strict";
  409. var aCallable = __webpack_require__(5980);
  410. var isNullOrUndefined = __webpack_require__(6254);
  411. // `GetMethod` abstract operation
  412. // https://tc39.es/ecma262/#sec-getmethod
  413. module.exports = function (V, P) {
  414. var func = V[P];
  415. return isNullOrUndefined(func) ? undefined : aCallable(func);
  416. };
  417. /***/ }),
  418. /***/ 5835:
  419. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  420. "use strict";
  421. function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
  422. var check = function check(it) {
  423. return it && it.Math == Math && it;
  424. };
  425. // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
  426. module.exports =
  427. // eslint-disable-next-line es/no-global-this -- safe
  428. check((typeof globalThis === "undefined" ? "undefined" : _typeof(globalThis)) == 'object' && globalThis) || check((typeof window === "undefined" ? "undefined" : _typeof(window)) == 'object' && window) ||
  429. // eslint-disable-next-line no-restricted-globals -- safe
  430. check((typeof self === "undefined" ? "undefined" : _typeof(self)) == 'object' && self) || check((typeof __webpack_require__.g === "undefined" ? "undefined" : _typeof(__webpack_require__.g)) == 'object' && __webpack_require__.g) ||
  431. // eslint-disable-next-line no-new-func -- fallback
  432. function () {
  433. return this;
  434. }() || this || Function('return this')();
  435. /***/ }),
  436. /***/ 1675:
  437. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  438. "use strict";
  439. var uncurryThis = __webpack_require__(9738);
  440. var toObject = __webpack_require__(5825);
  441. var hasOwnProperty = uncurryThis({}.hasOwnProperty);
  442. // `HasOwnProperty` abstract operation
  443. // https://tc39.es/ecma262/#sec-hasownproperty
  444. // eslint-disable-next-line es/no-object-hasown -- safe
  445. module.exports = Object.hasOwn || function hasOwn(it, key) {
  446. return hasOwnProperty(toObject(it), key);
  447. };
  448. /***/ }),
  449. /***/ 940:
  450. /***/ (function(module) {
  451. "use strict";
  452. module.exports = {};
  453. /***/ }),
  454. /***/ 2175:
  455. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  456. "use strict";
  457. var DESCRIPTORS = __webpack_require__(6539);
  458. var fails = __webpack_require__(6583);
  459. var createElement = __webpack_require__(3343);
  460. // Thanks to IE8 for its funny defineProperty
  461. module.exports = !DESCRIPTORS && !fails(function () {
  462. // eslint-disable-next-line es/no-object-defineproperty -- required for testing
  463. return Object.defineProperty(createElement('div'), 'a', {
  464. get: function get() {
  465. return 7;
  466. }
  467. }).a != 7;
  468. });
  469. /***/ }),
  470. /***/ 5407:
  471. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  472. "use strict";
  473. var uncurryThis = __webpack_require__(9738);
  474. var fails = __webpack_require__(6583);
  475. var classof = __webpack_require__(2177);
  476. var $Object = Object;
  477. var split = uncurryThis(''.split);
  478. // fallback for non-array-like ES3 and non-enumerable old V8 strings
  479. module.exports = fails(function () {
  480. // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
  481. // eslint-disable-next-line no-prototype-builtins -- safe
  482. return !$Object('z').propertyIsEnumerable(0);
  483. }) ? function (it) {
  484. return classof(it) == 'String' ? split(it, '') : $Object(it);
  485. } : $Object;
  486. /***/ }),
  487. /***/ 6111:
  488. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  489. "use strict";
  490. var uncurryThis = __webpack_require__(9738);
  491. var isCallable = __webpack_require__(729);
  492. var store = __webpack_require__(9700);
  493. var functionToString = uncurryThis(Function.toString);
  494. // this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
  495. if (!isCallable(store.inspectSource)) {
  496. store.inspectSource = function (it) {
  497. return functionToString(it);
  498. };
  499. }
  500. module.exports = store.inspectSource;
  501. /***/ }),
  502. /***/ 4751:
  503. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  504. "use strict";
  505. var NATIVE_WEAK_MAP = __webpack_require__(9801);
  506. var global = __webpack_require__(5835);
  507. var isObject = __webpack_require__(691);
  508. var createNonEnumerableProperty = __webpack_require__(8268);
  509. var hasOwn = __webpack_require__(1675);
  510. var shared = __webpack_require__(9700);
  511. var sharedKey = __webpack_require__(7307);
  512. var hiddenKeys = __webpack_require__(940);
  513. var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
  514. var TypeError = global.TypeError;
  515. var WeakMap = global.WeakMap;
  516. var set, get, has;
  517. var enforce = function enforce(it) {
  518. return has(it) ? get(it) : set(it, {});
  519. };
  520. var getterFor = function getterFor(TYPE) {
  521. return function (it) {
  522. var state;
  523. if (!isObject(it) || (state = get(it)).type !== TYPE) {
  524. throw TypeError('Incompatible receiver, ' + TYPE + ' required');
  525. }
  526. return state;
  527. };
  528. };
  529. if (NATIVE_WEAK_MAP || shared.state) {
  530. var store = shared.state || (shared.state = new WeakMap());
  531. /* eslint-disable no-self-assign -- prototype methods protection */
  532. store.get = store.get;
  533. store.has = store.has;
  534. store.set = store.set;
  535. /* eslint-enable no-self-assign -- prototype methods protection */
  536. set = function set(it, metadata) {
  537. if (store.has(it)) throw TypeError(OBJECT_ALREADY_INITIALIZED);
  538. metadata.facade = it;
  539. store.set(it, metadata);
  540. return metadata;
  541. };
  542. get = function get(it) {
  543. return store.get(it) || {};
  544. };
  545. has = function has(it) {
  546. return store.has(it);
  547. };
  548. } else {
  549. var STATE = sharedKey('state');
  550. hiddenKeys[STATE] = true;
  551. set = function set(it, metadata) {
  552. if (hasOwn(it, STATE)) throw TypeError(OBJECT_ALREADY_INITIALIZED);
  553. metadata.facade = it;
  554. createNonEnumerableProperty(it, STATE, metadata);
  555. return metadata;
  556. };
  557. get = function get(it) {
  558. return hasOwn(it, STATE) ? it[STATE] : {};
  559. };
  560. has = function has(it) {
  561. return hasOwn(it, STATE);
  562. };
  563. }
  564. module.exports = {
  565. set: set,
  566. get: get,
  567. has: has,
  568. enforce: enforce,
  569. getterFor: getterFor
  570. };
  571. /***/ }),
  572. /***/ 729:
  573. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  574. "use strict";
  575. var $documentAll = __webpack_require__(9967);
  576. var documentAll = $documentAll.all;
  577. // `IsCallable` abstract operation
  578. // https://tc39.es/ecma262/#sec-iscallable
  579. module.exports = $documentAll.IS_HTMLDDA ? function (argument) {
  580. return typeof argument == 'function' || argument === documentAll;
  581. } : function (argument) {
  582. return typeof argument == 'function';
  583. };
  584. /***/ }),
  585. /***/ 3175:
  586. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  587. "use strict";
  588. var fails = __webpack_require__(6583);
  589. var isCallable = __webpack_require__(729);
  590. var replacement = /#|\.prototype\./;
  591. var isForced = function isForced(feature, detection) {
  592. var value = data[normalize(feature)];
  593. return value == POLYFILL ? true : value == NATIVE ? false : isCallable(detection) ? fails(detection) : !!detection;
  594. };
  595. var normalize = isForced.normalize = function (string) {
  596. return String(string).replace(replacement, '.').toLowerCase();
  597. };
  598. var data = isForced.data = {};
  599. var NATIVE = isForced.NATIVE = 'N';
  600. var POLYFILL = isForced.POLYFILL = 'P';
  601. module.exports = isForced;
  602. /***/ }),
  603. /***/ 6254:
  604. /***/ (function(module) {
  605. "use strict";
  606. // we can't use just `it == null` since of `document.all` special case
  607. // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot-aec
  608. module.exports = function (it) {
  609. return it === null || it === undefined;
  610. };
  611. /***/ }),
  612. /***/ 691:
  613. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  614. "use strict";
  615. function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
  616. var isCallable = __webpack_require__(729);
  617. var $documentAll = __webpack_require__(9967);
  618. var documentAll = $documentAll.all;
  619. module.exports = $documentAll.IS_HTMLDDA ? function (it) {
  620. return _typeof(it) == 'object' ? it !== null : isCallable(it) || it === documentAll;
  621. } : function (it) {
  622. return _typeof(it) == 'object' ? it !== null : isCallable(it);
  623. };
  624. /***/ }),
  625. /***/ 1437:
  626. /***/ (function(module) {
  627. "use strict";
  628. module.exports = false;
  629. /***/ }),
  630. /***/ 4192:
  631. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  632. "use strict";
  633. function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
  634. var getBuiltIn = __webpack_require__(8078);
  635. var isCallable = __webpack_require__(729);
  636. var isPrototypeOf = __webpack_require__(5522);
  637. var USE_SYMBOL_AS_UID = __webpack_require__(7860);
  638. var $Object = Object;
  639. module.exports = USE_SYMBOL_AS_UID ? function (it) {
  640. return _typeof(it) == 'symbol';
  641. } : function (it) {
  642. var $Symbol = getBuiltIn('Symbol');
  643. return isCallable($Symbol) && isPrototypeOf($Symbol.prototype, $Object(it));
  644. };
  645. /***/ }),
  646. /***/ 6803:
  647. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  648. "use strict";
  649. var toLength = __webpack_require__(5108);
  650. // `LengthOfArrayLike` abstract operation
  651. // https://tc39.es/ecma262/#sec-lengthofarraylike
  652. module.exports = function (obj) {
  653. return toLength(obj.length);
  654. };
  655. /***/ }),
  656. /***/ 7948:
  657. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  658. "use strict";
  659. var uncurryThis = __webpack_require__(9738);
  660. var fails = __webpack_require__(6583);
  661. var isCallable = __webpack_require__(729);
  662. var hasOwn = __webpack_require__(1675);
  663. var DESCRIPTORS = __webpack_require__(6539);
  664. var CONFIGURABLE_FUNCTION_NAME = (__webpack_require__(1864).CONFIGURABLE);
  665. var inspectSource = __webpack_require__(6111);
  666. var InternalStateModule = __webpack_require__(4751);
  667. var enforceInternalState = InternalStateModule.enforce;
  668. var getInternalState = InternalStateModule.get;
  669. var $String = String;
  670. // eslint-disable-next-line es/no-object-defineproperty -- safe
  671. var defineProperty = Object.defineProperty;
  672. var stringSlice = uncurryThis(''.slice);
  673. var replace = uncurryThis(''.replace);
  674. var join = uncurryThis([].join);
  675. var CONFIGURABLE_LENGTH = DESCRIPTORS && !fails(function () {
  676. return defineProperty(function () {/* empty */}, 'length', {
  677. value: 8
  678. }).length !== 8;
  679. });
  680. var TEMPLATE = String(String).split('String');
  681. var makeBuiltIn = module.exports = function (value, name, options) {
  682. if (stringSlice($String(name), 0, 7) === 'Symbol(') {
  683. name = '[' + replace($String(name), /^Symbol\(([^)]*)\)/, '$1') + ']';
  684. }
  685. if (options && options.getter) name = 'get ' + name;
  686. if (options && options.setter) name = 'set ' + name;
  687. if (!hasOwn(value, 'name') || CONFIGURABLE_FUNCTION_NAME && value.name !== name) {
  688. if (DESCRIPTORS) defineProperty(value, 'name', {
  689. value: name,
  690. configurable: true
  691. });else value.name = name;
  692. }
  693. if (CONFIGURABLE_LENGTH && options && hasOwn(options, 'arity') && value.length !== options.arity) {
  694. defineProperty(value, 'length', {
  695. value: options.arity
  696. });
  697. }
  698. try {
  699. if (options && hasOwn(options, 'constructor') && options.constructor) {
  700. if (DESCRIPTORS) defineProperty(value, 'prototype', {
  701. writable: false
  702. });
  703. // in V8 ~ Chrome 53, prototypes of some methods, like `Array.prototype.values`, are non-writable
  704. } else if (value.prototype) value.prototype = undefined;
  705. } catch (error) {/* empty */}
  706. var state = enforceInternalState(value);
  707. if (!hasOwn(state, 'source')) {
  708. state.source = join(TEMPLATE, typeof name == 'string' ? name : '');
  709. }
  710. return value;
  711. };
  712. // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
  713. // eslint-disable-next-line no-extend-native -- required
  714. Function.prototype.toString = makeBuiltIn(function toString() {
  715. return isCallable(this) && getInternalState(this).source || inspectSource(this);
  716. }, 'toString');
  717. /***/ }),
  718. /***/ 4920:
  719. /***/ (function(module) {
  720. "use strict";
  721. var ceil = Math.ceil;
  722. var floor = Math.floor;
  723. // `Math.trunc` method
  724. // https://tc39.es/ecma262/#sec-math.trunc
  725. // eslint-disable-next-line es/no-math-trunc -- safe
  726. module.exports = Math.trunc || function trunc(x) {
  727. var n = +x;
  728. return (n > 0 ? floor : ceil)(n);
  729. };
  730. /***/ }),
  731. /***/ 7328:
  732. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  733. "use strict";
  734. var DESCRIPTORS = __webpack_require__(6539);
  735. var uncurryThis = __webpack_require__(9738);
  736. var call = __webpack_require__(5057);
  737. var fails = __webpack_require__(6583);
  738. var objectKeys = __webpack_require__(5403);
  739. var getOwnPropertySymbolsModule = __webpack_require__(7485);
  740. var propertyIsEnumerableModule = __webpack_require__(5339);
  741. var toObject = __webpack_require__(5825);
  742. var IndexedObject = __webpack_require__(5407);
  743. // eslint-disable-next-line es/no-object-assign -- safe
  744. var $assign = Object.assign;
  745. // eslint-disable-next-line es/no-object-defineproperty -- required for testing
  746. var defineProperty = Object.defineProperty;
  747. var concat = uncurryThis([].concat);
  748. // `Object.assign` method
  749. // https://tc39.es/ecma262/#sec-object.assign
  750. module.exports = !$assign || fails(function () {
  751. // should have correct order of operations (Edge bug)
  752. if (DESCRIPTORS && $assign({
  753. b: 1
  754. }, $assign(defineProperty({}, 'a', {
  755. enumerable: true,
  756. get: function get() {
  757. defineProperty(this, 'b', {
  758. value: 3,
  759. enumerable: false
  760. });
  761. }
  762. }), {
  763. b: 2
  764. })).b !== 1) return true;
  765. // should work with symbols and should have deterministic property order (V8 bug)
  766. var A = {};
  767. var B = {};
  768. // eslint-disable-next-line es/no-symbol -- safe
  769. var symbol = Symbol();
  770. var alphabet = 'abcdefghijklmnopqrst';
  771. A[symbol] = 7;
  772. alphabet.split('').forEach(function (chr) {
  773. B[chr] = chr;
  774. });
  775. return $assign({}, A)[symbol] != 7 || objectKeys($assign({}, B)).join('') != alphabet;
  776. }) ? function assign(target, source) {
  777. // eslint-disable-line no-unused-vars -- required for `.length`
  778. var T = toObject(target);
  779. var argumentsLength = arguments.length;
  780. var index = 1;
  781. var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
  782. var propertyIsEnumerable = propertyIsEnumerableModule.f;
  783. while (argumentsLength > index) {
  784. var S = IndexedObject(arguments[index++]);
  785. var keys = getOwnPropertySymbols ? concat(objectKeys(S), getOwnPropertySymbols(S)) : objectKeys(S);
  786. var length = keys.length;
  787. var j = 0;
  788. var key;
  789. while (length > j) {
  790. key = keys[j++];
  791. if (!DESCRIPTORS || call(propertyIsEnumerable, S, key)) T[key] = S[key];
  792. }
  793. }
  794. return T;
  795. } : $assign;
  796. /***/ }),
  797. /***/ 704:
  798. /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
  799. "use strict";
  800. var DESCRIPTORS = __webpack_require__(6539);
  801. var IE8_DOM_DEFINE = __webpack_require__(2175);
  802. var V8_PROTOTYPE_DEFINE_BUG = __webpack_require__(4821);
  803. var anObject = __webpack_require__(7563);
  804. var toPropertyKey = __webpack_require__(9737);
  805. var $TypeError = TypeError;
  806. // eslint-disable-next-line es/no-object-defineproperty -- safe
  807. var $defineProperty = Object.defineProperty;
  808. // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
  809. var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  810. var ENUMERABLE = 'enumerable';
  811. var CONFIGURABLE = 'configurable';
  812. var WRITABLE = 'writable';
  813. // `Object.defineProperty` method
  814. // https://tc39.es/ecma262/#sec-object.defineproperty
  815. exports.f = DESCRIPTORS ? V8_PROTOTYPE_DEFINE_BUG ? function defineProperty(O, P, Attributes) {
  816. anObject(O);
  817. P = toPropertyKey(P);
  818. anObject(Attributes);
  819. if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
  820. var current = $getOwnPropertyDescriptor(O, P);
  821. if (current && current[WRITABLE]) {
  822. O[P] = Attributes.value;
  823. Attributes = {
  824. configurable: CONFIGURABLE in Attributes ? Attributes[CONFIGURABLE] : current[CONFIGURABLE],
  825. enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
  826. writable: false
  827. };
  828. }
  829. }
  830. return $defineProperty(O, P, Attributes);
  831. } : $defineProperty : function defineProperty(O, P, Attributes) {
  832. anObject(O);
  833. P = toPropertyKey(P);
  834. anObject(Attributes);
  835. if (IE8_DOM_DEFINE) try {
  836. return $defineProperty(O, P, Attributes);
  837. } catch (error) {/* empty */}
  838. if ('get' in Attributes || 'set' in Attributes) throw $TypeError('Accessors not supported');
  839. if ('value' in Attributes) O[P] = Attributes.value;
  840. return O;
  841. };
  842. /***/ }),
  843. /***/ 7238:
  844. /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
  845. "use strict";
  846. var DESCRIPTORS = __webpack_require__(6539);
  847. var call = __webpack_require__(5057);
  848. var propertyIsEnumerableModule = __webpack_require__(5339);
  849. var createPropertyDescriptor = __webpack_require__(4925);
  850. var toIndexedObject = __webpack_require__(6462);
  851. var toPropertyKey = __webpack_require__(9737);
  852. var hasOwn = __webpack_require__(1675);
  853. var IE8_DOM_DEFINE = __webpack_require__(2175);
  854. // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
  855. var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  856. // `Object.getOwnPropertyDescriptor` method
  857. // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
  858. exports.f = DESCRIPTORS ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
  859. O = toIndexedObject(O);
  860. P = toPropertyKey(P);
  861. if (IE8_DOM_DEFINE) try {
  862. return $getOwnPropertyDescriptor(O, P);
  863. } catch (error) {/* empty */}
  864. if (hasOwn(O, P)) return createPropertyDescriptor(!call(propertyIsEnumerableModule.f, O, P), O[P]);
  865. };
  866. /***/ }),
  867. /***/ 5454:
  868. /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
  869. "use strict";
  870. var internalObjectKeys = __webpack_require__(497);
  871. var enumBugKeys = __webpack_require__(8525);
  872. var hiddenKeys = enumBugKeys.concat('length', 'prototype');
  873. // `Object.getOwnPropertyNames` method
  874. // https://tc39.es/ecma262/#sec-object.getownpropertynames
  875. // eslint-disable-next-line es/no-object-getownpropertynames -- safe
  876. exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
  877. return internalObjectKeys(O, hiddenKeys);
  878. };
  879. /***/ }),
  880. /***/ 7485:
  881. /***/ (function(__unused_webpack_module, exports) {
  882. "use strict";
  883. // eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
  884. exports.f = Object.getOwnPropertySymbols;
  885. /***/ }),
  886. /***/ 5522:
  887. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  888. "use strict";
  889. var uncurryThis = __webpack_require__(9738);
  890. module.exports = uncurryThis({}.isPrototypeOf);
  891. /***/ }),
  892. /***/ 497:
  893. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  894. "use strict";
  895. var uncurryThis = __webpack_require__(9738);
  896. var hasOwn = __webpack_require__(1675);
  897. var toIndexedObject = __webpack_require__(6462);
  898. var indexOf = (__webpack_require__(8632).indexOf);
  899. var hiddenKeys = __webpack_require__(940);
  900. var push = uncurryThis([].push);
  901. module.exports = function (object, names) {
  902. var O = toIndexedObject(object);
  903. var i = 0;
  904. var result = [];
  905. var key;
  906. for (key in O) !hasOwn(hiddenKeys, key) && hasOwn(O, key) && push(result, key);
  907. // Don't enum bug & hidden keys
  908. while (names.length > i) if (hasOwn(O, key = names[i++])) {
  909. ~indexOf(result, key) || push(result, key);
  910. }
  911. return result;
  912. };
  913. /***/ }),
  914. /***/ 5403:
  915. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  916. "use strict";
  917. var internalObjectKeys = __webpack_require__(497);
  918. var enumBugKeys = __webpack_require__(8525);
  919. // `Object.keys` method
  920. // https://tc39.es/ecma262/#sec-object.keys
  921. // eslint-disable-next-line es/no-object-keys -- safe
  922. module.exports = Object.keys || function keys(O) {
  923. return internalObjectKeys(O, enumBugKeys);
  924. };
  925. /***/ }),
  926. /***/ 5339:
  927. /***/ (function(__unused_webpack_module, exports) {
  928. "use strict";
  929. var $propertyIsEnumerable = {}.propertyIsEnumerable;
  930. // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
  931. var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  932. // Nashorn ~ JDK8 bug
  933. var NASHORN_BUG = getOwnPropertyDescriptor && !$propertyIsEnumerable.call({
  934. 1: 2
  935. }, 1);
  936. // `Object.prototype.propertyIsEnumerable` method implementation
  937. // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
  938. exports.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
  939. var descriptor = getOwnPropertyDescriptor(this, V);
  940. return !!descriptor && descriptor.enumerable;
  941. } : $propertyIsEnumerable;
  942. /***/ }),
  943. /***/ 2821:
  944. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  945. "use strict";
  946. var call = __webpack_require__(5057);
  947. var isCallable = __webpack_require__(729);
  948. var isObject = __webpack_require__(691);
  949. var $TypeError = TypeError;
  950. // `OrdinaryToPrimitive` abstract operation
  951. // https://tc39.es/ecma262/#sec-ordinarytoprimitive
  952. module.exports = function (input, pref) {
  953. var fn, val;
  954. if (pref === 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val;
  955. if (isCallable(fn = input.valueOf) && !isObject(val = call(fn, input))) return val;
  956. if (pref !== 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val;
  957. throw $TypeError("Can't convert object to primitive value");
  958. };
  959. /***/ }),
  960. /***/ 9402:
  961. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  962. "use strict";
  963. var getBuiltIn = __webpack_require__(8078);
  964. var uncurryThis = __webpack_require__(9738);
  965. var getOwnPropertyNamesModule = __webpack_require__(5454);
  966. var getOwnPropertySymbolsModule = __webpack_require__(7485);
  967. var anObject = __webpack_require__(7563);
  968. var concat = uncurryThis([].concat);
  969. // all object keys, includes non-enumerable and symbols
  970. module.exports = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
  971. var keys = getOwnPropertyNamesModule.f(anObject(it));
  972. var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
  973. return getOwnPropertySymbols ? concat(keys, getOwnPropertySymbols(it)) : keys;
  974. };
  975. /***/ }),
  976. /***/ 97:
  977. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  978. "use strict";
  979. var global = __webpack_require__(5835);
  980. module.exports = global;
  981. /***/ }),
  982. /***/ 1894:
  983. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  984. "use strict";
  985. var isNullOrUndefined = __webpack_require__(6254);
  986. var $TypeError = TypeError;
  987. // `RequireObjectCoercible` abstract operation
  988. // https://tc39.es/ecma262/#sec-requireobjectcoercible
  989. module.exports = function (it) {
  990. if (isNullOrUndefined(it)) throw $TypeError("Can't call method on " + it);
  991. return it;
  992. };
  993. /***/ }),
  994. /***/ 7307:
  995. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  996. "use strict";
  997. var shared = __webpack_require__(5464);
  998. var uid = __webpack_require__(6065);
  999. var keys = shared('keys');
  1000. module.exports = function (key) {
  1001. return keys[key] || (keys[key] = uid(key));
  1002. };
  1003. /***/ }),
  1004. /***/ 9700:
  1005. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  1006. "use strict";
  1007. var global = __webpack_require__(5835);
  1008. var defineGlobalProperty = __webpack_require__(161);
  1009. var SHARED = '__core-js_shared__';
  1010. var store = global[SHARED] || defineGlobalProperty(SHARED, {});
  1011. module.exports = store;
  1012. /***/ }),
  1013. /***/ 5464:
  1014. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  1015. "use strict";
  1016. var IS_PURE = __webpack_require__(1437);
  1017. var store = __webpack_require__(9700);
  1018. (module.exports = function (key, value) {
  1019. return store[key] || (store[key] = value !== undefined ? value : {});
  1020. })('versions', []).push({
  1021. version: '3.32.0',
  1022. mode: IS_PURE ? 'pure' : 'global',
  1023. copyright: '© 2014-2023 Denis Pushkarev (zloirock.ru)',
  1024. license: 'https://github.com/zloirock/core-js/blob/v3.32.0/LICENSE',
  1025. source: 'https://github.com/zloirock/core-js'
  1026. });
  1027. /***/ }),
  1028. /***/ 4993:
  1029. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  1030. "use strict";
  1031. /* eslint-disable es/no-symbol -- required for testing */
  1032. var V8_VERSION = __webpack_require__(9282);
  1033. var fails = __webpack_require__(6583);
  1034. var global = __webpack_require__(5835);
  1035. var $String = global.String;
  1036. // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
  1037. module.exports = !!Object.getOwnPropertySymbols && !fails(function () {
  1038. var symbol = Symbol();
  1039. // Chrome 38 Symbol has incorrect toString conversion
  1040. // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
  1041. // nb: Do not call `String` directly to avoid this being optimized out to `symbol+''` which will,
  1042. // of course, fail.
  1043. return !$String(symbol) || !(Object(symbol) instanceof Symbol) ||
  1044. // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
  1045. !Symbol.sham && V8_VERSION && V8_VERSION < 41;
  1046. });
  1047. /***/ }),
  1048. /***/ 5333:
  1049. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  1050. "use strict";
  1051. var toIntegerOrInfinity = __webpack_require__(1087);
  1052. var max = Math.max;
  1053. var min = Math.min;
  1054. // Helper for a popular repeating case of the spec:
  1055. // Let integer be ? ToInteger(index).
  1056. // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
  1057. module.exports = function (index, length) {
  1058. var integer = toIntegerOrInfinity(index);
  1059. return integer < 0 ? max(integer + length, 0) : min(integer, length);
  1060. };
  1061. /***/ }),
  1062. /***/ 6462:
  1063. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  1064. "use strict";
  1065. // toObject with fallback for non-array-like ES3 strings
  1066. var IndexedObject = __webpack_require__(5407);
  1067. var requireObjectCoercible = __webpack_require__(1894);
  1068. module.exports = function (it) {
  1069. return IndexedObject(requireObjectCoercible(it));
  1070. };
  1071. /***/ }),
  1072. /***/ 1087:
  1073. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  1074. "use strict";
  1075. var trunc = __webpack_require__(4920);
  1076. // `ToIntegerOrInfinity` abstract operation
  1077. // https://tc39.es/ecma262/#sec-tointegerorinfinity
  1078. module.exports = function (argument) {
  1079. var number = +argument;
  1080. // eslint-disable-next-line no-self-compare -- NaN check
  1081. return number !== number || number === 0 ? 0 : trunc(number);
  1082. };
  1083. /***/ }),
  1084. /***/ 5108:
  1085. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  1086. "use strict";
  1087. var toIntegerOrInfinity = __webpack_require__(1087);
  1088. var min = Math.min;
  1089. // `ToLength` abstract operation
  1090. // https://tc39.es/ecma262/#sec-tolength
  1091. module.exports = function (argument) {
  1092. return argument > 0 ? min(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
  1093. };
  1094. /***/ }),
  1095. /***/ 5825:
  1096. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  1097. "use strict";
  1098. var requireObjectCoercible = __webpack_require__(1894);
  1099. var $Object = Object;
  1100. // `ToObject` abstract operation
  1101. // https://tc39.es/ecma262/#sec-toobject
  1102. module.exports = function (argument) {
  1103. return $Object(requireObjectCoercible(argument));
  1104. };
  1105. /***/ }),
  1106. /***/ 1044:
  1107. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  1108. "use strict";
  1109. var call = __webpack_require__(5057);
  1110. var isObject = __webpack_require__(691);
  1111. var isSymbol = __webpack_require__(4192);
  1112. var getMethod = __webpack_require__(2337);
  1113. var ordinaryToPrimitive = __webpack_require__(2821);
  1114. var wellKnownSymbol = __webpack_require__(3121);
  1115. var $TypeError = TypeError;
  1116. var TO_PRIMITIVE = wellKnownSymbol('toPrimitive');
  1117. // `ToPrimitive` abstract operation
  1118. // https://tc39.es/ecma262/#sec-toprimitive
  1119. module.exports = function (input, pref) {
  1120. if (!isObject(input) || isSymbol(input)) return input;
  1121. var exoticToPrim = getMethod(input, TO_PRIMITIVE);
  1122. var result;
  1123. if (exoticToPrim) {
  1124. if (pref === undefined) pref = 'default';
  1125. result = call(exoticToPrim, input, pref);
  1126. if (!isObject(result) || isSymbol(result)) return result;
  1127. throw $TypeError("Can't convert object to primitive value");
  1128. }
  1129. if (pref === undefined) pref = 'number';
  1130. return ordinaryToPrimitive(input, pref);
  1131. };
  1132. /***/ }),
  1133. /***/ 9737:
  1134. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  1135. "use strict";
  1136. var toPrimitive = __webpack_require__(1044);
  1137. var isSymbol = __webpack_require__(4192);
  1138. // `ToPropertyKey` abstract operation
  1139. // https://tc39.es/ecma262/#sec-topropertykey
  1140. module.exports = function (argument) {
  1141. var key = toPrimitive(argument, 'string');
  1142. return isSymbol(key) ? key : key + '';
  1143. };
  1144. /***/ }),
  1145. /***/ 8434:
  1146. /***/ (function(module) {
  1147. "use strict";
  1148. var $String = String;
  1149. module.exports = function (argument) {
  1150. try {
  1151. return $String(argument);
  1152. } catch (error) {
  1153. return 'Object';
  1154. }
  1155. };
  1156. /***/ }),
  1157. /***/ 6065:
  1158. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  1159. "use strict";
  1160. var uncurryThis = __webpack_require__(9738);
  1161. var id = 0;
  1162. var postfix = Math.random();
  1163. var toString = uncurryThis(1.0.toString);
  1164. module.exports = function (key) {
  1165. return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36);
  1166. };
  1167. /***/ }),
  1168. /***/ 7860:
  1169. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  1170. "use strict";
  1171. /* eslint-disable es/no-symbol -- required for testing */
  1172. function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
  1173. var NATIVE_SYMBOL = __webpack_require__(4993);
  1174. module.exports = NATIVE_SYMBOL && !Symbol.sham && _typeof(Symbol.iterator) == 'symbol';
  1175. /***/ }),
  1176. /***/ 4821:
  1177. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  1178. "use strict";
  1179. var DESCRIPTORS = __webpack_require__(6539);
  1180. var fails = __webpack_require__(6583);
  1181. // V8 ~ Chrome 36-
  1182. // https://bugs.chromium.org/p/v8/issues/detail?id=3334
  1183. module.exports = DESCRIPTORS && fails(function () {
  1184. // eslint-disable-next-line es/no-object-defineproperty -- required for testing
  1185. return Object.defineProperty(function () {/* empty */}, 'prototype', {
  1186. value: 42,
  1187. writable: false
  1188. }).prototype != 42;
  1189. });
  1190. /***/ }),
  1191. /***/ 9801:
  1192. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  1193. "use strict";
  1194. var global = __webpack_require__(5835);
  1195. var isCallable = __webpack_require__(729);
  1196. var WeakMap = global.WeakMap;
  1197. module.exports = isCallable(WeakMap) && /native code/.test(String(WeakMap));
  1198. /***/ }),
  1199. /***/ 5336:
  1200. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  1201. "use strict";
  1202. var path = __webpack_require__(97);
  1203. var hasOwn = __webpack_require__(1675);
  1204. var wrappedWellKnownSymbolModule = __webpack_require__(8384);
  1205. var defineProperty = (__webpack_require__(704).f);
  1206. module.exports = function (NAME) {
  1207. var _Symbol = path.Symbol || (path.Symbol = {});
  1208. if (!hasOwn(_Symbol, NAME)) defineProperty(_Symbol, NAME, {
  1209. value: wrappedWellKnownSymbolModule.f(NAME)
  1210. });
  1211. };
  1212. /***/ }),
  1213. /***/ 8384:
  1214. /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
  1215. "use strict";
  1216. var wellKnownSymbol = __webpack_require__(3121);
  1217. exports.f = wellKnownSymbol;
  1218. /***/ }),
  1219. /***/ 3121:
  1220. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  1221. "use strict";
  1222. var global = __webpack_require__(5835);
  1223. var shared = __webpack_require__(5464);
  1224. var hasOwn = __webpack_require__(1675);
  1225. var uid = __webpack_require__(6065);
  1226. var NATIVE_SYMBOL = __webpack_require__(4993);
  1227. var USE_SYMBOL_AS_UID = __webpack_require__(7860);
  1228. var _Symbol = global.Symbol;
  1229. var WellKnownSymbolsStore = shared('wks');
  1230. var createWellKnownSymbol = USE_SYMBOL_AS_UID ? _Symbol['for'] || _Symbol : _Symbol && _Symbol.withoutSetter || uid;
  1231. module.exports = function (name) {
  1232. if (!hasOwn(WellKnownSymbolsStore, name)) {
  1233. WellKnownSymbolsStore[name] = NATIVE_SYMBOL && hasOwn(_Symbol, name) ? _Symbol[name] : createWellKnownSymbol('Symbol.' + name);
  1234. }
  1235. return WellKnownSymbolsStore[name];
  1236. };
  1237. /***/ }),
  1238. /***/ 7422:
  1239. /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
  1240. "use strict";
  1241. var $ = __webpack_require__(7926);
  1242. var assign = __webpack_require__(7328);
  1243. // `Object.assign` method
  1244. // https://tc39.es/ecma262/#sec-object.assign
  1245. // eslint-disable-next-line es/no-object-assign -- required for testing
  1246. $({
  1247. target: 'Object',
  1248. stat: true,
  1249. arity: 2,
  1250. forced: Object.assign !== assign
  1251. }, {
  1252. assign: assign
  1253. });
  1254. /***/ }),
  1255. /***/ 4835:
  1256. /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
  1257. "use strict";
  1258. var defineWellKnownSymbol = __webpack_require__(5336);
  1259. // `Symbol.asyncIterator` well-known symbol
  1260. // https://tc39.es/ecma262/#sec-symbol.asynciterator
  1261. defineWellKnownSymbol('asyncIterator');
  1262. /***/ }),
  1263. /***/ 6727:
  1264. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  1265. "use strict";
  1266. var parent = __webpack_require__(879);
  1267. module.exports = parent;
  1268. /***/ }),
  1269. /***/ 8690:
  1270. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  1271. "use strict";
  1272. var parent = __webpack_require__(3723);
  1273. module.exports = parent;
  1274. /***/ }),
  1275. /***/ 5937:
  1276. /***/ (function(module) {
  1277. (function (self) {
  1278. 'use strict';
  1279. // if __disableNativeFetch is set to true, the it will always polyfill fetch
  1280. // with Ajax.
  1281. if (!self.__disableNativeFetch && self.fetch) {
  1282. return;
  1283. }
  1284. function normalizeName(name) {
  1285. if (typeof name !== 'string') {
  1286. name = String(name);
  1287. }
  1288. if (/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(name)) {
  1289. throw new TypeError('Invalid character in header field name');
  1290. }
  1291. return name.toLowerCase();
  1292. }
  1293. function normalizeValue(value) {
  1294. if (typeof value !== 'string') {
  1295. value = String(value);
  1296. }
  1297. return value;
  1298. }
  1299. function Headers(headers) {
  1300. this.map = {};
  1301. if (headers instanceof Headers) {
  1302. headers.forEach(function (value, name) {
  1303. this.append(name, value);
  1304. }, this);
  1305. } else if (headers) {
  1306. Object.getOwnPropertyNames(headers).forEach(function (name) {
  1307. this.append(name, headers[name]);
  1308. }, this);
  1309. }
  1310. }
  1311. Headers.prototype.append = function (name, value) {
  1312. name = normalizeName(name);
  1313. value = normalizeValue(value);
  1314. var list = this.map[name];
  1315. if (!list) {
  1316. list = [];
  1317. this.map[name] = list;
  1318. }
  1319. list.push(value);
  1320. };
  1321. Headers.prototype['delete'] = function (name) {
  1322. delete this.map[normalizeName(name)];
  1323. };
  1324. Headers.prototype.get = function (name) {
  1325. var values = this.map[normalizeName(name)];
  1326. return values ? values[0] : null;
  1327. };
  1328. Headers.prototype.getAll = function (name) {
  1329. return this.map[normalizeName(name)] || [];
  1330. };
  1331. Headers.prototype.has = function (name) {
  1332. return this.map.hasOwnProperty(normalizeName(name));
  1333. };
  1334. Headers.prototype.set = function (name, value) {
  1335. this.map[normalizeName(name)] = [normalizeValue(value)];
  1336. };
  1337. Headers.prototype.forEach = function (callback, thisArg) {
  1338. Object.getOwnPropertyNames(this.map).forEach(function (name) {
  1339. this.map[name].forEach(function (value) {
  1340. callback.call(thisArg, value, name, this);
  1341. }, this);
  1342. }, this);
  1343. };
  1344. function consumed(body) {
  1345. if (body.bodyUsed) {
  1346. return Promise.reject(new TypeError('Already read'));
  1347. }
  1348. body.bodyUsed = true;
  1349. }
  1350. function fileReaderReady(reader) {
  1351. return new Promise(function (resolve, reject) {
  1352. reader.onload = function () {
  1353. resolve(reader.result);
  1354. };
  1355. reader.onerror = function () {
  1356. reject(reader.error);
  1357. };
  1358. });
  1359. }
  1360. function readBlobAsArrayBuffer(blob) {
  1361. var reader = new FileReader();
  1362. reader.readAsArrayBuffer(blob);
  1363. return fileReaderReady(reader);
  1364. }
  1365. function readBlobAsText(blob, options) {
  1366. var reader = new FileReader();
  1367. var contentType = options.headers.map['content-type'] ? options.headers.map['content-type'].toString() : '';
  1368. var regex = /charset\=[0-9a-zA-Z\-\_]*;?/;
  1369. var _charset = blob.type.match(regex) || contentType.match(regex);
  1370. var args = [blob];
  1371. if (_charset) {
  1372. args.push(_charset[0].replace(/^charset\=/, '').replace(/;$/, ''));
  1373. }
  1374. reader.readAsText.apply(reader, args);
  1375. return fileReaderReady(reader);
  1376. }
  1377. var support = {
  1378. blob: 'FileReader' in self && 'Blob' in self && function () {
  1379. try {
  1380. new Blob();
  1381. return true;
  1382. } catch (e) {
  1383. return false;
  1384. }
  1385. }(),
  1386. formData: 'FormData' in self,
  1387. arrayBuffer: 'ArrayBuffer' in self
  1388. };
  1389. function Body() {
  1390. this.bodyUsed = false;
  1391. this._initBody = function (body, options) {
  1392. this._bodyInit = body;
  1393. if (typeof body === 'string') {
  1394. this._bodyText = body;
  1395. } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {
  1396. this._bodyBlob = body;
  1397. this._options = options;
  1398. } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {
  1399. this._bodyFormData = body;
  1400. } else if (!body) {
  1401. this._bodyText = '';
  1402. } else if (support.arrayBuffer && ArrayBuffer.prototype.isPrototypeOf(body)) {
  1403. // Only support ArrayBuffers for POST method.
  1404. // Receiving ArrayBuffers happens via Blobs, instead.
  1405. } else {
  1406. throw new Error('unsupported BodyInit type');
  1407. }
  1408. };
  1409. if (support.blob) {
  1410. this.blob = function () {
  1411. var rejected = consumed(this);
  1412. if (rejected) {
  1413. return rejected;
  1414. }
  1415. if (this._bodyBlob) {
  1416. return Promise.resolve(this._bodyBlob);
  1417. } else if (this._bodyFormData) {
  1418. throw new Error('could not read FormData body as blob');
  1419. } else {
  1420. return Promise.resolve(new Blob([this._bodyText]));
  1421. }
  1422. };
  1423. this.arrayBuffer = function () {
  1424. return this.blob().then(readBlobAsArrayBuffer);
  1425. };
  1426. this.text = function () {
  1427. var rejected = consumed(this);
  1428. if (rejected) {
  1429. return rejected;
  1430. }
  1431. if (this._bodyBlob) {
  1432. return readBlobAsText(this._bodyBlob, this._options);
  1433. } else if (this._bodyFormData) {
  1434. throw new Error('could not read FormData body as text');
  1435. } else {
  1436. return Promise.resolve(this._bodyText);
  1437. }
  1438. };
  1439. } else {
  1440. this.text = function () {
  1441. var rejected = consumed(this);
  1442. return rejected ? rejected : Promise.resolve(this._bodyText);
  1443. };
  1444. }
  1445. if (support.formData) {
  1446. this.formData = function () {
  1447. return this.text().then(decode);
  1448. };
  1449. }
  1450. this.json = function () {
  1451. return this.text().then(JSON.parse);
  1452. };
  1453. return this;
  1454. }
  1455. // HTTP methods whose capitalization should be normalized
  1456. var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT'];
  1457. function normalizeMethod(method) {
  1458. var upcased = method.toUpperCase();
  1459. return methods.indexOf(upcased) > -1 ? upcased : method;
  1460. }
  1461. function Request(input, options) {
  1462. options = options || {};
  1463. var body = options.body;
  1464. if (Request.prototype.isPrototypeOf(input)) {
  1465. if (input.bodyUsed) {
  1466. throw new TypeError('Already read');
  1467. }
  1468. this.url = input.url;
  1469. this.credentials = input.credentials;
  1470. if (!options.headers) {
  1471. this.headers = new Headers(input.headers);
  1472. }
  1473. this.method = input.method;
  1474. this.mode = input.mode;
  1475. if (!body) {
  1476. body = input._bodyInit;
  1477. input.bodyUsed = true;
  1478. }
  1479. } else {
  1480. this.url = input;
  1481. }
  1482. this.credentials = options.credentials || this.credentials || 'omit';
  1483. if (options.headers || !this.headers) {
  1484. this.headers = new Headers(options.headers);
  1485. }
  1486. this.method = normalizeMethod(options.method || this.method || 'GET');
  1487. this.mode = options.mode || this.mode || null;
  1488. this.referrer = null;
  1489. if ((this.method === 'GET' || this.method === 'HEAD') && body) {
  1490. throw new TypeError('Body not allowed for GET or HEAD requests');
  1491. }
  1492. this._initBody(body, options);
  1493. }
  1494. Request.prototype.clone = function () {
  1495. return new Request(this);
  1496. };
  1497. function decode(body) {
  1498. var form = new FormData();
  1499. body.trim().split('&').forEach(function (bytes) {
  1500. if (bytes) {
  1501. var split = bytes.split('=');
  1502. var name = split.shift().replace(/\+/g, ' ');
  1503. var value = split.join('=').replace(/\+/g, ' ');
  1504. form.append(decodeURIComponent(name), decodeURIComponent(value));
  1505. }
  1506. });
  1507. return form;
  1508. }
  1509. function headers(xhr) {
  1510. var head = new Headers();
  1511. var pairs = xhr.getAllResponseHeaders().trim().split('\n');
  1512. pairs.forEach(function (header) {
  1513. var split = header.trim().split(':');
  1514. var key = split.shift().trim();
  1515. var value = split.join(':').trim();
  1516. head.append(key, value);
  1517. });
  1518. return head;
  1519. }
  1520. Body.call(Request.prototype);
  1521. function Response(bodyInit, options) {
  1522. if (!options) {
  1523. options = {};
  1524. }
  1525. this._initBody(bodyInit, options);
  1526. this.type = 'default';
  1527. this.status = options.status;
  1528. this.ok = this.status >= 200 && this.status < 300;
  1529. this.statusText = options.statusText;
  1530. this.headers = options.headers instanceof Headers ? options.headers : new Headers(options.headers);
  1531. this.url = options.url || '';
  1532. }
  1533. Body.call(Response.prototype);
  1534. Response.prototype.clone = function () {
  1535. return new Response(this._bodyInit, {
  1536. status: this.status,
  1537. statusText: this.statusText,
  1538. headers: new Headers(this.headers),
  1539. url: this.url
  1540. });
  1541. };
  1542. Response.error = function () {
  1543. var response = new Response(null, {
  1544. status: 0,
  1545. statusText: ''
  1546. });
  1547. response.type = 'error';
  1548. return response;
  1549. };
  1550. var redirectStatuses = [301, 302, 303, 307, 308];
  1551. Response.redirect = function (url, status) {
  1552. if (redirectStatuses.indexOf(status) === -1) {
  1553. throw new RangeError('Invalid status code');
  1554. }
  1555. return new Response(null, {
  1556. status: status,
  1557. headers: {
  1558. location: url
  1559. }
  1560. });
  1561. };
  1562. self.Headers = Headers;
  1563. self.Request = Request;
  1564. self.Response = Response;
  1565. self.fetch = function (input, init) {
  1566. return new Promise(function (resolve, reject) {
  1567. var request;
  1568. if (Request.prototype.isPrototypeOf(input) && !init) {
  1569. request = input;
  1570. } else {
  1571. request = new Request(input, init);
  1572. }
  1573. var xhr = new XMLHttpRequest();
  1574. function responseURL() {
  1575. if ('responseURL' in xhr) {
  1576. return xhr.responseURL;
  1577. }
  1578. // Avoid security warnings on getResponseHeader when not allowed by CORS
  1579. if (/^X-Request-URL:/m.test(xhr.getAllResponseHeaders())) {
  1580. return xhr.getResponseHeader('X-Request-URL');
  1581. }
  1582. return;
  1583. }
  1584. var __onLoadHandled = false;
  1585. function onload() {
  1586. if (xhr.readyState !== 4) {
  1587. return;
  1588. }
  1589. var status = xhr.status === 1223 ? 204 : xhr.status;
  1590. if (status < 100 || status > 599) {
  1591. if (__onLoadHandled) {
  1592. return;
  1593. } else {
  1594. __onLoadHandled = true;
  1595. }
  1596. reject(new TypeError('Network request failed'));
  1597. return;
  1598. }
  1599. var options = {
  1600. status: status,
  1601. statusText: xhr.statusText,
  1602. headers: headers(xhr),
  1603. url: responseURL()
  1604. };
  1605. var body = 'response' in xhr ? xhr.response : xhr.responseText;
  1606. if (__onLoadHandled) {
  1607. return;
  1608. } else {
  1609. __onLoadHandled = true;
  1610. }
  1611. resolve(new Response(body, options));
  1612. }
  1613. xhr.onreadystatechange = onload;
  1614. xhr.onload = onload;
  1615. xhr.onerror = function () {
  1616. if (__onLoadHandled) {
  1617. return;
  1618. } else {
  1619. __onLoadHandled = true;
  1620. }
  1621. reject(new TypeError('Network request failed'));
  1622. };
  1623. xhr.open(request.method, request.url, true);
  1624. // `withCredentials` should be setted after calling `.open` in IE10
  1625. // http://stackoverflow.com/a/19667959/1219343
  1626. try {
  1627. if (request.credentials === 'include') {
  1628. if ('withCredentials' in xhr) {
  1629. xhr.withCredentials = true;
  1630. } else {
  1631. console && console.warn && console.warn('withCredentials is not supported, you can ignore this warning');
  1632. }
  1633. }
  1634. } catch (e) {
  1635. console && console.warn && console.warn('set withCredentials error:' + e);
  1636. }
  1637. if ('responseType' in xhr && support.blob) {
  1638. xhr.responseType = 'blob';
  1639. }
  1640. request.headers.forEach(function (value, name) {
  1641. xhr.setRequestHeader(name, value);
  1642. });
  1643. xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit);
  1644. });
  1645. };
  1646. self.fetch.polyfill = true;
  1647. // Support CommonJS
  1648. if ( true && module.exports) {
  1649. module.exports = self.fetch;
  1650. }
  1651. })(typeof self !== 'undefined' ? self : this);
  1652. /***/ }),
  1653. /***/ 4238:
  1654. /***/ (function(module, exports) {
  1655. var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) {
  1656. if (true) {
  1657. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [exports, module], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
  1658. __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
  1659. (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
  1660. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  1661. } else { var mod; }
  1662. })(this, function (exports, module) {
  1663. 'use strict';
  1664. var defaultOptions = {
  1665. timeout: 5000,
  1666. jsonpCallback: 'callback',
  1667. jsonpCallbackFunction: null
  1668. };
  1669. function generateCallbackFunction() {
  1670. return 'jsonp_' + Date.now() + '_' + Math.ceil(Math.random() * 100000);
  1671. }
  1672. function clearFunction(functionName) {
  1673. // IE8 throws an exception when you try to delete a property on window
  1674. // http://stackoverflow.com/a/1824228/751089
  1675. try {
  1676. delete window[functionName];
  1677. } catch (e) {
  1678. window[functionName] = undefined;
  1679. }
  1680. }
  1681. function removeScript(scriptId) {
  1682. var script = document.getElementById(scriptId);
  1683. if (script) {
  1684. document.getElementsByTagName('head')[0].removeChild(script);
  1685. }
  1686. }
  1687. function fetchJsonp(_url) {
  1688. var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
  1689. // to avoid param reassign
  1690. var url = _url;
  1691. var timeout = options.timeout || defaultOptions.timeout;
  1692. var jsonpCallback = options.jsonpCallback || defaultOptions.jsonpCallback;
  1693. var timeoutId = undefined;
  1694. return new Promise(function (resolve, reject) {
  1695. var callbackFunction = options.jsonpCallbackFunction || generateCallbackFunction();
  1696. var scriptId = jsonpCallback + '_' + callbackFunction;
  1697. window[callbackFunction] = function (response) {
  1698. resolve({
  1699. ok: true,
  1700. // keep consistent with fetch API
  1701. json: function json() {
  1702. return Promise.resolve(response);
  1703. }
  1704. });
  1705. if (timeoutId) clearTimeout(timeoutId);
  1706. removeScript(scriptId);
  1707. clearFunction(callbackFunction);
  1708. };
  1709. // Check if the user set their own params, and if not add a ? to start a list of params
  1710. url += url.indexOf('?') === -1 ? '?' : '&';
  1711. var jsonpScript = document.createElement('script');
  1712. jsonpScript.setAttribute('src', '' + url + jsonpCallback + '=' + callbackFunction);
  1713. if (options.charset) {
  1714. jsonpScript.setAttribute('charset', options.charset);
  1715. }
  1716. jsonpScript.id = scriptId;
  1717. document.getElementsByTagName('head')[0].appendChild(jsonpScript);
  1718. timeoutId = setTimeout(function () {
  1719. reject(new Error('JSONP request to ' + _url + ' timed out'));
  1720. clearFunction(callbackFunction);
  1721. removeScript(scriptId);
  1722. window[callbackFunction] = function () {
  1723. clearFunction(callbackFunction);
  1724. };
  1725. }, timeout);
  1726. // Caught if got 404/500
  1727. jsonpScript.onerror = function () {
  1728. reject(new Error('JSONP request to ' + _url + ' failed'));
  1729. clearFunction(callbackFunction);
  1730. removeScript(scriptId);
  1731. if (timeoutId) clearTimeout(timeoutId);
  1732. };
  1733. });
  1734. }
  1735. // export as global function
  1736. /*
  1737. let local;
  1738. if (typeof global !== 'undefined') {
  1739. local = global;
  1740. } else if (typeof self !== 'undefined') {
  1741. local = self;
  1742. } else {
  1743. try {
  1744. local = Function('return this')();
  1745. } catch (e) {
  1746. throw new Error('polyfill failed because global object is unavailable in this environment');
  1747. }
  1748. }
  1749. local.fetchJsonp = fetchJsonp;
  1750. */
  1751. module.exports = fetchJsonp;
  1752. });
  1753. /***/ }),
  1754. /***/ 4634:
  1755. /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
  1756. "use strict";
  1757. Object.defineProperty(exports, "__esModule", ({
  1758. value: true
  1759. }));
  1760. exports.Builder = void 0;
  1761. var byte_buffer_js_1 = __webpack_require__(1603);
  1762. var constants_js_1 = __webpack_require__(1083);
  1763. var Builder = /** @class */function () {
  1764. /**
  1765. * Create a FlatBufferBuilder.
  1766. */
  1767. function Builder(opt_initial_size) {
  1768. /** Minimum alignment encountered so far. */
  1769. this.minalign = 1;
  1770. /** The vtable for the current table. */
  1771. this.vtable = null;
  1772. /** The amount of fields we're actually using. */
  1773. this.vtable_in_use = 0;
  1774. /** Whether we are currently serializing a table. */
  1775. this.isNested = false;
  1776. /** Starting offset of the current struct/table. */
  1777. this.object_start = 0;
  1778. /** List of offsets of all vtables. */
  1779. this.vtables = [];
  1780. /** For the current vector being built. */
  1781. this.vector_num_elems = 0;
  1782. /** False omits default values from the serialized data */
  1783. this.force_defaults = false;
  1784. this.string_maps = null;
  1785. var initial_size;
  1786. if (!opt_initial_size) {
  1787. initial_size = 1024;
  1788. } else {
  1789. initial_size = opt_initial_size;
  1790. }
  1791. /**
  1792. * @type {ByteBuffer}
  1793. * @private
  1794. */
  1795. this.bb = byte_buffer_js_1.ByteBuffer.allocate(initial_size);
  1796. this.space = initial_size;
  1797. }
  1798. Builder.prototype.clear = function () {
  1799. this.bb.clear();
  1800. this.space = this.bb.capacity();
  1801. this.minalign = 1;
  1802. this.vtable = null;
  1803. this.vtable_in_use = 0;
  1804. this.isNested = false;
  1805. this.object_start = 0;
  1806. this.vtables = [];
  1807. this.vector_num_elems = 0;
  1808. this.force_defaults = false;
  1809. this.string_maps = null;
  1810. };
  1811. /**
  1812. * In order to save space, fields that are set to their default value
  1813. * don't get serialized into the buffer. Forcing defaults provides a
  1814. * way to manually disable this optimization.
  1815. *
  1816. * @param forceDefaults true always serializes default values
  1817. */
  1818. Builder.prototype.forceDefaults = function (forceDefaults) {
  1819. this.force_defaults = forceDefaults;
  1820. };
  1821. /**
  1822. * Get the ByteBuffer representing the FlatBuffer. Only call this after you've
  1823. * called finish(). The actual data starts at the ByteBuffer's current position,
  1824. * not necessarily at 0.
  1825. */
  1826. Builder.prototype.dataBuffer = function () {
  1827. return this.bb;
  1828. };
  1829. /**
  1830. * Get the bytes representing the FlatBuffer. Only call this after you've
  1831. * called finish().
  1832. */
  1833. Builder.prototype.asUint8Array = function () {
  1834. return this.bb.bytes().subarray(this.bb.position(), this.bb.position() + this.offset());
  1835. };
  1836. /**
  1837. * Prepare to write an element of `size` after `additional_bytes` have been
  1838. * written, e.g. if you write a string, you need to align such the int length
  1839. * field is aligned to 4 bytes, and the string data follows it directly. If all
  1840. * you need to do is alignment, `additional_bytes` will be 0.
  1841. *
  1842. * @param size This is the of the new element to write
  1843. * @param additional_bytes The padding size
  1844. */
  1845. Builder.prototype.prep = function (size, additional_bytes) {
  1846. // Track the biggest thing we've ever aligned to.
  1847. if (size > this.minalign) {
  1848. this.minalign = size;
  1849. }
  1850. // Find the amount of alignment needed such that `size` is properly
  1851. // aligned after `additional_bytes`
  1852. var align_size = ~(this.bb.capacity() - this.space + additional_bytes) + 1 & size - 1;
  1853. // Reallocate the buffer if needed.
  1854. while (this.space < align_size + size + additional_bytes) {
  1855. var old_buf_size = this.bb.capacity();
  1856. this.bb = Builder.growByteBuffer(this.bb);
  1857. this.space += this.bb.capacity() - old_buf_size;
  1858. }
  1859. this.pad(align_size);
  1860. };
  1861. Builder.prototype.pad = function (byte_size) {
  1862. for (var i = 0; i < byte_size; i++) {
  1863. this.bb.writeInt8(--this.space, 0);
  1864. }
  1865. };
  1866. Builder.prototype.writeInt8 = function (value) {
  1867. this.bb.writeInt8(this.space -= 1, value);
  1868. };
  1869. Builder.prototype.writeInt16 = function (value) {
  1870. this.bb.writeInt16(this.space -= 2, value);
  1871. };
  1872. Builder.prototype.writeInt32 = function (value) {
  1873. this.bb.writeInt32(this.space -= 4, value);
  1874. };
  1875. Builder.prototype.writeInt64 = function (value) {
  1876. this.bb.writeInt64(this.space -= 8, value);
  1877. };
  1878. Builder.prototype.writeFloat32 = function (value) {
  1879. this.bb.writeFloat32(this.space -= 4, value);
  1880. };
  1881. Builder.prototype.writeFloat64 = function (value) {
  1882. this.bb.writeFloat64(this.space -= 8, value);
  1883. };
  1884. /**
  1885. * Add an `int8` to the buffer, properly aligned, and grows the buffer (if necessary).
  1886. * @param value The `int8` to add the the buffer.
  1887. */
  1888. Builder.prototype.addInt8 = function (value) {
  1889. this.prep(1, 0);
  1890. this.writeInt8(value);
  1891. };
  1892. /**
  1893. * Add an `int16` to the buffer, properly aligned, and grows the buffer (if necessary).
  1894. * @param value The `int16` to add the the buffer.
  1895. */
  1896. Builder.prototype.addInt16 = function (value) {
  1897. this.prep(2, 0);
  1898. this.writeInt16(value);
  1899. };
  1900. /**
  1901. * Add an `int32` to the buffer, properly aligned, and grows the buffer (if necessary).
  1902. * @param value The `int32` to add the the buffer.
  1903. */
  1904. Builder.prototype.addInt32 = function (value) {
  1905. this.prep(4, 0);
  1906. this.writeInt32(value);
  1907. };
  1908. /**
  1909. * Add an `int64` to the buffer, properly aligned, and grows the buffer (if necessary).
  1910. * @param value The `int64` to add the the buffer.
  1911. */
  1912. Builder.prototype.addInt64 = function (value) {
  1913. this.prep(8, 0);
  1914. this.writeInt64(value);
  1915. };
  1916. /**
  1917. * Add a `float32` to the buffer, properly aligned, and grows the buffer (if necessary).
  1918. * @param value The `float32` to add the the buffer.
  1919. */
  1920. Builder.prototype.addFloat32 = function (value) {
  1921. this.prep(4, 0);
  1922. this.writeFloat32(value);
  1923. };
  1924. /**
  1925. * Add a `float64` to the buffer, properly aligned, and grows the buffer (if necessary).
  1926. * @param value The `float64` to add the the buffer.
  1927. */
  1928. Builder.prototype.addFloat64 = function (value) {
  1929. this.prep(8, 0);
  1930. this.writeFloat64(value);
  1931. };
  1932. Builder.prototype.addFieldInt8 = function (voffset, value, defaultValue) {
  1933. if (this.force_defaults || value != defaultValue) {
  1934. this.addInt8(value);
  1935. this.slot(voffset);
  1936. }
  1937. };
  1938. Builder.prototype.addFieldInt16 = function (voffset, value, defaultValue) {
  1939. if (this.force_defaults || value != defaultValue) {
  1940. this.addInt16(value);
  1941. this.slot(voffset);
  1942. }
  1943. };
  1944. Builder.prototype.addFieldInt32 = function (voffset, value, defaultValue) {
  1945. if (this.force_defaults || value != defaultValue) {
  1946. this.addInt32(value);
  1947. this.slot(voffset);
  1948. }
  1949. };
  1950. Builder.prototype.addFieldInt64 = function (voffset, value, defaultValue) {
  1951. if (this.force_defaults || value !== defaultValue) {
  1952. this.addInt64(value);
  1953. this.slot(voffset);
  1954. }
  1955. };
  1956. Builder.prototype.addFieldFloat32 = function (voffset, value, defaultValue) {
  1957. if (this.force_defaults || value != defaultValue) {
  1958. this.addFloat32(value);
  1959. this.slot(voffset);
  1960. }
  1961. };
  1962. Builder.prototype.addFieldFloat64 = function (voffset, value, defaultValue) {
  1963. if (this.force_defaults || value != defaultValue) {
  1964. this.addFloat64(value);
  1965. this.slot(voffset);
  1966. }
  1967. };
  1968. Builder.prototype.addFieldOffset = function (voffset, value, defaultValue) {
  1969. if (this.force_defaults || value != defaultValue) {
  1970. this.addOffset(value);
  1971. this.slot(voffset);
  1972. }
  1973. };
  1974. /**
  1975. * Structs are stored inline, so nothing additional is being added. `d` is always 0.
  1976. */
  1977. Builder.prototype.addFieldStruct = function (voffset, value, defaultValue) {
  1978. if (value != defaultValue) {
  1979. this.nested(value);
  1980. this.slot(voffset);
  1981. }
  1982. };
  1983. /**
  1984. * Structures are always stored inline, they need to be created right
  1985. * where they're used. You'll get this assertion failure if you
  1986. * created it elsewhere.
  1987. */
  1988. Builder.prototype.nested = function (obj) {
  1989. if (obj != this.offset()) {
  1990. throw new Error('FlatBuffers: struct must be serialized inline.');
  1991. }
  1992. };
  1993. /**
  1994. * Should not be creating any other object, string or vector
  1995. * while an object is being constructed
  1996. */
  1997. Builder.prototype.notNested = function () {
  1998. if (this.isNested) {
  1999. throw new Error('FlatBuffers: object serialization must not be nested.');
  2000. }
  2001. };
  2002. /**
  2003. * Set the current vtable at `voffset` to the current location in the buffer.
  2004. */
  2005. Builder.prototype.slot = function (voffset) {
  2006. if (this.vtable !== null) this.vtable[voffset] = this.offset();
  2007. };
  2008. /**
  2009. * @returns Offset relative to the end of the buffer.
  2010. */
  2011. Builder.prototype.offset = function () {
  2012. return this.bb.capacity() - this.space;
  2013. };
  2014. /**
  2015. * Doubles the size of the backing ByteBuffer and copies the old data towards
  2016. * the end of the new buffer (since we build the buffer backwards).
  2017. *
  2018. * @param bb The current buffer with the existing data
  2019. * @returns A new byte buffer with the old data copied
  2020. * to it. The data is located at the end of the buffer.
  2021. *
  2022. * uint8Array.set() formally takes {Array<number>|ArrayBufferView}, so to pass
  2023. * it a uint8Array we need to suppress the type check:
  2024. * @suppress {checkTypes}
  2025. */
  2026. Builder.growByteBuffer = function (bb) {
  2027. var old_buf_size = bb.capacity();
  2028. // Ensure we don't grow beyond what fits in an int.
  2029. if (old_buf_size & 0xC0000000) {
  2030. throw new Error('FlatBuffers: cannot grow buffer beyond 2 gigabytes.');
  2031. }
  2032. var new_buf_size = old_buf_size << 1;
  2033. var nbb = byte_buffer_js_1.ByteBuffer.allocate(new_buf_size);
  2034. nbb.setPosition(new_buf_size - old_buf_size);
  2035. nbb.bytes().set(bb.bytes(), new_buf_size - old_buf_size);
  2036. return nbb;
  2037. };
  2038. /**
  2039. * Adds on offset, relative to where it will be written.
  2040. *
  2041. * @param offset The offset to add.
  2042. */
  2043. Builder.prototype.addOffset = function (offset) {
  2044. this.prep(constants_js_1.SIZEOF_INT, 0); // Ensure alignment is already done.
  2045. this.writeInt32(this.offset() - offset + constants_js_1.SIZEOF_INT);
  2046. };
  2047. /**
  2048. * Start encoding a new object in the buffer. Users will not usually need to
  2049. * call this directly. The FlatBuffers compiler will generate helper methods
  2050. * that call this method internally.
  2051. */
  2052. Builder.prototype.startObject = function (numfields) {
  2053. this.notNested();
  2054. if (this.vtable == null) {
  2055. this.vtable = [];
  2056. }
  2057. this.vtable_in_use = numfields;
  2058. for (var i = 0; i < numfields; i++) {
  2059. this.vtable[i] = 0; // This will push additional elements as needed
  2060. }
  2061. this.isNested = true;
  2062. this.object_start = this.offset();
  2063. };
  2064. /**
  2065. * Finish off writing the object that is under construction.
  2066. *
  2067. * @returns The offset to the object inside `dataBuffer`
  2068. */
  2069. Builder.prototype.endObject = function () {
  2070. if (this.vtable == null || !this.isNested) {
  2071. throw new Error('FlatBuffers: endObject called without startObject');
  2072. }
  2073. this.addInt32(0);
  2074. var vtableloc = this.offset();
  2075. // Trim trailing zeroes.
  2076. var i = this.vtable_in_use - 1;
  2077. // eslint-disable-next-line no-empty
  2078. for (; i >= 0 && this.vtable[i] == 0; i--) {}
  2079. var trimmed_size = i + 1;
  2080. // Write out the current vtable.
  2081. for (; i >= 0; i--) {
  2082. // Offset relative to the start of the table.
  2083. this.addInt16(this.vtable[i] != 0 ? vtableloc - this.vtable[i] : 0);
  2084. }
  2085. var standard_fields = 2; // The fields below:
  2086. this.addInt16(vtableloc - this.object_start);
  2087. var len = (trimmed_size + standard_fields) * constants_js_1.SIZEOF_SHORT;
  2088. this.addInt16(len);
  2089. // Search for an existing vtable that matches the current one.
  2090. var existing_vtable = 0;
  2091. var vt1 = this.space;
  2092. outer_loop: for (i = 0; i < this.vtables.length; i++) {
  2093. var vt2 = this.bb.capacity() - this.vtables[i];
  2094. if (len == this.bb.readInt16(vt2)) {
  2095. for (var j = constants_js_1.SIZEOF_SHORT; j < len; j += constants_js_1.SIZEOF_SHORT) {
  2096. if (this.bb.readInt16(vt1 + j) != this.bb.readInt16(vt2 + j)) {
  2097. continue outer_loop;
  2098. }
  2099. }
  2100. existing_vtable = this.vtables[i];
  2101. break;
  2102. }
  2103. }
  2104. if (existing_vtable) {
  2105. // Found a match:
  2106. // Remove the current vtable.
  2107. this.space = this.bb.capacity() - vtableloc;
  2108. // Point table to existing vtable.
  2109. this.bb.writeInt32(this.space, existing_vtable - vtableloc);
  2110. } else {
  2111. // No match:
  2112. // Add the location of the current vtable to the list of vtables.
  2113. this.vtables.push(this.offset());
  2114. // Point table to current vtable.
  2115. this.bb.writeInt32(this.bb.capacity() - vtableloc, this.offset() - vtableloc);
  2116. }
  2117. this.isNested = false;
  2118. return vtableloc;
  2119. };
  2120. /**
  2121. * Finalize a buffer, poiting to the given `root_table`.
  2122. */
  2123. Builder.prototype.finish = function (root_table, opt_file_identifier, opt_size_prefix) {
  2124. var size_prefix = opt_size_prefix ? constants_js_1.SIZE_PREFIX_LENGTH : 0;
  2125. if (opt_file_identifier) {
  2126. var file_identifier = opt_file_identifier;
  2127. this.prep(this.minalign, constants_js_1.SIZEOF_INT + constants_js_1.FILE_IDENTIFIER_LENGTH + size_prefix);
  2128. if (file_identifier.length != constants_js_1.FILE_IDENTIFIER_LENGTH) {
  2129. throw new Error('FlatBuffers: file identifier must be length ' + constants_js_1.FILE_IDENTIFIER_LENGTH);
  2130. }
  2131. for (var i = constants_js_1.FILE_IDENTIFIER_LENGTH - 1; i >= 0; i--) {
  2132. this.writeInt8(file_identifier.charCodeAt(i));
  2133. }
  2134. }
  2135. this.prep(this.minalign, constants_js_1.SIZEOF_INT + size_prefix);
  2136. this.addOffset(root_table);
  2137. if (size_prefix) {
  2138. this.addInt32(this.bb.capacity() - this.space);
  2139. }
  2140. this.bb.setPosition(this.space);
  2141. };
  2142. /**
  2143. * Finalize a size prefixed buffer, pointing to the given `root_table`.
  2144. */
  2145. Builder.prototype.finishSizePrefixed = function (root_table, opt_file_identifier) {
  2146. this.finish(root_table, opt_file_identifier, true);
  2147. };
  2148. /**
  2149. * This checks a required field has been set in a given table that has
  2150. * just been constructed.
  2151. */
  2152. Builder.prototype.requiredField = function (table, field) {
  2153. var table_start = this.bb.capacity() - table;
  2154. var vtable_start = table_start - this.bb.readInt32(table_start);
  2155. var ok = this.bb.readInt16(vtable_start + field) != 0;
  2156. // If this fails, the caller will show what field needs to be set.
  2157. if (!ok) {
  2158. throw new Error('FlatBuffers: field ' + field + ' must be set');
  2159. }
  2160. };
  2161. /**
  2162. * Start a new array/vector of objects. Users usually will not call
  2163. * this directly. The FlatBuffers compiler will create a start/end
  2164. * method for vector types in generated code.
  2165. *
  2166. * @param elem_size The size of each element in the array
  2167. * @param num_elems The number of elements in the array
  2168. * @param alignment The alignment of the array
  2169. */
  2170. Builder.prototype.startVector = function (elem_size, num_elems, alignment) {
  2171. this.notNested();
  2172. this.vector_num_elems = num_elems;
  2173. this.prep(constants_js_1.SIZEOF_INT, elem_size * num_elems);
  2174. this.prep(alignment, elem_size * num_elems); // Just in case alignment > int.
  2175. };
  2176. /**
  2177. * Finish off the creation of an array and all its elements. The array must be
  2178. * created with `startVector`.
  2179. *
  2180. * @returns The offset at which the newly created array
  2181. * starts.
  2182. */
  2183. Builder.prototype.endVector = function () {
  2184. this.writeInt32(this.vector_num_elems);
  2185. return this.offset();
  2186. };
  2187. /**
  2188. * Encode the string `s` in the buffer using UTF-8. If the string passed has
  2189. * already been seen, we return the offset of the already written string
  2190. *
  2191. * @param s The string to encode
  2192. * @return The offset in the buffer where the encoded string starts
  2193. */
  2194. Builder.prototype.createSharedString = function (s) {
  2195. if (!s) {
  2196. return 0;
  2197. }
  2198. if (!this.string_maps) {
  2199. this.string_maps = new Map();
  2200. }
  2201. if (this.string_maps.has(s)) {
  2202. return this.string_maps.get(s);
  2203. }
  2204. var offset = this.createString(s);
  2205. this.string_maps.set(s, offset);
  2206. return offset;
  2207. };
  2208. /**
  2209. * Encode the string `s` in the buffer using UTF-8. If a Uint8Array is passed
  2210. * instead of a string, it is assumed to contain valid UTF-8 encoded data.
  2211. *
  2212. * @param s The string to encode
  2213. * @return The offset in the buffer where the encoded string starts
  2214. */
  2215. Builder.prototype.createString = function (s) {
  2216. if (s === null || s === undefined) {
  2217. return 0;
  2218. }
  2219. var utf8;
  2220. if (s instanceof Uint8Array) {
  2221. utf8 = s;
  2222. } else {
  2223. utf8 = [];
  2224. var i = 0;
  2225. while (i < s.length) {
  2226. var codePoint = void 0;
  2227. // Decode UTF-16
  2228. var a = s.charCodeAt(i++);
  2229. if (a < 0xD800 || a >= 0xDC00) {
  2230. codePoint = a;
  2231. } else {
  2232. var b = s.charCodeAt(i++);
  2233. codePoint = (a << 10) + b + (0x10000 - (0xD800 << 10) - 0xDC00);
  2234. }
  2235. // Encode UTF-8
  2236. if (codePoint < 0x80) {
  2237. utf8.push(codePoint);
  2238. } else {
  2239. if (codePoint < 0x800) {
  2240. utf8.push(codePoint >> 6 & 0x1F | 0xC0);
  2241. } else {
  2242. if (codePoint < 0x10000) {
  2243. utf8.push(codePoint >> 12 & 0x0F | 0xE0);
  2244. } else {
  2245. utf8.push(codePoint >> 18 & 0x07 | 0xF0, codePoint >> 12 & 0x3F | 0x80);
  2246. }
  2247. utf8.push(codePoint >> 6 & 0x3F | 0x80);
  2248. }
  2249. utf8.push(codePoint & 0x3F | 0x80);
  2250. }
  2251. }
  2252. }
  2253. this.addInt8(0);
  2254. this.startVector(1, utf8.length, 1);
  2255. this.bb.setPosition(this.space -= utf8.length);
  2256. for (var i = 0, offset = this.space, bytes = this.bb.bytes(); i < utf8.length; i++) {
  2257. bytes[offset++] = utf8[i];
  2258. }
  2259. return this.endVector();
  2260. };
  2261. /**
  2262. * A helper function to pack an object
  2263. *
  2264. * @returns offset of obj
  2265. */
  2266. Builder.prototype.createObjectOffset = function (obj) {
  2267. if (obj === null) {
  2268. return 0;
  2269. }
  2270. if (typeof obj === 'string') {
  2271. return this.createString(obj);
  2272. } else {
  2273. return obj.pack(this);
  2274. }
  2275. };
  2276. /**
  2277. * A helper function to pack a list of object
  2278. *
  2279. * @returns list of offsets of each non null object
  2280. */
  2281. Builder.prototype.createObjectOffsetList = function (list) {
  2282. var ret = [];
  2283. for (var i = 0; i < list.length; ++i) {
  2284. var val = list[i];
  2285. if (val !== null) {
  2286. ret.push(this.createObjectOffset(val));
  2287. } else {
  2288. throw new Error('FlatBuffers: Argument for createObjectOffsetList cannot contain null.');
  2289. }
  2290. }
  2291. return ret;
  2292. };
  2293. Builder.prototype.createStructOffsetList = function (list, startFunc) {
  2294. startFunc(this, list.length);
  2295. this.createObjectOffsetList(list);
  2296. return this.endVector();
  2297. };
  2298. return Builder;
  2299. }();
  2300. exports.Builder = Builder;
  2301. /***/ }),
  2302. /***/ 1603:
  2303. /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
  2304. "use strict";
  2305. Object.defineProperty(exports, "__esModule", ({
  2306. value: true
  2307. }));
  2308. exports.ByteBuffer = void 0;
  2309. var constants_js_1 = __webpack_require__(1083);
  2310. var utils_js_1 = __webpack_require__(8700);
  2311. var encoding_js_1 = __webpack_require__(1958);
  2312. var ByteBuffer = /** @class */function () {
  2313. /**
  2314. * Create a new ByteBuffer with a given array of bytes (`Uint8Array`)
  2315. */
  2316. function ByteBuffer(bytes_) {
  2317. this.bytes_ = bytes_;
  2318. this.position_ = 0;
  2319. }
  2320. /**
  2321. * Create and allocate a new ByteBuffer with a given size.
  2322. */
  2323. ByteBuffer.allocate = function (byte_size) {
  2324. return new ByteBuffer(new Uint8Array(byte_size));
  2325. };
  2326. ByteBuffer.prototype.clear = function () {
  2327. this.position_ = 0;
  2328. };
  2329. /**
  2330. * Get the underlying `Uint8Array`.
  2331. */
  2332. ByteBuffer.prototype.bytes = function () {
  2333. return this.bytes_;
  2334. };
  2335. /**
  2336. * Get the buffer's position.
  2337. */
  2338. ByteBuffer.prototype.position = function () {
  2339. return this.position_;
  2340. };
  2341. /**
  2342. * Set the buffer's position.
  2343. */
  2344. ByteBuffer.prototype.setPosition = function (position) {
  2345. this.position_ = position;
  2346. };
  2347. /**
  2348. * Get the buffer's capacity.
  2349. */
  2350. ByteBuffer.prototype.capacity = function () {
  2351. return this.bytes_.length;
  2352. };
  2353. ByteBuffer.prototype.readInt8 = function (offset) {
  2354. return this.readUint8(offset) << 24 >> 24;
  2355. };
  2356. ByteBuffer.prototype.readUint8 = function (offset) {
  2357. return this.bytes_[offset];
  2358. };
  2359. ByteBuffer.prototype.readInt16 = function (offset) {
  2360. return this.readUint16(offset) << 16 >> 16;
  2361. };
  2362. ByteBuffer.prototype.readUint16 = function (offset) {
  2363. return this.bytes_[offset] | this.bytes_[offset + 1] << 8;
  2364. };
  2365. ByteBuffer.prototype.readInt32 = function (offset) {
  2366. return this.bytes_[offset] | this.bytes_[offset + 1] << 8 | this.bytes_[offset + 2] << 16 | this.bytes_[offset + 3] << 24;
  2367. };
  2368. ByteBuffer.prototype.readUint32 = function (offset) {
  2369. return this.readInt32(offset) >>> 0;
  2370. };
  2371. ByteBuffer.prototype.readInt64 = function (offset) {
  2372. return BigInt.asIntN(64, BigInt(this.readUint32(offset)) + (BigInt(this.readUint32(offset + 4)) << BigInt(32)));
  2373. };
  2374. ByteBuffer.prototype.readUint64 = function (offset) {
  2375. return BigInt.asUintN(64, BigInt(this.readUint32(offset)) + (BigInt(this.readUint32(offset + 4)) << BigInt(32)));
  2376. };
  2377. ByteBuffer.prototype.readFloat32 = function (offset) {
  2378. utils_js_1.int32[0] = this.readInt32(offset);
  2379. return utils_js_1.float32[0];
  2380. };
  2381. ByteBuffer.prototype.readFloat64 = function (offset) {
  2382. utils_js_1.int32[utils_js_1.isLittleEndian ? 0 : 1] = this.readInt32(offset);
  2383. utils_js_1.int32[utils_js_1.isLittleEndian ? 1 : 0] = this.readInt32(offset + 4);
  2384. return utils_js_1.float64[0];
  2385. };
  2386. ByteBuffer.prototype.writeInt8 = function (offset, value) {
  2387. this.bytes_[offset] = value;
  2388. };
  2389. ByteBuffer.prototype.writeUint8 = function (offset, value) {
  2390. this.bytes_[offset] = value;
  2391. };
  2392. ByteBuffer.prototype.writeInt16 = function (offset, value) {
  2393. this.bytes_[offset] = value;
  2394. this.bytes_[offset + 1] = value >> 8;
  2395. };
  2396. ByteBuffer.prototype.writeUint16 = function (offset, value) {
  2397. this.bytes_[offset] = value;
  2398. this.bytes_[offset + 1] = value >> 8;
  2399. };
  2400. ByteBuffer.prototype.writeInt32 = function (offset, value) {
  2401. this.bytes_[offset] = value;
  2402. this.bytes_[offset + 1] = value >> 8;
  2403. this.bytes_[offset + 2] = value >> 16;
  2404. this.bytes_[offset + 3] = value >> 24;
  2405. };
  2406. ByteBuffer.prototype.writeUint32 = function (offset, value) {
  2407. this.bytes_[offset] = value;
  2408. this.bytes_[offset + 1] = value >> 8;
  2409. this.bytes_[offset + 2] = value >> 16;
  2410. this.bytes_[offset + 3] = value >> 24;
  2411. };
  2412. ByteBuffer.prototype.writeInt64 = function (offset, value) {
  2413. this.writeInt32(offset, Number(BigInt.asIntN(32, value)));
  2414. this.writeInt32(offset + 4, Number(BigInt.asIntN(32, value >> BigInt(32))));
  2415. };
  2416. ByteBuffer.prototype.writeUint64 = function (offset, value) {
  2417. this.writeUint32(offset, Number(BigInt.asUintN(32, value)));
  2418. this.writeUint32(offset + 4, Number(BigInt.asUintN(32, value >> BigInt(32))));
  2419. };
  2420. ByteBuffer.prototype.writeFloat32 = function (offset, value) {
  2421. utils_js_1.float32[0] = value;
  2422. this.writeInt32(offset, utils_js_1.int32[0]);
  2423. };
  2424. ByteBuffer.prototype.writeFloat64 = function (offset, value) {
  2425. utils_js_1.float64[0] = value;
  2426. this.writeInt32(offset, utils_js_1.int32[utils_js_1.isLittleEndian ? 0 : 1]);
  2427. this.writeInt32(offset + 4, utils_js_1.int32[utils_js_1.isLittleEndian ? 1 : 0]);
  2428. };
  2429. /**
  2430. * Return the file identifier. Behavior is undefined for FlatBuffers whose
  2431. * schema does not include a file_identifier (likely points at padding or the
  2432. * start of a the root vtable).
  2433. */
  2434. ByteBuffer.prototype.getBufferIdentifier = function () {
  2435. if (this.bytes_.length < this.position_ + constants_js_1.SIZEOF_INT + constants_js_1.FILE_IDENTIFIER_LENGTH) {
  2436. throw new Error('FlatBuffers: ByteBuffer is too short to contain an identifier.');
  2437. }
  2438. var result = "";
  2439. for (var i = 0; i < constants_js_1.FILE_IDENTIFIER_LENGTH; i++) {
  2440. result += String.fromCharCode(this.readInt8(this.position_ + constants_js_1.SIZEOF_INT + i));
  2441. }
  2442. return result;
  2443. };
  2444. /**
  2445. * Look up a field in the vtable, return an offset into the object, or 0 if the
  2446. * field is not present.
  2447. */
  2448. ByteBuffer.prototype.__offset = function (bb_pos, vtable_offset) {
  2449. var vtable = bb_pos - this.readInt32(bb_pos);
  2450. return vtable_offset < this.readInt16(vtable) ? this.readInt16(vtable + vtable_offset) : 0;
  2451. };
  2452. /**
  2453. * Initialize any Table-derived type to point to the union at the given offset.
  2454. */
  2455. ByteBuffer.prototype.__union = function (t, offset) {
  2456. t.bb_pos = offset + this.readInt32(offset);
  2457. t.bb = this;
  2458. return t;
  2459. };
  2460. /**
  2461. * Create a JavaScript string from UTF-8 data stored inside the FlatBuffer.
  2462. * This allocates a new string and converts to wide chars upon each access.
  2463. *
  2464. * To avoid the conversion to UTF-16, pass Encoding.UTF8_BYTES as
  2465. * the "optionalEncoding" argument. This is useful for avoiding conversion to
  2466. * and from UTF-16 when the data will just be packaged back up in another
  2467. * FlatBuffer later on.
  2468. *
  2469. * @param offset
  2470. * @param opt_encoding Defaults to UTF16_STRING
  2471. */
  2472. ByteBuffer.prototype.__string = function (offset, opt_encoding) {
  2473. offset += this.readInt32(offset);
  2474. var length = this.readInt32(offset);
  2475. var result = '';
  2476. var i = 0;
  2477. offset += constants_js_1.SIZEOF_INT;
  2478. if (opt_encoding === encoding_js_1.Encoding.UTF8_BYTES) {
  2479. return this.bytes_.subarray(offset, offset + length);
  2480. }
  2481. while (i < length) {
  2482. var codePoint = void 0;
  2483. // Decode UTF-8
  2484. var a = this.readUint8(offset + i++);
  2485. if (a < 0xC0) {
  2486. codePoint = a;
  2487. } else {
  2488. var b = this.readUint8(offset + i++);
  2489. if (a < 0xE0) {
  2490. codePoint = (a & 0x1F) << 6 | b & 0x3F;
  2491. } else {
  2492. var c = this.readUint8(offset + i++);
  2493. if (a < 0xF0) {
  2494. codePoint = (a & 0x0F) << 12 | (b & 0x3F) << 6 | c & 0x3F;
  2495. } else {
  2496. var d = this.readUint8(offset + i++);
  2497. codePoint = (a & 0x07) << 18 | (b & 0x3F) << 12 | (c & 0x3F) << 6 | d & 0x3F;
  2498. }
  2499. }
  2500. }
  2501. // Encode UTF-16
  2502. if (codePoint < 0x10000) {
  2503. result += String.fromCharCode(codePoint);
  2504. } else {
  2505. codePoint -= 0x10000;
  2506. result += String.fromCharCode((codePoint >> 10) + 0xD800, (codePoint & (1 << 10) - 1) + 0xDC00);
  2507. }
  2508. }
  2509. return result;
  2510. };
  2511. /**
  2512. * Handle unions that can contain string as its member, if a Table-derived type then initialize it,
  2513. * if a string then return a new one
  2514. *
  2515. * WARNING: strings are immutable in JS so we can't change the string that the user gave us, this
  2516. * makes the behaviour of __union_with_string different compared to __union
  2517. */
  2518. ByteBuffer.prototype.__union_with_string = function (o, offset) {
  2519. if (typeof o === 'string') {
  2520. return this.__string(offset);
  2521. }
  2522. return this.__union(o, offset);
  2523. };
  2524. /**
  2525. * Retrieve the relative offset stored at "offset"
  2526. */
  2527. ByteBuffer.prototype.__indirect = function (offset) {
  2528. return offset + this.readInt32(offset);
  2529. };
  2530. /**
  2531. * Get the start of data of a vector whose offset is stored at "offset" in this object.
  2532. */
  2533. ByteBuffer.prototype.__vector = function (offset) {
  2534. return offset + this.readInt32(offset) + constants_js_1.SIZEOF_INT; // data starts after the length
  2535. };
  2536. /**
  2537. * Get the length of a vector whose offset is stored at "offset" in this object.
  2538. */
  2539. ByteBuffer.prototype.__vector_len = function (offset) {
  2540. return this.readInt32(offset + this.readInt32(offset));
  2541. };
  2542. ByteBuffer.prototype.__has_identifier = function (ident) {
  2543. if (ident.length != constants_js_1.FILE_IDENTIFIER_LENGTH) {
  2544. throw new Error('FlatBuffers: file identifier must be length ' + constants_js_1.FILE_IDENTIFIER_LENGTH);
  2545. }
  2546. for (var i = 0; i < constants_js_1.FILE_IDENTIFIER_LENGTH; i++) {
  2547. if (ident.charCodeAt(i) != this.readInt8(this.position() + constants_js_1.SIZEOF_INT + i)) {
  2548. return false;
  2549. }
  2550. }
  2551. return true;
  2552. };
  2553. /**
  2554. * A helper function for generating list for obj api
  2555. */
  2556. ByteBuffer.prototype.createScalarList = function (listAccessor, listLength) {
  2557. var ret = [];
  2558. for (var i = 0; i < listLength; ++i) {
  2559. if (listAccessor(i) !== null) {
  2560. ret.push(listAccessor(i));
  2561. }
  2562. }
  2563. return ret;
  2564. };
  2565. /**
  2566. * A helper function for generating list for obj api
  2567. * @param listAccessor function that accepts an index and return data at that index
  2568. * @param listLength listLength
  2569. * @param res result list
  2570. */
  2571. ByteBuffer.prototype.createObjList = function (listAccessor, listLength) {
  2572. var ret = [];
  2573. for (var i = 0; i < listLength; ++i) {
  2574. var val = listAccessor(i);
  2575. if (val !== null) {
  2576. ret.push(val.unpack());
  2577. }
  2578. }
  2579. return ret;
  2580. };
  2581. return ByteBuffer;
  2582. }();
  2583. exports.ByteBuffer = ByteBuffer;
  2584. /***/ }),
  2585. /***/ 1083:
  2586. /***/ (function(__unused_webpack_module, exports) {
  2587. "use strict";
  2588. Object.defineProperty(exports, "__esModule", ({
  2589. value: true
  2590. }));
  2591. exports.SIZE_PREFIX_LENGTH = exports.FILE_IDENTIFIER_LENGTH = exports.SIZEOF_INT = exports.SIZEOF_SHORT = void 0;
  2592. exports.SIZEOF_SHORT = 2;
  2593. exports.SIZEOF_INT = 4;
  2594. exports.FILE_IDENTIFIER_LENGTH = 4;
  2595. exports.SIZE_PREFIX_LENGTH = 4;
  2596. /***/ }),
  2597. /***/ 1958:
  2598. /***/ (function(__unused_webpack_module, exports) {
  2599. "use strict";
  2600. Object.defineProperty(exports, "__esModule", ({
  2601. value: true
  2602. }));
  2603. exports.Encoding = void 0;
  2604. var Encoding;
  2605. (function (Encoding) {
  2606. Encoding[Encoding["UTF8_BYTES"] = 1] = "UTF8_BYTES";
  2607. Encoding[Encoding["UTF16_STRING"] = 2] = "UTF16_STRING";
  2608. })(Encoding = exports.Encoding || (exports.Encoding = {}));
  2609. /***/ }),
  2610. /***/ 1095:
  2611. /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
  2612. "use strict";
  2613. var __webpack_unused_export__;
  2614. __webpack_unused_export__ = ({
  2615. value: true
  2616. });
  2617. exports.cZ = __webpack_unused_export__ = __webpack_unused_export__ = __webpack_unused_export__ = __webpack_unused_export__ = __webpack_unused_export__ = __webpack_unused_export__ = exports.XU = __webpack_unused_export__ = __webpack_unused_export__ = __webpack_unused_export__ = void 0;
  2618. var constants_js_1 = __webpack_require__(1083);
  2619. __webpack_unused_export__ = ({
  2620. enumerable: true,
  2621. get: function get() {
  2622. return constants_js_1.SIZEOF_SHORT;
  2623. }
  2624. });
  2625. var constants_js_2 = __webpack_require__(1083);
  2626. __webpack_unused_export__ = ({
  2627. enumerable: true,
  2628. get: function get() {
  2629. return constants_js_2.SIZEOF_INT;
  2630. }
  2631. });
  2632. var constants_js_3 = __webpack_require__(1083);
  2633. __webpack_unused_export__ = ({
  2634. enumerable: true,
  2635. get: function get() {
  2636. return constants_js_3.FILE_IDENTIFIER_LENGTH;
  2637. }
  2638. });
  2639. var constants_js_4 = __webpack_require__(1083);
  2640. Object.defineProperty(exports, "XU", ({
  2641. enumerable: true,
  2642. get: function get() {
  2643. return constants_js_4.SIZE_PREFIX_LENGTH;
  2644. }
  2645. }));
  2646. var utils_js_1 = __webpack_require__(8700);
  2647. __webpack_unused_export__ = ({
  2648. enumerable: true,
  2649. get: function get() {
  2650. return utils_js_1.int32;
  2651. }
  2652. });
  2653. __webpack_unused_export__ = ({
  2654. enumerable: true,
  2655. get: function get() {
  2656. return utils_js_1.float32;
  2657. }
  2658. });
  2659. __webpack_unused_export__ = ({
  2660. enumerable: true,
  2661. get: function get() {
  2662. return utils_js_1.float64;
  2663. }
  2664. });
  2665. __webpack_unused_export__ = ({
  2666. enumerable: true,
  2667. get: function get() {
  2668. return utils_js_1.isLittleEndian;
  2669. }
  2670. });
  2671. var encoding_js_1 = __webpack_require__(1958);
  2672. __webpack_unused_export__ = ({
  2673. enumerable: true,
  2674. get: function get() {
  2675. return encoding_js_1.Encoding;
  2676. }
  2677. });
  2678. var builder_js_1 = __webpack_require__(4634);
  2679. __webpack_unused_export__ = ({
  2680. enumerable: true,
  2681. get: function get() {
  2682. return builder_js_1.Builder;
  2683. }
  2684. });
  2685. var byte_buffer_js_1 = __webpack_require__(1603);
  2686. Object.defineProperty(exports, "cZ", ({
  2687. enumerable: true,
  2688. get: function get() {
  2689. return byte_buffer_js_1.ByteBuffer;
  2690. }
  2691. }));
  2692. /***/ }),
  2693. /***/ 8700:
  2694. /***/ (function(__unused_webpack_module, exports) {
  2695. "use strict";
  2696. Object.defineProperty(exports, "__esModule", ({
  2697. value: true
  2698. }));
  2699. exports.isLittleEndian = exports.float64 = exports.float32 = exports.int32 = void 0;
  2700. exports.int32 = new Int32Array(2);
  2701. exports.float32 = new Float32Array(exports.int32.buffer);
  2702. exports.float64 = new Float64Array(exports.int32.buffer);
  2703. exports.isLittleEndian = new Uint16Array(new Uint8Array([1, 0]).buffer)[0] === 1;
  2704. /***/ }),
  2705. /***/ 8813:
  2706. /***/ (function(module) {
  2707. var containers = []; // will store container HTMLElement references
  2708. var styleElements = []; // will store {prepend: HTMLElement, append: HTMLElement}
  2709. var usage = 'insert-css: You need to provide a CSS string. Usage: insertCss(cssString[, options]).';
  2710. function insertCss(css, options) {
  2711. options = options || {};
  2712. if (css === undefined) {
  2713. throw new Error(usage);
  2714. }
  2715. var position = options.prepend === true ? 'prepend' : 'append';
  2716. var container = options.container !== undefined ? options.container : document.querySelector('head');
  2717. var containerId = containers.indexOf(container);
  2718. // first time we see this container, create the necessary entries
  2719. if (containerId === -1) {
  2720. containerId = containers.push(container) - 1;
  2721. styleElements[containerId] = {};
  2722. }
  2723. // try to get the correponding container + position styleElement, create it otherwise
  2724. var styleElement;
  2725. if (styleElements[containerId] !== undefined && styleElements[containerId][position] !== undefined) {
  2726. styleElement = styleElements[containerId][position];
  2727. } else {
  2728. styleElement = styleElements[containerId][position] = createStyleElement();
  2729. if (position === 'prepend') {
  2730. container.insertBefore(styleElement, container.childNodes[0]);
  2731. } else {
  2732. container.appendChild(styleElement);
  2733. }
  2734. }
  2735. // strip potential UTF-8 BOM if css was read from a file
  2736. if (css.charCodeAt(0) === 0xFEFF) {
  2737. css = css.substr(1, css.length);
  2738. }
  2739. // actually add the stylesheet
  2740. if (styleElement.styleSheet) {
  2741. styleElement.styleSheet.cssText += css;
  2742. } else {
  2743. styleElement.textContent += css;
  2744. }
  2745. return styleElement;
  2746. }
  2747. ;
  2748. function createStyleElement() {
  2749. var styleElement = document.createElement('style');
  2750. styleElement.setAttribute('type', 'text/css');
  2751. return styleElement;
  2752. }
  2753. module.exports = insertCss;
  2754. module.exports.insertCss = insertCss;
  2755. /***/ }),
  2756. /***/ 2138:
  2757. /***/ (function(module, exports, __webpack_require__) {
  2758. /* module decorator */ module = __webpack_require__.nmd(module);
  2759. function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
  2760. /**
  2761. * lodash (Custom Build) <https://lodash.com/>
  2762. * Build: `lodash modularize exports="npm" -o ./`
  2763. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  2764. * Released under MIT license <https://lodash.com/license>
  2765. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  2766. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  2767. */
  2768. /** Used as the size to enable large array optimizations. */
  2769. var LARGE_ARRAY_SIZE = 200;
  2770. /** Used to stand-in for `undefined` hash values. */
  2771. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  2772. /** Used as references for various `Number` constants. */
  2773. var MAX_SAFE_INTEGER = 9007199254740991;
  2774. /** `Object#toString` result references. */
  2775. var argsTag = '[object Arguments]',
  2776. arrayTag = '[object Array]',
  2777. boolTag = '[object Boolean]',
  2778. dateTag = '[object Date]',
  2779. errorTag = '[object Error]',
  2780. funcTag = '[object Function]',
  2781. genTag = '[object GeneratorFunction]',
  2782. mapTag = '[object Map]',
  2783. numberTag = '[object Number]',
  2784. objectTag = '[object Object]',
  2785. promiseTag = '[object Promise]',
  2786. regexpTag = '[object RegExp]',
  2787. setTag = '[object Set]',
  2788. stringTag = '[object String]',
  2789. symbolTag = '[object Symbol]',
  2790. weakMapTag = '[object WeakMap]';
  2791. var arrayBufferTag = '[object ArrayBuffer]',
  2792. dataViewTag = '[object DataView]',
  2793. float32Tag = '[object Float32Array]',
  2794. float64Tag = '[object Float64Array]',
  2795. int8Tag = '[object Int8Array]',
  2796. int16Tag = '[object Int16Array]',
  2797. int32Tag = '[object Int32Array]',
  2798. uint8Tag = '[object Uint8Array]',
  2799. uint8ClampedTag = '[object Uint8ClampedArray]',
  2800. uint16Tag = '[object Uint16Array]',
  2801. uint32Tag = '[object Uint32Array]';
  2802. /**
  2803. * Used to match `RegExp`
  2804. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  2805. */
  2806. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  2807. /** Used to match `RegExp` flags from their coerced string values. */
  2808. var reFlags = /\w*$/;
  2809. /** Used to detect host constructors (Safari). */
  2810. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  2811. /** Used to detect unsigned integer values. */
  2812. var reIsUint = /^(?:0|[1-9]\d*)$/;
  2813. /** Used to identify `toStringTag` values supported by `_.clone`. */
  2814. var cloneableTags = {};
  2815. cloneableTags[argsTag] = cloneableTags[arrayTag] = cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = cloneableTags[boolTag] = cloneableTags[dateTag] = cloneableTags[float32Tag] = cloneableTags[float64Tag] = cloneableTags[int8Tag] = cloneableTags[int16Tag] = cloneableTags[int32Tag] = cloneableTags[mapTag] = cloneableTags[numberTag] = cloneableTags[objectTag] = cloneableTags[regexpTag] = cloneableTags[setTag] = cloneableTags[stringTag] = cloneableTags[symbolTag] = cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
  2816. cloneableTags[errorTag] = cloneableTags[funcTag] = cloneableTags[weakMapTag] = false;
  2817. /** Detect free variable `global` from Node.js. */
  2818. var freeGlobal = (typeof __webpack_require__.g === "undefined" ? "undefined" : _typeof(__webpack_require__.g)) == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;
  2819. /** Detect free variable `self`. */
  2820. var freeSelf = (typeof self === "undefined" ? "undefined" : _typeof(self)) == 'object' && self && self.Object === Object && self;
  2821. /** Used as a reference to the global object. */
  2822. var root = freeGlobal || freeSelf || Function('return this')();
  2823. /** Detect free variable `exports`. */
  2824. var freeExports = ( false ? 0 : _typeof(exports)) == 'object' && exports && !exports.nodeType && exports;
  2825. /** Detect free variable `module`. */
  2826. var freeModule = freeExports && ( false ? 0 : _typeof(module)) == 'object' && module && !module.nodeType && module;
  2827. /** Detect the popular CommonJS extension `module.exports`. */
  2828. var moduleExports = freeModule && freeModule.exports === freeExports;
  2829. /**
  2830. * Adds the key-value `pair` to `map`.
  2831. *
  2832. * @private
  2833. * @param {Object} map The map to modify.
  2834. * @param {Array} pair The key-value pair to add.
  2835. * @returns {Object} Returns `map`.
  2836. */
  2837. function addMapEntry(map, pair) {
  2838. // Don't return `map.set` because it's not chainable in IE 11.
  2839. map.set(pair[0], pair[1]);
  2840. return map;
  2841. }
  2842. /**
  2843. * Adds `value` to `set`.
  2844. *
  2845. * @private
  2846. * @param {Object} set The set to modify.
  2847. * @param {*} value The value to add.
  2848. * @returns {Object} Returns `set`.
  2849. */
  2850. function addSetEntry(set, value) {
  2851. // Don't return `set.add` because it's not chainable in IE 11.
  2852. set.add(value);
  2853. return set;
  2854. }
  2855. /**
  2856. * A specialized version of `_.forEach` for arrays without support for
  2857. * iteratee shorthands.
  2858. *
  2859. * @private
  2860. * @param {Array} [array] The array to iterate over.
  2861. * @param {Function} iteratee The function invoked per iteration.
  2862. * @returns {Array} Returns `array`.
  2863. */
  2864. function arrayEach(array, iteratee) {
  2865. var index = -1,
  2866. length = array ? array.length : 0;
  2867. while (++index < length) {
  2868. if (iteratee(array[index], index, array) === false) {
  2869. break;
  2870. }
  2871. }
  2872. return array;
  2873. }
  2874. /**
  2875. * Appends the elements of `values` to `array`.
  2876. *
  2877. * @private
  2878. * @param {Array} array The array to modify.
  2879. * @param {Array} values The values to append.
  2880. * @returns {Array} Returns `array`.
  2881. */
  2882. function arrayPush(array, values) {
  2883. var index = -1,
  2884. length = values.length,
  2885. offset = array.length;
  2886. while (++index < length) {
  2887. array[offset + index] = values[index];
  2888. }
  2889. return array;
  2890. }
  2891. /**
  2892. * A specialized version of `_.reduce` for arrays without support for
  2893. * iteratee shorthands.
  2894. *
  2895. * @private
  2896. * @param {Array} [array] The array to iterate over.
  2897. * @param {Function} iteratee The function invoked per iteration.
  2898. * @param {*} [accumulator] The initial value.
  2899. * @param {boolean} [initAccum] Specify using the first element of `array` as
  2900. * the initial value.
  2901. * @returns {*} Returns the accumulated value.
  2902. */
  2903. function arrayReduce(array, iteratee, accumulator, initAccum) {
  2904. var index = -1,
  2905. length = array ? array.length : 0;
  2906. if (initAccum && length) {
  2907. accumulator = array[++index];
  2908. }
  2909. while (++index < length) {
  2910. accumulator = iteratee(accumulator, array[index], index, array);
  2911. }
  2912. return accumulator;
  2913. }
  2914. /**
  2915. * The base implementation of `_.times` without support for iteratee shorthands
  2916. * or max array length checks.
  2917. *
  2918. * @private
  2919. * @param {number} n The number of times to invoke `iteratee`.
  2920. * @param {Function} iteratee The function invoked per iteration.
  2921. * @returns {Array} Returns the array of results.
  2922. */
  2923. function baseTimes(n, iteratee) {
  2924. var index = -1,
  2925. result = Array(n);
  2926. while (++index < n) {
  2927. result[index] = iteratee(index);
  2928. }
  2929. return result;
  2930. }
  2931. /**
  2932. * Gets the value at `key` of `object`.
  2933. *
  2934. * @private
  2935. * @param {Object} [object] The object to query.
  2936. * @param {string} key The key of the property to get.
  2937. * @returns {*} Returns the property value.
  2938. */
  2939. function getValue(object, key) {
  2940. return object == null ? undefined : object[key];
  2941. }
  2942. /**
  2943. * Checks if `value` is a host object in IE < 9.
  2944. *
  2945. * @private
  2946. * @param {*} value The value to check.
  2947. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  2948. */
  2949. function isHostObject(value) {
  2950. // Many host objects are `Object` objects that can coerce to strings
  2951. // despite having improperly defined `toString` methods.
  2952. var result = false;
  2953. if (value != null && typeof value.toString != 'function') {
  2954. try {
  2955. result = !!(value + '');
  2956. } catch (e) {}
  2957. }
  2958. return result;
  2959. }
  2960. /**
  2961. * Converts `map` to its key-value pairs.
  2962. *
  2963. * @private
  2964. * @param {Object} map The map to convert.
  2965. * @returns {Array} Returns the key-value pairs.
  2966. */
  2967. function mapToArray(map) {
  2968. var index = -1,
  2969. result = Array(map.size);
  2970. map.forEach(function (value, key) {
  2971. result[++index] = [key, value];
  2972. });
  2973. return result;
  2974. }
  2975. /**
  2976. * Creates a unary function that invokes `func` with its argument transformed.
  2977. *
  2978. * @private
  2979. * @param {Function} func The function to wrap.
  2980. * @param {Function} transform The argument transform.
  2981. * @returns {Function} Returns the new function.
  2982. */
  2983. function overArg(func, transform) {
  2984. return function (arg) {
  2985. return func(transform(arg));
  2986. };
  2987. }
  2988. /**
  2989. * Converts `set` to an array of its values.
  2990. *
  2991. * @private
  2992. * @param {Object} set The set to convert.
  2993. * @returns {Array} Returns the values.
  2994. */
  2995. function setToArray(set) {
  2996. var index = -1,
  2997. result = Array(set.size);
  2998. set.forEach(function (value) {
  2999. result[++index] = value;
  3000. });
  3001. return result;
  3002. }
  3003. /** Used for built-in method references. */
  3004. var arrayProto = Array.prototype,
  3005. funcProto = Function.prototype,
  3006. objectProto = Object.prototype;
  3007. /** Used to detect overreaching core-js shims. */
  3008. var coreJsData = root['__core-js_shared__'];
  3009. /** Used to detect methods masquerading as native. */
  3010. var maskSrcKey = function () {
  3011. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  3012. return uid ? 'Symbol(src)_1.' + uid : '';
  3013. }();
  3014. /** Used to resolve the decompiled source of functions. */
  3015. var funcToString = funcProto.toString;
  3016. /** Used to check objects for own properties. */
  3017. var hasOwnProperty = objectProto.hasOwnProperty;
  3018. /**
  3019. * Used to resolve the
  3020. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  3021. * of values.
  3022. */
  3023. var objectToString = objectProto.toString;
  3024. /** Used to detect if a method is native. */
  3025. var reIsNative = RegExp('^' + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&').replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$');
  3026. /** Built-in value references. */
  3027. var Buffer = moduleExports ? root.Buffer : undefined,
  3028. _Symbol = root.Symbol,
  3029. Uint8Array = root.Uint8Array,
  3030. getPrototype = overArg(Object.getPrototypeOf, Object),
  3031. objectCreate = Object.create,
  3032. propertyIsEnumerable = objectProto.propertyIsEnumerable,
  3033. splice = arrayProto.splice;
  3034. /* Built-in method references for those with the same name as other `lodash` methods. */
  3035. var nativeGetSymbols = Object.getOwnPropertySymbols,
  3036. nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
  3037. nativeKeys = overArg(Object.keys, Object);
  3038. /* Built-in method references that are verified to be native. */
  3039. var DataView = getNative(root, 'DataView'),
  3040. Map = getNative(root, 'Map'),
  3041. Promise = getNative(root, 'Promise'),
  3042. Set = getNative(root, 'Set'),
  3043. WeakMap = getNative(root, 'WeakMap'),
  3044. nativeCreate = getNative(Object, 'create');
  3045. /** Used to detect maps, sets, and weakmaps. */
  3046. var dataViewCtorString = toSource(DataView),
  3047. mapCtorString = toSource(Map),
  3048. promiseCtorString = toSource(Promise),
  3049. setCtorString = toSource(Set),
  3050. weakMapCtorString = toSource(WeakMap);
  3051. /** Used to convert symbols to primitives and strings. */
  3052. var symbolProto = _Symbol ? _Symbol.prototype : undefined,
  3053. symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
  3054. /**
  3055. * Creates a hash object.
  3056. *
  3057. * @private
  3058. * @constructor
  3059. * @param {Array} [entries] The key-value pairs to cache.
  3060. */
  3061. function Hash(entries) {
  3062. var index = -1,
  3063. length = entries ? entries.length : 0;
  3064. this.clear();
  3065. while (++index < length) {
  3066. var entry = entries[index];
  3067. this.set(entry[0], entry[1]);
  3068. }
  3069. }
  3070. /**
  3071. * Removes all key-value entries from the hash.
  3072. *
  3073. * @private
  3074. * @name clear
  3075. * @memberOf Hash
  3076. */
  3077. function hashClear() {
  3078. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  3079. }
  3080. /**
  3081. * Removes `key` and its value from the hash.
  3082. *
  3083. * @private
  3084. * @name delete
  3085. * @memberOf Hash
  3086. * @param {Object} hash The hash to modify.
  3087. * @param {string} key The key of the value to remove.
  3088. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3089. */
  3090. function hashDelete(key) {
  3091. return this.has(key) && delete this.__data__[key];
  3092. }
  3093. /**
  3094. * Gets the hash value for `key`.
  3095. *
  3096. * @private
  3097. * @name get
  3098. * @memberOf Hash
  3099. * @param {string} key The key of the value to get.
  3100. * @returns {*} Returns the entry value.
  3101. */
  3102. function hashGet(key) {
  3103. var data = this.__data__;
  3104. if (nativeCreate) {
  3105. var result = data[key];
  3106. return result === HASH_UNDEFINED ? undefined : result;
  3107. }
  3108. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  3109. }
  3110. /**
  3111. * Checks if a hash value for `key` exists.
  3112. *
  3113. * @private
  3114. * @name has
  3115. * @memberOf Hash
  3116. * @param {string} key The key of the entry to check.
  3117. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3118. */
  3119. function hashHas(key) {
  3120. var data = this.__data__;
  3121. return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
  3122. }
  3123. /**
  3124. * Sets the hash `key` to `value`.
  3125. *
  3126. * @private
  3127. * @name set
  3128. * @memberOf Hash
  3129. * @param {string} key The key of the value to set.
  3130. * @param {*} value The value to set.
  3131. * @returns {Object} Returns the hash instance.
  3132. */
  3133. function hashSet(key, value) {
  3134. var data = this.__data__;
  3135. data[key] = nativeCreate && value === undefined ? HASH_UNDEFINED : value;
  3136. return this;
  3137. }
  3138. // Add methods to `Hash`.
  3139. Hash.prototype.clear = hashClear;
  3140. Hash.prototype['delete'] = hashDelete;
  3141. Hash.prototype.get = hashGet;
  3142. Hash.prototype.has = hashHas;
  3143. Hash.prototype.set = hashSet;
  3144. /**
  3145. * Creates an list cache object.
  3146. *
  3147. * @private
  3148. * @constructor
  3149. * @param {Array} [entries] The key-value pairs to cache.
  3150. */
  3151. function ListCache(entries) {
  3152. var index = -1,
  3153. length = entries ? entries.length : 0;
  3154. this.clear();
  3155. while (++index < length) {
  3156. var entry = entries[index];
  3157. this.set(entry[0], entry[1]);
  3158. }
  3159. }
  3160. /**
  3161. * Removes all key-value entries from the list cache.
  3162. *
  3163. * @private
  3164. * @name clear
  3165. * @memberOf ListCache
  3166. */
  3167. function listCacheClear() {
  3168. this.__data__ = [];
  3169. }
  3170. /**
  3171. * Removes `key` and its value from the list cache.
  3172. *
  3173. * @private
  3174. * @name delete
  3175. * @memberOf ListCache
  3176. * @param {string} key The key of the value to remove.
  3177. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3178. */
  3179. function listCacheDelete(key) {
  3180. var data = this.__data__,
  3181. index = assocIndexOf(data, key);
  3182. if (index < 0) {
  3183. return false;
  3184. }
  3185. var lastIndex = data.length - 1;
  3186. if (index == lastIndex) {
  3187. data.pop();
  3188. } else {
  3189. splice.call(data, index, 1);
  3190. }
  3191. return true;
  3192. }
  3193. /**
  3194. * Gets the list cache value for `key`.
  3195. *
  3196. * @private
  3197. * @name get
  3198. * @memberOf ListCache
  3199. * @param {string} key The key of the value to get.
  3200. * @returns {*} Returns the entry value.
  3201. */
  3202. function listCacheGet(key) {
  3203. var data = this.__data__,
  3204. index = assocIndexOf(data, key);
  3205. return index < 0 ? undefined : data[index][1];
  3206. }
  3207. /**
  3208. * Checks if a list cache value for `key` exists.
  3209. *
  3210. * @private
  3211. * @name has
  3212. * @memberOf ListCache
  3213. * @param {string} key The key of the entry to check.
  3214. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3215. */
  3216. function listCacheHas(key) {
  3217. return assocIndexOf(this.__data__, key) > -1;
  3218. }
  3219. /**
  3220. * Sets the list cache `key` to `value`.
  3221. *
  3222. * @private
  3223. * @name set
  3224. * @memberOf ListCache
  3225. * @param {string} key The key of the value to set.
  3226. * @param {*} value The value to set.
  3227. * @returns {Object} Returns the list cache instance.
  3228. */
  3229. function listCacheSet(key, value) {
  3230. var data = this.__data__,
  3231. index = assocIndexOf(data, key);
  3232. if (index < 0) {
  3233. data.push([key, value]);
  3234. } else {
  3235. data[index][1] = value;
  3236. }
  3237. return this;
  3238. }
  3239. // Add methods to `ListCache`.
  3240. ListCache.prototype.clear = listCacheClear;
  3241. ListCache.prototype['delete'] = listCacheDelete;
  3242. ListCache.prototype.get = listCacheGet;
  3243. ListCache.prototype.has = listCacheHas;
  3244. ListCache.prototype.set = listCacheSet;
  3245. /**
  3246. * Creates a map cache object to store key-value pairs.
  3247. *
  3248. * @private
  3249. * @constructor
  3250. * @param {Array} [entries] The key-value pairs to cache.
  3251. */
  3252. function MapCache(entries) {
  3253. var index = -1,
  3254. length = entries ? entries.length : 0;
  3255. this.clear();
  3256. while (++index < length) {
  3257. var entry = entries[index];
  3258. this.set(entry[0], entry[1]);
  3259. }
  3260. }
  3261. /**
  3262. * Removes all key-value entries from the map.
  3263. *
  3264. * @private
  3265. * @name clear
  3266. * @memberOf MapCache
  3267. */
  3268. function mapCacheClear() {
  3269. this.__data__ = {
  3270. 'hash': new Hash(),
  3271. 'map': new (Map || ListCache)(),
  3272. 'string': new Hash()
  3273. };
  3274. }
  3275. /**
  3276. * Removes `key` and its value from the map.
  3277. *
  3278. * @private
  3279. * @name delete
  3280. * @memberOf MapCache
  3281. * @param {string} key The key of the value to remove.
  3282. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3283. */
  3284. function mapCacheDelete(key) {
  3285. return getMapData(this, key)['delete'](key);
  3286. }
  3287. /**
  3288. * Gets the map value for `key`.
  3289. *
  3290. * @private
  3291. * @name get
  3292. * @memberOf MapCache
  3293. * @param {string} key The key of the value to get.
  3294. * @returns {*} Returns the entry value.
  3295. */
  3296. function mapCacheGet(key) {
  3297. return getMapData(this, key).get(key);
  3298. }
  3299. /**
  3300. * Checks if a map value for `key` exists.
  3301. *
  3302. * @private
  3303. * @name has
  3304. * @memberOf MapCache
  3305. * @param {string} key The key of the entry to check.
  3306. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3307. */
  3308. function mapCacheHas(key) {
  3309. return getMapData(this, key).has(key);
  3310. }
  3311. /**
  3312. * Sets the map `key` to `value`.
  3313. *
  3314. * @private
  3315. * @name set
  3316. * @memberOf MapCache
  3317. * @param {string} key The key of the value to set.
  3318. * @param {*} value The value to set.
  3319. * @returns {Object} Returns the map cache instance.
  3320. */
  3321. function mapCacheSet(key, value) {
  3322. getMapData(this, key).set(key, value);
  3323. return this;
  3324. }
  3325. // Add methods to `MapCache`.
  3326. MapCache.prototype.clear = mapCacheClear;
  3327. MapCache.prototype['delete'] = mapCacheDelete;
  3328. MapCache.prototype.get = mapCacheGet;
  3329. MapCache.prototype.has = mapCacheHas;
  3330. MapCache.prototype.set = mapCacheSet;
  3331. /**
  3332. * Creates a stack cache object to store key-value pairs.
  3333. *
  3334. * @private
  3335. * @constructor
  3336. * @param {Array} [entries] The key-value pairs to cache.
  3337. */
  3338. function Stack(entries) {
  3339. this.__data__ = new ListCache(entries);
  3340. }
  3341. /**
  3342. * Removes all key-value entries from the stack.
  3343. *
  3344. * @private
  3345. * @name clear
  3346. * @memberOf Stack
  3347. */
  3348. function stackClear() {
  3349. this.__data__ = new ListCache();
  3350. }
  3351. /**
  3352. * Removes `key` and its value from the stack.
  3353. *
  3354. * @private
  3355. * @name delete
  3356. * @memberOf Stack
  3357. * @param {string} key The key of the value to remove.
  3358. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3359. */
  3360. function stackDelete(key) {
  3361. return this.__data__['delete'](key);
  3362. }
  3363. /**
  3364. * Gets the stack value for `key`.
  3365. *
  3366. * @private
  3367. * @name get
  3368. * @memberOf Stack
  3369. * @param {string} key The key of the value to get.
  3370. * @returns {*} Returns the entry value.
  3371. */
  3372. function stackGet(key) {
  3373. return this.__data__.get(key);
  3374. }
  3375. /**
  3376. * Checks if a stack value for `key` exists.
  3377. *
  3378. * @private
  3379. * @name has
  3380. * @memberOf Stack
  3381. * @param {string} key The key of the entry to check.
  3382. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3383. */
  3384. function stackHas(key) {
  3385. return this.__data__.has(key);
  3386. }
  3387. /**
  3388. * Sets the stack `key` to `value`.
  3389. *
  3390. * @private
  3391. * @name set
  3392. * @memberOf Stack
  3393. * @param {string} key The key of the value to set.
  3394. * @param {*} value The value to set.
  3395. * @returns {Object} Returns the stack cache instance.
  3396. */
  3397. function stackSet(key, value) {
  3398. var cache = this.__data__;
  3399. if (cache instanceof ListCache) {
  3400. var pairs = cache.__data__;
  3401. if (!Map || pairs.length < LARGE_ARRAY_SIZE - 1) {
  3402. pairs.push([key, value]);
  3403. return this;
  3404. }
  3405. cache = this.__data__ = new MapCache(pairs);
  3406. }
  3407. cache.set(key, value);
  3408. return this;
  3409. }
  3410. // Add methods to `Stack`.
  3411. Stack.prototype.clear = stackClear;
  3412. Stack.prototype['delete'] = stackDelete;
  3413. Stack.prototype.get = stackGet;
  3414. Stack.prototype.has = stackHas;
  3415. Stack.prototype.set = stackSet;
  3416. /**
  3417. * Creates an array of the enumerable property names of the array-like `value`.
  3418. *
  3419. * @private
  3420. * @param {*} value The value to query.
  3421. * @param {boolean} inherited Specify returning inherited property names.
  3422. * @returns {Array} Returns the array of property names.
  3423. */
  3424. function arrayLikeKeys(value, inherited) {
  3425. // Safari 8.1 makes `arguments.callee` enumerable in strict mode.
  3426. // Safari 9 makes `arguments.length` enumerable in strict mode.
  3427. var result = isArray(value) || isArguments(value) ? baseTimes(value.length, String) : [];
  3428. var length = result.length,
  3429. skipIndexes = !!length;
  3430. for (var key in value) {
  3431. if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && (key == 'length' || isIndex(key, length)))) {
  3432. result.push(key);
  3433. }
  3434. }
  3435. return result;
  3436. }
  3437. /**
  3438. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  3439. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  3440. * for equality comparisons.
  3441. *
  3442. * @private
  3443. * @param {Object} object The object to modify.
  3444. * @param {string} key The key of the property to assign.
  3445. * @param {*} value The value to assign.
  3446. */
  3447. function assignValue(object, key, value) {
  3448. var objValue = object[key];
  3449. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || value === undefined && !(key in object)) {
  3450. object[key] = value;
  3451. }
  3452. }
  3453. /**
  3454. * Gets the index at which the `key` is found in `array` of key-value pairs.
  3455. *
  3456. * @private
  3457. * @param {Array} array The array to inspect.
  3458. * @param {*} key The key to search for.
  3459. * @returns {number} Returns the index of the matched value, else `-1`.
  3460. */
  3461. function assocIndexOf(array, key) {
  3462. var length = array.length;
  3463. while (length--) {
  3464. if (eq(array[length][0], key)) {
  3465. return length;
  3466. }
  3467. }
  3468. return -1;
  3469. }
  3470. /**
  3471. * The base implementation of `_.assign` without support for multiple sources
  3472. * or `customizer` functions.
  3473. *
  3474. * @private
  3475. * @param {Object} object The destination object.
  3476. * @param {Object} source The source object.
  3477. * @returns {Object} Returns `object`.
  3478. */
  3479. function baseAssign(object, source) {
  3480. return object && copyObject(source, keys(source), object);
  3481. }
  3482. /**
  3483. * The base implementation of `_.clone` and `_.cloneDeep` which tracks
  3484. * traversed objects.
  3485. *
  3486. * @private
  3487. * @param {*} value The value to clone.
  3488. * @param {boolean} [isDeep] Specify a deep clone.
  3489. * @param {boolean} [isFull] Specify a clone including symbols.
  3490. * @param {Function} [customizer] The function to customize cloning.
  3491. * @param {string} [key] The key of `value`.
  3492. * @param {Object} [object] The parent object of `value`.
  3493. * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
  3494. * @returns {*} Returns the cloned value.
  3495. */
  3496. function baseClone(value, isDeep, isFull, customizer, key, object, stack) {
  3497. var result;
  3498. if (customizer) {
  3499. result = object ? customizer(value, key, object, stack) : customizer(value);
  3500. }
  3501. if (result !== undefined) {
  3502. return result;
  3503. }
  3504. if (!isObject(value)) {
  3505. return value;
  3506. }
  3507. var isArr = isArray(value);
  3508. if (isArr) {
  3509. result = initCloneArray(value);
  3510. if (!isDeep) {
  3511. return copyArray(value, result);
  3512. }
  3513. } else {
  3514. var tag = getTag(value),
  3515. isFunc = tag == funcTag || tag == genTag;
  3516. if (isBuffer(value)) {
  3517. return cloneBuffer(value, isDeep);
  3518. }
  3519. if (tag == objectTag || tag == argsTag || isFunc && !object) {
  3520. if (isHostObject(value)) {
  3521. return object ? value : {};
  3522. }
  3523. result = initCloneObject(isFunc ? {} : value);
  3524. if (!isDeep) {
  3525. return copySymbols(value, baseAssign(result, value));
  3526. }
  3527. } else {
  3528. if (!cloneableTags[tag]) {
  3529. return object ? value : {};
  3530. }
  3531. result = initCloneByTag(value, tag, baseClone, isDeep);
  3532. }
  3533. }
  3534. // Check for circular references and return its corresponding clone.
  3535. stack || (stack = new Stack());
  3536. var stacked = stack.get(value);
  3537. if (stacked) {
  3538. return stacked;
  3539. }
  3540. stack.set(value, result);
  3541. if (!isArr) {
  3542. var props = isFull ? getAllKeys(value) : keys(value);
  3543. }
  3544. arrayEach(props || value, function (subValue, key) {
  3545. if (props) {
  3546. key = subValue;
  3547. subValue = value[key];
  3548. }
  3549. // Recursively populate clone (susceptible to call stack limits).
  3550. assignValue(result, key, baseClone(subValue, isDeep, isFull, customizer, key, value, stack));
  3551. });
  3552. return result;
  3553. }
  3554. /**
  3555. * The base implementation of `_.create` without support for assigning
  3556. * properties to the created object.
  3557. *
  3558. * @private
  3559. * @param {Object} prototype The object to inherit from.
  3560. * @returns {Object} Returns the new object.
  3561. */
  3562. function baseCreate(proto) {
  3563. return isObject(proto) ? objectCreate(proto) : {};
  3564. }
  3565. /**
  3566. * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
  3567. * `keysFunc` and `symbolsFunc` to get the enumerable property names and
  3568. * symbols of `object`.
  3569. *
  3570. * @private
  3571. * @param {Object} object The object to query.
  3572. * @param {Function} keysFunc The function to get the keys of `object`.
  3573. * @param {Function} symbolsFunc The function to get the symbols of `object`.
  3574. * @returns {Array} Returns the array of property names and symbols.
  3575. */
  3576. function baseGetAllKeys(object, keysFunc, symbolsFunc) {
  3577. var result = keysFunc(object);
  3578. return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
  3579. }
  3580. /**
  3581. * The base implementation of `getTag`.
  3582. *
  3583. * @private
  3584. * @param {*} value The value to query.
  3585. * @returns {string} Returns the `toStringTag`.
  3586. */
  3587. function baseGetTag(value) {
  3588. return objectToString.call(value);
  3589. }
  3590. /**
  3591. * The base implementation of `_.isNative` without bad shim checks.
  3592. *
  3593. * @private
  3594. * @param {*} value The value to check.
  3595. * @returns {boolean} Returns `true` if `value` is a native function,
  3596. * else `false`.
  3597. */
  3598. function baseIsNative(value) {
  3599. if (!isObject(value) || isMasked(value)) {
  3600. return false;
  3601. }
  3602. var pattern = isFunction(value) || isHostObject(value) ? reIsNative : reIsHostCtor;
  3603. return pattern.test(toSource(value));
  3604. }
  3605. /**
  3606. * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
  3607. *
  3608. * @private
  3609. * @param {Object} object The object to query.
  3610. * @returns {Array} Returns the array of property names.
  3611. */
  3612. function baseKeys(object) {
  3613. if (!isPrototype(object)) {
  3614. return nativeKeys(object);
  3615. }
  3616. var result = [];
  3617. for (var key in Object(object)) {
  3618. if (hasOwnProperty.call(object, key) && key != 'constructor') {
  3619. result.push(key);
  3620. }
  3621. }
  3622. return result;
  3623. }
  3624. /**
  3625. * Creates a clone of `buffer`.
  3626. *
  3627. * @private
  3628. * @param {Buffer} buffer The buffer to clone.
  3629. * @param {boolean} [isDeep] Specify a deep clone.
  3630. * @returns {Buffer} Returns the cloned buffer.
  3631. */
  3632. function cloneBuffer(buffer, isDeep) {
  3633. if (isDeep) {
  3634. return buffer.slice();
  3635. }
  3636. var result = new buffer.constructor(buffer.length);
  3637. buffer.copy(result);
  3638. return result;
  3639. }
  3640. /**
  3641. * Creates a clone of `arrayBuffer`.
  3642. *
  3643. * @private
  3644. * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
  3645. * @returns {ArrayBuffer} Returns the cloned array buffer.
  3646. */
  3647. function cloneArrayBuffer(arrayBuffer) {
  3648. var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
  3649. new Uint8Array(result).set(new Uint8Array(arrayBuffer));
  3650. return result;
  3651. }
  3652. /**
  3653. * Creates a clone of `dataView`.
  3654. *
  3655. * @private
  3656. * @param {Object} dataView The data view to clone.
  3657. * @param {boolean} [isDeep] Specify a deep clone.
  3658. * @returns {Object} Returns the cloned data view.
  3659. */
  3660. function cloneDataView(dataView, isDeep) {
  3661. var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
  3662. return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
  3663. }
  3664. /**
  3665. * Creates a clone of `map`.
  3666. *
  3667. * @private
  3668. * @param {Object} map The map to clone.
  3669. * @param {Function} cloneFunc The function to clone values.
  3670. * @param {boolean} [isDeep] Specify a deep clone.
  3671. * @returns {Object} Returns the cloned map.
  3672. */
  3673. function cloneMap(map, isDeep, cloneFunc) {
  3674. var array = isDeep ? cloneFunc(mapToArray(map), true) : mapToArray(map);
  3675. return arrayReduce(array, addMapEntry, new map.constructor());
  3676. }
  3677. /**
  3678. * Creates a clone of `regexp`.
  3679. *
  3680. * @private
  3681. * @param {Object} regexp The regexp to clone.
  3682. * @returns {Object} Returns the cloned regexp.
  3683. */
  3684. function cloneRegExp(regexp) {
  3685. var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
  3686. result.lastIndex = regexp.lastIndex;
  3687. return result;
  3688. }
  3689. /**
  3690. * Creates a clone of `set`.
  3691. *
  3692. * @private
  3693. * @param {Object} set The set to clone.
  3694. * @param {Function} cloneFunc The function to clone values.
  3695. * @param {boolean} [isDeep] Specify a deep clone.
  3696. * @returns {Object} Returns the cloned set.
  3697. */
  3698. function cloneSet(set, isDeep, cloneFunc) {
  3699. var array = isDeep ? cloneFunc(setToArray(set), true) : setToArray(set);
  3700. return arrayReduce(array, addSetEntry, new set.constructor());
  3701. }
  3702. /**
  3703. * Creates a clone of the `symbol` object.
  3704. *
  3705. * @private
  3706. * @param {Object} symbol The symbol object to clone.
  3707. * @returns {Object} Returns the cloned symbol object.
  3708. */
  3709. function cloneSymbol(symbol) {
  3710. return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
  3711. }
  3712. /**
  3713. * Creates a clone of `typedArray`.
  3714. *
  3715. * @private
  3716. * @param {Object} typedArray The typed array to clone.
  3717. * @param {boolean} [isDeep] Specify a deep clone.
  3718. * @returns {Object} Returns the cloned typed array.
  3719. */
  3720. function cloneTypedArray(typedArray, isDeep) {
  3721. var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
  3722. return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
  3723. }
  3724. /**
  3725. * Copies the values of `source` to `array`.
  3726. *
  3727. * @private
  3728. * @param {Array} source The array to copy values from.
  3729. * @param {Array} [array=[]] The array to copy values to.
  3730. * @returns {Array} Returns `array`.
  3731. */
  3732. function copyArray(source, array) {
  3733. var index = -1,
  3734. length = source.length;
  3735. array || (array = Array(length));
  3736. while (++index < length) {
  3737. array[index] = source[index];
  3738. }
  3739. return array;
  3740. }
  3741. /**
  3742. * Copies properties of `source` to `object`.
  3743. *
  3744. * @private
  3745. * @param {Object} source The object to copy properties from.
  3746. * @param {Array} props The property identifiers to copy.
  3747. * @param {Object} [object={}] The object to copy properties to.
  3748. * @param {Function} [customizer] The function to customize copied values.
  3749. * @returns {Object} Returns `object`.
  3750. */
  3751. function copyObject(source, props, object, customizer) {
  3752. object || (object = {});
  3753. var index = -1,
  3754. length = props.length;
  3755. while (++index < length) {
  3756. var key = props[index];
  3757. var newValue = customizer ? customizer(object[key], source[key], key, object, source) : undefined;
  3758. assignValue(object, key, newValue === undefined ? source[key] : newValue);
  3759. }
  3760. return object;
  3761. }
  3762. /**
  3763. * Copies own symbol properties of `source` to `object`.
  3764. *
  3765. * @private
  3766. * @param {Object} source The object to copy symbols from.
  3767. * @param {Object} [object={}] The object to copy symbols to.
  3768. * @returns {Object} Returns `object`.
  3769. */
  3770. function copySymbols(source, object) {
  3771. return copyObject(source, getSymbols(source), object);
  3772. }
  3773. /**
  3774. * Creates an array of own enumerable property names and symbols of `object`.
  3775. *
  3776. * @private
  3777. * @param {Object} object The object to query.
  3778. * @returns {Array} Returns the array of property names and symbols.
  3779. */
  3780. function getAllKeys(object) {
  3781. return baseGetAllKeys(object, keys, getSymbols);
  3782. }
  3783. /**
  3784. * Gets the data for `map`.
  3785. *
  3786. * @private
  3787. * @param {Object} map The map to query.
  3788. * @param {string} key The reference key.
  3789. * @returns {*} Returns the map data.
  3790. */
  3791. function getMapData(map, key) {
  3792. var data = map.__data__;
  3793. return isKeyable(key) ? data[typeof key == 'string' ? 'string' : 'hash'] : data.map;
  3794. }
  3795. /**
  3796. * Gets the native function at `key` of `object`.
  3797. *
  3798. * @private
  3799. * @param {Object} object The object to query.
  3800. * @param {string} key The key of the method to get.
  3801. * @returns {*} Returns the function if it's native, else `undefined`.
  3802. */
  3803. function getNative(object, key) {
  3804. var value = getValue(object, key);
  3805. return baseIsNative(value) ? value : undefined;
  3806. }
  3807. /**
  3808. * Creates an array of the own enumerable symbol properties of `object`.
  3809. *
  3810. * @private
  3811. * @param {Object} object The object to query.
  3812. * @returns {Array} Returns the array of symbols.
  3813. */
  3814. var getSymbols = nativeGetSymbols ? overArg(nativeGetSymbols, Object) : stubArray;
  3815. /**
  3816. * Gets the `toStringTag` of `value`.
  3817. *
  3818. * @private
  3819. * @param {*} value The value to query.
  3820. * @returns {string} Returns the `toStringTag`.
  3821. */
  3822. var getTag = baseGetTag;
  3823. // Fallback for data views, maps, sets, and weak maps in IE 11,
  3824. // for data views in Edge < 14, and promises in Node.js.
  3825. if (DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag || Map && getTag(new Map()) != mapTag || Promise && getTag(Promise.resolve()) != promiseTag || Set && getTag(new Set()) != setTag || WeakMap && getTag(new WeakMap()) != weakMapTag) {
  3826. getTag = function getTag(value) {
  3827. var result = objectToString.call(value),
  3828. Ctor = result == objectTag ? value.constructor : undefined,
  3829. ctorString = Ctor ? toSource(Ctor) : undefined;
  3830. if (ctorString) {
  3831. switch (ctorString) {
  3832. case dataViewCtorString:
  3833. return dataViewTag;
  3834. case mapCtorString:
  3835. return mapTag;
  3836. case promiseCtorString:
  3837. return promiseTag;
  3838. case setCtorString:
  3839. return setTag;
  3840. case weakMapCtorString:
  3841. return weakMapTag;
  3842. }
  3843. }
  3844. return result;
  3845. };
  3846. }
  3847. /**
  3848. * Initializes an array clone.
  3849. *
  3850. * @private
  3851. * @param {Array} array The array to clone.
  3852. * @returns {Array} Returns the initialized clone.
  3853. */
  3854. function initCloneArray(array) {
  3855. var length = array.length,
  3856. result = array.constructor(length);
  3857. // Add properties assigned by `RegExp#exec`.
  3858. if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
  3859. result.index = array.index;
  3860. result.input = array.input;
  3861. }
  3862. return result;
  3863. }
  3864. /**
  3865. * Initializes an object clone.
  3866. *
  3867. * @private
  3868. * @param {Object} object The object to clone.
  3869. * @returns {Object} Returns the initialized clone.
  3870. */
  3871. function initCloneObject(object) {
  3872. return typeof object.constructor == 'function' && !isPrototype(object) ? baseCreate(getPrototype(object)) : {};
  3873. }
  3874. /**
  3875. * Initializes an object clone based on its `toStringTag`.
  3876. *
  3877. * **Note:** This function only supports cloning values with tags of
  3878. * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
  3879. *
  3880. * @private
  3881. * @param {Object} object The object to clone.
  3882. * @param {string} tag The `toStringTag` of the object to clone.
  3883. * @param {Function} cloneFunc The function to clone values.
  3884. * @param {boolean} [isDeep] Specify a deep clone.
  3885. * @returns {Object} Returns the initialized clone.
  3886. */
  3887. function initCloneByTag(object, tag, cloneFunc, isDeep) {
  3888. var Ctor = object.constructor;
  3889. switch (tag) {
  3890. case arrayBufferTag:
  3891. return cloneArrayBuffer(object);
  3892. case boolTag:
  3893. case dateTag:
  3894. return new Ctor(+object);
  3895. case dataViewTag:
  3896. return cloneDataView(object, isDeep);
  3897. case float32Tag:
  3898. case float64Tag:
  3899. case int8Tag:
  3900. case int16Tag:
  3901. case int32Tag:
  3902. case uint8Tag:
  3903. case uint8ClampedTag:
  3904. case uint16Tag:
  3905. case uint32Tag:
  3906. return cloneTypedArray(object, isDeep);
  3907. case mapTag:
  3908. return cloneMap(object, isDeep, cloneFunc);
  3909. case numberTag:
  3910. case stringTag:
  3911. return new Ctor(object);
  3912. case regexpTag:
  3913. return cloneRegExp(object);
  3914. case setTag:
  3915. return cloneSet(object, isDeep, cloneFunc);
  3916. case symbolTag:
  3917. return cloneSymbol(object);
  3918. }
  3919. }
  3920. /**
  3921. * Checks if `value` is a valid array-like index.
  3922. *
  3923. * @private
  3924. * @param {*} value The value to check.
  3925. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  3926. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  3927. */
  3928. function isIndex(value, length) {
  3929. length = length == null ? MAX_SAFE_INTEGER : length;
  3930. return !!length && (typeof value == 'number' || reIsUint.test(value)) && value > -1 && value % 1 == 0 && value < length;
  3931. }
  3932. /**
  3933. * Checks if `value` is suitable for use as unique object key.
  3934. *
  3935. * @private
  3936. * @param {*} value The value to check.
  3937. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  3938. */
  3939. function isKeyable(value) {
  3940. var type = _typeof(value);
  3941. return type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean' ? value !== '__proto__' : value === null;
  3942. }
  3943. /**
  3944. * Checks if `func` has its source masked.
  3945. *
  3946. * @private
  3947. * @param {Function} func The function to check.
  3948. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  3949. */
  3950. function isMasked(func) {
  3951. return !!maskSrcKey && maskSrcKey in func;
  3952. }
  3953. /**
  3954. * Checks if `value` is likely a prototype object.
  3955. *
  3956. * @private
  3957. * @param {*} value The value to check.
  3958. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
  3959. */
  3960. function isPrototype(value) {
  3961. var Ctor = value && value.constructor,
  3962. proto = typeof Ctor == 'function' && Ctor.prototype || objectProto;
  3963. return value === proto;
  3964. }
  3965. /**
  3966. * Converts `func` to its source code.
  3967. *
  3968. * @private
  3969. * @param {Function} func The function to process.
  3970. * @returns {string} Returns the source code.
  3971. */
  3972. function toSource(func) {
  3973. if (func != null) {
  3974. try {
  3975. return funcToString.call(func);
  3976. } catch (e) {}
  3977. try {
  3978. return func + '';
  3979. } catch (e) {}
  3980. }
  3981. return '';
  3982. }
  3983. /**
  3984. * This method is like `_.clone` except that it recursively clones `value`.
  3985. *
  3986. * @static
  3987. * @memberOf _
  3988. * @since 1.0.0
  3989. * @category Lang
  3990. * @param {*} value The value to recursively clone.
  3991. * @returns {*} Returns the deep cloned value.
  3992. * @see _.clone
  3993. * @example
  3994. *
  3995. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  3996. *
  3997. * var deep = _.cloneDeep(objects);
  3998. * console.log(deep[0] === objects[0]);
  3999. * // => false
  4000. */
  4001. function cloneDeep(value) {
  4002. return baseClone(value, true, true);
  4003. }
  4004. /**
  4005. * Performs a
  4006. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  4007. * comparison between two values to determine if they are equivalent.
  4008. *
  4009. * @static
  4010. * @memberOf _
  4011. * @since 4.0.0
  4012. * @category Lang
  4013. * @param {*} value The value to compare.
  4014. * @param {*} other The other value to compare.
  4015. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  4016. * @example
  4017. *
  4018. * var object = { 'a': 1 };
  4019. * var other = { 'a': 1 };
  4020. *
  4021. * _.eq(object, object);
  4022. * // => true
  4023. *
  4024. * _.eq(object, other);
  4025. * // => false
  4026. *
  4027. * _.eq('a', 'a');
  4028. * // => true
  4029. *
  4030. * _.eq('a', Object('a'));
  4031. * // => false
  4032. *
  4033. * _.eq(NaN, NaN);
  4034. * // => true
  4035. */
  4036. function eq(value, other) {
  4037. return value === other || value !== value && other !== other;
  4038. }
  4039. /**
  4040. * Checks if `value` is likely an `arguments` object.
  4041. *
  4042. * @static
  4043. * @memberOf _
  4044. * @since 0.1.0
  4045. * @category Lang
  4046. * @param {*} value The value to check.
  4047. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  4048. * else `false`.
  4049. * @example
  4050. *
  4051. * _.isArguments(function() { return arguments; }());
  4052. * // => true
  4053. *
  4054. * _.isArguments([1, 2, 3]);
  4055. * // => false
  4056. */
  4057. function isArguments(value) {
  4058. // Safari 8.1 makes `arguments.callee` enumerable in strict mode.
  4059. return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);
  4060. }
  4061. /**
  4062. * Checks if `value` is classified as an `Array` object.
  4063. *
  4064. * @static
  4065. * @memberOf _
  4066. * @since 0.1.0
  4067. * @category Lang
  4068. * @param {*} value The value to check.
  4069. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  4070. * @example
  4071. *
  4072. * _.isArray([1, 2, 3]);
  4073. * // => true
  4074. *
  4075. * _.isArray(document.body.children);
  4076. * // => false
  4077. *
  4078. * _.isArray('abc');
  4079. * // => false
  4080. *
  4081. * _.isArray(_.noop);
  4082. * // => false
  4083. */
  4084. var isArray = Array.isArray;
  4085. /**
  4086. * Checks if `value` is array-like. A value is considered array-like if it's
  4087. * not a function and has a `value.length` that's an integer greater than or
  4088. * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
  4089. *
  4090. * @static
  4091. * @memberOf _
  4092. * @since 4.0.0
  4093. * @category Lang
  4094. * @param {*} value The value to check.
  4095. * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
  4096. * @example
  4097. *
  4098. * _.isArrayLike([1, 2, 3]);
  4099. * // => true
  4100. *
  4101. * _.isArrayLike(document.body.children);
  4102. * // => true
  4103. *
  4104. * _.isArrayLike('abc');
  4105. * // => true
  4106. *
  4107. * _.isArrayLike(_.noop);
  4108. * // => false
  4109. */
  4110. function isArrayLike(value) {
  4111. return value != null && isLength(value.length) && !isFunction(value);
  4112. }
  4113. /**
  4114. * This method is like `_.isArrayLike` except that it also checks if `value`
  4115. * is an object.
  4116. *
  4117. * @static
  4118. * @memberOf _
  4119. * @since 4.0.0
  4120. * @category Lang
  4121. * @param {*} value The value to check.
  4122. * @returns {boolean} Returns `true` if `value` is an array-like object,
  4123. * else `false`.
  4124. * @example
  4125. *
  4126. * _.isArrayLikeObject([1, 2, 3]);
  4127. * // => true
  4128. *
  4129. * _.isArrayLikeObject(document.body.children);
  4130. * // => true
  4131. *
  4132. * _.isArrayLikeObject('abc');
  4133. * // => false
  4134. *
  4135. * _.isArrayLikeObject(_.noop);
  4136. * // => false
  4137. */
  4138. function isArrayLikeObject(value) {
  4139. return isObjectLike(value) && isArrayLike(value);
  4140. }
  4141. /**
  4142. * Checks if `value` is a buffer.
  4143. *
  4144. * @static
  4145. * @memberOf _
  4146. * @since 4.3.0
  4147. * @category Lang
  4148. * @param {*} value The value to check.
  4149. * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
  4150. * @example
  4151. *
  4152. * _.isBuffer(new Buffer(2));
  4153. * // => true
  4154. *
  4155. * _.isBuffer(new Uint8Array(2));
  4156. * // => false
  4157. */
  4158. var isBuffer = nativeIsBuffer || stubFalse;
  4159. /**
  4160. * Checks if `value` is classified as a `Function` object.
  4161. *
  4162. * @static
  4163. * @memberOf _
  4164. * @since 0.1.0
  4165. * @category Lang
  4166. * @param {*} value The value to check.
  4167. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  4168. * @example
  4169. *
  4170. * _.isFunction(_);
  4171. * // => true
  4172. *
  4173. * _.isFunction(/abc/);
  4174. * // => false
  4175. */
  4176. function isFunction(value) {
  4177. // The use of `Object#toString` avoids issues with the `typeof` operator
  4178. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  4179. var tag = isObject(value) ? objectToString.call(value) : '';
  4180. return tag == funcTag || tag == genTag;
  4181. }
  4182. /**
  4183. * Checks if `value` is a valid array-like length.
  4184. *
  4185. * **Note:** This method is loosely based on
  4186. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  4187. *
  4188. * @static
  4189. * @memberOf _
  4190. * @since 4.0.0
  4191. * @category Lang
  4192. * @param {*} value The value to check.
  4193. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
  4194. * @example
  4195. *
  4196. * _.isLength(3);
  4197. * // => true
  4198. *
  4199. * _.isLength(Number.MIN_VALUE);
  4200. * // => false
  4201. *
  4202. * _.isLength(Infinity);
  4203. * // => false
  4204. *
  4205. * _.isLength('3');
  4206. * // => false
  4207. */
  4208. function isLength(value) {
  4209. return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
  4210. }
  4211. /**
  4212. * Checks if `value` is the
  4213. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  4214. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  4215. *
  4216. * @static
  4217. * @memberOf _
  4218. * @since 0.1.0
  4219. * @category Lang
  4220. * @param {*} value The value to check.
  4221. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  4222. * @example
  4223. *
  4224. * _.isObject({});
  4225. * // => true
  4226. *
  4227. * _.isObject([1, 2, 3]);
  4228. * // => true
  4229. *
  4230. * _.isObject(_.noop);
  4231. * // => true
  4232. *
  4233. * _.isObject(null);
  4234. * // => false
  4235. */
  4236. function isObject(value) {
  4237. var type = _typeof(value);
  4238. return !!value && (type == 'object' || type == 'function');
  4239. }
  4240. /**
  4241. * Checks if `value` is object-like. A value is object-like if it's not `null`
  4242. * and has a `typeof` result of "object".
  4243. *
  4244. * @static
  4245. * @memberOf _
  4246. * @since 4.0.0
  4247. * @category Lang
  4248. * @param {*} value The value to check.
  4249. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  4250. * @example
  4251. *
  4252. * _.isObjectLike({});
  4253. * // => true
  4254. *
  4255. * _.isObjectLike([1, 2, 3]);
  4256. * // => true
  4257. *
  4258. * _.isObjectLike(_.noop);
  4259. * // => false
  4260. *
  4261. * _.isObjectLike(null);
  4262. * // => false
  4263. */
  4264. function isObjectLike(value) {
  4265. return !!value && _typeof(value) == 'object';
  4266. }
  4267. /**
  4268. * Creates an array of the own enumerable property names of `object`.
  4269. *
  4270. * **Note:** Non-object values are coerced to objects. See the
  4271. * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  4272. * for more details.
  4273. *
  4274. * @static
  4275. * @since 0.1.0
  4276. * @memberOf _
  4277. * @category Object
  4278. * @param {Object} object The object to query.
  4279. * @returns {Array} Returns the array of property names.
  4280. * @example
  4281. *
  4282. * function Foo() {
  4283. * this.a = 1;
  4284. * this.b = 2;
  4285. * }
  4286. *
  4287. * Foo.prototype.c = 3;
  4288. *
  4289. * _.keys(new Foo);
  4290. * // => ['a', 'b'] (iteration order is not guaranteed)
  4291. *
  4292. * _.keys('hi');
  4293. * // => ['0', '1']
  4294. */
  4295. function keys(object) {
  4296. return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
  4297. }
  4298. /**
  4299. * This method returns a new empty array.
  4300. *
  4301. * @static
  4302. * @memberOf _
  4303. * @since 4.13.0
  4304. * @category Util
  4305. * @returns {Array} Returns the new empty array.
  4306. * @example
  4307. *
  4308. * var arrays = _.times(2, _.stubArray);
  4309. *
  4310. * console.log(arrays);
  4311. * // => [[], []]
  4312. *
  4313. * console.log(arrays[0] === arrays[1]);
  4314. * // => false
  4315. */
  4316. function stubArray() {
  4317. return [];
  4318. }
  4319. /**
  4320. * This method returns `false`.
  4321. *
  4322. * @static
  4323. * @memberOf _
  4324. * @since 4.13.0
  4325. * @category Util
  4326. * @returns {boolean} Returns `false`.
  4327. * @example
  4328. *
  4329. * _.times(2, _.stubFalse);
  4330. * // => [false, false]
  4331. */
  4332. function stubFalse() {
  4333. return false;
  4334. }
  4335. module.exports = cloneDeep;
  4336. /***/ }),
  4337. /***/ 7820:
  4338. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  4339. function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
  4340. /**
  4341. * lodash (Custom Build) <https://lodash.com/>
  4342. * Build: `lodash modularize exports="npm" -o ./`
  4343. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  4344. * Released under MIT license <https://lodash.com/license>
  4345. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  4346. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  4347. */
  4348. /** Used as references for various `Number` constants. */
  4349. var MAX_SAFE_INTEGER = 9007199254740991;
  4350. /** `Object#toString` result references. */
  4351. var argsTag = '[object Arguments]',
  4352. funcTag = '[object Function]',
  4353. genTag = '[object GeneratorFunction]',
  4354. mapTag = '[object Map]',
  4355. objectTag = '[object Object]',
  4356. promiseTag = '[object Promise]',
  4357. setTag = '[object Set]',
  4358. weakMapTag = '[object WeakMap]';
  4359. var dataViewTag = '[object DataView]';
  4360. /**
  4361. * Used to match `RegExp`
  4362. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  4363. */
  4364. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  4365. /** Used to detect host constructors (Safari). */
  4366. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  4367. /** Used to detect unsigned integer values. */
  4368. var reIsUint = /^(?:0|[1-9]\d*)$/;
  4369. /** Detect free variable `global` from Node.js. */
  4370. var freeGlobal = (typeof __webpack_require__.g === "undefined" ? "undefined" : _typeof(__webpack_require__.g)) == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;
  4371. /** Detect free variable `self`. */
  4372. var freeSelf = (typeof self === "undefined" ? "undefined" : _typeof(self)) == 'object' && self && self.Object === Object && self;
  4373. /** Used as a reference to the global object. */
  4374. var root = freeGlobal || freeSelf || Function('return this')();
  4375. /**
  4376. * A specialized version of `_.map` for arrays without support for iteratee
  4377. * shorthands.
  4378. *
  4379. * @private
  4380. * @param {Array} [array] The array to iterate over.
  4381. * @param {Function} iteratee The function invoked per iteration.
  4382. * @returns {Array} Returns the new mapped array.
  4383. */
  4384. function arrayMap(array, iteratee) {
  4385. var index = -1,
  4386. length = array ? array.length : 0,
  4387. result = Array(length);
  4388. while (++index < length) {
  4389. result[index] = iteratee(array[index], index, array);
  4390. }
  4391. return result;
  4392. }
  4393. /**
  4394. * The base implementation of `_.times` without support for iteratee shorthands
  4395. * or max array length checks.
  4396. *
  4397. * @private
  4398. * @param {number} n The number of times to invoke `iteratee`.
  4399. * @param {Function} iteratee The function invoked per iteration.
  4400. * @returns {Array} Returns the array of results.
  4401. */
  4402. function baseTimes(n, iteratee) {
  4403. var index = -1,
  4404. result = Array(n);
  4405. while (++index < n) {
  4406. result[index] = iteratee(index);
  4407. }
  4408. return result;
  4409. }
  4410. /**
  4411. * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array
  4412. * of key-value pairs for `object` corresponding to the property names of `props`.
  4413. *
  4414. * @private
  4415. * @param {Object} object The object to query.
  4416. * @param {Array} props The property names to get values for.
  4417. * @returns {Object} Returns the key-value pairs.
  4418. */
  4419. function baseToPairs(object, props) {
  4420. return arrayMap(props, function (key) {
  4421. return [key, object[key]];
  4422. });
  4423. }
  4424. /**
  4425. * Gets the value at `key` of `object`.
  4426. *
  4427. * @private
  4428. * @param {Object} [object] The object to query.
  4429. * @param {string} key The key of the property to get.
  4430. * @returns {*} Returns the property value.
  4431. */
  4432. function getValue(object, key) {
  4433. return object == null ? undefined : object[key];
  4434. }
  4435. /**
  4436. * Checks if `value` is a host object in IE < 9.
  4437. *
  4438. * @private
  4439. * @param {*} value The value to check.
  4440. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  4441. */
  4442. function isHostObject(value) {
  4443. // Many host objects are `Object` objects that can coerce to strings
  4444. // despite having improperly defined `toString` methods.
  4445. var result = false;
  4446. if (value != null && typeof value.toString != 'function') {
  4447. try {
  4448. result = !!(value + '');
  4449. } catch (e) {}
  4450. }
  4451. return result;
  4452. }
  4453. /**
  4454. * Converts `map` to its key-value pairs.
  4455. *
  4456. * @private
  4457. * @param {Object} map The map to convert.
  4458. * @returns {Array} Returns the key-value pairs.
  4459. */
  4460. function mapToArray(map) {
  4461. var index = -1,
  4462. result = Array(map.size);
  4463. map.forEach(function (value, key) {
  4464. result[++index] = [key, value];
  4465. });
  4466. return result;
  4467. }
  4468. /**
  4469. * Creates a unary function that invokes `func` with its argument transformed.
  4470. *
  4471. * @private
  4472. * @param {Function} func The function to wrap.
  4473. * @param {Function} transform The argument transform.
  4474. * @returns {Function} Returns the new function.
  4475. */
  4476. function overArg(func, transform) {
  4477. return function (arg) {
  4478. return func(transform(arg));
  4479. };
  4480. }
  4481. /**
  4482. * Converts `set` to its value-value pairs.
  4483. *
  4484. * @private
  4485. * @param {Object} set The set to convert.
  4486. * @returns {Array} Returns the value-value pairs.
  4487. */
  4488. function setToPairs(set) {
  4489. var index = -1,
  4490. result = Array(set.size);
  4491. set.forEach(function (value) {
  4492. result[++index] = [value, value];
  4493. });
  4494. return result;
  4495. }
  4496. /** Used for built-in method references. */
  4497. var funcProto = Function.prototype,
  4498. objectProto = Object.prototype;
  4499. /** Used to detect overreaching core-js shims. */
  4500. var coreJsData = root['__core-js_shared__'];
  4501. /** Used to detect methods masquerading as native. */
  4502. var maskSrcKey = function () {
  4503. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  4504. return uid ? 'Symbol(src)_1.' + uid : '';
  4505. }();
  4506. /** Used to resolve the decompiled source of functions. */
  4507. var funcToString = funcProto.toString;
  4508. /** Used to check objects for own properties. */
  4509. var hasOwnProperty = objectProto.hasOwnProperty;
  4510. /**
  4511. * Used to resolve the
  4512. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  4513. * of values.
  4514. */
  4515. var objectToString = objectProto.toString;
  4516. /** Used to detect if a method is native. */
  4517. var reIsNative = RegExp('^' + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&').replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$');
  4518. /** Built-in value references. */
  4519. var propertyIsEnumerable = objectProto.propertyIsEnumerable;
  4520. /* Built-in method references for those with the same name as other `lodash` methods. */
  4521. var nativeKeys = overArg(Object.keys, Object);
  4522. /* Built-in method references that are verified to be native. */
  4523. var DataView = getNative(root, 'DataView'),
  4524. Map = getNative(root, 'Map'),
  4525. Promise = getNative(root, 'Promise'),
  4526. Set = getNative(root, 'Set'),
  4527. WeakMap = getNative(root, 'WeakMap');
  4528. /** Used to detect maps, sets, and weakmaps. */
  4529. var dataViewCtorString = toSource(DataView),
  4530. mapCtorString = toSource(Map),
  4531. promiseCtorString = toSource(Promise),
  4532. setCtorString = toSource(Set),
  4533. weakMapCtorString = toSource(WeakMap);
  4534. /**
  4535. * Creates an array of the enumerable property names of the array-like `value`.
  4536. *
  4537. * @private
  4538. * @param {*} value The value to query.
  4539. * @param {boolean} inherited Specify returning inherited property names.
  4540. * @returns {Array} Returns the array of property names.
  4541. */
  4542. function arrayLikeKeys(value, inherited) {
  4543. // Safari 8.1 makes `arguments.callee` enumerable in strict mode.
  4544. // Safari 9 makes `arguments.length` enumerable in strict mode.
  4545. var result = isArray(value) || isArguments(value) ? baseTimes(value.length, String) : [];
  4546. var length = result.length,
  4547. skipIndexes = !!length;
  4548. for (var key in value) {
  4549. if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && (key == 'length' || isIndex(key, length)))) {
  4550. result.push(key);
  4551. }
  4552. }
  4553. return result;
  4554. }
  4555. /**
  4556. * The base implementation of `getTag`.
  4557. *
  4558. * @private
  4559. * @param {*} value The value to query.
  4560. * @returns {string} Returns the `toStringTag`.
  4561. */
  4562. function baseGetTag(value) {
  4563. return objectToString.call(value);
  4564. }
  4565. /**
  4566. * The base implementation of `_.isNative` without bad shim checks.
  4567. *
  4568. * @private
  4569. * @param {*} value The value to check.
  4570. * @returns {boolean} Returns `true` if `value` is a native function,
  4571. * else `false`.
  4572. */
  4573. function baseIsNative(value) {
  4574. if (!isObject(value) || isMasked(value)) {
  4575. return false;
  4576. }
  4577. var pattern = isFunction(value) || isHostObject(value) ? reIsNative : reIsHostCtor;
  4578. return pattern.test(toSource(value));
  4579. }
  4580. /**
  4581. * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
  4582. *
  4583. * @private
  4584. * @param {Object} object The object to query.
  4585. * @returns {Array} Returns the array of property names.
  4586. */
  4587. function baseKeys(object) {
  4588. if (!isPrototype(object)) {
  4589. return nativeKeys(object);
  4590. }
  4591. var result = [];
  4592. for (var key in Object(object)) {
  4593. if (hasOwnProperty.call(object, key) && key != 'constructor') {
  4594. result.push(key);
  4595. }
  4596. }
  4597. return result;
  4598. }
  4599. /**
  4600. * Creates a `_.toPairs` or `_.toPairsIn` function.
  4601. *
  4602. * @private
  4603. * @param {Function} keysFunc The function to get the keys of a given object.
  4604. * @returns {Function} Returns the new pairs function.
  4605. */
  4606. function createToPairs(keysFunc) {
  4607. return function (object) {
  4608. var tag = getTag(object);
  4609. if (tag == mapTag) {
  4610. return mapToArray(object);
  4611. }
  4612. if (tag == setTag) {
  4613. return setToPairs(object);
  4614. }
  4615. return baseToPairs(object, keysFunc(object));
  4616. };
  4617. }
  4618. /**
  4619. * Gets the native function at `key` of `object`.
  4620. *
  4621. * @private
  4622. * @param {Object} object The object to query.
  4623. * @param {string} key The key of the method to get.
  4624. * @returns {*} Returns the function if it's native, else `undefined`.
  4625. */
  4626. function getNative(object, key) {
  4627. var value = getValue(object, key);
  4628. return baseIsNative(value) ? value : undefined;
  4629. }
  4630. /**
  4631. * Gets the `toStringTag` of `value`.
  4632. *
  4633. * @private
  4634. * @param {*} value The value to query.
  4635. * @returns {string} Returns the `toStringTag`.
  4636. */
  4637. var getTag = baseGetTag;
  4638. // Fallback for data views, maps, sets, and weak maps in IE 11,
  4639. // for data views in Edge < 14, and promises in Node.js.
  4640. if (DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag || Map && getTag(new Map()) != mapTag || Promise && getTag(Promise.resolve()) != promiseTag || Set && getTag(new Set()) != setTag || WeakMap && getTag(new WeakMap()) != weakMapTag) {
  4641. getTag = function getTag(value) {
  4642. var result = objectToString.call(value),
  4643. Ctor = result == objectTag ? value.constructor : undefined,
  4644. ctorString = Ctor ? toSource(Ctor) : undefined;
  4645. if (ctorString) {
  4646. switch (ctorString) {
  4647. case dataViewCtorString:
  4648. return dataViewTag;
  4649. case mapCtorString:
  4650. return mapTag;
  4651. case promiseCtorString:
  4652. return promiseTag;
  4653. case setCtorString:
  4654. return setTag;
  4655. case weakMapCtorString:
  4656. return weakMapTag;
  4657. }
  4658. }
  4659. return result;
  4660. };
  4661. }
  4662. /**
  4663. * Checks if `value` is a valid array-like index.
  4664. *
  4665. * @private
  4666. * @param {*} value The value to check.
  4667. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  4668. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  4669. */
  4670. function isIndex(value, length) {
  4671. length = length == null ? MAX_SAFE_INTEGER : length;
  4672. return !!length && (typeof value == 'number' || reIsUint.test(value)) && value > -1 && value % 1 == 0 && value < length;
  4673. }
  4674. /**
  4675. * Checks if `func` has its source masked.
  4676. *
  4677. * @private
  4678. * @param {Function} func The function to check.
  4679. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  4680. */
  4681. function isMasked(func) {
  4682. return !!maskSrcKey && maskSrcKey in func;
  4683. }
  4684. /**
  4685. * Checks if `value` is likely a prototype object.
  4686. *
  4687. * @private
  4688. * @param {*} value The value to check.
  4689. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
  4690. */
  4691. function isPrototype(value) {
  4692. var Ctor = value && value.constructor,
  4693. proto = typeof Ctor == 'function' && Ctor.prototype || objectProto;
  4694. return value === proto;
  4695. }
  4696. /**
  4697. * Converts `func` to its source code.
  4698. *
  4699. * @private
  4700. * @param {Function} func The function to process.
  4701. * @returns {string} Returns the source code.
  4702. */
  4703. function toSource(func) {
  4704. if (func != null) {
  4705. try {
  4706. return funcToString.call(func);
  4707. } catch (e) {}
  4708. try {
  4709. return func + '';
  4710. } catch (e) {}
  4711. }
  4712. return '';
  4713. }
  4714. /**
  4715. * Checks if `value` is likely an `arguments` object.
  4716. *
  4717. * @static
  4718. * @memberOf _
  4719. * @since 0.1.0
  4720. * @category Lang
  4721. * @param {*} value The value to check.
  4722. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  4723. * else `false`.
  4724. * @example
  4725. *
  4726. * _.isArguments(function() { return arguments; }());
  4727. * // => true
  4728. *
  4729. * _.isArguments([1, 2, 3]);
  4730. * // => false
  4731. */
  4732. function isArguments(value) {
  4733. // Safari 8.1 makes `arguments.callee` enumerable in strict mode.
  4734. return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);
  4735. }
  4736. /**
  4737. * Checks if `value` is classified as an `Array` object.
  4738. *
  4739. * @static
  4740. * @memberOf _
  4741. * @since 0.1.0
  4742. * @category Lang
  4743. * @param {*} value The value to check.
  4744. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  4745. * @example
  4746. *
  4747. * _.isArray([1, 2, 3]);
  4748. * // => true
  4749. *
  4750. * _.isArray(document.body.children);
  4751. * // => false
  4752. *
  4753. * _.isArray('abc');
  4754. * // => false
  4755. *
  4756. * _.isArray(_.noop);
  4757. * // => false
  4758. */
  4759. var isArray = Array.isArray;
  4760. /**
  4761. * Checks if `value` is array-like. A value is considered array-like if it's
  4762. * not a function and has a `value.length` that's an integer greater than or
  4763. * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
  4764. *
  4765. * @static
  4766. * @memberOf _
  4767. * @since 4.0.0
  4768. * @category Lang
  4769. * @param {*} value The value to check.
  4770. * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
  4771. * @example
  4772. *
  4773. * _.isArrayLike([1, 2, 3]);
  4774. * // => true
  4775. *
  4776. * _.isArrayLike(document.body.children);
  4777. * // => true
  4778. *
  4779. * _.isArrayLike('abc');
  4780. * // => true
  4781. *
  4782. * _.isArrayLike(_.noop);
  4783. * // => false
  4784. */
  4785. function isArrayLike(value) {
  4786. return value != null && isLength(value.length) && !isFunction(value);
  4787. }
  4788. /**
  4789. * This method is like `_.isArrayLike` except that it also checks if `value`
  4790. * is an object.
  4791. *
  4792. * @static
  4793. * @memberOf _
  4794. * @since 4.0.0
  4795. * @category Lang
  4796. * @param {*} value The value to check.
  4797. * @returns {boolean} Returns `true` if `value` is an array-like object,
  4798. * else `false`.
  4799. * @example
  4800. *
  4801. * _.isArrayLikeObject([1, 2, 3]);
  4802. * // => true
  4803. *
  4804. * _.isArrayLikeObject(document.body.children);
  4805. * // => true
  4806. *
  4807. * _.isArrayLikeObject('abc');
  4808. * // => false
  4809. *
  4810. * _.isArrayLikeObject(_.noop);
  4811. * // => false
  4812. */
  4813. function isArrayLikeObject(value) {
  4814. return isObjectLike(value) && isArrayLike(value);
  4815. }
  4816. /**
  4817. * Checks if `value` is classified as a `Function` object.
  4818. *
  4819. * @static
  4820. * @memberOf _
  4821. * @since 0.1.0
  4822. * @category Lang
  4823. * @param {*} value The value to check.
  4824. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  4825. * @example
  4826. *
  4827. * _.isFunction(_);
  4828. * // => true
  4829. *
  4830. * _.isFunction(/abc/);
  4831. * // => false
  4832. */
  4833. function isFunction(value) {
  4834. // The use of `Object#toString` avoids issues with the `typeof` operator
  4835. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  4836. var tag = isObject(value) ? objectToString.call(value) : '';
  4837. return tag == funcTag || tag == genTag;
  4838. }
  4839. /**
  4840. * Checks if `value` is a valid array-like length.
  4841. *
  4842. * **Note:** This method is loosely based on
  4843. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  4844. *
  4845. * @static
  4846. * @memberOf _
  4847. * @since 4.0.0
  4848. * @category Lang
  4849. * @param {*} value The value to check.
  4850. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
  4851. * @example
  4852. *
  4853. * _.isLength(3);
  4854. * // => true
  4855. *
  4856. * _.isLength(Number.MIN_VALUE);
  4857. * // => false
  4858. *
  4859. * _.isLength(Infinity);
  4860. * // => false
  4861. *
  4862. * _.isLength('3');
  4863. * // => false
  4864. */
  4865. function isLength(value) {
  4866. return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
  4867. }
  4868. /**
  4869. * Checks if `value` is the
  4870. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  4871. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  4872. *
  4873. * @static
  4874. * @memberOf _
  4875. * @since 0.1.0
  4876. * @category Lang
  4877. * @param {*} value The value to check.
  4878. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  4879. * @example
  4880. *
  4881. * _.isObject({});
  4882. * // => true
  4883. *
  4884. * _.isObject([1, 2, 3]);
  4885. * // => true
  4886. *
  4887. * _.isObject(_.noop);
  4888. * // => true
  4889. *
  4890. * _.isObject(null);
  4891. * // => false
  4892. */
  4893. function isObject(value) {
  4894. var type = _typeof(value);
  4895. return !!value && (type == 'object' || type == 'function');
  4896. }
  4897. /**
  4898. * Checks if `value` is object-like. A value is object-like if it's not `null`
  4899. * and has a `typeof` result of "object".
  4900. *
  4901. * @static
  4902. * @memberOf _
  4903. * @since 4.0.0
  4904. * @category Lang
  4905. * @param {*} value The value to check.
  4906. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  4907. * @example
  4908. *
  4909. * _.isObjectLike({});
  4910. * // => true
  4911. *
  4912. * _.isObjectLike([1, 2, 3]);
  4913. * // => true
  4914. *
  4915. * _.isObjectLike(_.noop);
  4916. * // => false
  4917. *
  4918. * _.isObjectLike(null);
  4919. * // => false
  4920. */
  4921. function isObjectLike(value) {
  4922. return !!value && _typeof(value) == 'object';
  4923. }
  4924. /**
  4925. * Creates an array of the own enumerable property names of `object`.
  4926. *
  4927. * **Note:** Non-object values are coerced to objects. See the
  4928. * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  4929. * for more details.
  4930. *
  4931. * @static
  4932. * @since 0.1.0
  4933. * @memberOf _
  4934. * @category Object
  4935. * @param {Object} object The object to query.
  4936. * @returns {Array} Returns the array of property names.
  4937. * @example
  4938. *
  4939. * function Foo() {
  4940. * this.a = 1;
  4941. * this.b = 2;
  4942. * }
  4943. *
  4944. * Foo.prototype.c = 3;
  4945. *
  4946. * _.keys(new Foo);
  4947. * // => ['a', 'b'] (iteration order is not guaranteed)
  4948. *
  4949. * _.keys('hi');
  4950. * // => ['0', '1']
  4951. */
  4952. function keys(object) {
  4953. return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
  4954. }
  4955. /**
  4956. * Creates an array of own enumerable string keyed-value pairs for `object`
  4957. * which can be consumed by `_.fromPairs`. If `object` is a map or set, its
  4958. * entries are returned.
  4959. *
  4960. * @static
  4961. * @memberOf _
  4962. * @since 4.0.0
  4963. * @alias entries
  4964. * @category Object
  4965. * @param {Object} object The object to query.
  4966. * @returns {Array} Returns the key-value pairs.
  4967. * @example
  4968. *
  4969. * function Foo() {
  4970. * this.a = 1;
  4971. * this.b = 2;
  4972. * }
  4973. *
  4974. * Foo.prototype.c = 3;
  4975. *
  4976. * _.toPairs(new Foo);
  4977. * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)
  4978. */
  4979. var toPairs = createToPairs(keys);
  4980. module.exports = toPairs;
  4981. /***/ }),
  4982. /***/ 9819:
  4983. /***/ (function(module, exports, __webpack_require__) {
  4984. /* module decorator */ module = __webpack_require__.nmd(module);
  4985. function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
  4986. /**
  4987. * lodash (Custom Build) <https://lodash.com/>
  4988. * Build: `lodash modularize exports="npm" -o ./`
  4989. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  4990. * Released under MIT license <https://lodash.com/license>
  4991. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  4992. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  4993. */
  4994. /** Used as the size to enable large array optimizations. */
  4995. var LARGE_ARRAY_SIZE = 200;
  4996. /** Used as the `TypeError` message for "Functions" methods. */
  4997. var FUNC_ERROR_TEXT = 'Expected a function';
  4998. /** Used to stand-in for `undefined` hash values. */
  4999. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  5000. /** Used to compose bitmasks for comparison styles. */
  5001. var UNORDERED_COMPARE_FLAG = 1,
  5002. PARTIAL_COMPARE_FLAG = 2;
  5003. /** Used as references for various `Number` constants. */
  5004. var INFINITY = 1 / 0,
  5005. MAX_SAFE_INTEGER = 9007199254740991;
  5006. /** `Object#toString` result references. */
  5007. var argsTag = '[object Arguments]',
  5008. arrayTag = '[object Array]',
  5009. boolTag = '[object Boolean]',
  5010. dateTag = '[object Date]',
  5011. errorTag = '[object Error]',
  5012. funcTag = '[object Function]',
  5013. genTag = '[object GeneratorFunction]',
  5014. mapTag = '[object Map]',
  5015. numberTag = '[object Number]',
  5016. objectTag = '[object Object]',
  5017. promiseTag = '[object Promise]',
  5018. regexpTag = '[object RegExp]',
  5019. setTag = '[object Set]',
  5020. stringTag = '[object String]',
  5021. symbolTag = '[object Symbol]',
  5022. weakMapTag = '[object WeakMap]';
  5023. var arrayBufferTag = '[object ArrayBuffer]',
  5024. dataViewTag = '[object DataView]',
  5025. float32Tag = '[object Float32Array]',
  5026. float64Tag = '[object Float64Array]',
  5027. int8Tag = '[object Int8Array]',
  5028. int16Tag = '[object Int16Array]',
  5029. int32Tag = '[object Int32Array]',
  5030. uint8Tag = '[object Uint8Array]',
  5031. uint8ClampedTag = '[object Uint8ClampedArray]',
  5032. uint16Tag = '[object Uint16Array]',
  5033. uint32Tag = '[object Uint32Array]';
  5034. /** Used to match property names within property paths. */
  5035. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  5036. reIsPlainProp = /^\w*$/,
  5037. reLeadingDot = /^\./,
  5038. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  5039. /**
  5040. * Used to match `RegExp`
  5041. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  5042. */
  5043. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  5044. /** Used to match backslashes in property paths. */
  5045. var reEscapeChar = /\\(\\)?/g;
  5046. /** Used to detect host constructors (Safari). */
  5047. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  5048. /** Used to detect unsigned integer values. */
  5049. var reIsUint = /^(?:0|[1-9]\d*)$/;
  5050. /** Used to identify `toStringTag` values of typed arrays. */
  5051. var typedArrayTags = {};
  5052. typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;
  5053. typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;
  5054. /** Detect free variable `global` from Node.js. */
  5055. var freeGlobal = (typeof __webpack_require__.g === "undefined" ? "undefined" : _typeof(__webpack_require__.g)) == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;
  5056. /** Detect free variable `self`. */
  5057. var freeSelf = (typeof self === "undefined" ? "undefined" : _typeof(self)) == 'object' && self && self.Object === Object && self;
  5058. /** Used as a reference to the global object. */
  5059. var root = freeGlobal || freeSelf || Function('return this')();
  5060. /** Detect free variable `exports`. */
  5061. var freeExports = ( false ? 0 : _typeof(exports)) == 'object' && exports && !exports.nodeType && exports;
  5062. /** Detect free variable `module`. */
  5063. var freeModule = freeExports && ( false ? 0 : _typeof(module)) == 'object' && module && !module.nodeType && module;
  5064. /** Detect the popular CommonJS extension `module.exports`. */
  5065. var moduleExports = freeModule && freeModule.exports === freeExports;
  5066. /** Detect free variable `process` from Node.js. */
  5067. var freeProcess = moduleExports && freeGlobal.process;
  5068. /** Used to access faster Node.js helpers. */
  5069. var nodeUtil = function () {
  5070. try {
  5071. return freeProcess && freeProcess.binding('util');
  5072. } catch (e) {}
  5073. }();
  5074. /* Node.js helper references. */
  5075. var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
  5076. /**
  5077. * A specialized version of `_.includes` for arrays without support for
  5078. * specifying an index to search from.
  5079. *
  5080. * @private
  5081. * @param {Array} [array] The array to inspect.
  5082. * @param {*} target The value to search for.
  5083. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  5084. */
  5085. function arrayIncludes(array, value) {
  5086. var length = array ? array.length : 0;
  5087. return !!length && baseIndexOf(array, value, 0) > -1;
  5088. }
  5089. /**
  5090. * This function is like `arrayIncludes` except that it accepts a comparator.
  5091. *
  5092. * @private
  5093. * @param {Array} [array] The array to inspect.
  5094. * @param {*} target The value to search for.
  5095. * @param {Function} comparator The comparator invoked per element.
  5096. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  5097. */
  5098. function arrayIncludesWith(array, value, comparator) {
  5099. var index = -1,
  5100. length = array ? array.length : 0;
  5101. while (++index < length) {
  5102. if (comparator(value, array[index])) {
  5103. return true;
  5104. }
  5105. }
  5106. return false;
  5107. }
  5108. /**
  5109. * A specialized version of `_.some` for arrays without support for iteratee
  5110. * shorthands.
  5111. *
  5112. * @private
  5113. * @param {Array} [array] The array to iterate over.
  5114. * @param {Function} predicate The function invoked per iteration.
  5115. * @returns {boolean} Returns `true` if any element passes the predicate check,
  5116. * else `false`.
  5117. */
  5118. function arraySome(array, predicate) {
  5119. var index = -1,
  5120. length = array ? array.length : 0;
  5121. while (++index < length) {
  5122. if (predicate(array[index], index, array)) {
  5123. return true;
  5124. }
  5125. }
  5126. return false;
  5127. }
  5128. /**
  5129. * The base implementation of `_.findIndex` and `_.findLastIndex` without
  5130. * support for iteratee shorthands.
  5131. *
  5132. * @private
  5133. * @param {Array} array The array to inspect.
  5134. * @param {Function} predicate The function invoked per iteration.
  5135. * @param {number} fromIndex The index to search from.
  5136. * @param {boolean} [fromRight] Specify iterating from right to left.
  5137. * @returns {number} Returns the index of the matched value, else `-1`.
  5138. */
  5139. function baseFindIndex(array, predicate, fromIndex, fromRight) {
  5140. var length = array.length,
  5141. index = fromIndex + (fromRight ? 1 : -1);
  5142. while (fromRight ? index-- : ++index < length) {
  5143. if (predicate(array[index], index, array)) {
  5144. return index;
  5145. }
  5146. }
  5147. return -1;
  5148. }
  5149. /**
  5150. * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
  5151. *
  5152. * @private
  5153. * @param {Array} array The array to inspect.
  5154. * @param {*} value The value to search for.
  5155. * @param {number} fromIndex The index to search from.
  5156. * @returns {number} Returns the index of the matched value, else `-1`.
  5157. */
  5158. function baseIndexOf(array, value, fromIndex) {
  5159. if (value !== value) {
  5160. return baseFindIndex(array, baseIsNaN, fromIndex);
  5161. }
  5162. var index = fromIndex - 1,
  5163. length = array.length;
  5164. while (++index < length) {
  5165. if (array[index] === value) {
  5166. return index;
  5167. }
  5168. }
  5169. return -1;
  5170. }
  5171. /**
  5172. * The base implementation of `_.isNaN` without support for number objects.
  5173. *
  5174. * @private
  5175. * @param {*} value The value to check.
  5176. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  5177. */
  5178. function baseIsNaN(value) {
  5179. return value !== value;
  5180. }
  5181. /**
  5182. * The base implementation of `_.property` without support for deep paths.
  5183. *
  5184. * @private
  5185. * @param {string} key The key of the property to get.
  5186. * @returns {Function} Returns the new accessor function.
  5187. */
  5188. function baseProperty(key) {
  5189. return function (object) {
  5190. return object == null ? undefined : object[key];
  5191. };
  5192. }
  5193. /**
  5194. * The base implementation of `_.times` without support for iteratee shorthands
  5195. * or max array length checks.
  5196. *
  5197. * @private
  5198. * @param {number} n The number of times to invoke `iteratee`.
  5199. * @param {Function} iteratee The function invoked per iteration.
  5200. * @returns {Array} Returns the array of results.
  5201. */
  5202. function baseTimes(n, iteratee) {
  5203. var index = -1,
  5204. result = Array(n);
  5205. while (++index < n) {
  5206. result[index] = iteratee(index);
  5207. }
  5208. return result;
  5209. }
  5210. /**
  5211. * The base implementation of `_.unary` without support for storing metadata.
  5212. *
  5213. * @private
  5214. * @param {Function} func The function to cap arguments for.
  5215. * @returns {Function} Returns the new capped function.
  5216. */
  5217. function baseUnary(func) {
  5218. return function (value) {
  5219. return func(value);
  5220. };
  5221. }
  5222. /**
  5223. * Checks if a cache value for `key` exists.
  5224. *
  5225. * @private
  5226. * @param {Object} cache The cache to query.
  5227. * @param {string} key The key of the entry to check.
  5228. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  5229. */
  5230. function cacheHas(cache, key) {
  5231. return cache.has(key);
  5232. }
  5233. /**
  5234. * Gets the value at `key` of `object`.
  5235. *
  5236. * @private
  5237. * @param {Object} [object] The object to query.
  5238. * @param {string} key The key of the property to get.
  5239. * @returns {*} Returns the property value.
  5240. */
  5241. function getValue(object, key) {
  5242. return object == null ? undefined : object[key];
  5243. }
  5244. /**
  5245. * Checks if `value` is a host object in IE < 9.
  5246. *
  5247. * @private
  5248. * @param {*} value The value to check.
  5249. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  5250. */
  5251. function isHostObject(value) {
  5252. // Many host objects are `Object` objects that can coerce to strings
  5253. // despite having improperly defined `toString` methods.
  5254. var result = false;
  5255. if (value != null && typeof value.toString != 'function') {
  5256. try {
  5257. result = !!(value + '');
  5258. } catch (e) {}
  5259. }
  5260. return result;
  5261. }
  5262. /**
  5263. * Converts `map` to its key-value pairs.
  5264. *
  5265. * @private
  5266. * @param {Object} map The map to convert.
  5267. * @returns {Array} Returns the key-value pairs.
  5268. */
  5269. function mapToArray(map) {
  5270. var index = -1,
  5271. result = Array(map.size);
  5272. map.forEach(function (value, key) {
  5273. result[++index] = [key, value];
  5274. });
  5275. return result;
  5276. }
  5277. /**
  5278. * Creates a unary function that invokes `func` with its argument transformed.
  5279. *
  5280. * @private
  5281. * @param {Function} func The function to wrap.
  5282. * @param {Function} transform The argument transform.
  5283. * @returns {Function} Returns the new function.
  5284. */
  5285. function overArg(func, transform) {
  5286. return function (arg) {
  5287. return func(transform(arg));
  5288. };
  5289. }
  5290. /**
  5291. * Converts `set` to an array of its values.
  5292. *
  5293. * @private
  5294. * @param {Object} set The set to convert.
  5295. * @returns {Array} Returns the values.
  5296. */
  5297. function setToArray(set) {
  5298. var index = -1,
  5299. result = Array(set.size);
  5300. set.forEach(function (value) {
  5301. result[++index] = value;
  5302. });
  5303. return result;
  5304. }
  5305. /** Used for built-in method references. */
  5306. var arrayProto = Array.prototype,
  5307. funcProto = Function.prototype,
  5308. objectProto = Object.prototype;
  5309. /** Used to detect overreaching core-js shims. */
  5310. var coreJsData = root['__core-js_shared__'];
  5311. /** Used to detect methods masquerading as native. */
  5312. var maskSrcKey = function () {
  5313. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  5314. return uid ? 'Symbol(src)_1.' + uid : '';
  5315. }();
  5316. /** Used to resolve the decompiled source of functions. */
  5317. var funcToString = funcProto.toString;
  5318. /** Used to check objects for own properties. */
  5319. var hasOwnProperty = objectProto.hasOwnProperty;
  5320. /**
  5321. * Used to resolve the
  5322. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  5323. * of values.
  5324. */
  5325. var objectToString = objectProto.toString;
  5326. /** Used to detect if a method is native. */
  5327. var reIsNative = RegExp('^' + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&').replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$');
  5328. /** Built-in value references. */
  5329. var _Symbol = root.Symbol,
  5330. Uint8Array = root.Uint8Array,
  5331. propertyIsEnumerable = objectProto.propertyIsEnumerable,
  5332. splice = arrayProto.splice;
  5333. /* Built-in method references for those with the same name as other `lodash` methods. */
  5334. var nativeKeys = overArg(Object.keys, Object);
  5335. /* Built-in method references that are verified to be native. */
  5336. var DataView = getNative(root, 'DataView'),
  5337. Map = getNative(root, 'Map'),
  5338. Promise = getNative(root, 'Promise'),
  5339. Set = getNative(root, 'Set'),
  5340. WeakMap = getNative(root, 'WeakMap'),
  5341. nativeCreate = getNative(Object, 'create');
  5342. /** Used to detect maps, sets, and weakmaps. */
  5343. var dataViewCtorString = toSource(DataView),
  5344. mapCtorString = toSource(Map),
  5345. promiseCtorString = toSource(Promise),
  5346. setCtorString = toSource(Set),
  5347. weakMapCtorString = toSource(WeakMap);
  5348. /** Used to convert symbols to primitives and strings. */
  5349. var symbolProto = _Symbol ? _Symbol.prototype : undefined,
  5350. symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,
  5351. symbolToString = symbolProto ? symbolProto.toString : undefined;
  5352. /**
  5353. * Creates a hash object.
  5354. *
  5355. * @private
  5356. * @constructor
  5357. * @param {Array} [entries] The key-value pairs to cache.
  5358. */
  5359. function Hash(entries) {
  5360. var index = -1,
  5361. length = entries ? entries.length : 0;
  5362. this.clear();
  5363. while (++index < length) {
  5364. var entry = entries[index];
  5365. this.set(entry[0], entry[1]);
  5366. }
  5367. }
  5368. /**
  5369. * Removes all key-value entries from the hash.
  5370. *
  5371. * @private
  5372. * @name clear
  5373. * @memberOf Hash
  5374. */
  5375. function hashClear() {
  5376. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  5377. }
  5378. /**
  5379. * Removes `key` and its value from the hash.
  5380. *
  5381. * @private
  5382. * @name delete
  5383. * @memberOf Hash
  5384. * @param {Object} hash The hash to modify.
  5385. * @param {string} key The key of the value to remove.
  5386. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  5387. */
  5388. function hashDelete(key) {
  5389. return this.has(key) && delete this.__data__[key];
  5390. }
  5391. /**
  5392. * Gets the hash value for `key`.
  5393. *
  5394. * @private
  5395. * @name get
  5396. * @memberOf Hash
  5397. * @param {string} key The key of the value to get.
  5398. * @returns {*} Returns the entry value.
  5399. */
  5400. function hashGet(key) {
  5401. var data = this.__data__;
  5402. if (nativeCreate) {
  5403. var result = data[key];
  5404. return result === HASH_UNDEFINED ? undefined : result;
  5405. }
  5406. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  5407. }
  5408. /**
  5409. * Checks if a hash value for `key` exists.
  5410. *
  5411. * @private
  5412. * @name has
  5413. * @memberOf Hash
  5414. * @param {string} key The key of the entry to check.
  5415. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  5416. */
  5417. function hashHas(key) {
  5418. var data = this.__data__;
  5419. return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
  5420. }
  5421. /**
  5422. * Sets the hash `key` to `value`.
  5423. *
  5424. * @private
  5425. * @name set
  5426. * @memberOf Hash
  5427. * @param {string} key The key of the value to set.
  5428. * @param {*} value The value to set.
  5429. * @returns {Object} Returns the hash instance.
  5430. */
  5431. function hashSet(key, value) {
  5432. var data = this.__data__;
  5433. data[key] = nativeCreate && value === undefined ? HASH_UNDEFINED : value;
  5434. return this;
  5435. }
  5436. // Add methods to `Hash`.
  5437. Hash.prototype.clear = hashClear;
  5438. Hash.prototype['delete'] = hashDelete;
  5439. Hash.prototype.get = hashGet;
  5440. Hash.prototype.has = hashHas;
  5441. Hash.prototype.set = hashSet;
  5442. /**
  5443. * Creates an list cache object.
  5444. *
  5445. * @private
  5446. * @constructor
  5447. * @param {Array} [entries] The key-value pairs to cache.
  5448. */
  5449. function ListCache(entries) {
  5450. var index = -1,
  5451. length = entries ? entries.length : 0;
  5452. this.clear();
  5453. while (++index < length) {
  5454. var entry = entries[index];
  5455. this.set(entry[0], entry[1]);
  5456. }
  5457. }
  5458. /**
  5459. * Removes all key-value entries from the list cache.
  5460. *
  5461. * @private
  5462. * @name clear
  5463. * @memberOf ListCache
  5464. */
  5465. function listCacheClear() {
  5466. this.__data__ = [];
  5467. }
  5468. /**
  5469. * Removes `key` and its value from the list cache.
  5470. *
  5471. * @private
  5472. * @name delete
  5473. * @memberOf ListCache
  5474. * @param {string} key The key of the value to remove.
  5475. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  5476. */
  5477. function listCacheDelete(key) {
  5478. var data = this.__data__,
  5479. index = assocIndexOf(data, key);
  5480. if (index < 0) {
  5481. return false;
  5482. }
  5483. var lastIndex = data.length - 1;
  5484. if (index == lastIndex) {
  5485. data.pop();
  5486. } else {
  5487. splice.call(data, index, 1);
  5488. }
  5489. return true;
  5490. }
  5491. /**
  5492. * Gets the list cache value for `key`.
  5493. *
  5494. * @private
  5495. * @name get
  5496. * @memberOf ListCache
  5497. * @param {string} key The key of the value to get.
  5498. * @returns {*} Returns the entry value.
  5499. */
  5500. function listCacheGet(key) {
  5501. var data = this.__data__,
  5502. index = assocIndexOf(data, key);
  5503. return index < 0 ? undefined : data[index][1];
  5504. }
  5505. /**
  5506. * Checks if a list cache value for `key` exists.
  5507. *
  5508. * @private
  5509. * @name has
  5510. * @memberOf ListCache
  5511. * @param {string} key The key of the entry to check.
  5512. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  5513. */
  5514. function listCacheHas(key) {
  5515. return assocIndexOf(this.__data__, key) > -1;
  5516. }
  5517. /**
  5518. * Sets the list cache `key` to `value`.
  5519. *
  5520. * @private
  5521. * @name set
  5522. * @memberOf ListCache
  5523. * @param {string} key The key of the value to set.
  5524. * @param {*} value The value to set.
  5525. * @returns {Object} Returns the list cache instance.
  5526. */
  5527. function listCacheSet(key, value) {
  5528. var data = this.__data__,
  5529. index = assocIndexOf(data, key);
  5530. if (index < 0) {
  5531. data.push([key, value]);
  5532. } else {
  5533. data[index][1] = value;
  5534. }
  5535. return this;
  5536. }
  5537. // Add methods to `ListCache`.
  5538. ListCache.prototype.clear = listCacheClear;
  5539. ListCache.prototype['delete'] = listCacheDelete;
  5540. ListCache.prototype.get = listCacheGet;
  5541. ListCache.prototype.has = listCacheHas;
  5542. ListCache.prototype.set = listCacheSet;
  5543. /**
  5544. * Creates a map cache object to store key-value pairs.
  5545. *
  5546. * @private
  5547. * @constructor
  5548. * @param {Array} [entries] The key-value pairs to cache.
  5549. */
  5550. function MapCache(entries) {
  5551. var index = -1,
  5552. length = entries ? entries.length : 0;
  5553. this.clear();
  5554. while (++index < length) {
  5555. var entry = entries[index];
  5556. this.set(entry[0], entry[1]);
  5557. }
  5558. }
  5559. /**
  5560. * Removes all key-value entries from the map.
  5561. *
  5562. * @private
  5563. * @name clear
  5564. * @memberOf MapCache
  5565. */
  5566. function mapCacheClear() {
  5567. this.__data__ = {
  5568. 'hash': new Hash(),
  5569. 'map': new (Map || ListCache)(),
  5570. 'string': new Hash()
  5571. };
  5572. }
  5573. /**
  5574. * Removes `key` and its value from the map.
  5575. *
  5576. * @private
  5577. * @name delete
  5578. * @memberOf MapCache
  5579. * @param {string} key The key of the value to remove.
  5580. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  5581. */
  5582. function mapCacheDelete(key) {
  5583. return getMapData(this, key)['delete'](key);
  5584. }
  5585. /**
  5586. * Gets the map value for `key`.
  5587. *
  5588. * @private
  5589. * @name get
  5590. * @memberOf MapCache
  5591. * @param {string} key The key of the value to get.
  5592. * @returns {*} Returns the entry value.
  5593. */
  5594. function mapCacheGet(key) {
  5595. return getMapData(this, key).get(key);
  5596. }
  5597. /**
  5598. * Checks if a map value for `key` exists.
  5599. *
  5600. * @private
  5601. * @name has
  5602. * @memberOf MapCache
  5603. * @param {string} key The key of the entry to check.
  5604. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  5605. */
  5606. function mapCacheHas(key) {
  5607. return getMapData(this, key).has(key);
  5608. }
  5609. /**
  5610. * Sets the map `key` to `value`.
  5611. *
  5612. * @private
  5613. * @name set
  5614. * @memberOf MapCache
  5615. * @param {string} key The key of the value to set.
  5616. * @param {*} value The value to set.
  5617. * @returns {Object} Returns the map cache instance.
  5618. */
  5619. function mapCacheSet(key, value) {
  5620. getMapData(this, key).set(key, value);
  5621. return this;
  5622. }
  5623. // Add methods to `MapCache`.
  5624. MapCache.prototype.clear = mapCacheClear;
  5625. MapCache.prototype['delete'] = mapCacheDelete;
  5626. MapCache.prototype.get = mapCacheGet;
  5627. MapCache.prototype.has = mapCacheHas;
  5628. MapCache.prototype.set = mapCacheSet;
  5629. /**
  5630. *
  5631. * Creates an array cache object to store unique values.
  5632. *
  5633. * @private
  5634. * @constructor
  5635. * @param {Array} [values] The values to cache.
  5636. */
  5637. function SetCache(values) {
  5638. var index = -1,
  5639. length = values ? values.length : 0;
  5640. this.__data__ = new MapCache();
  5641. while (++index < length) {
  5642. this.add(values[index]);
  5643. }
  5644. }
  5645. /**
  5646. * Adds `value` to the array cache.
  5647. *
  5648. * @private
  5649. * @name add
  5650. * @memberOf SetCache
  5651. * @alias push
  5652. * @param {*} value The value to cache.
  5653. * @returns {Object} Returns the cache instance.
  5654. */
  5655. function setCacheAdd(value) {
  5656. this.__data__.set(value, HASH_UNDEFINED);
  5657. return this;
  5658. }
  5659. /**
  5660. * Checks if `value` is in the array cache.
  5661. *
  5662. * @private
  5663. * @name has
  5664. * @memberOf SetCache
  5665. * @param {*} value The value to search for.
  5666. * @returns {number} Returns `true` if `value` is found, else `false`.
  5667. */
  5668. function setCacheHas(value) {
  5669. return this.__data__.has(value);
  5670. }
  5671. // Add methods to `SetCache`.
  5672. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  5673. SetCache.prototype.has = setCacheHas;
  5674. /**
  5675. * Creates a stack cache object to store key-value pairs.
  5676. *
  5677. * @private
  5678. * @constructor
  5679. * @param {Array} [entries] The key-value pairs to cache.
  5680. */
  5681. function Stack(entries) {
  5682. this.__data__ = new ListCache(entries);
  5683. }
  5684. /**
  5685. * Removes all key-value entries from the stack.
  5686. *
  5687. * @private
  5688. * @name clear
  5689. * @memberOf Stack
  5690. */
  5691. function stackClear() {
  5692. this.__data__ = new ListCache();
  5693. }
  5694. /**
  5695. * Removes `key` and its value from the stack.
  5696. *
  5697. * @private
  5698. * @name delete
  5699. * @memberOf Stack
  5700. * @param {string} key The key of the value to remove.
  5701. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  5702. */
  5703. function stackDelete(key) {
  5704. return this.__data__['delete'](key);
  5705. }
  5706. /**
  5707. * Gets the stack value for `key`.
  5708. *
  5709. * @private
  5710. * @name get
  5711. * @memberOf Stack
  5712. * @param {string} key The key of the value to get.
  5713. * @returns {*} Returns the entry value.
  5714. */
  5715. function stackGet(key) {
  5716. return this.__data__.get(key);
  5717. }
  5718. /**
  5719. * Checks if a stack value for `key` exists.
  5720. *
  5721. * @private
  5722. * @name has
  5723. * @memberOf Stack
  5724. * @param {string} key The key of the entry to check.
  5725. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  5726. */
  5727. function stackHas(key) {
  5728. return this.__data__.has(key);
  5729. }
  5730. /**
  5731. * Sets the stack `key` to `value`.
  5732. *
  5733. * @private
  5734. * @name set
  5735. * @memberOf Stack
  5736. * @param {string} key The key of the value to set.
  5737. * @param {*} value The value to set.
  5738. * @returns {Object} Returns the stack cache instance.
  5739. */
  5740. function stackSet(key, value) {
  5741. var cache = this.__data__;
  5742. if (cache instanceof ListCache) {
  5743. var pairs = cache.__data__;
  5744. if (!Map || pairs.length < LARGE_ARRAY_SIZE - 1) {
  5745. pairs.push([key, value]);
  5746. return this;
  5747. }
  5748. cache = this.__data__ = new MapCache(pairs);
  5749. }
  5750. cache.set(key, value);
  5751. return this;
  5752. }
  5753. // Add methods to `Stack`.
  5754. Stack.prototype.clear = stackClear;
  5755. Stack.prototype['delete'] = stackDelete;
  5756. Stack.prototype.get = stackGet;
  5757. Stack.prototype.has = stackHas;
  5758. Stack.prototype.set = stackSet;
  5759. /**
  5760. * Creates an array of the enumerable property names of the array-like `value`.
  5761. *
  5762. * @private
  5763. * @param {*} value The value to query.
  5764. * @param {boolean} inherited Specify returning inherited property names.
  5765. * @returns {Array} Returns the array of property names.
  5766. */
  5767. function arrayLikeKeys(value, inherited) {
  5768. // Safari 8.1 makes `arguments.callee` enumerable in strict mode.
  5769. // Safari 9 makes `arguments.length` enumerable in strict mode.
  5770. var result = isArray(value) || isArguments(value) ? baseTimes(value.length, String) : [];
  5771. var length = result.length,
  5772. skipIndexes = !!length;
  5773. for (var key in value) {
  5774. if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && (key == 'length' || isIndex(key, length)))) {
  5775. result.push(key);
  5776. }
  5777. }
  5778. return result;
  5779. }
  5780. /**
  5781. * Gets the index at which the `key` is found in `array` of key-value pairs.
  5782. *
  5783. * @private
  5784. * @param {Array} array The array to inspect.
  5785. * @param {*} key The key to search for.
  5786. * @returns {number} Returns the index of the matched value, else `-1`.
  5787. */
  5788. function assocIndexOf(array, key) {
  5789. var length = array.length;
  5790. while (length--) {
  5791. if (eq(array[length][0], key)) {
  5792. return length;
  5793. }
  5794. }
  5795. return -1;
  5796. }
  5797. /**
  5798. * The base implementation of `_.get` without support for default values.
  5799. *
  5800. * @private
  5801. * @param {Object} object The object to query.
  5802. * @param {Array|string} path The path of the property to get.
  5803. * @returns {*} Returns the resolved value.
  5804. */
  5805. function baseGet(object, path) {
  5806. path = isKey(path, object) ? [path] : castPath(path);
  5807. var index = 0,
  5808. length = path.length;
  5809. while (object != null && index < length) {
  5810. object = object[toKey(path[index++])];
  5811. }
  5812. return index && index == length ? object : undefined;
  5813. }
  5814. /**
  5815. * The base implementation of `getTag`.
  5816. *
  5817. * @private
  5818. * @param {*} value The value to query.
  5819. * @returns {string} Returns the `toStringTag`.
  5820. */
  5821. function baseGetTag(value) {
  5822. return objectToString.call(value);
  5823. }
  5824. /**
  5825. * The base implementation of `_.hasIn` without support for deep paths.
  5826. *
  5827. * @private
  5828. * @param {Object} [object] The object to query.
  5829. * @param {Array|string} key The key to check.
  5830. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  5831. */
  5832. function baseHasIn(object, key) {
  5833. return object != null && key in Object(object);
  5834. }
  5835. /**
  5836. * The base implementation of `_.isEqual` which supports partial comparisons
  5837. * and tracks traversed objects.
  5838. *
  5839. * @private
  5840. * @param {*} value The value to compare.
  5841. * @param {*} other The other value to compare.
  5842. * @param {Function} [customizer] The function to customize comparisons.
  5843. * @param {boolean} [bitmask] The bitmask of comparison flags.
  5844. * The bitmask may be composed of the following flags:
  5845. * 1 - Unordered comparison
  5846. * 2 - Partial comparison
  5847. * @param {Object} [stack] Tracks traversed `value` and `other` objects.
  5848. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  5849. */
  5850. function baseIsEqual(value, other, customizer, bitmask, stack) {
  5851. if (value === other) {
  5852. return true;
  5853. }
  5854. if (value == null || other == null || !isObject(value) && !isObjectLike(other)) {
  5855. return value !== value && other !== other;
  5856. }
  5857. return baseIsEqualDeep(value, other, baseIsEqual, customizer, bitmask, stack);
  5858. }
  5859. /**
  5860. * A specialized version of `baseIsEqual` for arrays and objects which performs
  5861. * deep comparisons and tracks traversed objects enabling objects with circular
  5862. * references to be compared.
  5863. *
  5864. * @private
  5865. * @param {Object} object The object to compare.
  5866. * @param {Object} other The other object to compare.
  5867. * @param {Function} equalFunc The function to determine equivalents of values.
  5868. * @param {Function} [customizer] The function to customize comparisons.
  5869. * @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual`
  5870. * for more details.
  5871. * @param {Object} [stack] Tracks traversed `object` and `other` objects.
  5872. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  5873. */
  5874. function baseIsEqualDeep(object, other, equalFunc, customizer, bitmask, stack) {
  5875. var objIsArr = isArray(object),
  5876. othIsArr = isArray(other),
  5877. objTag = arrayTag,
  5878. othTag = arrayTag;
  5879. if (!objIsArr) {
  5880. objTag = getTag(object);
  5881. objTag = objTag == argsTag ? objectTag : objTag;
  5882. }
  5883. if (!othIsArr) {
  5884. othTag = getTag(other);
  5885. othTag = othTag == argsTag ? objectTag : othTag;
  5886. }
  5887. var objIsObj = objTag == objectTag && !isHostObject(object),
  5888. othIsObj = othTag == objectTag && !isHostObject(other),
  5889. isSameTag = objTag == othTag;
  5890. if (isSameTag && !objIsObj) {
  5891. stack || (stack = new Stack());
  5892. return objIsArr || isTypedArray(object) ? equalArrays(object, other, equalFunc, customizer, bitmask, stack) : equalByTag(object, other, objTag, equalFunc, customizer, bitmask, stack);
  5893. }
  5894. if (!(bitmask & PARTIAL_COMPARE_FLAG)) {
  5895. var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
  5896. othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
  5897. if (objIsWrapped || othIsWrapped) {
  5898. var objUnwrapped = objIsWrapped ? object.value() : object,
  5899. othUnwrapped = othIsWrapped ? other.value() : other;
  5900. stack || (stack = new Stack());
  5901. return equalFunc(objUnwrapped, othUnwrapped, customizer, bitmask, stack);
  5902. }
  5903. }
  5904. if (!isSameTag) {
  5905. return false;
  5906. }
  5907. stack || (stack = new Stack());
  5908. return equalObjects(object, other, equalFunc, customizer, bitmask, stack);
  5909. }
  5910. /**
  5911. * The base implementation of `_.isMatch` without support for iteratee shorthands.
  5912. *
  5913. * @private
  5914. * @param {Object} object The object to inspect.
  5915. * @param {Object} source The object of property values to match.
  5916. * @param {Array} matchData The property names, values, and compare flags to match.
  5917. * @param {Function} [customizer] The function to customize comparisons.
  5918. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  5919. */
  5920. function baseIsMatch(object, source, matchData, customizer) {
  5921. var index = matchData.length,
  5922. length = index,
  5923. noCustomizer = !customizer;
  5924. if (object == null) {
  5925. return !length;
  5926. }
  5927. object = Object(object);
  5928. while (index--) {
  5929. var data = matchData[index];
  5930. if (noCustomizer && data[2] ? data[1] !== object[data[0]] : !(data[0] in object)) {
  5931. return false;
  5932. }
  5933. }
  5934. while (++index < length) {
  5935. data = matchData[index];
  5936. var key = data[0],
  5937. objValue = object[key],
  5938. srcValue = data[1];
  5939. if (noCustomizer && data[2]) {
  5940. if (objValue === undefined && !(key in object)) {
  5941. return false;
  5942. }
  5943. } else {
  5944. var stack = new Stack();
  5945. if (customizer) {
  5946. var result = customizer(objValue, srcValue, key, object, source, stack);
  5947. }
  5948. if (!(result === undefined ? baseIsEqual(srcValue, objValue, customizer, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG, stack) : result)) {
  5949. return false;
  5950. }
  5951. }
  5952. }
  5953. return true;
  5954. }
  5955. /**
  5956. * The base implementation of `_.isNative` without bad shim checks.
  5957. *
  5958. * @private
  5959. * @param {*} value The value to check.
  5960. * @returns {boolean} Returns `true` if `value` is a native function,
  5961. * else `false`.
  5962. */
  5963. function baseIsNative(value) {
  5964. if (!isObject(value) || isMasked(value)) {
  5965. return false;
  5966. }
  5967. var pattern = isFunction(value) || isHostObject(value) ? reIsNative : reIsHostCtor;
  5968. return pattern.test(toSource(value));
  5969. }
  5970. /**
  5971. * The base implementation of `_.isTypedArray` without Node.js optimizations.
  5972. *
  5973. * @private
  5974. * @param {*} value The value to check.
  5975. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  5976. */
  5977. function baseIsTypedArray(value) {
  5978. return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[objectToString.call(value)];
  5979. }
  5980. /**
  5981. * The base implementation of `_.iteratee`.
  5982. *
  5983. * @private
  5984. * @param {*} [value=_.identity] The value to convert to an iteratee.
  5985. * @returns {Function} Returns the iteratee.
  5986. */
  5987. function baseIteratee(value) {
  5988. // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
  5989. // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
  5990. if (typeof value == 'function') {
  5991. return value;
  5992. }
  5993. if (value == null) {
  5994. return identity;
  5995. }
  5996. if (_typeof(value) == 'object') {
  5997. return isArray(value) ? baseMatchesProperty(value[0], value[1]) : baseMatches(value);
  5998. }
  5999. return property(value);
  6000. }
  6001. /**
  6002. * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
  6003. *
  6004. * @private
  6005. * @param {Object} object The object to query.
  6006. * @returns {Array} Returns the array of property names.
  6007. */
  6008. function baseKeys(object) {
  6009. if (!isPrototype(object)) {
  6010. return nativeKeys(object);
  6011. }
  6012. var result = [];
  6013. for (var key in Object(object)) {
  6014. if (hasOwnProperty.call(object, key) && key != 'constructor') {
  6015. result.push(key);
  6016. }
  6017. }
  6018. return result;
  6019. }
  6020. /**
  6021. * The base implementation of `_.matches` which doesn't clone `source`.
  6022. *
  6023. * @private
  6024. * @param {Object} source The object of property values to match.
  6025. * @returns {Function} Returns the new spec function.
  6026. */
  6027. function baseMatches(source) {
  6028. var matchData = getMatchData(source);
  6029. if (matchData.length == 1 && matchData[0][2]) {
  6030. return matchesStrictComparable(matchData[0][0], matchData[0][1]);
  6031. }
  6032. return function (object) {
  6033. return object === source || baseIsMatch(object, source, matchData);
  6034. };
  6035. }
  6036. /**
  6037. * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
  6038. *
  6039. * @private
  6040. * @param {string} path The path of the property to get.
  6041. * @param {*} srcValue The value to match.
  6042. * @returns {Function} Returns the new spec function.
  6043. */
  6044. function baseMatchesProperty(path, srcValue) {
  6045. if (isKey(path) && isStrictComparable(srcValue)) {
  6046. return matchesStrictComparable(toKey(path), srcValue);
  6047. }
  6048. return function (object) {
  6049. var objValue = get(object, path);
  6050. return objValue === undefined && objValue === srcValue ? hasIn(object, path) : baseIsEqual(srcValue, objValue, undefined, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG);
  6051. };
  6052. }
  6053. /**
  6054. * A specialized version of `baseProperty` which supports deep paths.
  6055. *
  6056. * @private
  6057. * @param {Array|string} path The path of the property to get.
  6058. * @returns {Function} Returns the new accessor function.
  6059. */
  6060. function basePropertyDeep(path) {
  6061. return function (object) {
  6062. return baseGet(object, path);
  6063. };
  6064. }
  6065. /**
  6066. * The base implementation of `_.toString` which doesn't convert nullish
  6067. * values to empty strings.
  6068. *
  6069. * @private
  6070. * @param {*} value The value to process.
  6071. * @returns {string} Returns the string.
  6072. */
  6073. function baseToString(value) {
  6074. // Exit early for strings to avoid a performance hit in some environments.
  6075. if (typeof value == 'string') {
  6076. return value;
  6077. }
  6078. if (isSymbol(value)) {
  6079. return symbolToString ? symbolToString.call(value) : '';
  6080. }
  6081. var result = value + '';
  6082. return result == '0' && 1 / value == -INFINITY ? '-0' : result;
  6083. }
  6084. /**
  6085. * The base implementation of `_.uniqBy` without support for iteratee shorthands.
  6086. *
  6087. * @private
  6088. * @param {Array} array The array to inspect.
  6089. * @param {Function} [iteratee] The iteratee invoked per element.
  6090. * @param {Function} [comparator] The comparator invoked per element.
  6091. * @returns {Array} Returns the new duplicate free array.
  6092. */
  6093. function baseUniq(array, iteratee, comparator) {
  6094. var index = -1,
  6095. includes = arrayIncludes,
  6096. length = array.length,
  6097. isCommon = true,
  6098. result = [],
  6099. seen = result;
  6100. if (comparator) {
  6101. isCommon = false;
  6102. includes = arrayIncludesWith;
  6103. } else if (length >= LARGE_ARRAY_SIZE) {
  6104. var set = iteratee ? null : createSet(array);
  6105. if (set) {
  6106. return setToArray(set);
  6107. }
  6108. isCommon = false;
  6109. includes = cacheHas;
  6110. seen = new SetCache();
  6111. } else {
  6112. seen = iteratee ? [] : result;
  6113. }
  6114. outer: while (++index < length) {
  6115. var value = array[index],
  6116. computed = iteratee ? iteratee(value) : value;
  6117. value = comparator || value !== 0 ? value : 0;
  6118. if (isCommon && computed === computed) {
  6119. var seenIndex = seen.length;
  6120. while (seenIndex--) {
  6121. if (seen[seenIndex] === computed) {
  6122. continue outer;
  6123. }
  6124. }
  6125. if (iteratee) {
  6126. seen.push(computed);
  6127. }
  6128. result.push(value);
  6129. } else if (!includes(seen, computed, comparator)) {
  6130. if (seen !== result) {
  6131. seen.push(computed);
  6132. }
  6133. result.push(value);
  6134. }
  6135. }
  6136. return result;
  6137. }
  6138. /**
  6139. * Casts `value` to a path array if it's not one.
  6140. *
  6141. * @private
  6142. * @param {*} value The value to inspect.
  6143. * @returns {Array} Returns the cast property path array.
  6144. */
  6145. function castPath(value) {
  6146. return isArray(value) ? value : stringToPath(value);
  6147. }
  6148. /**
  6149. * Creates a set object of `values`.
  6150. *
  6151. * @private
  6152. * @param {Array} values The values to add to the set.
  6153. * @returns {Object} Returns the new set.
  6154. */
  6155. var createSet = !(Set && 1 / setToArray(new Set([, -0]))[1] == INFINITY) ? noop : function (values) {
  6156. return new Set(values);
  6157. };
  6158. /**
  6159. * A specialized version of `baseIsEqualDeep` for arrays with support for
  6160. * partial deep comparisons.
  6161. *
  6162. * @private
  6163. * @param {Array} array The array to compare.
  6164. * @param {Array} other The other array to compare.
  6165. * @param {Function} equalFunc The function to determine equivalents of values.
  6166. * @param {Function} customizer The function to customize comparisons.
  6167. * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual`
  6168. * for more details.
  6169. * @param {Object} stack Tracks traversed `array` and `other` objects.
  6170. * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
  6171. */
  6172. function equalArrays(array, other, equalFunc, customizer, bitmask, stack) {
  6173. var isPartial = bitmask & PARTIAL_COMPARE_FLAG,
  6174. arrLength = array.length,
  6175. othLength = other.length;
  6176. if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
  6177. return false;
  6178. }
  6179. // Assume cyclic values are equal.
  6180. var stacked = stack.get(array);
  6181. if (stacked && stack.get(other)) {
  6182. return stacked == other;
  6183. }
  6184. var index = -1,
  6185. result = true,
  6186. seen = bitmask & UNORDERED_COMPARE_FLAG ? new SetCache() : undefined;
  6187. stack.set(array, other);
  6188. stack.set(other, array);
  6189. // Ignore non-index properties.
  6190. while (++index < arrLength) {
  6191. var arrValue = array[index],
  6192. othValue = other[index];
  6193. if (customizer) {
  6194. var compared = isPartial ? customizer(othValue, arrValue, index, other, array, stack) : customizer(arrValue, othValue, index, array, other, stack);
  6195. }
  6196. if (compared !== undefined) {
  6197. if (compared) {
  6198. continue;
  6199. }
  6200. result = false;
  6201. break;
  6202. }
  6203. // Recursively compare arrays (susceptible to call stack limits).
  6204. if (seen) {
  6205. if (!arraySome(other, function (othValue, othIndex) {
  6206. if (!seen.has(othIndex) && (arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stack))) {
  6207. return seen.add(othIndex);
  6208. }
  6209. })) {
  6210. result = false;
  6211. break;
  6212. }
  6213. } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stack))) {
  6214. result = false;
  6215. break;
  6216. }
  6217. }
  6218. stack['delete'](array);
  6219. stack['delete'](other);
  6220. return result;
  6221. }
  6222. /**
  6223. * A specialized version of `baseIsEqualDeep` for comparing objects of
  6224. * the same `toStringTag`.
  6225. *
  6226. * **Note:** This function only supports comparing values with tags of
  6227. * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
  6228. *
  6229. * @private
  6230. * @param {Object} object The object to compare.
  6231. * @param {Object} other The other object to compare.
  6232. * @param {string} tag The `toStringTag` of the objects to compare.
  6233. * @param {Function} equalFunc The function to determine equivalents of values.
  6234. * @param {Function} customizer The function to customize comparisons.
  6235. * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual`
  6236. * for more details.
  6237. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6238. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6239. */
  6240. function equalByTag(object, other, tag, equalFunc, customizer, bitmask, stack) {
  6241. switch (tag) {
  6242. case dataViewTag:
  6243. if (object.byteLength != other.byteLength || object.byteOffset != other.byteOffset) {
  6244. return false;
  6245. }
  6246. object = object.buffer;
  6247. other = other.buffer;
  6248. case arrayBufferTag:
  6249. if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
  6250. return false;
  6251. }
  6252. return true;
  6253. case boolTag:
  6254. case dateTag:
  6255. case numberTag:
  6256. // Coerce booleans to `1` or `0` and dates to milliseconds.
  6257. // Invalid dates are coerced to `NaN`.
  6258. return eq(+object, +other);
  6259. case errorTag:
  6260. return object.name == other.name && object.message == other.message;
  6261. case regexpTag:
  6262. case stringTag:
  6263. // Coerce regexes to strings and treat strings, primitives and objects,
  6264. // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
  6265. // for more details.
  6266. return object == other + '';
  6267. case mapTag:
  6268. var convert = mapToArray;
  6269. case setTag:
  6270. var isPartial = bitmask & PARTIAL_COMPARE_FLAG;
  6271. convert || (convert = setToArray);
  6272. if (object.size != other.size && !isPartial) {
  6273. return false;
  6274. }
  6275. // Assume cyclic values are equal.
  6276. var stacked = stack.get(object);
  6277. if (stacked) {
  6278. return stacked == other;
  6279. }
  6280. bitmask |= UNORDERED_COMPARE_FLAG;
  6281. // Recursively compare objects (susceptible to call stack limits).
  6282. stack.set(object, other);
  6283. var result = equalArrays(convert(object), convert(other), equalFunc, customizer, bitmask, stack);
  6284. stack['delete'](object);
  6285. return result;
  6286. case symbolTag:
  6287. if (symbolValueOf) {
  6288. return symbolValueOf.call(object) == symbolValueOf.call(other);
  6289. }
  6290. }
  6291. return false;
  6292. }
  6293. /**
  6294. * A specialized version of `baseIsEqualDeep` for objects with support for
  6295. * partial deep comparisons.
  6296. *
  6297. * @private
  6298. * @param {Object} object The object to compare.
  6299. * @param {Object} other The other object to compare.
  6300. * @param {Function} equalFunc The function to determine equivalents of values.
  6301. * @param {Function} customizer The function to customize comparisons.
  6302. * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual`
  6303. * for more details.
  6304. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6305. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6306. */
  6307. function equalObjects(object, other, equalFunc, customizer, bitmask, stack) {
  6308. var isPartial = bitmask & PARTIAL_COMPARE_FLAG,
  6309. objProps = keys(object),
  6310. objLength = objProps.length,
  6311. othProps = keys(other),
  6312. othLength = othProps.length;
  6313. if (objLength != othLength && !isPartial) {
  6314. return false;
  6315. }
  6316. var index = objLength;
  6317. while (index--) {
  6318. var key = objProps[index];
  6319. if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
  6320. return false;
  6321. }
  6322. }
  6323. // Assume cyclic values are equal.
  6324. var stacked = stack.get(object);
  6325. if (stacked && stack.get(other)) {
  6326. return stacked == other;
  6327. }
  6328. var result = true;
  6329. stack.set(object, other);
  6330. stack.set(other, object);
  6331. var skipCtor = isPartial;
  6332. while (++index < objLength) {
  6333. key = objProps[index];
  6334. var objValue = object[key],
  6335. othValue = other[key];
  6336. if (customizer) {
  6337. var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack);
  6338. }
  6339. // Recursively compare objects (susceptible to call stack limits).
  6340. if (!(compared === undefined ? objValue === othValue || equalFunc(objValue, othValue, customizer, bitmask, stack) : compared)) {
  6341. result = false;
  6342. break;
  6343. }
  6344. skipCtor || (skipCtor = key == 'constructor');
  6345. }
  6346. if (result && !skipCtor) {
  6347. var objCtor = object.constructor,
  6348. othCtor = other.constructor;
  6349. // Non `Object` object instances with different constructors are not equal.
  6350. if (objCtor != othCtor && 'constructor' in object && 'constructor' in other && !(typeof objCtor == 'function' && objCtor instanceof objCtor && typeof othCtor == 'function' && othCtor instanceof othCtor)) {
  6351. result = false;
  6352. }
  6353. }
  6354. stack['delete'](object);
  6355. stack['delete'](other);
  6356. return result;
  6357. }
  6358. /**
  6359. * Gets the data for `map`.
  6360. *
  6361. * @private
  6362. * @param {Object} map The map to query.
  6363. * @param {string} key The reference key.
  6364. * @returns {*} Returns the map data.
  6365. */
  6366. function getMapData(map, key) {
  6367. var data = map.__data__;
  6368. return isKeyable(key) ? data[typeof key == 'string' ? 'string' : 'hash'] : data.map;
  6369. }
  6370. /**
  6371. * Gets the property names, values, and compare flags of `object`.
  6372. *
  6373. * @private
  6374. * @param {Object} object The object to query.
  6375. * @returns {Array} Returns the match data of `object`.
  6376. */
  6377. function getMatchData(object) {
  6378. var result = keys(object),
  6379. length = result.length;
  6380. while (length--) {
  6381. var key = result[length],
  6382. value = object[key];
  6383. result[length] = [key, value, isStrictComparable(value)];
  6384. }
  6385. return result;
  6386. }
  6387. /**
  6388. * Gets the native function at `key` of `object`.
  6389. *
  6390. * @private
  6391. * @param {Object} object The object to query.
  6392. * @param {string} key The key of the method to get.
  6393. * @returns {*} Returns the function if it's native, else `undefined`.
  6394. */
  6395. function getNative(object, key) {
  6396. var value = getValue(object, key);
  6397. return baseIsNative(value) ? value : undefined;
  6398. }
  6399. /**
  6400. * Gets the `toStringTag` of `value`.
  6401. *
  6402. * @private
  6403. * @param {*} value The value to query.
  6404. * @returns {string} Returns the `toStringTag`.
  6405. */
  6406. var getTag = baseGetTag;
  6407. // Fallback for data views, maps, sets, and weak maps in IE 11,
  6408. // for data views in Edge < 14, and promises in Node.js.
  6409. if (DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag || Map && getTag(new Map()) != mapTag || Promise && getTag(Promise.resolve()) != promiseTag || Set && getTag(new Set()) != setTag || WeakMap && getTag(new WeakMap()) != weakMapTag) {
  6410. getTag = function getTag(value) {
  6411. var result = objectToString.call(value),
  6412. Ctor = result == objectTag ? value.constructor : undefined,
  6413. ctorString = Ctor ? toSource(Ctor) : undefined;
  6414. if (ctorString) {
  6415. switch (ctorString) {
  6416. case dataViewCtorString:
  6417. return dataViewTag;
  6418. case mapCtorString:
  6419. return mapTag;
  6420. case promiseCtorString:
  6421. return promiseTag;
  6422. case setCtorString:
  6423. return setTag;
  6424. case weakMapCtorString:
  6425. return weakMapTag;
  6426. }
  6427. }
  6428. return result;
  6429. };
  6430. }
  6431. /**
  6432. * Checks if `path` exists on `object`.
  6433. *
  6434. * @private
  6435. * @param {Object} object The object to query.
  6436. * @param {Array|string} path The path to check.
  6437. * @param {Function} hasFunc The function to check properties.
  6438. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  6439. */
  6440. function hasPath(object, path, hasFunc) {
  6441. path = isKey(path, object) ? [path] : castPath(path);
  6442. var result,
  6443. index = -1,
  6444. length = path.length;
  6445. while (++index < length) {
  6446. var key = toKey(path[index]);
  6447. if (!(result = object != null && hasFunc(object, key))) {
  6448. break;
  6449. }
  6450. object = object[key];
  6451. }
  6452. if (result) {
  6453. return result;
  6454. }
  6455. var length = object ? object.length : 0;
  6456. return !!length && isLength(length) && isIndex(key, length) && (isArray(object) || isArguments(object));
  6457. }
  6458. /**
  6459. * Checks if `value` is a valid array-like index.
  6460. *
  6461. * @private
  6462. * @param {*} value The value to check.
  6463. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  6464. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  6465. */
  6466. function isIndex(value, length) {
  6467. length = length == null ? MAX_SAFE_INTEGER : length;
  6468. return !!length && (typeof value == 'number' || reIsUint.test(value)) && value > -1 && value % 1 == 0 && value < length;
  6469. }
  6470. /**
  6471. * Checks if `value` is a property name and not a property path.
  6472. *
  6473. * @private
  6474. * @param {*} value The value to check.
  6475. * @param {Object} [object] The object to query keys on.
  6476. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  6477. */
  6478. function isKey(value, object) {
  6479. if (isArray(value)) {
  6480. return false;
  6481. }
  6482. var type = _typeof(value);
  6483. if (type == 'number' || type == 'symbol' || type == 'boolean' || value == null || isSymbol(value)) {
  6484. return true;
  6485. }
  6486. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object != null && value in Object(object);
  6487. }
  6488. /**
  6489. * Checks if `value` is suitable for use as unique object key.
  6490. *
  6491. * @private
  6492. * @param {*} value The value to check.
  6493. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  6494. */
  6495. function isKeyable(value) {
  6496. var type = _typeof(value);
  6497. return type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean' ? value !== '__proto__' : value === null;
  6498. }
  6499. /**
  6500. * Checks if `func` has its source masked.
  6501. *
  6502. * @private
  6503. * @param {Function} func The function to check.
  6504. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  6505. */
  6506. function isMasked(func) {
  6507. return !!maskSrcKey && maskSrcKey in func;
  6508. }
  6509. /**
  6510. * Checks if `value` is likely a prototype object.
  6511. *
  6512. * @private
  6513. * @param {*} value The value to check.
  6514. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
  6515. */
  6516. function isPrototype(value) {
  6517. var Ctor = value && value.constructor,
  6518. proto = typeof Ctor == 'function' && Ctor.prototype || objectProto;
  6519. return value === proto;
  6520. }
  6521. /**
  6522. * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
  6523. *
  6524. * @private
  6525. * @param {*} value The value to check.
  6526. * @returns {boolean} Returns `true` if `value` if suitable for strict
  6527. * equality comparisons, else `false`.
  6528. */
  6529. function isStrictComparable(value) {
  6530. return value === value && !isObject(value);
  6531. }
  6532. /**
  6533. * A specialized version of `matchesProperty` for source values suitable
  6534. * for strict equality comparisons, i.e. `===`.
  6535. *
  6536. * @private
  6537. * @param {string} key The key of the property to get.
  6538. * @param {*} srcValue The value to match.
  6539. * @returns {Function} Returns the new spec function.
  6540. */
  6541. function matchesStrictComparable(key, srcValue) {
  6542. return function (object) {
  6543. if (object == null) {
  6544. return false;
  6545. }
  6546. return object[key] === srcValue && (srcValue !== undefined || key in Object(object));
  6547. };
  6548. }
  6549. /**
  6550. * Converts `string` to a property path array.
  6551. *
  6552. * @private
  6553. * @param {string} string The string to convert.
  6554. * @returns {Array} Returns the property path array.
  6555. */
  6556. var stringToPath = memoize(function (string) {
  6557. string = toString(string);
  6558. var result = [];
  6559. if (reLeadingDot.test(string)) {
  6560. result.push('');
  6561. }
  6562. string.replace(rePropName, function (match, number, quote, string) {
  6563. result.push(quote ? string.replace(reEscapeChar, '$1') : number || match);
  6564. });
  6565. return result;
  6566. });
  6567. /**
  6568. * Converts `value` to a string key if it's not a string or symbol.
  6569. *
  6570. * @private
  6571. * @param {*} value The value to inspect.
  6572. * @returns {string|symbol} Returns the key.
  6573. */
  6574. function toKey(value) {
  6575. if (typeof value == 'string' || isSymbol(value)) {
  6576. return value;
  6577. }
  6578. var result = value + '';
  6579. return result == '0' && 1 / value == -INFINITY ? '-0' : result;
  6580. }
  6581. /**
  6582. * Converts `func` to its source code.
  6583. *
  6584. * @private
  6585. * @param {Function} func The function to process.
  6586. * @returns {string} Returns the source code.
  6587. */
  6588. function toSource(func) {
  6589. if (func != null) {
  6590. try {
  6591. return funcToString.call(func);
  6592. } catch (e) {}
  6593. try {
  6594. return func + '';
  6595. } catch (e) {}
  6596. }
  6597. return '';
  6598. }
  6599. /**
  6600. * This method is like `_.uniq` except that it accepts `iteratee` which is
  6601. * invoked for each element in `array` to generate the criterion by which
  6602. * uniqueness is computed. The iteratee is invoked with one argument: (value).
  6603. *
  6604. * @static
  6605. * @memberOf _
  6606. * @since 4.0.0
  6607. * @category Array
  6608. * @param {Array} array The array to inspect.
  6609. * @param {Function} [iteratee=_.identity]
  6610. * The iteratee invoked per element.
  6611. * @returns {Array} Returns the new duplicate free array.
  6612. * @example
  6613. *
  6614. * _.uniqBy([2.1, 1.2, 2.3], Math.floor);
  6615. * // => [2.1, 1.2]
  6616. *
  6617. * // The `_.property` iteratee shorthand.
  6618. * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
  6619. * // => [{ 'x': 1 }, { 'x': 2 }]
  6620. */
  6621. function uniqBy(array, iteratee) {
  6622. return array && array.length ? baseUniq(array, baseIteratee(iteratee, 2)) : [];
  6623. }
  6624. /**
  6625. * Creates a function that memoizes the result of `func`. If `resolver` is
  6626. * provided, it determines the cache key for storing the result based on the
  6627. * arguments provided to the memoized function. By default, the first argument
  6628. * provided to the memoized function is used as the map cache key. The `func`
  6629. * is invoked with the `this` binding of the memoized function.
  6630. *
  6631. * **Note:** The cache is exposed as the `cache` property on the memoized
  6632. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  6633. * constructor with one whose instances implement the
  6634. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  6635. * method interface of `delete`, `get`, `has`, and `set`.
  6636. *
  6637. * @static
  6638. * @memberOf _
  6639. * @since 0.1.0
  6640. * @category Function
  6641. * @param {Function} func The function to have its output memoized.
  6642. * @param {Function} [resolver] The function to resolve the cache key.
  6643. * @returns {Function} Returns the new memoized function.
  6644. * @example
  6645. *
  6646. * var object = { 'a': 1, 'b': 2 };
  6647. * var other = { 'c': 3, 'd': 4 };
  6648. *
  6649. * var values = _.memoize(_.values);
  6650. * values(object);
  6651. * // => [1, 2]
  6652. *
  6653. * values(other);
  6654. * // => [3, 4]
  6655. *
  6656. * object.a = 2;
  6657. * values(object);
  6658. * // => [1, 2]
  6659. *
  6660. * // Modify the result cache.
  6661. * values.cache.set(object, ['a', 'b']);
  6662. * values(object);
  6663. * // => ['a', 'b']
  6664. *
  6665. * // Replace `_.memoize.Cache`.
  6666. * _.memoize.Cache = WeakMap;
  6667. */
  6668. function memoize(func, resolver) {
  6669. if (typeof func != 'function' || resolver && typeof resolver != 'function') {
  6670. throw new TypeError(FUNC_ERROR_TEXT);
  6671. }
  6672. var memoized = function memoized() {
  6673. var args = arguments,
  6674. key = resolver ? resolver.apply(this, args) : args[0],
  6675. cache = memoized.cache;
  6676. if (cache.has(key)) {
  6677. return cache.get(key);
  6678. }
  6679. var result = func.apply(this, args);
  6680. memoized.cache = cache.set(key, result);
  6681. return result;
  6682. };
  6683. memoized.cache = new (memoize.Cache || MapCache)();
  6684. return memoized;
  6685. }
  6686. // Assign cache to `_.memoize`.
  6687. memoize.Cache = MapCache;
  6688. /**
  6689. * Performs a
  6690. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  6691. * comparison between two values to determine if they are equivalent.
  6692. *
  6693. * @static
  6694. * @memberOf _
  6695. * @since 4.0.0
  6696. * @category Lang
  6697. * @param {*} value The value to compare.
  6698. * @param {*} other The other value to compare.
  6699. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  6700. * @example
  6701. *
  6702. * var object = { 'a': 1 };
  6703. * var other = { 'a': 1 };
  6704. *
  6705. * _.eq(object, object);
  6706. * // => true
  6707. *
  6708. * _.eq(object, other);
  6709. * // => false
  6710. *
  6711. * _.eq('a', 'a');
  6712. * // => true
  6713. *
  6714. * _.eq('a', Object('a'));
  6715. * // => false
  6716. *
  6717. * _.eq(NaN, NaN);
  6718. * // => true
  6719. */
  6720. function eq(value, other) {
  6721. return value === other || value !== value && other !== other;
  6722. }
  6723. /**
  6724. * Checks if `value` is likely an `arguments` object.
  6725. *
  6726. * @static
  6727. * @memberOf _
  6728. * @since 0.1.0
  6729. * @category Lang
  6730. * @param {*} value The value to check.
  6731. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  6732. * else `false`.
  6733. * @example
  6734. *
  6735. * _.isArguments(function() { return arguments; }());
  6736. * // => true
  6737. *
  6738. * _.isArguments([1, 2, 3]);
  6739. * // => false
  6740. */
  6741. function isArguments(value) {
  6742. // Safari 8.1 makes `arguments.callee` enumerable in strict mode.
  6743. return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);
  6744. }
  6745. /**
  6746. * Checks if `value` is classified as an `Array` object.
  6747. *
  6748. * @static
  6749. * @memberOf _
  6750. * @since 0.1.0
  6751. * @category Lang
  6752. * @param {*} value The value to check.
  6753. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  6754. * @example
  6755. *
  6756. * _.isArray([1, 2, 3]);
  6757. * // => true
  6758. *
  6759. * _.isArray(document.body.children);
  6760. * // => false
  6761. *
  6762. * _.isArray('abc');
  6763. * // => false
  6764. *
  6765. * _.isArray(_.noop);
  6766. * // => false
  6767. */
  6768. var isArray = Array.isArray;
  6769. /**
  6770. * Checks if `value` is array-like. A value is considered array-like if it's
  6771. * not a function and has a `value.length` that's an integer greater than or
  6772. * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
  6773. *
  6774. * @static
  6775. * @memberOf _
  6776. * @since 4.0.0
  6777. * @category Lang
  6778. * @param {*} value The value to check.
  6779. * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
  6780. * @example
  6781. *
  6782. * _.isArrayLike([1, 2, 3]);
  6783. * // => true
  6784. *
  6785. * _.isArrayLike(document.body.children);
  6786. * // => true
  6787. *
  6788. * _.isArrayLike('abc');
  6789. * // => true
  6790. *
  6791. * _.isArrayLike(_.noop);
  6792. * // => false
  6793. */
  6794. function isArrayLike(value) {
  6795. return value != null && isLength(value.length) && !isFunction(value);
  6796. }
  6797. /**
  6798. * This method is like `_.isArrayLike` except that it also checks if `value`
  6799. * is an object.
  6800. *
  6801. * @static
  6802. * @memberOf _
  6803. * @since 4.0.0
  6804. * @category Lang
  6805. * @param {*} value The value to check.
  6806. * @returns {boolean} Returns `true` if `value` is an array-like object,
  6807. * else `false`.
  6808. * @example
  6809. *
  6810. * _.isArrayLikeObject([1, 2, 3]);
  6811. * // => true
  6812. *
  6813. * _.isArrayLikeObject(document.body.children);
  6814. * // => true
  6815. *
  6816. * _.isArrayLikeObject('abc');
  6817. * // => false
  6818. *
  6819. * _.isArrayLikeObject(_.noop);
  6820. * // => false
  6821. */
  6822. function isArrayLikeObject(value) {
  6823. return isObjectLike(value) && isArrayLike(value);
  6824. }
  6825. /**
  6826. * Checks if `value` is classified as a `Function` object.
  6827. *
  6828. * @static
  6829. * @memberOf _
  6830. * @since 0.1.0
  6831. * @category Lang
  6832. * @param {*} value The value to check.
  6833. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  6834. * @example
  6835. *
  6836. * _.isFunction(_);
  6837. * // => true
  6838. *
  6839. * _.isFunction(/abc/);
  6840. * // => false
  6841. */
  6842. function isFunction(value) {
  6843. // The use of `Object#toString` avoids issues with the `typeof` operator
  6844. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  6845. var tag = isObject(value) ? objectToString.call(value) : '';
  6846. return tag == funcTag || tag == genTag;
  6847. }
  6848. /**
  6849. * Checks if `value` is a valid array-like length.
  6850. *
  6851. * **Note:** This method is loosely based on
  6852. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  6853. *
  6854. * @static
  6855. * @memberOf _
  6856. * @since 4.0.0
  6857. * @category Lang
  6858. * @param {*} value The value to check.
  6859. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
  6860. * @example
  6861. *
  6862. * _.isLength(3);
  6863. * // => true
  6864. *
  6865. * _.isLength(Number.MIN_VALUE);
  6866. * // => false
  6867. *
  6868. * _.isLength(Infinity);
  6869. * // => false
  6870. *
  6871. * _.isLength('3');
  6872. * // => false
  6873. */
  6874. function isLength(value) {
  6875. return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
  6876. }
  6877. /**
  6878. * Checks if `value` is the
  6879. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  6880. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  6881. *
  6882. * @static
  6883. * @memberOf _
  6884. * @since 0.1.0
  6885. * @category Lang
  6886. * @param {*} value The value to check.
  6887. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  6888. * @example
  6889. *
  6890. * _.isObject({});
  6891. * // => true
  6892. *
  6893. * _.isObject([1, 2, 3]);
  6894. * // => true
  6895. *
  6896. * _.isObject(_.noop);
  6897. * // => true
  6898. *
  6899. * _.isObject(null);
  6900. * // => false
  6901. */
  6902. function isObject(value) {
  6903. var type = _typeof(value);
  6904. return !!value && (type == 'object' || type == 'function');
  6905. }
  6906. /**
  6907. * Checks if `value` is object-like. A value is object-like if it's not `null`
  6908. * and has a `typeof` result of "object".
  6909. *
  6910. * @static
  6911. * @memberOf _
  6912. * @since 4.0.0
  6913. * @category Lang
  6914. * @param {*} value The value to check.
  6915. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  6916. * @example
  6917. *
  6918. * _.isObjectLike({});
  6919. * // => true
  6920. *
  6921. * _.isObjectLike([1, 2, 3]);
  6922. * // => true
  6923. *
  6924. * _.isObjectLike(_.noop);
  6925. * // => false
  6926. *
  6927. * _.isObjectLike(null);
  6928. * // => false
  6929. */
  6930. function isObjectLike(value) {
  6931. return !!value && _typeof(value) == 'object';
  6932. }
  6933. /**
  6934. * Checks if `value` is classified as a `Symbol` primitive or object.
  6935. *
  6936. * @static
  6937. * @memberOf _
  6938. * @since 4.0.0
  6939. * @category Lang
  6940. * @param {*} value The value to check.
  6941. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  6942. * @example
  6943. *
  6944. * _.isSymbol(Symbol.iterator);
  6945. * // => true
  6946. *
  6947. * _.isSymbol('abc');
  6948. * // => false
  6949. */
  6950. function isSymbol(value) {
  6951. return _typeof(value) == 'symbol' || isObjectLike(value) && objectToString.call(value) == symbolTag;
  6952. }
  6953. /**
  6954. * Checks if `value` is classified as a typed array.
  6955. *
  6956. * @static
  6957. * @memberOf _
  6958. * @since 3.0.0
  6959. * @category Lang
  6960. * @param {*} value The value to check.
  6961. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  6962. * @example
  6963. *
  6964. * _.isTypedArray(new Uint8Array);
  6965. * // => true
  6966. *
  6967. * _.isTypedArray([]);
  6968. * // => false
  6969. */
  6970. var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
  6971. /**
  6972. * Converts `value` to a string. An empty string is returned for `null`
  6973. * and `undefined` values. The sign of `-0` is preserved.
  6974. *
  6975. * @static
  6976. * @memberOf _
  6977. * @since 4.0.0
  6978. * @category Lang
  6979. * @param {*} value The value to process.
  6980. * @returns {string} Returns the string.
  6981. * @example
  6982. *
  6983. * _.toString(null);
  6984. * // => ''
  6985. *
  6986. * _.toString(-0);
  6987. * // => '-0'
  6988. *
  6989. * _.toString([1, 2, 3]);
  6990. * // => '1,2,3'
  6991. */
  6992. function toString(value) {
  6993. return value == null ? '' : baseToString(value);
  6994. }
  6995. /**
  6996. * Gets the value at `path` of `object`. If the resolved value is
  6997. * `undefined`, the `defaultValue` is returned in its place.
  6998. *
  6999. * @static
  7000. * @memberOf _
  7001. * @since 3.7.0
  7002. * @category Object
  7003. * @param {Object} object The object to query.
  7004. * @param {Array|string} path The path of the property to get.
  7005. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  7006. * @returns {*} Returns the resolved value.
  7007. * @example
  7008. *
  7009. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  7010. *
  7011. * _.get(object, 'a[0].b.c');
  7012. * // => 3
  7013. *
  7014. * _.get(object, ['a', '0', 'b', 'c']);
  7015. * // => 3
  7016. *
  7017. * _.get(object, 'a.b.c', 'default');
  7018. * // => 'default'
  7019. */
  7020. function get(object, path, defaultValue) {
  7021. var result = object == null ? undefined : baseGet(object, path);
  7022. return result === undefined ? defaultValue : result;
  7023. }
  7024. /**
  7025. * Checks if `path` is a direct or inherited property of `object`.
  7026. *
  7027. * @static
  7028. * @memberOf _
  7029. * @since 4.0.0
  7030. * @category Object
  7031. * @param {Object} object The object to query.
  7032. * @param {Array|string} path The path to check.
  7033. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  7034. * @example
  7035. *
  7036. * var object = _.create({ 'a': _.create({ 'b': 2 }) });
  7037. *
  7038. * _.hasIn(object, 'a');
  7039. * // => true
  7040. *
  7041. * _.hasIn(object, 'a.b');
  7042. * // => true
  7043. *
  7044. * _.hasIn(object, ['a', 'b']);
  7045. * // => true
  7046. *
  7047. * _.hasIn(object, 'b');
  7048. * // => false
  7049. */
  7050. function hasIn(object, path) {
  7051. return object != null && hasPath(object, path, baseHasIn);
  7052. }
  7053. /**
  7054. * Creates an array of the own enumerable property names of `object`.
  7055. *
  7056. * **Note:** Non-object values are coerced to objects. See the
  7057. * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  7058. * for more details.
  7059. *
  7060. * @static
  7061. * @since 0.1.0
  7062. * @memberOf _
  7063. * @category Object
  7064. * @param {Object} object The object to query.
  7065. * @returns {Array} Returns the array of property names.
  7066. * @example
  7067. *
  7068. * function Foo() {
  7069. * this.a = 1;
  7070. * this.b = 2;
  7071. * }
  7072. *
  7073. * Foo.prototype.c = 3;
  7074. *
  7075. * _.keys(new Foo);
  7076. * // => ['a', 'b'] (iteration order is not guaranteed)
  7077. *
  7078. * _.keys('hi');
  7079. * // => ['0', '1']
  7080. */
  7081. function keys(object) {
  7082. return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
  7083. }
  7084. /**
  7085. * This method returns the first argument it receives.
  7086. *
  7087. * @static
  7088. * @since 0.1.0
  7089. * @memberOf _
  7090. * @category Util
  7091. * @param {*} value Any value.
  7092. * @returns {*} Returns `value`.
  7093. * @example
  7094. *
  7095. * var object = { 'a': 1 };
  7096. *
  7097. * console.log(_.identity(object) === object);
  7098. * // => true
  7099. */
  7100. function identity(value) {
  7101. return value;
  7102. }
  7103. /**
  7104. * This method returns `undefined`.
  7105. *
  7106. * @static
  7107. * @memberOf _
  7108. * @since 2.3.0
  7109. * @category Util
  7110. * @example
  7111. *
  7112. * _.times(2, _.noop);
  7113. * // => [undefined, undefined]
  7114. */
  7115. function noop() {
  7116. // No operation performed.
  7117. }
  7118. /**
  7119. * Creates a function that returns the value at `path` of a given object.
  7120. *
  7121. * @static
  7122. * @memberOf _
  7123. * @since 2.4.0
  7124. * @category Util
  7125. * @param {Array|string} path The path of the property to get.
  7126. * @returns {Function} Returns the new accessor function.
  7127. * @example
  7128. *
  7129. * var objects = [
  7130. * { 'a': { 'b': 2 } },
  7131. * { 'a': { 'b': 1 } }
  7132. * ];
  7133. *
  7134. * _.map(objects, _.property('a.b'));
  7135. * // => [2, 1]
  7136. *
  7137. * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
  7138. * // => [1, 2]
  7139. */
  7140. function property(path) {
  7141. return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
  7142. }
  7143. module.exports = uniqBy;
  7144. /***/ }),
  7145. /***/ 9957:
  7146. /***/ (function(module, exports, __webpack_require__) {
  7147. var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
  7148. (function (global, factory) {
  7149. ( false ? 0 : _typeof(exports)) === 'object' && "object" !== 'undefined' ? factory() : true ? !(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
  7150. __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
  7151. (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) :
  7152. __WEBPACK_AMD_DEFINE_FACTORY__),
  7153. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) : 0;
  7154. })(this, function () {
  7155. 'use strict';
  7156. /**
  7157. * @this {Promise}
  7158. */
  7159. function finallyConstructor(callback) {
  7160. var constructor = this.constructor;
  7161. return this.then(function (value) {
  7162. // @ts-ignore
  7163. return constructor.resolve(callback()).then(function () {
  7164. return value;
  7165. });
  7166. }, function (reason) {
  7167. // @ts-ignore
  7168. return constructor.resolve(callback()).then(function () {
  7169. // @ts-ignore
  7170. return constructor.reject(reason);
  7171. });
  7172. });
  7173. }
  7174. function allSettled(arr) {
  7175. var P = this;
  7176. return new P(function (resolve, reject) {
  7177. if (!(arr && typeof arr.length !== 'undefined')) {
  7178. return reject(new TypeError(_typeof(arr) + ' ' + arr + ' is not iterable(cannot read property Symbol(Symbol.iterator))'));
  7179. }
  7180. var args = Array.prototype.slice.call(arr);
  7181. if (args.length === 0) return resolve([]);
  7182. var remaining = args.length;
  7183. function res(i, val) {
  7184. if (val && (_typeof(val) === 'object' || typeof val === 'function')) {
  7185. var then = val.then;
  7186. if (typeof then === 'function') {
  7187. then.call(val, function (val) {
  7188. res(i, val);
  7189. }, function (e) {
  7190. args[i] = {
  7191. status: 'rejected',
  7192. reason: e
  7193. };
  7194. if (--remaining === 0) {
  7195. resolve(args);
  7196. }
  7197. });
  7198. return;
  7199. }
  7200. }
  7201. args[i] = {
  7202. status: 'fulfilled',
  7203. value: val
  7204. };
  7205. if (--remaining === 0) {
  7206. resolve(args);
  7207. }
  7208. }
  7209. for (var i = 0; i < args.length; i++) {
  7210. res(i, args[i]);
  7211. }
  7212. });
  7213. }
  7214. // Store setTimeout reference so promise-polyfill will be unaffected by
  7215. // other code modifying setTimeout (like sinon.useFakeTimers())
  7216. var setTimeoutFunc = setTimeout;
  7217. function isArray(x) {
  7218. return Boolean(x && typeof x.length !== 'undefined');
  7219. }
  7220. function noop() {}
  7221. // Polyfill for Function.prototype.bind
  7222. function bind(fn, thisArg) {
  7223. return function () {
  7224. fn.apply(thisArg, arguments);
  7225. };
  7226. }
  7227. /**
  7228. * @constructor
  7229. * @param {Function} fn
  7230. */
  7231. function Promise(fn) {
  7232. if (!(this instanceof Promise)) throw new TypeError('Promises must be constructed via new');
  7233. if (typeof fn !== 'function') throw new TypeError('not a function');
  7234. /** @type {!number} */
  7235. this._state = 0;
  7236. /** @type {!boolean} */
  7237. this._handled = false;
  7238. /** @type {Promise|undefined} */
  7239. this._value = undefined;
  7240. /** @type {!Array<!Function>} */
  7241. this._deferreds = [];
  7242. doResolve(fn, this);
  7243. }
  7244. function handle(self, deferred) {
  7245. while (self._state === 3) {
  7246. self = self._value;
  7247. }
  7248. if (self._state === 0) {
  7249. self._deferreds.push(deferred);
  7250. return;
  7251. }
  7252. self._handled = true;
  7253. Promise._immediateFn(function () {
  7254. var cb = self._state === 1 ? deferred.onFulfilled : deferred.onRejected;
  7255. if (cb === null) {
  7256. (self._state === 1 ? resolve : reject)(deferred.promise, self._value);
  7257. return;
  7258. }
  7259. var ret;
  7260. try {
  7261. ret = cb(self._value);
  7262. } catch (e) {
  7263. reject(deferred.promise, e);
  7264. return;
  7265. }
  7266. resolve(deferred.promise, ret);
  7267. });
  7268. }
  7269. function resolve(self, newValue) {
  7270. try {
  7271. // Promise Resolution Procedure: https://github.com/promises-aplus/promises-spec#the-promise-resolution-procedure
  7272. if (newValue === self) throw new TypeError('A promise cannot be resolved with itself.');
  7273. if (newValue && (_typeof(newValue) === 'object' || typeof newValue === 'function')) {
  7274. var then = newValue.then;
  7275. if (newValue instanceof Promise) {
  7276. self._state = 3;
  7277. self._value = newValue;
  7278. finale(self);
  7279. return;
  7280. } else if (typeof then === 'function') {
  7281. doResolve(bind(then, newValue), self);
  7282. return;
  7283. }
  7284. }
  7285. self._state = 1;
  7286. self._value = newValue;
  7287. finale(self);
  7288. } catch (e) {
  7289. reject(self, e);
  7290. }
  7291. }
  7292. function reject(self, newValue) {
  7293. self._state = 2;
  7294. self._value = newValue;
  7295. finale(self);
  7296. }
  7297. function finale(self) {
  7298. if (self._state === 2 && self._deferreds.length === 0) {
  7299. Promise._immediateFn(function () {
  7300. if (!self._handled) {
  7301. Promise._unhandledRejectionFn(self._value);
  7302. }
  7303. });
  7304. }
  7305. for (var i = 0, len = self._deferreds.length; i < len; i++) {
  7306. handle(self, self._deferreds[i]);
  7307. }
  7308. self._deferreds = null;
  7309. }
  7310. /**
  7311. * @constructor
  7312. */
  7313. function Handler(onFulfilled, onRejected, promise) {
  7314. this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null;
  7315. this.onRejected = typeof onRejected === 'function' ? onRejected : null;
  7316. this.promise = promise;
  7317. }
  7318. /**
  7319. * Take a potentially misbehaving resolver function and make sure
  7320. * onFulfilled and onRejected are only called once.
  7321. *
  7322. * Makes no guarantees about asynchrony.
  7323. */
  7324. function doResolve(fn, self) {
  7325. var done = false;
  7326. try {
  7327. fn(function (value) {
  7328. if (done) return;
  7329. done = true;
  7330. resolve(self, value);
  7331. }, function (reason) {
  7332. if (done) return;
  7333. done = true;
  7334. reject(self, reason);
  7335. });
  7336. } catch (ex) {
  7337. if (done) return;
  7338. done = true;
  7339. reject(self, ex);
  7340. }
  7341. }
  7342. Promise.prototype['catch'] = function (onRejected) {
  7343. return this.then(null, onRejected);
  7344. };
  7345. Promise.prototype.then = function (onFulfilled, onRejected) {
  7346. // @ts-ignore
  7347. var prom = new this.constructor(noop);
  7348. handle(this, new Handler(onFulfilled, onRejected, prom));
  7349. return prom;
  7350. };
  7351. Promise.prototype['finally'] = finallyConstructor;
  7352. Promise.all = function (arr) {
  7353. return new Promise(function (resolve, reject) {
  7354. if (!isArray(arr)) {
  7355. return reject(new TypeError('Promise.all accepts an array'));
  7356. }
  7357. var args = Array.prototype.slice.call(arr);
  7358. if (args.length === 0) return resolve([]);
  7359. var remaining = args.length;
  7360. function res(i, val) {
  7361. try {
  7362. if (val && (_typeof(val) === 'object' || typeof val === 'function')) {
  7363. var then = val.then;
  7364. if (typeof then === 'function') {
  7365. then.call(val, function (val) {
  7366. res(i, val);
  7367. }, reject);
  7368. return;
  7369. }
  7370. }
  7371. args[i] = val;
  7372. if (--remaining === 0) {
  7373. resolve(args);
  7374. }
  7375. } catch (ex) {
  7376. reject(ex);
  7377. }
  7378. }
  7379. for (var i = 0; i < args.length; i++) {
  7380. res(i, args[i]);
  7381. }
  7382. });
  7383. };
  7384. Promise.allSettled = allSettled;
  7385. Promise.resolve = function (value) {
  7386. if (value && _typeof(value) === 'object' && value.constructor === Promise) {
  7387. return value;
  7388. }
  7389. return new Promise(function (resolve) {
  7390. resolve(value);
  7391. });
  7392. };
  7393. Promise.reject = function (value) {
  7394. return new Promise(function (resolve, reject) {
  7395. reject(value);
  7396. });
  7397. };
  7398. Promise.race = function (arr) {
  7399. return new Promise(function (resolve, reject) {
  7400. if (!isArray(arr)) {
  7401. return reject(new TypeError('Promise.race accepts an array'));
  7402. }
  7403. for (var i = 0, len = arr.length; i < len; i++) {
  7404. Promise.resolve(arr[i]).then(resolve, reject);
  7405. }
  7406. });
  7407. };
  7408. // Use polyfill for setImmediate for performance gains
  7409. Promise._immediateFn =
  7410. // @ts-ignore
  7411. typeof setImmediate === 'function' && function (fn) {
  7412. // @ts-ignore
  7413. setImmediate(fn);
  7414. } || function (fn) {
  7415. setTimeoutFunc(fn, 0);
  7416. };
  7417. Promise._unhandledRejectionFn = function _unhandledRejectionFn(err) {
  7418. if (typeof console !== 'undefined' && console) {
  7419. console.warn('Possible Unhandled Promise Rejection:', err); // eslint-disable-line no-console
  7420. }
  7421. };
  7422. /** @suppress {undefinedVars} */
  7423. var globalNS = function () {
  7424. // the only reliable means to get the global object is
  7425. // `Function('return this')()`
  7426. // However, this causes CSP violations in Chrome apps.
  7427. if (typeof self !== 'undefined') {
  7428. return self;
  7429. }
  7430. if (typeof window !== 'undefined') {
  7431. return window;
  7432. }
  7433. if (typeof __webpack_require__.g !== 'undefined') {
  7434. return __webpack_require__.g;
  7435. }
  7436. throw new Error('unable to locate global object');
  7437. }();
  7438. // Expose the polyfill if Promise is undefined or set to a
  7439. // non-function value. The latter can be due to a named HTMLElement
  7440. // being exposed by browsers for legacy reasons.
  7441. // https://github.com/taylorhakes/promise-polyfill/issues/114
  7442. if (typeof globalNS['Promise'] !== 'function') {
  7443. globalNS['Promise'] = Promise;
  7444. } else {
  7445. if (!globalNS.Promise.prototype['finally']) {
  7446. globalNS.Promise.prototype['finally'] = finallyConstructor;
  7447. }
  7448. if (!globalNS.Promise.allSettled) {
  7449. globalNS.Promise.allSettled = allSettled;
  7450. }
  7451. }
  7452. });
  7453. /***/ }),
  7454. /***/ 1441:
  7455. /***/ (function(module, exports, __webpack_require__) {
  7456. var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
  7457. (function (global, factory) {
  7458. ( false ? 0 : _typeof(exports)) === 'object' && "object" !== 'undefined' ? module.exports = factory() : true ? !(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
  7459. __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
  7460. (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) :
  7461. __WEBPACK_AMD_DEFINE_FACTORY__),
  7462. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) : 0;
  7463. })(this, function () {
  7464. 'use strict';
  7465. function quickselect(arr, k, left, right, compare) {
  7466. quickselectStep(arr, k, left || 0, right || arr.length - 1, compare || defaultCompare);
  7467. }
  7468. function quickselectStep(arr, k, left, right, compare) {
  7469. while (right > left) {
  7470. if (right - left > 600) {
  7471. var n = right - left + 1;
  7472. var m = k - left + 1;
  7473. var z = Math.log(n);
  7474. var s = 0.5 * Math.exp(2 * z / 3);
  7475. var sd = 0.5 * Math.sqrt(z * s * (n - s) / n) * (m - n / 2 < 0 ? -1 : 1);
  7476. var newLeft = Math.max(left, Math.floor(k - m * s / n + sd));
  7477. var newRight = Math.min(right, Math.floor(k + (n - m) * s / n + sd));
  7478. quickselectStep(arr, k, newLeft, newRight, compare);
  7479. }
  7480. var t = arr[k];
  7481. var i = left;
  7482. var j = right;
  7483. swap(arr, left, k);
  7484. if (compare(arr[right], t) > 0) swap(arr, left, right);
  7485. while (i < j) {
  7486. swap(arr, i, j);
  7487. i++;
  7488. j--;
  7489. while (compare(arr[i], t) < 0) i++;
  7490. while (compare(arr[j], t) > 0) j--;
  7491. }
  7492. if (compare(arr[left], t) === 0) swap(arr, left, j);else {
  7493. j++;
  7494. swap(arr, j, right);
  7495. }
  7496. if (j <= k) left = j + 1;
  7497. if (k <= j) right = j - 1;
  7498. }
  7499. }
  7500. function swap(arr, i, j) {
  7501. var tmp = arr[i];
  7502. arr[i] = arr[j];
  7503. arr[j] = tmp;
  7504. }
  7505. function defaultCompare(a, b) {
  7506. return a < b ? -1 : a > b ? 1 : 0;
  7507. }
  7508. return quickselect;
  7509. });
  7510. /***/ }),
  7511. /***/ 3861:
  7512. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  7513. "use strict";
  7514. module.exports = rbush;
  7515. module.exports["default"] = rbush;
  7516. var quickselect = __webpack_require__(1441);
  7517. function rbush(maxEntries, format) {
  7518. if (!(this instanceof rbush)) return new rbush(maxEntries, format);
  7519. // max entries in a node is 9 by default; min node fill is 40% for best performance
  7520. this._maxEntries = Math.max(4, maxEntries || 9);
  7521. this._minEntries = Math.max(2, Math.ceil(this._maxEntries * 0.4));
  7522. if (format) {
  7523. this._initFormat(format);
  7524. }
  7525. this.clear();
  7526. }
  7527. rbush.prototype = {
  7528. all: function all() {
  7529. return this._all(this.data, []);
  7530. },
  7531. search: function search(bbox) {
  7532. var node = this.data,
  7533. result = [],
  7534. toBBox = this.toBBox;
  7535. if (!intersects(bbox, node)) return result;
  7536. var nodesToSearch = [],
  7537. i,
  7538. len,
  7539. child,
  7540. childBBox;
  7541. while (node) {
  7542. for (i = 0, len = node.children.length; i < len; i++) {
  7543. child = node.children[i];
  7544. childBBox = node.leaf ? toBBox(child) : child;
  7545. if (intersects(bbox, childBBox)) {
  7546. if (node.leaf) result.push(child);else if (contains(bbox, childBBox)) this._all(child, result);else nodesToSearch.push(child);
  7547. }
  7548. }
  7549. node = nodesToSearch.pop();
  7550. }
  7551. return result;
  7552. },
  7553. collides: function collides(bbox) {
  7554. var node = this.data,
  7555. toBBox = this.toBBox;
  7556. if (!intersects(bbox, node)) return false;
  7557. var nodesToSearch = [],
  7558. i,
  7559. len,
  7560. child,
  7561. childBBox;
  7562. while (node) {
  7563. for (i = 0, len = node.children.length; i < len; i++) {
  7564. child = node.children[i];
  7565. childBBox = node.leaf ? toBBox(child) : child;
  7566. if (intersects(bbox, childBBox)) {
  7567. if (node.leaf || contains(bbox, childBBox)) return true;
  7568. nodesToSearch.push(child);
  7569. }
  7570. }
  7571. node = nodesToSearch.pop();
  7572. }
  7573. return false;
  7574. },
  7575. load: function load(data) {
  7576. if (!(data && data.length)) return this;
  7577. if (data.length < this._minEntries) {
  7578. for (var i = 0, len = data.length; i < len; i++) {
  7579. this.insert(data[i]);
  7580. }
  7581. return this;
  7582. }
  7583. // recursively build the tree with the given data from scratch using OMT algorithm
  7584. var node = this._build(data.slice(), 0, data.length - 1, 0);
  7585. if (!this.data.children.length) {
  7586. // save as is if tree is empty
  7587. this.data = node;
  7588. } else if (this.data.height === node.height) {
  7589. // split root if trees have the same height
  7590. this._splitRoot(this.data, node);
  7591. } else {
  7592. if (this.data.height < node.height) {
  7593. // swap trees if inserted one is bigger
  7594. var tmpNode = this.data;
  7595. this.data = node;
  7596. node = tmpNode;
  7597. }
  7598. // insert the small tree into the large tree at appropriate level
  7599. this._insert(node, this.data.height - node.height - 1, true);
  7600. }
  7601. return this;
  7602. },
  7603. insert: function insert(item) {
  7604. if (item) this._insert(item, this.data.height - 1);
  7605. return this;
  7606. },
  7607. clear: function clear() {
  7608. this.data = createNode([]);
  7609. return this;
  7610. },
  7611. remove: function remove(item, equalsFn) {
  7612. if (!item) return this;
  7613. var node = this.data,
  7614. bbox = this.toBBox(item),
  7615. path = [],
  7616. indexes = [],
  7617. i,
  7618. parent,
  7619. index,
  7620. goingUp;
  7621. // depth-first iterative tree traversal
  7622. while (node || path.length) {
  7623. if (!node) {
  7624. // go up
  7625. node = path.pop();
  7626. parent = path[path.length - 1];
  7627. i = indexes.pop();
  7628. goingUp = true;
  7629. }
  7630. if (node.leaf) {
  7631. // check current node
  7632. index = findItem(item, node.children, equalsFn);
  7633. if (index !== -1) {
  7634. // item found, remove the item and condense tree upwards
  7635. node.children.splice(index, 1);
  7636. path.push(node);
  7637. this._condense(path);
  7638. return this;
  7639. }
  7640. }
  7641. if (!goingUp && !node.leaf && contains(node, bbox)) {
  7642. // go down
  7643. path.push(node);
  7644. indexes.push(i);
  7645. i = 0;
  7646. parent = node;
  7647. node = node.children[0];
  7648. } else if (parent) {
  7649. // go right
  7650. i++;
  7651. node = parent.children[i];
  7652. goingUp = false;
  7653. } else node = null; // nothing found
  7654. }
  7655. return this;
  7656. },
  7657. toBBox: function toBBox(item) {
  7658. return item;
  7659. },
  7660. compareMinX: compareNodeMinX,
  7661. compareMinY: compareNodeMinY,
  7662. toJSON: function toJSON() {
  7663. return this.data;
  7664. },
  7665. fromJSON: function fromJSON(data) {
  7666. this.data = data;
  7667. return this;
  7668. },
  7669. _all: function _all(node, result) {
  7670. var nodesToSearch = [];
  7671. while (node) {
  7672. if (node.leaf) result.push.apply(result, node.children);else nodesToSearch.push.apply(nodesToSearch, node.children);
  7673. node = nodesToSearch.pop();
  7674. }
  7675. return result;
  7676. },
  7677. _build: function _build(items, left, right, height) {
  7678. var N = right - left + 1,
  7679. M = this._maxEntries,
  7680. node;
  7681. if (N <= M) {
  7682. // reached leaf level; return leaf
  7683. node = createNode(items.slice(left, right + 1));
  7684. calcBBox(node, this.toBBox);
  7685. return node;
  7686. }
  7687. if (!height) {
  7688. // target height of the bulk-loaded tree
  7689. height = Math.ceil(Math.log(N) / Math.log(M));
  7690. // target number of root entries to maximize storage utilization
  7691. M = Math.ceil(N / Math.pow(M, height - 1));
  7692. }
  7693. node = createNode([]);
  7694. node.leaf = false;
  7695. node.height = height;
  7696. // split the items into M mostly square tiles
  7697. var N2 = Math.ceil(N / M),
  7698. N1 = N2 * Math.ceil(Math.sqrt(M)),
  7699. i,
  7700. j,
  7701. right2,
  7702. right3;
  7703. multiSelect(items, left, right, N1, this.compareMinX);
  7704. for (i = left; i <= right; i += N1) {
  7705. right2 = Math.min(i + N1 - 1, right);
  7706. multiSelect(items, i, right2, N2, this.compareMinY);
  7707. for (j = i; j <= right2; j += N2) {
  7708. right3 = Math.min(j + N2 - 1, right2);
  7709. // pack each entry recursively
  7710. node.children.push(this._build(items, j, right3, height - 1));
  7711. }
  7712. }
  7713. calcBBox(node, this.toBBox);
  7714. return node;
  7715. },
  7716. _chooseSubtree: function _chooseSubtree(bbox, node, level, path) {
  7717. var i, len, child, targetNode, area, enlargement, minArea, minEnlargement;
  7718. while (true) {
  7719. path.push(node);
  7720. if (node.leaf || path.length - 1 === level) break;
  7721. minArea = minEnlargement = Infinity;
  7722. for (i = 0, len = node.children.length; i < len; i++) {
  7723. child = node.children[i];
  7724. area = bboxArea(child);
  7725. enlargement = enlargedArea(bbox, child) - area;
  7726. // choose entry with the least area enlargement
  7727. if (enlargement < minEnlargement) {
  7728. minEnlargement = enlargement;
  7729. minArea = area < minArea ? area : minArea;
  7730. targetNode = child;
  7731. } else if (enlargement === minEnlargement) {
  7732. // otherwise choose one with the smallest area
  7733. if (area < minArea) {
  7734. minArea = area;
  7735. targetNode = child;
  7736. }
  7737. }
  7738. }
  7739. node = targetNode || node.children[0];
  7740. }
  7741. return node;
  7742. },
  7743. _insert: function _insert(item, level, isNode) {
  7744. var toBBox = this.toBBox,
  7745. bbox = isNode ? item : toBBox(item),
  7746. insertPath = [];
  7747. // find the best node for accommodating the item, saving all nodes along the path too
  7748. var node = this._chooseSubtree(bbox, this.data, level, insertPath);
  7749. // put the item into the node
  7750. node.children.push(item);
  7751. extend(node, bbox);
  7752. // split on node overflow; propagate upwards if necessary
  7753. while (level >= 0) {
  7754. if (insertPath[level].children.length > this._maxEntries) {
  7755. this._split(insertPath, level);
  7756. level--;
  7757. } else break;
  7758. }
  7759. // adjust bboxes along the insertion path
  7760. this._adjustParentBBoxes(bbox, insertPath, level);
  7761. },
  7762. // split overflowed node into two
  7763. _split: function _split(insertPath, level) {
  7764. var node = insertPath[level],
  7765. M = node.children.length,
  7766. m = this._minEntries;
  7767. this._chooseSplitAxis(node, m, M);
  7768. var splitIndex = this._chooseSplitIndex(node, m, M);
  7769. var newNode = createNode(node.children.splice(splitIndex, node.children.length - splitIndex));
  7770. newNode.height = node.height;
  7771. newNode.leaf = node.leaf;
  7772. calcBBox(node, this.toBBox);
  7773. calcBBox(newNode, this.toBBox);
  7774. if (level) insertPath[level - 1].children.push(newNode);else this._splitRoot(node, newNode);
  7775. },
  7776. _splitRoot: function _splitRoot(node, newNode) {
  7777. // split root node
  7778. this.data = createNode([node, newNode]);
  7779. this.data.height = node.height + 1;
  7780. this.data.leaf = false;
  7781. calcBBox(this.data, this.toBBox);
  7782. },
  7783. _chooseSplitIndex: function _chooseSplitIndex(node, m, M) {
  7784. var i, bbox1, bbox2, overlap, area, minOverlap, minArea, index;
  7785. minOverlap = minArea = Infinity;
  7786. for (i = m; i <= M - m; i++) {
  7787. bbox1 = distBBox(node, 0, i, this.toBBox);
  7788. bbox2 = distBBox(node, i, M, this.toBBox);
  7789. overlap = intersectionArea(bbox1, bbox2);
  7790. area = bboxArea(bbox1) + bboxArea(bbox2);
  7791. // choose distribution with minimum overlap
  7792. if (overlap < minOverlap) {
  7793. minOverlap = overlap;
  7794. index = i;
  7795. minArea = area < minArea ? area : minArea;
  7796. } else if (overlap === minOverlap) {
  7797. // otherwise choose distribution with minimum area
  7798. if (area < minArea) {
  7799. minArea = area;
  7800. index = i;
  7801. }
  7802. }
  7803. }
  7804. return index;
  7805. },
  7806. // sorts node children by the best axis for split
  7807. _chooseSplitAxis: function _chooseSplitAxis(node, m, M) {
  7808. var compareMinX = node.leaf ? this.compareMinX : compareNodeMinX,
  7809. compareMinY = node.leaf ? this.compareMinY : compareNodeMinY,
  7810. xMargin = this._allDistMargin(node, m, M, compareMinX),
  7811. yMargin = this._allDistMargin(node, m, M, compareMinY);
  7812. // if total distributions margin value is minimal for x, sort by minX,
  7813. // otherwise it's already sorted by minY
  7814. if (xMargin < yMargin) node.children.sort(compareMinX);
  7815. },
  7816. // total margin of all possible split distributions where each node is at least m full
  7817. _allDistMargin: function _allDistMargin(node, m, M, compare) {
  7818. node.children.sort(compare);
  7819. var toBBox = this.toBBox,
  7820. leftBBox = distBBox(node, 0, m, toBBox),
  7821. rightBBox = distBBox(node, M - m, M, toBBox),
  7822. margin = bboxMargin(leftBBox) + bboxMargin(rightBBox),
  7823. i,
  7824. child;
  7825. for (i = m; i < M - m; i++) {
  7826. child = node.children[i];
  7827. extend(leftBBox, node.leaf ? toBBox(child) : child);
  7828. margin += bboxMargin(leftBBox);
  7829. }
  7830. for (i = M - m - 1; i >= m; i--) {
  7831. child = node.children[i];
  7832. extend(rightBBox, node.leaf ? toBBox(child) : child);
  7833. margin += bboxMargin(rightBBox);
  7834. }
  7835. return margin;
  7836. },
  7837. _adjustParentBBoxes: function _adjustParentBBoxes(bbox, path, level) {
  7838. // adjust bboxes along the given tree path
  7839. for (var i = level; i >= 0; i--) {
  7840. extend(path[i], bbox);
  7841. }
  7842. },
  7843. _condense: function _condense(path) {
  7844. // go through the path, removing empty nodes and updating bboxes
  7845. for (var i = path.length - 1, siblings; i >= 0; i--) {
  7846. if (path[i].children.length === 0) {
  7847. if (i > 0) {
  7848. siblings = path[i - 1].children;
  7849. siblings.splice(siblings.indexOf(path[i]), 1);
  7850. } else this.clear();
  7851. } else calcBBox(path[i], this.toBBox);
  7852. }
  7853. },
  7854. _initFormat: function _initFormat(format) {
  7855. // data format (minX, minY, maxX, maxY accessors)
  7856. // uses eval-type function compilation instead of just accepting a toBBox function
  7857. // because the algorithms are very sensitive to sorting functions performance,
  7858. // so they should be dead simple and without inner calls
  7859. var compareArr = ['return a', ' - b', ';'];
  7860. this.compareMinX = new Function('a', 'b', compareArr.join(format[0]));
  7861. this.compareMinY = new Function('a', 'b', compareArr.join(format[1]));
  7862. this.toBBox = new Function('a', 'return {minX: a' + format[0] + ', minY: a' + format[1] + ', maxX: a' + format[2] + ', maxY: a' + format[3] + '};');
  7863. }
  7864. };
  7865. function findItem(item, items, equalsFn) {
  7866. if (!equalsFn) return items.indexOf(item);
  7867. for (var i = 0; i < items.length; i++) {
  7868. if (equalsFn(item, items[i])) return i;
  7869. }
  7870. return -1;
  7871. }
  7872. // calculate node's bbox from bboxes of its children
  7873. function calcBBox(node, toBBox) {
  7874. distBBox(node, 0, node.children.length, toBBox, node);
  7875. }
  7876. // min bounding rectangle of node children from k to p-1
  7877. function distBBox(node, k, p, toBBox, destNode) {
  7878. if (!destNode) destNode = createNode(null);
  7879. destNode.minX = Infinity;
  7880. destNode.minY = Infinity;
  7881. destNode.maxX = -Infinity;
  7882. destNode.maxY = -Infinity;
  7883. for (var i = k, child; i < p; i++) {
  7884. child = node.children[i];
  7885. extend(destNode, node.leaf ? toBBox(child) : child);
  7886. }
  7887. return destNode;
  7888. }
  7889. function extend(a, b) {
  7890. a.minX = Math.min(a.minX, b.minX);
  7891. a.minY = Math.min(a.minY, b.minY);
  7892. a.maxX = Math.max(a.maxX, b.maxX);
  7893. a.maxY = Math.max(a.maxY, b.maxY);
  7894. return a;
  7895. }
  7896. function compareNodeMinX(a, b) {
  7897. return a.minX - b.minX;
  7898. }
  7899. function compareNodeMinY(a, b) {
  7900. return a.minY - b.minY;
  7901. }
  7902. function bboxArea(a) {
  7903. return (a.maxX - a.minX) * (a.maxY - a.minY);
  7904. }
  7905. function bboxMargin(a) {
  7906. return a.maxX - a.minX + (a.maxY - a.minY);
  7907. }
  7908. function enlargedArea(a, b) {
  7909. return (Math.max(b.maxX, a.maxX) - Math.min(b.minX, a.minX)) * (Math.max(b.maxY, a.maxY) - Math.min(b.minY, a.minY));
  7910. }
  7911. function intersectionArea(a, b) {
  7912. var minX = Math.max(a.minX, b.minX),
  7913. minY = Math.max(a.minY, b.minY),
  7914. maxX = Math.min(a.maxX, b.maxX),
  7915. maxY = Math.min(a.maxY, b.maxY);
  7916. return Math.max(0, maxX - minX) * Math.max(0, maxY - minY);
  7917. }
  7918. function contains(a, b) {
  7919. return a.minX <= b.minX && a.minY <= b.minY && b.maxX <= a.maxX && b.maxY <= a.maxY;
  7920. }
  7921. function intersects(a, b) {
  7922. return b.minX <= a.maxX && b.minY <= a.maxY && b.maxX >= a.minX && b.maxY >= a.minY;
  7923. }
  7924. function createNode(children) {
  7925. return {
  7926. children: children,
  7927. height: 1,
  7928. leaf: true,
  7929. minX: Infinity,
  7930. minY: Infinity,
  7931. maxX: -Infinity,
  7932. maxY: -Infinity
  7933. };
  7934. }
  7935. // sort an array so that items come in groups of n unsorted items, with groups sorted between each other;
  7936. // combines selection algorithm with binary divide & conquer approach
  7937. function multiSelect(arr, left, right, n, compare) {
  7938. var stack = [left, right],
  7939. mid;
  7940. while (stack.length) {
  7941. right = stack.pop();
  7942. left = stack.pop();
  7943. if (right - left <= n) continue;
  7944. mid = left + Math.ceil((right - left) / n / 2) * n;
  7945. quickselect(arr, mid, left, right, compare);
  7946. stack.push(left, mid, mid, right);
  7947. }
  7948. }
  7949. /***/ }),
  7950. /***/ 3425:
  7951. /***/ (function(module, exports, __webpack_require__) {
  7952. var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
  7953. // https://github.com/mbostock/slice-source Version 0.4.1. Copyright 2016 Mike Bostock.
  7954. (function (global, factory) {
  7955. ( false ? 0 : _typeof(exports)) === 'object' && "object" !== 'undefined' ? module.exports = factory() : true ? !(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
  7956. __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
  7957. (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) :
  7958. __WEBPACK_AMD_DEFINE_FACTORY__),
  7959. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) : (0);
  7960. })(this, function () {
  7961. 'use strict';
  7962. var empty = new Uint8Array(0);
  7963. function slice_cancel() {
  7964. return this._source.cancel();
  7965. }
  7966. function concat(a, b) {
  7967. if (!a.length) return b;
  7968. if (!b.length) return a;
  7969. var c = new Uint8Array(a.length + b.length);
  7970. c.set(a);
  7971. c.set(b, a.length);
  7972. return c;
  7973. }
  7974. function slice_read() {
  7975. var that = this,
  7976. array = that._array.subarray(that._index);
  7977. return that._source.read().then(function (result) {
  7978. that._array = empty;
  7979. that._index = 0;
  7980. return result.done ? array.length > 0 ? {
  7981. done: false,
  7982. value: array
  7983. } : {
  7984. done: true,
  7985. value: undefined
  7986. } : {
  7987. done: false,
  7988. value: concat(array, result.value)
  7989. };
  7990. });
  7991. }
  7992. function slice_slice(length) {
  7993. if ((length |= 0) < 0) throw new Error("invalid length");
  7994. var that = this,
  7995. index = this._array.length - this._index;
  7996. // If the request fits within the remaining buffer, resolve it immediately.
  7997. if (this._index + length <= this._array.length) {
  7998. return Promise.resolve(this._array.subarray(this._index, this._index += length));
  7999. }
  8000. // Otherwise, read chunks repeatedly until the request is fulfilled.
  8001. var array = new Uint8Array(length);
  8002. array.set(this._array.subarray(this._index));
  8003. return function read() {
  8004. return that._source.read().then(function (result) {
  8005. // When done, it’s possible the request wasn’t fully fullfilled!
  8006. // If so, the pre-allocated array is too big and needs slicing.
  8007. if (result.done) {
  8008. that._array = empty;
  8009. that._index = 0;
  8010. return index > 0 ? array.subarray(0, index) : null;
  8011. }
  8012. // If this chunk fulfills the request, return the resulting array.
  8013. if (index + result.value.length >= length) {
  8014. that._array = result.value;
  8015. that._index = length - index;
  8016. array.set(result.value.subarray(0, length - index), index);
  8017. return array;
  8018. }
  8019. // Otherwise copy this chunk into the array, then read the next chunk.
  8020. array.set(result.value, index);
  8021. index += result.value.length;
  8022. return read();
  8023. });
  8024. }();
  8025. }
  8026. function slice(source) {
  8027. return typeof source.slice === "function" ? source : new SliceSource(typeof source.read === "function" ? source : source.getReader());
  8028. }
  8029. function SliceSource(source) {
  8030. this._source = source;
  8031. this._array = empty;
  8032. this._index = 0;
  8033. }
  8034. SliceSource.prototype.read = slice_read;
  8035. SliceSource.prototype.slice = slice_slice;
  8036. SliceSource.prototype.cancel = slice_cancel;
  8037. return slice;
  8038. });
  8039. /***/ }),
  8040. /***/ 4595:
  8041. /***/ (function(__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) {
  8042. "use strict";
  8043. // UNUSED EXPORTS: AddressMatchService, AggregationParameter, AggregationTypes, AlongLineDirection, AnalystAreaUnit, AnalystSizeUnit, AreaSolarRadiationParameters, ArrayStatistic, AttributesPopContainer, Bounds, Browser, BucketAggParameter, BucketAggType, BufferAnalystParameters, BufferDistance, BufferEndType, BufferRadiusUnit, BufferSetting, BuffersAnalystJobsParameter, BurstPipelineAnalystParameters, CartoCSS, ChartQueryFilterParameter, ChartQueryParameters, ChartService, ChartType, ChartView, ChartViewModel, CityTabsPage, ClientType, ClipAnalystMode, ClipParameter, ColorDictionary, ColorGradientType, ColorSpaceType, ColorsPickerUtil, CommonContainer, CommonServiceBase, CommonTheme, CommonUtil, ComponentsUtil, ComputeWeightMatrixParameters, CreateDatasetParameters, Credential, DataFlowService, DataFormat, DataItemOrderBy, DataItemType, DataReturnMode, DataReturnOption, DatasetBufferAnalystParameters, DatasetInfo, DatasetOverlayAnalystParameters, DatasetService, DatasetSurfaceAnalystParameters, DatasetThiessenAnalystParameters, DatasourceConnectionInfo, DatasourceService, DeckglLayer, DensityKernelAnalystParameters, DirectionType, DropDownBox, EditFeaturesParameters, EditType, ElasticSearch, EngineType, EntityType, Event, Events, Exponent, FGBLayer, FacilityAnalyst3DParameters, FacilityAnalystSinks3DParameters, FacilityAnalystSources3DParameters, FacilityAnalystStreamParameters, FacilityAnalystTracedown3DParameters, FacilityAnalystTraceup3DParameters, FacilityAnalystUpstream3DParameters, Feature, FeatureService, FeatureShapeFactory, FeatureTheme, FeatureThemeGraph, FeatureThemeRankSymbol, FeatureThemeVector, FeatureVector, FetchRequest, FieldParameters, FieldService, FieldStatisticsParameters, FieldsFilter, FileReaderUtil, FillGradientMode, FilterField, FilterParameter, FindClosestFacilitiesParameters, FindLocationParameters, FindMTSPPathsParameters, FindPathParameters, FindServiceAreasParameters, FindTSPPathsParameters, Format, GenerateSpatialDataParameters, GeoCodingParameter, GeoDecodingParameter, GeoHashGridAggParameter, GeoJSONFormat, GeoRelationAnalystParameters, Geometry, GeometryBufferAnalystParameters, GeometryCollection, GeometryCurve, GeometryGeoText, GeometryLineString, GeometryLinearRing, GeometryMultiLineString, GeometryMultiPoint, GeometryMultiPolygon, GeometryOverlayAnalystParameters, GeometryPoint, GeometryPolygon, GeometryRectangle, GeometrySurfaceAnalystParameters, GeometryThiessenAnalystParameters, GeometryType, GeoprocessingService, GetFeatureMode, GetFeaturesByBoundsParameters, GetFeaturesByBufferParameters, GetFeaturesByGeometryParameters, GetFeaturesByIDsParameters, GetFeaturesBySQLParameters, GetFeaturesParametersBase, GetFeaturesServiceBase, GetGridCellInfosParameters, GraduatedMode, GraphAxesTextDisplayMode, GraphMap, Graphic, GraphicLayer, GraticuleLayer, Grid, GridCellInfosService, GridType, HeatMapLayer, HillshadeParameter, IManager, IManagerCreateNodeParam, IManagerServiceBase, IPortal, IPortalAddDataParam, IPortalAddResourceParam, IPortalDataConnectionInfoParam, IPortalDataMetaInfoParam, IPortalDataStoreInfoParam, IPortalQueryParam, IPortalQueryResult, IPortalRegisterServiceParam, IPortalResource, IPortalServiceBase, IPortalShareEntity, IPortalShareParam, IPortalUser, ImageCollectionService, ImageGFAspect, ImageGFHillShade, ImageGFOrtho, ImageGFSlope, ImageRenderingRule, ImageSearchParameter, ImageService, ImageStretchOption, IndexTabsPageContainer, InterpolationAlgorithmType, InterpolationAnalystParameters, InterpolationDensityAnalystParameters, InterpolationIDWAnalystParameters, InterpolationKrigingAnalystParameters, InterpolationRBFAnalystParameters, JSONFormat, JoinItem, JoinType, KernelDensityJobParameter, KeyServiceParameter, KnowledgeGraph, KnowledgeGraphService, LabelBackShape, LabelImageCell, LabelMatrixCell, LabelMixedTextStyle, LabelOverLengthMode, LabelSymbolCell, LabelThemeCell, Lang, LayerInfoService, LayerStatus, LayerType, LinkItem, Logo, LonLat, MapExtend, MapService, MappingParameters, MapvLayer, MathExpressionAnalysisParameters, MeasureMode, MeasureParameters, MeasureService, MessageBox, MetricsAggParameter, MetricsAggType, NDVIParameter, NavTabsPage, NetworkAnalyst3DService, NetworkAnalystService, NetworkAnalystServiceBase, Online, OnlineData, OnlineQueryDatasParameter, OnlineServiceBase, OrderBy, OrderType, OutputSetting, OutputType, OverlapDisplayedOptions, OverlayAnalystParameters, OverlayGeoJobParameter, OverlayOperationType, PaginationContainer, PermissionType, Pixel, PixelFormat, PointWithMeasure, PopContainer, ProcessingService, ProcessingServiceBase, QueryByBoundsParameters, QueryByDistanceParameters, QueryByGeometryParameters, QueryBySQLParameters, QueryOption, QueryParameters, QueryService, RangeMode, RasterFunctionParameter, RasterFunctionType, ResourceType, Route, RouteCalculateMeasureParameters, RouteLocatorParameters, SearchMode, SearchType, SecurityManager, Select, ServerColor, ServerFeature, ServerGeometry, ServerInfo, ServerStyle, ServerTextStyle, ServerTheme, ServerType, ServiceBase, ServiceStatus, SetDatasourceParameters, SetLayerInfoParameters, SetLayerStatusParameters, SetLayersInfoParameters, ShapeParameters, ShapeParametersCircle, ShapeParametersImage, ShapeParametersLabel, ShapeParametersLine, ShapeParametersPoint, ShapeParametersPolygon, ShapeParametersRectangle, ShapeParametersSector, SideType, SingleObjectQueryJobsParameter, Size, SmoothMethod, Sortby, SpatialAnalystBase, SpatialAnalystService, SpatialQueryMode, SpatialRelationType, StatisticAnalystMode, StatisticMode, StopQueryParameters, SummaryAttributesJobsParameter, SummaryMeshJobParameter, SummaryRegionJobParameter, SummaryType, SuperMap, SupplyCenter, SupplyCenterType, SurfaceAnalystMethod, SurfaceAnalystParameters, SurfaceAnalystParametersSetting, TemplateBase, TerrainCurvatureCalculationParameters, TextAlignment, ThemeDotDensity, ThemeGraduatedSymbol, ThemeGraduatedSymbolStyle, ThemeGraph, ThemeGraphAxes, ThemeGraphItem, ThemeGraphSize, ThemeGraphText, ThemeGraphTextFormat, ThemeGraphType, ThemeGridRange, ThemeGridRangeItem, ThemeGridUnique, ThemeGridUniqueItem, ThemeLabel, ThemeLabelAlongLine, ThemeLabelBackground, ThemeLabelItem, ThemeLabelText, ThemeLabelUniqueItem, ThemeMemoryData, ThemeOffset, ThemeParameters, ThemeRange, ThemeRangeItem, ThemeService, ThemeStyle, ThemeType, ThemeUnique, ThemeUniqueItem, ThiessenAnalystParameters, ThreeLayer, TimeControlBase, TimeFlowControl, TokenServiceParameter, TopologyValidatorJobsParameter, TopologyValidatorRule, TrafficTransferAnalystService, TransferLine, TransferPathParameters, TransferPreference, TransferSolutionParameters, TransferTactic, Transform, TransportationAnalystParameter, TransportationAnalystResultSetting, TurnType, UGCLayer, UGCLayerType, UGCMapLayer, UGCSubLayer, Unit, UpdateDatasetParameters, UpdateEdgeWeightParameters, UpdateTurnNodeWeightParameters, Util, VariogramMode, Vector, VectorClipJobsParameter, WKTFormat, WebExportFormatType, WebPrintingJobContent, WebPrintingJobCustomItems, WebPrintingJobExportOptions, WebPrintingJobImage, WebPrintingJobLayers, WebPrintingJobLayoutOptions, WebPrintingJobLegendOptions, WebPrintingJobLittleMapOptions, WebPrintingJobNorthArrowOptions, WebPrintingJobParameters, WebPrintingJobScaleBarOptions, WebPrintingJobService, WebScaleOrientationType, WebScaleType, WebScaleUnit, conversionDegree, getMeterPerMapUnit, getWrapNum, isCORS, setCORS
  8044. ;// CONCATENATED MODULE: external "maplibregl"
  8045. var external_maplibregl_namespaceObject = maplibregl;
  8046. var external_maplibregl_default = /*#__PURE__*/__webpack_require__.n(external_maplibregl_namespaceObject);
  8047. ;// CONCATENATED MODULE: ./src/common/control/img/Logo.js
  8048. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  8049. * This program are made available under the terms of the Apache License, Version 2.0
  8050. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  8051. var LogoBase64 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAF4AAAAdCAYAAAAjHtusAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA4ZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMDY3IDc5LjE1Nzc0NywgMjAxNS8wMy8zMC0yMzo0MDo0MiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDozYWZlOGIwMi01MWE3LTRiZjYtYWVkYS05MGQ2ZTQ4YjZiMmUiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6ODg0NkFBQUE3RjEzMTFFNzhFRjJFQkY4RjcxQjc1NjIiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6ODg0NkFBQTk3RjEzMTFFNzhFRjJFQkY4RjcxQjc1NjIiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTUgKE1hY2ludG9zaCkiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo4MWI3NzdhNC1lZmEyLTQ1MzUtOGQzNi03MmRjNDkyODMzN2UiIHN0UmVmOmRvY3VtZW50SUQ9ImFkb2JlOmRvY2lkOnBob3Rvc2hvcDpjYTYzODVjMi1jNDQ1LTExN2EtYTc0ZC1lM2I5MzJlMGE4Y2QiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz5q1HM0AAAF/ElEQVR42tSabYhUVRjHZ7W01C1uaCRW4F3oi9SXCUnwQ9gsGUFvOEtQH1bLu5VS9sbYh5KicjYt29qiGQwVg2xWWKgocob91AvC+CWsoJqB3qHMSdTMpZyeU/+Df07n3pk7997Z6cBv99z7nHvOvf/z/pxJNZvNVI/jCKXmv6EquAmVkxPSlvtp2GItr0/96fFQForChJAWDiVYTkMYMu4XBFcYjLOwWS3sNwmn8NGzZ0h4Flv/zwIdchAnh/slCGmmKUNIBzYPaXOUr0vPuEjD71JAPh7l61embzinhV3V8nnCGmGT8LwlzSL8/yUh4Tfjo9T/CgnCIYNKycA2Qq21AcHU/VHE80Idoo3Qs0W6p0UtUnkZvEMDeVcCyqxEafF7hL8Qf0oYsIj+lfC9cH1CwhchWAGCtZO+AooQOkdC1Km1VtCb63StW73uFSzgKFUkNwBbmZGGmqowhvg8ZNpH9oXChcIcYRdeNomgxLkaH+S1SGubAxyIpFv+Zp+0DYjrAS00j/dem2VGEl6FJ4Qa4quEu8j2hTCJ+GJhe4JjfQMf6JCYPPbysMPxBlp0BUKOogEF9Rg9/heNvNKYfM0KsZUZaYxX4STGrzJa+zbhPeFH2DcK10KItcI+pI0rVElwXl1ULaKnIJhDw0oRQpTQc1zcbwRU8ATy4DR6yMlTzwkqMziEWHvubJ4Nk4ZtHdnqwvwY17xq3Z4FjrG+z2Kdrdf2ZSGD+xlLPh6t1R0jP9fI22ZzKI92yvQl7EbmBxI4S7Y+vIAOL87QZqsc5uNnssxZIcfYjXT9snCR7jjobidp+FkxA2v+Cq1QervMDmp4P7Xs3YZtE9kOC3P/By6JGaETl8ElwueYTNTDq4UDsKnd7YfCNbT239LF1udS72xYJt1UWxNfN4IIP4bWuTpEja01JtMFZFsm/AHbtHBlDE6yasA4moYTrUbvdBTXHqUrAH4uSadbyzF+vbBM2IsNkS3MNa5305JxqfA02T4TnkX8XOH1mPw8ruVejpxbI9hZD2Cz1U7LdrrUvjP/WfZinNZhr6V27hP+FPZh9aLvLxVO4DllX0G2OcKnlO/DCblxaz6uXBtmi+8mBaP3/SP8IuEIiTRoPPQm2TaEmEyXo0JU+F0YiPFD0hhOsiE/vqeEVwyTgF8L51OilcIZ2I4Ll5NttvAJPfukUeB2sk0ZPSbKIUUJpCII7+DasWy08uhNNazT0wGHI7mAtB7KqMKm38HhDdAUibTVKGicbB8YAqrJ9DRsp43JdB4qUof1HQrPE6XTQWu3Ce/inVzjXhXpMiTwUYugNVQ+p80jrUsV5EH0POKeuXO9QjhFq5GryNYvfEMCDhsftYVsB9ETtG0V9ZjfhCURhbcJFpfwVZ9jvhxsLHwTYtp2svlWQw3vXL8UnqHVSIG8l8ex+tHhBXgjddgqHEZ8ufAA2aaEnYgrF/KrPXrEmMUqZ9THLW06xhoBaVueQpkug+ewOUphE3Qv2Q5gGamXYa+QbVq4O+DQ5FHyZqrjxNt7UHh9uuRa0F7HjCF8o9PCTOGnscM7g2u1Hl9C9oeEnxC/1ajZg8JLiM9Hj9GHJseMShwL2DO0G5yEWn3Zh1QUods5CPkIoqlwAZxhXMsb6HrcEPBxchhdJ6wj29vCW4hfLOzo8J3rltYX50nXQAATSf/K4DEaGlTLvplsk/QCpoD60EQ7gLYZc8H9wq+I3yncEOEcNhuz6HWf3XEiwU/4Y8YEqVp2P10rt+8REvBGw026i4aDcbL9jF8r8Blmf4fCOzhViiscskygXRdehf3CO4hfigmTBXyQrl8TFtD1IzQX3CbcQrY3hPcRv4z8OmHPXwchVNln2MmE7BX6VwIFi/he6uxvb6JM3m0fdqvx/ATidxg2JeC7VDErAw5NzGfvwRJVheEIQ8Mg/pdwIM+UOmi9Q8ivCsrIy0tF+wVbEcLrd3Pb2XisEb4Tdlhsi4WP4RBbaLGrHfC3PrvMIezy9rTpGm5lz9LOMG15xvFxD/j5gjzjjDbMOzk+9zzt3v5bgAEAibzFeFHVgYkAAAAASUVORK5CYII=";
  8052. ;// CONCATENATED MODULE: ./src/maplibregl/control/Logo.js
  8053. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  8054. 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); } }
  8055. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  8056. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  8057. * This program are made available under the terms of the Apache License, Version 2.0
  8058. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  8059. /**
  8060. * @class Logo
  8061. * @deprecatedclass maplibregl.supermap.LogoControl
  8062. * @category Control
  8063. * @classdesc Logo 控件类。默认不显示。
  8064. * @modulecategory Control
  8065. *
  8066. * @example
  8067. * (start code)
  8068. * map.addControl(new Logo(),'bottom-right');
  8069. * (end)
  8070. * @param {Object} options - logo 控件配置项。
  8071. * @param {string} [options.imageUrl] - logo 图片地址。
  8072. * @param {string} [options.width] - logo 图片宽度。
  8073. * @param {string} [options.height] - logo 图片高度。
  8074. * @param {string} [options.link] - logo图片跳转链接。
  8075. * @param {string} [options.alt='SuperMap iClient'] - logo 图片失效时显示文本。
  8076. * @usage
  8077. */
  8078. var Logo = /*#__PURE__*/function () {
  8079. function Logo(options) {
  8080. _classCallCheck(this, Logo);
  8081. //logo图片地址
  8082. this.imageUrl = null;
  8083. //跳转链接
  8084. this.link = null;
  8085. //logo图片宽
  8086. this.width = null;
  8087. //logo图片高
  8088. this.height = null;
  8089. //logo图片失效时显示文本
  8090. this.alt = "SuperMap iClient";
  8091. this._extend(this, options);
  8092. }
  8093. /**
  8094. * @function Logo.prototype.onAdd
  8095. * @description 添加Logo。
  8096. * @returns {HTMLElement} 返回创建的 Logo 元素。
  8097. */
  8098. _createClass(Logo, [{
  8099. key: "onAdd",
  8100. value: function onAdd(map) {
  8101. this._map = map;
  8102. this._container = document.createElement('div');
  8103. this._container.className = 'maplibregl-ctrl iclient-logo';
  8104. this._container.style.marginTop = 0;
  8105. this._container.style.marginBottom = 0;
  8106. this._container.style.marginLeft = 0;
  8107. this._container.style.marginRight = 0;
  8108. var imgSrc = LogoBase64;
  8109. if (this.imageUrl) {
  8110. imgSrc = this.imageUrl;
  8111. }
  8112. var alt = this.alt;
  8113. var imageWidth = "94px";
  8114. var imageHeight = "29px";
  8115. var styleSize = "width:" + imageWidth + ";height:" + imageHeight + ";";
  8116. if (this.imageUrl) {
  8117. imageWidth = this.width;
  8118. imageHeight = this.height;
  8119. styleSize = "width:" + imageWidth + ";height:" + imageHeight + ";";
  8120. if (!imageWidth || !imageHeight) {
  8121. styleSize = "";
  8122. }
  8123. }
  8124. var link = this.link;
  8125. this._container.innerHTML = "<a href='" + link + "' target='_blank'>" + "<img src=" + imgSrc + " alt='" + alt + "' style='" + styleSize + "margin-bottom: 2px'></a>";
  8126. this._createStyleSheet();
  8127. return this._container;
  8128. }
  8129. }, {
  8130. key: "_createStyleSheet",
  8131. value: function _createStyleSheet() {
  8132. var style = document.createElement('style');
  8133. style.type = 'text/css';
  8134. style.innerHTML = ".iclient-logo{" + "margin:0 !important;" + "}" + ".iclient-logo a{" + "border: none;" + "display: block;" + "height:31px;" + "}" + ".iclient-logo img{" + "border: none;" + "white-space: nowrap" + "}";
  8135. document.getElementsByTagName('head')[0].appendChild(style);
  8136. }
  8137. }, {
  8138. key: "_extend",
  8139. value: function _extend(dest) {
  8140. for (var index = 0; index < Object.getOwnPropertyNames(arguments).length; index++) {
  8141. var arg = Object.getOwnPropertyNames(arguments)[index];
  8142. if (arg == "caller" || arg == "callee" || arg == "length" || arg == "arguments") {
  8143. continue;
  8144. }
  8145. var obj = arguments[arg];
  8146. if (obj) {
  8147. for (var j = 0; j < Object.getOwnPropertyNames(obj).length; j++) {
  8148. var key = Object.getOwnPropertyNames(obj)[j];
  8149. if (arg == "caller" || arg == "callee" || arg == "length" || arg == "arguments") {
  8150. continue;
  8151. }
  8152. dest[key] = obj[key];
  8153. }
  8154. }
  8155. }
  8156. return dest;
  8157. }
  8158. }]);
  8159. return Logo;
  8160. }();
  8161. ;// CONCATENATED MODULE: ./src/common/commontypes/Size.js
  8162. function Size_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  8163. function Size_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  8164. function Size_createClass(Constructor, protoProps, staticProps) { if (protoProps) Size_defineProperties(Constructor.prototype, protoProps); if (staticProps) Size_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  8165. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  8166. * This program are made available under the terms of the Apache License, Version 2.0
  8167. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  8168. /**
  8169. * @class Size
  8170. * @deprecatedclass SuperMap.Size
  8171. * @category BaseTypes Style
  8172. * @classdesc 此类描绘一对高宽值的实例。
  8173. * @param {number} [w=0.0] - 宽度。
  8174. * @param {number} [h=0.0] - 高度。
  8175. *
  8176. * @example
  8177. * var size = new Size(31,46);
  8178. * @usage
  8179. */
  8180. var Size = /*#__PURE__*/function () {
  8181. function Size(w, h) {
  8182. Size_classCallCheck(this, Size);
  8183. /**
  8184. * @member {number} [Size.prototype.w=0.0]
  8185. * @description 宽度。
  8186. */
  8187. this.w = w ? parseFloat(w) : 0.0;
  8188. /**
  8189. * @member {number} [Size.prototype.h=0.0]
  8190. * @description 高度。
  8191. */
  8192. this.h = w ? parseFloat(h) : 0.0;
  8193. this.CLASS_NAME = "SuperMap.Size";
  8194. }
  8195. /**
  8196. * @function Size.prototype.toString
  8197. * @description 返回字符串形式。
  8198. * @example
  8199. * var size = new Size(10,5);
  8200. * var str = size.toString();
  8201. * @returns {string} 例如:"w=10,h=5"。
  8202. */
  8203. Size_createClass(Size, [{
  8204. key: "toString",
  8205. value: function toString() {
  8206. return "w=" + this.w + ",h=" + this.h;
  8207. }
  8208. /**
  8209. * @function Size.prototype.clone
  8210. * @description 克隆当前size对象。
  8211. * @example
  8212. * var size = new Size(31,46);
  8213. * var size2 = size.clone();
  8214. * @returns {Size} 新的与当前 size 对象有相同宽、高的 Size 对象。
  8215. */
  8216. }, {
  8217. key: "clone",
  8218. value: function clone() {
  8219. return new Size(this.w, this.h);
  8220. }
  8221. /**
  8222. *
  8223. * @function Size.prototype.equals
  8224. * @description 比较两个 size 对象是否相等。
  8225. * @example
  8226. * var size = new Size(31,46);
  8227. * var size2 = new Size(31,46);
  8228. * var isEquals = size.equals(size2);
  8229. *
  8230. * @param {Size} sz - 用于比较相等的 Size 对象。
  8231. * @returns {boolean} 传入的 size 和当前 size 高宽相等,注意:如果传入的 size 为空则返回 false。
  8232. *
  8233. */
  8234. }, {
  8235. key: "equals",
  8236. value: function equals(sz) {
  8237. var equals = false;
  8238. if (sz != null) {
  8239. equals = this.w === sz.w && this.h === sz.h || isNaN(this.w) && isNaN(this.h) && isNaN(sz.w) && isNaN(sz.h);
  8240. }
  8241. return equals;
  8242. }
  8243. /**
  8244. *
  8245. * @function Size.prototype.destroy
  8246. * @description 销毁此对象。销毁后此对象的所有属性为 null,而不是初始值。
  8247. * @example
  8248. * var size = new Size(31,46);
  8249. * size.destroy();
  8250. */
  8251. }, {
  8252. key: "destroy",
  8253. value: function destroy() {
  8254. this.w = null;
  8255. this.h = null;
  8256. }
  8257. }]);
  8258. return Size;
  8259. }();
  8260. ;// CONCATENATED MODULE: ./src/common/commontypes/Pixel.js
  8261. function Pixel_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  8262. function Pixel_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  8263. function Pixel_createClass(Constructor, protoProps, staticProps) { if (protoProps) Pixel_defineProperties(Constructor.prototype, protoProps); if (staticProps) Pixel_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  8264. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  8265. * This program are made available under the terms of the Apache License, Version 2.0
  8266. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  8267. /**
  8268. * @class Pixel
  8269. * @deprecatedclass SuperMap.Pixel
  8270. * @category BaseTypes Geometry
  8271. * @classdesc 用 x,y 坐标描绘屏幕坐标(像素点)。
  8272. * @param {number} [x=0.0] - x 坐标。
  8273. * @param {number} [y=0.0] - y 坐标。
  8274. * @param {Pixel.Mode} [mode=Pixel.Mode.LeftTop] - 坐标模式。
  8275. *
  8276. * @example
  8277. * //单独创建一个对象
  8278. * var pixcel = new Pixel(100,50);
  8279. *
  8280. * //依据 size 创建
  8281. * var size = new Size(21,25);
  8282. * var offset = new Pixel(-(size.w/2), -size.h);
  8283. * @usage
  8284. */
  8285. var Pixel = /*#__PURE__*/function () {
  8286. function Pixel(x, y, mode) {
  8287. Pixel_classCallCheck(this, Pixel);
  8288. /**
  8289. * @member {number} [Pixel.prototype.x=0.0]
  8290. * @description x 坐标。
  8291. */
  8292. this.x = x ? parseFloat(x) : 0.0;
  8293. /**
  8294. * @member {number} [Pixel.prototype.y=0.0]
  8295. * @description y 坐标。
  8296. */
  8297. this.y = y ? parseFloat(y) : 0.0;
  8298. /**
  8299. * @member {Pixel.Mode} [Pixel.prototype.mode=Pixel.Mode.LeftTop]
  8300. * @description 坐标模式,有左上、右上、右下、左下这几种模式,分别表示相对于左上角、右上角、右下角、左下角的坐标。
  8301. */
  8302. this.mode = mode;
  8303. this.CLASS_NAME = 'SuperMap.Pixel';
  8304. }
  8305. /**
  8306. * @function Pixel.prototype.toString
  8307. * @description 返回此对象的字符串形式。
  8308. * @example
  8309. *
  8310. * var pixcel = new Pixel(100,50);
  8311. * var str = pixcel.toString();
  8312. *
  8313. * @returns {string} 例如: "x=200.4,y=242.2"
  8314. */
  8315. Pixel_createClass(Pixel, [{
  8316. key: "toString",
  8317. value: function toString() {
  8318. return 'x=' + this.x + ',y=' + this.y;
  8319. }
  8320. /**
  8321. * @function Pixel.prototype.clone
  8322. * @description 克隆当前的 pixel 对象。
  8323. * @example
  8324. * var pixcel = new Pixel(100,50);
  8325. * var pixcel2 = pixcel.clone();
  8326. * @returns {Pixel} 新的与当前 pixel 对象有相同 x、y 坐标的 pixel 对象。
  8327. */
  8328. }, {
  8329. key: "clone",
  8330. value: function clone() {
  8331. return new Pixel(this.x, this.y, this.mode);
  8332. }
  8333. /**
  8334. * @function Pixel.prototype.equals
  8335. * @description 比较两 pixel 是否相等。
  8336. * @example
  8337. * var pixcel = new Pixel(100,50);
  8338. * var pixcel2 = new Pixel(100,50);
  8339. * var isEquals = pixcel.equals(pixcel2);
  8340. *
  8341. * @param {Pixel} px - 用于比较相等的 pixel 对象。
  8342. * @returns {boolean} 如果传入的像素点和当前像素点相同返回 true,如果不同或传入参数为 NULL 则返回 false。
  8343. */
  8344. }, {
  8345. key: "equals",
  8346. value: function equals(px) {
  8347. var equals = false;
  8348. if (px != null) {
  8349. equals = this.x == px.x && this.y == px.y || isNaN(this.x) && isNaN(this.y) && isNaN(px.x) && isNaN(px.y);
  8350. }
  8351. return equals;
  8352. }
  8353. /**
  8354. * @function Pixel.prototype.distanceTo
  8355. * @description 返回两个 pixel 的距离。
  8356. * @example
  8357. * var pixcel = new Pixel(100,50);
  8358. * var pixcel2 = new Pixel(110,30);
  8359. * var distance = pixcel.distanceTo(pixcel2);
  8360. *
  8361. * @param {Pixel} px - 需要计算的 pixel。
  8362. * @returns {number} 作为参数传入的像素与当前像素点的距离。
  8363. */
  8364. }, {
  8365. key: "distanceTo",
  8366. value: function distanceTo(px) {
  8367. return Math.sqrt(Math.pow(this.x - px.x, 2) + Math.pow(this.y - px.y, 2));
  8368. }
  8369. /**
  8370. * @function Pixel.prototype.add
  8371. * @description 在原来像素坐标基础上,x 值加上传入的 x 参数,y 值加上传入的 y 参数。
  8372. * @example
  8373. * var pixcel = new Pixel(100,50);
  8374. * //pixcel2是新的对象
  8375. * var pixcel2 = pixcel.add(20,30);
  8376. *
  8377. * @param {number} x - 传入的 x 值。
  8378. * @param {number} y - 传入的 y 值。
  8379. * @returns {Pixel} 新的 pixel 对象,该 pixel 是由当前的 pixel 与传入的 x,y 相加得到。
  8380. */
  8381. }, {
  8382. key: "add",
  8383. value: function add(x, y) {
  8384. if (x == null || y == null) {
  8385. throw new TypeError('Pixel.add cannot receive null values');
  8386. }
  8387. return new Pixel(this.x + x, this.y + y);
  8388. }
  8389. /**
  8390. * @function Pixel.prototype.offset
  8391. * @description 通过传入的 {@link Pixel} 参数对原屏幕坐标进行偏移。
  8392. * @example
  8393. * var pixcel = new Pixel(100,50);
  8394. * var pixcel2 = new Pixel(130,20);
  8395. * //pixcel3 是新的对象
  8396. * var pixcel3 = pixcel.offset(pixcel2);
  8397. *
  8398. * @param {Pixel} px - 传入的 {@link Pixel} 对象。
  8399. * @returns {Pixel} 新的 pixel,该 pixel 是由当前的 pixel 对象的 x,y 值与传入的 Pixel 对象的 x,y 值相加得到。
  8400. */
  8401. }, {
  8402. key: "offset",
  8403. value: function offset(px) {
  8404. var newPx = this.clone();
  8405. if (px) {
  8406. newPx = this.add(px.x, px.y);
  8407. }
  8408. return newPx;
  8409. }
  8410. /**
  8411. *
  8412. * @function Pixel.prototype.destroy
  8413. * @description 销毁此对象。销毁后此对象的所有属性为 null,而不是初始值。
  8414. * @example
  8415. * var pixcel = new Pixel(100,50);
  8416. * pixcel.destroy();
  8417. */
  8418. }, {
  8419. key: "destroy",
  8420. value: function destroy() {
  8421. this.x = null;
  8422. this.y = null;
  8423. this.mode = null;
  8424. }
  8425. }]);
  8426. return Pixel;
  8427. }();
  8428. /**
  8429. * @enum Mode
  8430. * @memberOf Pixel
  8431. * @readonly
  8432. * @description 模式。
  8433. * @type {string}
  8434. */
  8435. Pixel.Mode = {
  8436. /** 左上模式。*/
  8437. LeftTop: 'lefttop',
  8438. /** 右上模式。 */
  8439. RightTop: 'righttop',
  8440. /** 右下模式。 */
  8441. RightBottom: 'rightbottom',
  8442. /** 左下模式。 */
  8443. LeftBottom: 'leftbottom'
  8444. };
  8445. ;// CONCATENATED MODULE: ./src/common/commontypes/BaseTypes.js
  8446. function BaseTypes_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  8447. function BaseTypes_createClass(Constructor, protoProps, staticProps) { if (protoProps) BaseTypes_defineProperties(Constructor.prototype, protoProps); if (staticProps) BaseTypes_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  8448. function BaseTypes_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  8449. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  8450. * This program are made available under the terms of the Apache License, Version 2.0
  8451. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  8452. /**
  8453. * @function inherit
  8454. * @description 除了 C 和 P 两个必要参数外,可以传递任意数量的对象,这些对象都将继承C。
  8455. * @param {Object} C - 继承的类。
  8456. * @param {Object} P - 被继承的父类。
  8457. * @private
  8458. */
  8459. var inheritExt = function inheritExt(C, P) {
  8460. var F = function F() {};
  8461. F.prototype = P.prototype;
  8462. C.prototype = new F();
  8463. var i, l, o;
  8464. for (i = 2, l = arguments.length; i < l; i++) {
  8465. o = arguments[i];
  8466. if (typeof o === "function") {
  8467. o = o.prototype;
  8468. }
  8469. Util_Util.extend(C.prototype, o);
  8470. }
  8471. };
  8472. /**
  8473. * @function mixinExt
  8474. * @description 实现多重继承。
  8475. * @param {Class|Object} ...mixins - 继承的类。
  8476. * @private
  8477. */
  8478. var mixinExt = function mixinExt() {
  8479. for (var _len = arguments.length, mixins = new Array(_len), _key = 0; _key < _len; _key++) {
  8480. mixins[_key] = arguments[_key];
  8481. }
  8482. var Mix = /*#__PURE__*/BaseTypes_createClass(function Mix(options) {
  8483. BaseTypes_classCallCheck(this, Mix);
  8484. for (var index = 0; index < mixins.length; index++) {
  8485. copyProperties(this, new mixins[index](options));
  8486. }
  8487. });
  8488. for (var index = 0; index < mixins.length; index++) {
  8489. var mixin = mixins[index];
  8490. copyProperties(Mix, mixin);
  8491. copyProperties(Mix.prototype, mixin.prototype);
  8492. copyProperties(Mix.prototype, new mixin());
  8493. }
  8494. return Mix;
  8495. function copyProperties(target, source) {
  8496. var ownKeys = Object.getOwnPropertyNames(source);
  8497. if (Object.getOwnPropertySymbols) {
  8498. ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source));
  8499. }
  8500. for (var index = 0; index < ownKeys.length; index++) {
  8501. var key = ownKeys[index];
  8502. if (key !== "constructor" && key !== "prototype" && key !== "name" && key !== "length") {
  8503. var desc = Object.getOwnPropertyDescriptor(source, key);
  8504. if (window["ActiveXObject"]) {
  8505. Object.defineProperty(target, key, desc || {});
  8506. } else {
  8507. Object.defineProperty(target, key, desc);
  8508. }
  8509. }
  8510. }
  8511. }
  8512. };
  8513. /**
  8514. * @name String
  8515. * @namespace
  8516. * @category BaseTypes Util
  8517. * @description 字符串操作的一系列常用扩展函数。
  8518. * @private
  8519. */
  8520. var StringExt = {
  8521. /**
  8522. * @function StringExt.startsWith
  8523. * @description 判断目标字符串是否以指定的子字符串开头。
  8524. * @param {string} str - 目标字符串。
  8525. * @param {string} sub - 查找的子字符串。
  8526. * @returns {boolean} 目标字符串以指定的子字符串开头,则返回 true;否则返回 false。
  8527. */
  8528. startsWith: function startsWith(str, sub) {
  8529. return str.indexOf(sub) == 0;
  8530. },
  8531. /**
  8532. * @function StringExt.contains
  8533. * @description 判断目标字符串是否包含指定的子字符串。
  8534. * @param {string} str - 目标字符串。
  8535. * @param {string} sub - 查找的子字符串。
  8536. * @returns {boolean} 目标字符串中包含指定的子字符串,则返回 true;否则返回 false。
  8537. */
  8538. contains: function contains(str, sub) {
  8539. return str.indexOf(sub) != -1;
  8540. },
  8541. /**
  8542. * @function StringExt.trim
  8543. * @description 删除一个字符串的开头和结尾处的所有空白字符。
  8544. * @param {string} str - (可能)存在空白字符填塞的字符串。
  8545. * @returns {string} 删除开头和结尾处空白字符后的字符串。
  8546. */
  8547. trim: function trim(str) {
  8548. return str.replace(/^\s\s*/, '').replace(/\s\s*$/, '');
  8549. },
  8550. /**
  8551. * @function StringExt.camelize
  8552. * @description 骆驼式("-")连字符的字符串处理。
  8553. * 例如:"chicken-head" becomes "chickenHead",
  8554. * "-chicken-head" becomes "ChickenHead"。
  8555. * @param {string} str - 要处理的字符串,原始内容不应被修改。
  8556. * @returns {string}
  8557. */
  8558. camelize: function camelize(str) {
  8559. var oStringList = str.split('-');
  8560. var camelizedString = oStringList[0];
  8561. for (var i = 1, len = oStringList.length; i < len; i++) {
  8562. var s = oStringList[i];
  8563. camelizedString += s.charAt(0).toUpperCase() + s.substring(1);
  8564. }
  8565. return camelizedString;
  8566. },
  8567. /**
  8568. * @function StringExt.format
  8569. * @description 提供带 ${token} 标记的字符串, 返回 context 对象属性中指定标记的属性值。
  8570. * @example
  8571. * 示例:
  8572. * (code)
  8573. * 1、template = "${value,getValue}";
  8574. * context = {value: {getValue:function(){return Math.max.apply(null,argument);}}};
  8575. * args = [2,23,12,36,21];
  8576. * 返回值:36
  8577. * (end)
  8578. * 示例:
  8579. * (code)
  8580. * 2、template = "$${{value,getValue}}";
  8581. * context = {value: {getValue:function(){return Math.max.apply(null,argument);}}};
  8582. * args = [2,23,12,36,21];
  8583. * 返回值:"${36}"
  8584. * (end)
  8585. * 示例:
  8586. * (code)
  8587. * 3、template = "${a,b}";
  8588. * context = {a: {b:"format"}};
  8589. * args = null;
  8590. * 返回值:"format"
  8591. * (end)
  8592. * 示例:
  8593. * (code)
  8594. * 3、template = "${a,b}";
  8595. * context = null;
  8596. * args = null;
  8597. * 返回值:"${a.b}"
  8598. * (end)
  8599. * @param {string} template - 带标记的字符串将要被替换。参数 template 格式为"${token}",此处的 token 标记会替换为 context["token"] 属性的值。
  8600. * @param {Object} [context=window] - 带有属性的可选对象的属性用于匹配格式化字符串中的标记。如果该参数为空,将使用 window 对象。
  8601. * @param {Array.<number>} [args] - 可选参数传递给在 context 对象上找到的函数。
  8602. * @returns {string} 从 context 对象属性中替换字符串标记位的字符串。
  8603. */
  8604. format: function format(template, context, args) {
  8605. if (!context) {
  8606. context = window;
  8607. }
  8608. // Example matching:
  8609. // str = ${foo.bar}
  8610. // match = foo.bar
  8611. var replacer = function replacer(str, match) {
  8612. var replacement;
  8613. // Loop through all subs. Example: ${a.b.c}
  8614. // 0 -> replacement = context[a];
  8615. // 1 -> replacement = context[a][b];
  8616. // 2 -> replacement = context[a][b][c];
  8617. var subs = match.split(/\.+/);
  8618. for (var i = 0; i < subs.length; i++) {
  8619. if (i == 0) {
  8620. replacement = context;
  8621. }
  8622. replacement = replacement[subs[i]];
  8623. }
  8624. if (typeof replacement === "function") {
  8625. replacement = args ? replacement.apply(null, args) : replacement();
  8626. }
  8627. // If replacement is undefined, return the string 'undefined'.
  8628. // This is a workaround for a bugs in browsers not properly
  8629. // dealing with non-participating groups in regular expressions:
  8630. // http://blog.stevenlevithan.com/archives/npcg-javascript
  8631. if (typeof replacement == 'undefined') {
  8632. return 'undefined';
  8633. } else {
  8634. return replacement;
  8635. }
  8636. };
  8637. return template.replace(StringExt.tokenRegEx, replacer);
  8638. },
  8639. /**
  8640. * @member {RegExp} [StringExt.tokenRegEx]
  8641. * @description 寻找带 token 的字符串,默认为 tokenRegEx=/\$\{([\w.]+?)\}/g。
  8642. * @example
  8643. * Examples: ${a}, ${a.b.c}, ${a-b}, ${5}
  8644. */
  8645. tokenRegEx: /\$\{([\w.]+?)\}/g,
  8646. /**
  8647. * @member {RegExp} [StringExt.numberRegEx]
  8648. * @description 判断一个字符串是否只包含一个数值,默认为 numberRegEx=/^([+-]?)(?=\d|\.\d)\d*(\.\d*)?([Ee]([+-]?\d+))?$/。
  8649. */
  8650. numberRegEx: /^([+-]?)(?=\d|\.\d)\d*(\.\d*)?([Ee]([+-]?\d+))?$/,
  8651. /**
  8652. * @function StringExt.isNumeric
  8653. * @description 判断一个字符串是否只包含一个数值。
  8654. * @example
  8655. * (code)
  8656. * StringExt.isNumeric("6.02e23") // true
  8657. * StringExt.isNumeric("12 dozen") // false
  8658. * StringExt.isNumeric("4") // true
  8659. * StringExt.isNumeric(" 4 ") // false
  8660. * (end)
  8661. * @returns {boolean} 字符串包含唯一的数值,返回 true;否则返回 false。
  8662. */
  8663. isNumeric: function isNumeric(value) {
  8664. return StringExt.numberRegEx.test(value);
  8665. },
  8666. /**
  8667. * @function StringExt.numericIf
  8668. * @description 把一个看似数值型的字符串转化为一个数值。
  8669. * @returns {(number|string)} 如果能转换为数值则返回数值,否则返回字符串本身。
  8670. */
  8671. numericIf: function numericIf(value) {
  8672. return StringExt.isNumeric(value) ? parseFloat(value) : value;
  8673. }
  8674. };
  8675. /**
  8676. * @name Number
  8677. * @namespace
  8678. * @category BaseTypes Util
  8679. * @description 数值操作的一系列常用扩展函数。
  8680. * @private
  8681. */
  8682. var NumberExt = {
  8683. /**
  8684. * @member {string} [NumberExt.decimalSeparator='.']
  8685. * @description 格式化数字时默认的小数点分隔符。
  8686. * @constant
  8687. */
  8688. decimalSeparator: ".",
  8689. /**
  8690. * @member {string} [NumberExt.thousandsSeparator=',']
  8691. * @description 格式化数字时默认的千位分隔符。
  8692. * @constant
  8693. */
  8694. thousandsSeparator: ",",
  8695. /**
  8696. * @function NumberExt.limitSigDigs
  8697. * @description 限制浮点数的有效数字位数。
  8698. * @param {number} num - 浮点数。
  8699. * @param {number} sig - 有效位数。
  8700. * @returns {number} 将数字四舍五入到指定数量的有效位数。
  8701. */
  8702. limitSigDigs: function limitSigDigs(num, sig) {
  8703. var fig = 0;
  8704. if (sig > 0) {
  8705. fig = parseFloat(num.toPrecision(sig));
  8706. }
  8707. return fig;
  8708. },
  8709. /**
  8710. * @function NumberExt.format
  8711. * @description 数字格式化输出。
  8712. * @param {number} num - 数字。
  8713. * @param {number} [dec=0] - 数字的小数部分四舍五入到指定的位数。设置为 null 值时小数部分不变。
  8714. * @param {string} [tsep=','] - 千位分隔符。
  8715. * @param {string} [dsep='.'] - 小数点分隔符。
  8716. * @returns {string} 数字格式化后的字符串。
  8717. */
  8718. format: function format(num, dec, tsep, dsep) {
  8719. dec = typeof dec != "undefined" ? dec : 0;
  8720. tsep = typeof tsep != "undefined" ? tsep : NumberExt.thousandsSeparator;
  8721. dsep = typeof dsep != "undefined" ? dsep : NumberExt.decimalSeparator;
  8722. if (dec != null) {
  8723. num = parseFloat(num.toFixed(dec));
  8724. }
  8725. var parts = num.toString().split(".");
  8726. if (parts.length === 1 && dec == null) {
  8727. // integer where we do not want to touch the decimals
  8728. dec = 0;
  8729. }
  8730. var integer = parts[0];
  8731. if (tsep) {
  8732. var thousands = /(-?[0-9]+)([0-9]{3})/;
  8733. while (thousands.test(integer)) {
  8734. integer = integer.replace(thousands, "$1" + tsep + "$2");
  8735. }
  8736. }
  8737. var str;
  8738. if (dec == 0) {
  8739. str = integer;
  8740. } else {
  8741. var rem = parts.length > 1 ? parts[1] : "0";
  8742. if (dec != null) {
  8743. rem = rem + new Array(dec - rem.length + 1).join("0");
  8744. }
  8745. str = integer + dsep + rem;
  8746. }
  8747. return str;
  8748. }
  8749. };
  8750. if (!Number.prototype.limitSigDigs) {
  8751. /**
  8752. * APIMethod: Number.limitSigDigs
  8753. * 限制浮点数的有效数字位数.
  8754. * @param {number} sig -有效位数。
  8755. * @returns {number} 将数字四舍五入到指定数量的有效位数。
  8756. * 如果传入值 为 null、0、或者是负数, 返回值 0。
  8757. */
  8758. Number.prototype.limitSigDigs = function (sig) {
  8759. return NumberExt.limitSigDigs(this, sig);
  8760. };
  8761. }
  8762. /**
  8763. * @name Function
  8764. * @namespace
  8765. * @category BaseTypes Util
  8766. * @description 函数操作的一系列常用扩展函数。
  8767. * @private
  8768. */
  8769. var FunctionExt = {
  8770. /**
  8771. * @function FunctionExt.bind
  8772. * @description 绑定函数到对象。方便创建 this 的作用域。
  8773. * @param {function} func - 输入函数。
  8774. * @param {Object} object - 对象绑定到输入函数(作为输入函数的 this 对象)。
  8775. * @returns {function} object 参数作为 func 函数的 this 对象。
  8776. */
  8777. bind: function bind(func, object) {
  8778. // create a reference to all arguments past the second one
  8779. var args = Array.prototype.slice.apply(arguments, [2]);
  8780. return function () {
  8781. // Push on any additional arguments from the actual function call.
  8782. // These will come after those sent to the bind call.
  8783. var newArgs = args.concat(Array.prototype.slice.apply(arguments, [0]));
  8784. return func.apply(object, newArgs);
  8785. };
  8786. },
  8787. /**
  8788. * @function FunctionExt.bindAsEventListener
  8789. * @description 绑定函数到对象,在调用该函数时配置并使用事件对象作为第一个参数。
  8790. * @param {function} func - 用于监听事件的函数。
  8791. * @param {Object} object - this 对象的引用。
  8792. * @returns {function}
  8793. */
  8794. bindAsEventListener: function bindAsEventListener(func, object) {
  8795. return function (event) {
  8796. return func.call(object, event || window.event);
  8797. };
  8798. },
  8799. /**
  8800. * @function FunctionExt.False
  8801. * @description 该函数仅仅返回 false。该函数主要是避免在 IE8 以下浏览中 DOM 事件句柄的匿名函数问题。
  8802. * @example
  8803. * document.onclick = FunctionExt.False;
  8804. * @returns {boolean}
  8805. */
  8806. False: function False() {
  8807. return false;
  8808. },
  8809. /**
  8810. * @function FunctionExt.True
  8811. * @description 该函数仅仅返回 true。该函数主要是避免在 IE8 以下浏览中 DOM 事件句柄的匿名函数问题。
  8812. * @example
  8813. * document.onclick = FunctionExt.True;
  8814. * @returns {boolean}
  8815. */
  8816. True: function True() {
  8817. return true;
  8818. },
  8819. /**
  8820. * @function FunctionExt.Void
  8821. * @description 可重用函数,仅仅返回 "undefined"。
  8822. * @returns {undefined}
  8823. */
  8824. Void: function Void() {}
  8825. };
  8826. /**
  8827. * @name Array
  8828. * @namespace
  8829. * @category BaseTypes Util
  8830. * @description 数组操作的一系列常用扩展函数。
  8831. * @private
  8832. */
  8833. var ArrayExt = {
  8834. /**
  8835. * @function ArrayExt.filter
  8836. * @description 过滤数组,提供了 ECMA-262 标准中 Array.prototype.filter 函数的扩展。详见:{@link http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array/filter}
  8837. * @param {Array} array - 要过滤的数组。
  8838. * @param {function} callback - 数组中的每一个元素调用该函数。</br>
  8839. * 如果函数的返回值为 true,该元素将包含在返回的数组中。该函数有三个参数: 数组中的元素,元素的索引,数组自身。</br>
  8840. * 如果设置了可选参数 caller,在调用 callback 时,使用可选参数 caller 设置为 callback 的参数。</br>
  8841. * @param {Object} [caller] - 在调用 callback 时,使用参数 caller 设置为 callback 的参数。
  8842. * @returns {Array} callback 函数返回 true 时的元素将作为返回数组中的元素。
  8843. */
  8844. filter: function filter(array, callback, caller) {
  8845. var selected = [];
  8846. if (Array.prototype.filter) {
  8847. selected = array.filter(callback, caller);
  8848. } else {
  8849. var len = array.length;
  8850. if (typeof callback != "function") {
  8851. throw new TypeError();
  8852. }
  8853. for (var i = 0; i < len; i++) {
  8854. if (i in array) {
  8855. var val = array[i];
  8856. if (callback.call(caller, val, i, array)) {
  8857. selected.push(val);
  8858. }
  8859. }
  8860. }
  8861. }
  8862. return selected;
  8863. }
  8864. };
  8865. ;// CONCATENATED MODULE: ./src/common/commontypes/Geometry.js
  8866. function Geometry_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  8867. function Geometry_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  8868. function Geometry_createClass(Constructor, protoProps, staticProps) { if (protoProps) Geometry_defineProperties(Constructor.prototype, protoProps); if (staticProps) Geometry_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  8869. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  8870. * This program are made available under the terms of the Apache License, Version 2.0
  8871. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  8872. // import {WKT} from '../format/WKT';
  8873. // import {Vector} from './Vector';
  8874. /**
  8875. * @class Geometry
  8876. * @deprecatedclass SuperMap.Geometry
  8877. * @category BaseTypes Geometry
  8878. * @classdesc 几何对象类,描述地理对象的几何图形。
  8879. * @usage
  8880. */
  8881. var Geometry_Geometry = /*#__PURE__*/function () {
  8882. function Geometry() {
  8883. Geometry_classCallCheck(this, Geometry);
  8884. this.CLASS_NAME = "SuperMap.Geometry";
  8885. /**
  8886. * @member {string} Geometry.prototype.id
  8887. * @description 几何对象的唯一标识符。
  8888. *
  8889. */
  8890. this.id = Util_Util.createUniqueID(this.CLASS_NAME + "_");
  8891. /**
  8892. * @member {Geometry} Geometry.prototype.parent
  8893. * @description 父类几何对象。
  8894. */
  8895. this.parent = null;
  8896. /**
  8897. * @member {Bounds} Geometry.prototype.bounds
  8898. * @description 几何对象的范围。
  8899. *
  8900. */
  8901. this.bounds = null;
  8902. /**
  8903. * @member {number} Geometry.prototype.SRID
  8904. * @description 投影坐标参数。通过该参数,服务器判断 Geometry 对象的坐标参考系是否与数据集相同,如果不同,则在数据入库前进行投影变换。
  8905. * @example
  8906. * var geometry= new Geometry();
  8907. * geometry. SRID=4326;
  8908. *
  8909. */
  8910. this.SRID = null;
  8911. }
  8912. /**
  8913. * @function Geometry.prototype.destroy
  8914. * @description 解构 Geometry 类,释放资源。
  8915. */
  8916. Geometry_createClass(Geometry, [{
  8917. key: "destroy",
  8918. value: function destroy() {
  8919. this.id = null;
  8920. this.bounds = null;
  8921. this.SRID = null;
  8922. }
  8923. /**
  8924. * @function Geometry.prototype.clone
  8925. * @description 克隆几何图形。克隆的几何图形不设置非标准的属性。
  8926. * @returns {Geometry} 克隆的几何图形。
  8927. */
  8928. }, {
  8929. key: "clone",
  8930. value: function clone() {
  8931. return new Geometry();
  8932. }
  8933. /**
  8934. * @function Geometry.prototype.setBounds
  8935. * @description 设置几何对象的 bounds。
  8936. * @param {Bounds} bounds - 范围。
  8937. */
  8938. }, {
  8939. key: "setBounds",
  8940. value: function setBounds(bounds) {
  8941. if (bounds) {
  8942. this.bounds = bounds.clone();
  8943. }
  8944. }
  8945. /**
  8946. * @function Geometry.prototype.clearBounds
  8947. * @description 清除几何对象的 bounds。
  8948. * 如果该对象有父类,也会清除父类几何对象的 bounds。
  8949. */
  8950. }, {
  8951. key: "clearBounds",
  8952. value: function clearBounds() {
  8953. this.bounds = null;
  8954. if (this.parent) {
  8955. this.parent.clearBounds();
  8956. }
  8957. }
  8958. /**
  8959. * @function Geometry.prototype.extendBounds
  8960. * @description 扩展现有边界以包含新边界。如果尚未设置几何边界,则设置新边界。
  8961. * @param {Bounds} newBounds - 几何对象的 bounds。
  8962. */
  8963. }, {
  8964. key: "extendBounds",
  8965. value: function extendBounds(newBounds) {
  8966. var bounds = this.getBounds();
  8967. if (!bounds) {
  8968. this.setBounds(newBounds);
  8969. } else {
  8970. this.bounds.extend(newBounds);
  8971. }
  8972. }
  8973. /**
  8974. * @function Geometry.prototype.getBounds
  8975. * @description 获得几何图形的边界。如果没有设置边界,可通过计算获得。
  8976. * @returns {Bounds} 几何对象的边界。
  8977. */
  8978. }, {
  8979. key: "getBounds",
  8980. value: function getBounds() {
  8981. if (this.bounds == null) {
  8982. this.calculateBounds();
  8983. }
  8984. return this.bounds;
  8985. }
  8986. /**
  8987. * @function Geometry.prototype.calculateBounds
  8988. * @description 重新计算几何图形的边界(需要在子类中实现此方法)。
  8989. */
  8990. }, {
  8991. key: "calculateBounds",
  8992. value: function calculateBounds() {
  8993. //
  8994. // This should be overridden by subclasses.
  8995. //
  8996. }
  8997. /**
  8998. * @function Geometry.prototype.getVertices
  8999. * @description 返回几何图形的所有顶点的列表(需要在子类中实现此方法)。
  9000. * @param {boolean} [nodes] - 如果是 true,线则只返回线的末端点,如果 false,仅仅返回顶点,如果没有设置,则返回顶点。
  9001. * @returns {Array} 几何图形的顶点列表。
  9002. */
  9003. }, {
  9004. key: "getVertices",
  9005. value: function getVertices(nodes) {// eslint-disable-line no-unused-vars
  9006. }
  9007. /**
  9008. * @function Geometry.prototype.getArea
  9009. * @description 计算几何对象的面积 ,此方法需要在子类中定义。
  9010. * @returns {number} 计算后的对象面积。
  9011. */
  9012. }, {
  9013. key: "getArea",
  9014. value: function getArea() {
  9015. //to be overridden by geometries that actually have an area
  9016. //
  9017. return 0.0;
  9018. }
  9019. // /**
  9020. // * @function Geometry.prototype.toString
  9021. // * @description 返回geometry对象的字符串表述,需要引入{@link WKTFormat}。此方法只能在子类实现,在父类使用会报错。
  9022. // * @returns {string} geometry对象的字符串表述(Well-Known Text)
  9023. // */
  9024. // toString() {
  9025. // var string;
  9026. // if (WKT) {
  9027. // var wkt = new WKT();
  9028. // string = wkt.write(new Vector(this));
  9029. // } else {
  9030. // string = Object.prototype.toString.call(this);
  9031. // }
  9032. // return string;
  9033. // }
  9034. }]);
  9035. return Geometry;
  9036. }();
  9037. ;// CONCATENATED MODULE: ./src/common/commontypes/Util.js
  9038. function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
  9039. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  9040. * This program are made available under the terms of the Apache License, Version 2.0
  9041. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  9042. /**
  9043. * @description 浏览器名称,依赖于 userAgent 属性,BROWSER_NAME 可以是空,或者以下浏览器:
  9044. * * "opera" -- Opera
  9045. * * "msie" -- Internet Explorer
  9046. * * "safari" -- Safari
  9047. * * "firefox" -- Firefox
  9048. * * "mozilla" -- Mozilla
  9049. * @category BaseTypes Constant
  9050. * @constant {Object}
  9051. * @usage
  9052. * ```
  9053. * // 浏览器
  9054. * <script type="text/javascript" src="{cdn}"></script>
  9055. * <script>
  9056. * const result = {namespace}.Browser.name;
  9057. *
  9058. * </script>
  9059. * // ES6 Import
  9060. * import { Browser } from '{npm}';
  9061. *
  9062. * const result = Browser.name;
  9063. * ```
  9064. */
  9065. var Browser = function () {
  9066. var name = '',
  9067. version = '',
  9068. device = 'pc',
  9069. uaMatch;
  9070. //以下进行测试
  9071. var ua = navigator.userAgent.toLowerCase();
  9072. if (ua.indexOf('msie') > -1 || ua.indexOf('trident') > -1 && ua.indexOf('rv') > -1) {
  9073. name = 'msie';
  9074. uaMatch = ua.match(/msie ([\d.]+)/) || ua.match(/rv:([\d.]+)/);
  9075. } else if (ua.indexOf('chrome') > -1) {
  9076. name = 'chrome';
  9077. uaMatch = ua.match(/chrome\/([\d.]+)/);
  9078. } else if (ua.indexOf('firefox') > -1) {
  9079. name = 'firefox';
  9080. uaMatch = ua.match(/firefox\/([\d.]+)/);
  9081. } else if (ua.indexOf('opera') > -1) {
  9082. name = 'opera';
  9083. uaMatch = ua.match(/version\/([\d.]+)/);
  9084. } else if (ua.indexOf('safari') > -1) {
  9085. name = 'safari';
  9086. uaMatch = ua.match(/version\/([\d.]+)/);
  9087. }
  9088. version = uaMatch ? uaMatch[1] : '';
  9089. if (ua.indexOf('ipad') > -1 || ua.indexOf('ipod') > -1 || ua.indexOf('iphone') > -1) {
  9090. device = 'apple';
  9091. } else if (ua.indexOf('android') > -1) {
  9092. uaMatch = ua.match(/version\/([\d.]+)/);
  9093. version = uaMatch ? uaMatch[1] : '';
  9094. device = 'android';
  9095. }
  9096. return {
  9097. name: name,
  9098. version: version,
  9099. device: device
  9100. };
  9101. }();
  9102. var isSupportCanvas = function () {
  9103. var checkRes = true,
  9104. broz = Browser;
  9105. if (document.createElement('canvas').getContext) {
  9106. if (broz.name === 'firefox' && parseFloat(broz.version) < 5) {
  9107. checkRes = false;
  9108. }
  9109. if (broz.name === 'safari' && parseFloat(broz.version) < 4) {
  9110. checkRes = false;
  9111. }
  9112. if (broz.name === 'opera' && parseFloat(broz.version) < 10) {
  9113. checkRes = false;
  9114. }
  9115. if (broz.name === 'msie' && parseFloat(broz.version) < 9) {
  9116. checkRes = false;
  9117. }
  9118. } else {
  9119. checkRes = false;
  9120. }
  9121. return checkRes;
  9122. }();
  9123. /**
  9124. * @description 如果 userAgent 捕获到浏览器使用的是 Gecko 引擎则返回 true。
  9125. * @constant {number}
  9126. * @private
  9127. */
  9128. var IS_GECKO = function () {
  9129. var ua = navigator.userAgent.toLowerCase();
  9130. return ua.indexOf('webkit') === -1 && ua.indexOf('gecko') !== -1;
  9131. }();
  9132. /**
  9133. * @constant {number}
  9134. * @default
  9135. * @description 分辨率与比例尺之间转换的常量。
  9136. * @private
  9137. */
  9138. var DOTS_PER_INCH = 96;
  9139. /**
  9140. * @name CommonUtil
  9141. * @namespace
  9142. * @category BaseTypes Util
  9143. * @description common 工具类。
  9144. * @usage
  9145. * ```
  9146. * // 浏览器
  9147. * <script type="text/javascript" src="{cdn}"></script>
  9148. * <script>
  9149. * const result = {namespace}.CommonUtil.getElement();
  9150. *
  9151. * // 弃用的写法
  9152. * const result = SuperMap.Util.getElement();
  9153. *
  9154. * </script>
  9155. *
  9156. * // ES6 Import
  9157. * import { CommonUtil } from '{npm}';
  9158. *
  9159. * const result = CommonUtil.getElement();
  9160. * ```
  9161. */
  9162. var Util_Util = {
  9163. /**
  9164. * @function Util.extend
  9165. * @description 对象拷贝赋值。
  9166. * @param {Object} dest - 目标对象。
  9167. * @param {Object} arguments - 待拷贝的对象。
  9168. * @returns {Object} 赋值后的目标对象。
  9169. */
  9170. assign: function assign(dest) {
  9171. for (var index = 0; index < Object.getOwnPropertyNames(arguments).length; index++) {
  9172. var arg = Object.getOwnPropertyNames(arguments)[index];
  9173. if (arg == "caller" || arg == "callee" || arg == "length" || arg == "arguments") {
  9174. continue;
  9175. }
  9176. var obj = arguments[arg];
  9177. if (obj) {
  9178. for (var j = 0; j < Object.getOwnPropertyNames(obj).length; j++) {
  9179. var key = Object.getOwnPropertyNames(obj)[j];
  9180. if (arg == "caller" || arg == "callee" || arg == "length" || arg == "arguments") {
  9181. continue;
  9182. }
  9183. dest[key] = obj[key];
  9184. }
  9185. }
  9186. }
  9187. return dest;
  9188. },
  9189. /**
  9190. * @memberOf CommonUtil
  9191. * @description 复制源对象的所有属性到目标对象上,源对象上的没有定义的属性在目标对象上也不会被设置。
  9192. * @example
  9193. * 要复制 Size 对象的所有属性到自定义对象上,使用方法如下:
  9194. * var size = new Size(100, 100);
  9195. * var obj = {};
  9196. * CommonUtil.extend(obj, size);
  9197. * @param {Object} [destination] - 目标对象。
  9198. * @param {Object} source - 源对象,其属性将被设置到目标对象上。
  9199. * @returns {Object} 目标对象。
  9200. */
  9201. extend: function extend(destination, source) {
  9202. destination = destination || {};
  9203. if (source) {
  9204. for (var property in source) {
  9205. var value = source[property];
  9206. if (value !== undefined) {
  9207. destination[property] = value;
  9208. }
  9209. }
  9210. /**
  9211. * IE doesn't include the toString property when iterating over an object's
  9212. * properties with the for(property in object) syntax. Explicitly check if
  9213. * the source has its own toString property.
  9214. */
  9215. /*
  9216. * FF/Windows < 2.0.0.13 reports "Illegal operation on WrappedNative
  9217. * prototype object" when calling hawOwnProperty if the source object
  9218. * is an instance of window.Event.
  9219. */
  9220. var sourceIsEvt = typeof window.Event === 'function' && source instanceof window.Event;
  9221. if (!sourceIsEvt && source.hasOwnProperty && source.hasOwnProperty('toString')) {
  9222. destination.toString = source.toString;
  9223. }
  9224. }
  9225. return destination;
  9226. },
  9227. /**
  9228. * @memberOf CommonUtil
  9229. * @description 对象拷贝。
  9230. * @param {Object} [des] - 目标对象。
  9231. * @param {Object} soc - 源对象。
  9232. */
  9233. copy: function copy(des, soc) {
  9234. des = des || {};
  9235. var v;
  9236. if (soc) {
  9237. for (var p in des) {
  9238. v = soc[p];
  9239. if (typeof v !== 'undefined') {
  9240. des[p] = v;
  9241. }
  9242. }
  9243. }
  9244. },
  9245. /**
  9246. * @memberOf CommonUtil
  9247. * @description 销毁对象,将其属性置空。
  9248. * @param {Object} [obj] - 目标对象。
  9249. */
  9250. reset: function reset(obj) {
  9251. obj = obj || {};
  9252. for (var p in obj) {
  9253. if (obj.hasOwnProperty(p)) {
  9254. if (_typeof(obj[p]) === 'object' && obj[p] instanceof Array) {
  9255. for (var i in obj[p]) {
  9256. if (obj[p][i].destroy) {
  9257. obj[p][i].destroy();
  9258. }
  9259. }
  9260. obj[p].length = 0;
  9261. } else if (_typeof(obj[p]) === 'object' && obj[p] instanceof Object) {
  9262. if (obj[p].destroy) {
  9263. obj[p].destroy();
  9264. }
  9265. }
  9266. obj[p] = null;
  9267. }
  9268. }
  9269. },
  9270. /**
  9271. * @memberOf CommonUtil
  9272. * @description 获取 HTML 元素数组。
  9273. * @returns {Array.<HTMLElement>} HTML 元素数组。
  9274. */
  9275. getElement: function getElement() {
  9276. var elements = [];
  9277. for (var i = 0, len = arguments.length; i < len; i++) {
  9278. var element = arguments[i];
  9279. if (typeof element === 'string') {
  9280. element = document.getElementById(element);
  9281. }
  9282. if (arguments.length === 1) {
  9283. return element;
  9284. }
  9285. elements.push(element);
  9286. }
  9287. return elements;
  9288. },
  9289. /**
  9290. * @memberOf CommonUtil
  9291. * @description instance of 的跨浏览器实现。
  9292. * @param {Object} o - 对象。
  9293. * @returns {boolean} 是否是页面元素。
  9294. */
  9295. isElement: function isElement(o) {
  9296. return !!(o && o.nodeType === 1);
  9297. },
  9298. /**
  9299. * @memberOf CommonUtil
  9300. * @description 判断一个对象是否是数组。
  9301. * @param {Object} a - 对象。
  9302. * @returns {boolean} 是否是数组。
  9303. */
  9304. isArray: function isArray(a) {
  9305. return Object.prototype.toString.call(a) === '[object Array]';
  9306. },
  9307. /**
  9308. * @memberOf CommonUtil
  9309. * @description 从数组中删除某一项。
  9310. * @param {Array} array - 数组。
  9311. * @param {Object} item - 数组中要删除的一项。
  9312. * @returns {Array} 执行删除操作后的数组。
  9313. */
  9314. removeItem: function removeItem(array, item) {
  9315. for (var i = array.length - 1; i >= 0; i--) {
  9316. if (array[i] === item) {
  9317. array.splice(i, 1);
  9318. //break;more than once??
  9319. }
  9320. }
  9321. return array;
  9322. },
  9323. /**
  9324. * @memberOf CommonUtil
  9325. * @description 获取某对象在数组中的索引值。
  9326. * @param {Array.<Object>} array - 数组。
  9327. * @param {Object} obj - 对象。
  9328. * @returns {number} 某对象在数组中的索引值。
  9329. */
  9330. indexOf: function indexOf(array, obj) {
  9331. if (array == null) {
  9332. return -1;
  9333. } else {
  9334. // use the build-in function if available.
  9335. if (typeof array.indexOf === 'function') {
  9336. return array.indexOf(obj);
  9337. } else {
  9338. for (var i = 0, len = array.length; i < len; i++) {
  9339. if (array[i] === obj) {
  9340. return i;
  9341. }
  9342. }
  9343. return -1;
  9344. }
  9345. }
  9346. },
  9347. /**
  9348. * @memberOf CommonUtil
  9349. * @description 修改某 DOM 元素的许多属性。
  9350. * @param {HTMLElement} element - 待修改的 DOM 元素。
  9351. * @param {string} [id] - DOM 元素的 ID。
  9352. * @param {Pixel} [px] - DOM 元素的 style 属性的 left 和 top 属性。
  9353. * @param {Size} [sz] - DOM 元素的 width 和 height 属性。
  9354. * @param {string} [position] - DOM 元素的 position 属性。
  9355. * @param {string} [border] - DOM 元素的 style 属性的 border 属性。
  9356. * @param {string} [overflow] - DOM 元素的 style 属性的 overflow 属性。
  9357. * @param {number} [opacity] - 不透明度值。取值范围为(0.0 - 1.0)。
  9358. */
  9359. modifyDOMElement: function modifyDOMElement(element, id, px, sz, position, border, overflow, opacity) {
  9360. if (id) {
  9361. element.id = id;
  9362. }
  9363. if (px) {
  9364. element.style.left = px.x + 'px';
  9365. element.style.top = px.y + 'px';
  9366. }
  9367. if (sz) {
  9368. element.style.width = sz.w + 'px';
  9369. element.style.height = sz.h + 'px';
  9370. }
  9371. if (position) {
  9372. element.style.position = position;
  9373. }
  9374. if (border) {
  9375. element.style.border = border;
  9376. }
  9377. if (overflow) {
  9378. element.style.overflow = overflow;
  9379. }
  9380. if (parseFloat(opacity) >= 0.0 && parseFloat(opacity) < 1.0) {
  9381. element.style.filter = 'alpha(opacity=' + opacity * 100 + ')';
  9382. element.style.opacity = opacity;
  9383. } else if (parseFloat(opacity) === 1.0) {
  9384. element.style.filter = '';
  9385. element.style.opacity = '';
  9386. }
  9387. },
  9388. /**
  9389. * @memberOf CommonUtil
  9390. * @description 比较两个对象并合并。
  9391. * @param {Object} [to] - 目标对象。
  9392. * @param {Object} from - 源对象。
  9393. * @returns {Object} 返回合并后的对象。
  9394. */
  9395. applyDefaults: function applyDefaults(to, from) {
  9396. to = to || {};
  9397. /*
  9398. * FF/Windows < 2.0.0.13 reports "Illegal operation on WrappedNative
  9399. * prototype object" when calling hawOwnProperty if the source object is an
  9400. * instance of window.Event.
  9401. */
  9402. var fromIsEvt = typeof window.Event === 'function' && from instanceof window.Event;
  9403. for (var key in from) {
  9404. if (to[key] === undefined || !fromIsEvt && from.hasOwnProperty && from.hasOwnProperty(key) && !to.hasOwnProperty(key)) {
  9405. to[key] = from[key];
  9406. }
  9407. }
  9408. /**
  9409. * IE doesn't include the toString property when iterating over an object's
  9410. * properties with the for(property in object) syntax. Explicitly check if
  9411. * the source has its own toString property.
  9412. */
  9413. if (!fromIsEvt && from && from.hasOwnProperty && from.hasOwnProperty('toString') && !to.hasOwnProperty('toString')) {
  9414. to.toString = from.toString;
  9415. }
  9416. return to;
  9417. },
  9418. /**
  9419. * @memberOf CommonUtil
  9420. * @description 将参数对象转换为 HTTP 的 GET 请求中的参数字符串。例如:"key1=value1&key2=value2&key3=value3"。
  9421. * @param {Object} params - 参数对象。
  9422. * @returns {string} HTTP 的 GET 请求中的参数字符串。
  9423. */
  9424. getParameterString: function getParameterString(params) {
  9425. var paramsArray = [];
  9426. for (var key in params) {
  9427. var value = params[key];
  9428. if (value != null && typeof value !== 'function') {
  9429. var encodedValue;
  9430. if (Array.isArray(value) || value.toString() === '[object Object]') {
  9431. encodedValue = encodeURIComponent(JSON.stringify(value));
  9432. } else {
  9433. /* value is a string; simply encode */
  9434. encodedValue = encodeURIComponent(value);
  9435. }
  9436. paramsArray.push(encodeURIComponent(key) + '=' + encodedValue);
  9437. }
  9438. }
  9439. return paramsArray.join('&');
  9440. },
  9441. /**
  9442. * @memberOf CommonUtil
  9443. * @description 给 URL 追加查询参数。
  9444. * @param {string} url - 待追加参数的 URL 字符串。
  9445. * @param {string} paramStr - 待追加的查询参数。
  9446. * @returns {string} 新的 URL。
  9447. */
  9448. urlAppend: function urlAppend(url, paramStr) {
  9449. var newUrl = url;
  9450. if (paramStr) {
  9451. if (paramStr.indexOf('?') === 0) {
  9452. paramStr = paramStr.substring(1);
  9453. }
  9454. var parts = (url + ' ').split(/[?&]/);
  9455. newUrl += parts.pop() === ' ' ? paramStr : parts.length ? '&' + paramStr : '?' + paramStr;
  9456. }
  9457. return newUrl;
  9458. },
  9459. /**
  9460. * @memberOf CommonUtil
  9461. * @description 给 URL 追加 path 参数。
  9462. * @param {string} url - 待追加参数的 URL 字符串。
  9463. * @param {string} paramStr - 待追加的path参数。
  9464. * @returns {string} 新的 URL。
  9465. */
  9466. urlPathAppend: function urlPathAppend(url, pathStr) {
  9467. var newUrl = url;
  9468. if (!pathStr) {
  9469. return newUrl;
  9470. }
  9471. if (pathStr.indexOf('/') === 0) {
  9472. pathStr = pathStr.substring(1);
  9473. }
  9474. var parts = url.split('?');
  9475. if (parts[0].indexOf('/', parts[0].length - 1) < 0) {
  9476. parts[0] += '/';
  9477. }
  9478. newUrl = "".concat(parts[0]).concat(pathStr).concat(parts.length > 1 ? "?".concat(parts[1]) : '');
  9479. return newUrl;
  9480. },
  9481. /**
  9482. * @memberOf CommonUtil
  9483. * @description 为了避免浮点精度错误而保留的有效位数。
  9484. * @type {number}
  9485. * @default 14
  9486. */
  9487. DEFAULT_PRECISION: 14,
  9488. /**
  9489. * @memberOf CommonUtil
  9490. * @description 将字符串以接近的精度转换为数字。
  9491. * @param {string} number - 字符串。
  9492. * @param {number} [precision=14] - 精度。
  9493. * @returns {number} 转化后的数字。
  9494. */
  9495. toFloat: function toFloat(number, precision) {
  9496. if (precision == null) {
  9497. precision = Util_Util.DEFAULT_PRECISION;
  9498. }
  9499. if (typeof number !== 'number') {
  9500. number = parseFloat(number);
  9501. }
  9502. return precision === 0 ? number : parseFloat(number.toPrecision(precision));
  9503. },
  9504. /**
  9505. * @memberOf CommonUtil
  9506. * @description 角度转弧度。
  9507. * @param {number} x - 角度。
  9508. * @returns {number} 转化后的弧度。
  9509. */
  9510. rad: function rad(x) {
  9511. return x * Math.PI / 180;
  9512. },
  9513. /**
  9514. * @memberOf CommonUtil
  9515. * @description 从 URL 字符串中解析出参数对象。
  9516. * @param {string} url - URL。
  9517. * @returns {Object} 解析出的参数对象。
  9518. */
  9519. getParameters: function getParameters(url) {
  9520. // if no url specified, take it from the location bar
  9521. url = url === null || url === undefined ? window.location.href : url;
  9522. //parse out parameters portion of url string
  9523. var paramsString = '';
  9524. if (StringExt.contains(url, '?')) {
  9525. var start = url.indexOf('?') + 1;
  9526. var end = StringExt.contains(url, '#') ? url.indexOf('#') : url.length;
  9527. paramsString = url.substring(start, end);
  9528. }
  9529. var parameters = {};
  9530. var pairs = paramsString.split(/[&;]/);
  9531. for (var i = 0, len = pairs.length; i < len; ++i) {
  9532. var keyValue = pairs[i].split('=');
  9533. if (keyValue[0]) {
  9534. var key = keyValue[0];
  9535. try {
  9536. key = decodeURIComponent(key);
  9537. } catch (err) {
  9538. key = unescape(key);
  9539. }
  9540. // being liberal by replacing "+" with " "
  9541. var value = (keyValue[1] || '').replace(/\+/g, ' ');
  9542. try {
  9543. value = decodeURIComponent(value);
  9544. } catch (err) {
  9545. value = unescape(value);
  9546. }
  9547. // follow OGC convention of comma delimited values
  9548. value = value.split(',');
  9549. //if there's only one value, do not return as array
  9550. if (value.length == 1) {
  9551. value = value[0];
  9552. }
  9553. parameters[key] = value;
  9554. }
  9555. }
  9556. return parameters;
  9557. },
  9558. /**
  9559. * @memberOf CommonUtil
  9560. * @description 不断递增计数变量,用于生成唯一 ID。
  9561. * @type {number}
  9562. * @default 0
  9563. */
  9564. lastSeqID: 0,
  9565. /**
  9566. * @memberOf CommonUtil
  9567. * @description 创建唯一 ID 值。
  9568. * @param {string} [prefix] - 前缀。
  9569. * @returns {string} 唯一的 ID 值。
  9570. */
  9571. createUniqueID: function createUniqueID(prefix) {
  9572. if (prefix == null) {
  9573. prefix = 'id_';
  9574. }
  9575. Util_Util.lastSeqID += 1;
  9576. return prefix + Util_Util.lastSeqID;
  9577. },
  9578. /**
  9579. * @memberOf CommonUtil
  9580. * @description 判断并转化比例尺。
  9581. * @param {number} scale - 比例尺。
  9582. * @returns {number} 正常的 scale 值。
  9583. */
  9584. normalizeScale: function normalizeScale(scale) {
  9585. var normScale = scale > 1.0 ? 1.0 / scale : scale;
  9586. return normScale;
  9587. },
  9588. /**
  9589. * @memberOf CommonUtil
  9590. * @description 比例尺转分辨率。
  9591. * @param {number} scale - 比例尺。
  9592. * @param {string} [units='degrees'] - 比例尺单位。
  9593. * @returns {number} 转化后的分辨率。
  9594. */
  9595. getResolutionFromScale: function getResolutionFromScale(scale, units) {
  9596. var resolution;
  9597. if (scale) {
  9598. if (units == null) {
  9599. units = 'degrees';
  9600. }
  9601. var normScale = Util_Util.normalizeScale(scale);
  9602. resolution = 1 / (normScale * INCHES_PER_UNIT[units] * DOTS_PER_INCH);
  9603. }
  9604. return resolution;
  9605. },
  9606. /**
  9607. * @memberOf CommonUtil
  9608. * @description 分辨率转比例尺。
  9609. * @param {number} resolution - 分辨率。
  9610. * @param {string} [units='degrees'] - 分辨率单位。
  9611. * @returns {number} 转化后的比例尺。
  9612. */
  9613. getScaleFromResolution: function getScaleFromResolution(resolution, units) {
  9614. if (units == null) {
  9615. units = 'degrees';
  9616. }
  9617. var scale = resolution * INCHES_PER_UNIT[units] * DOTS_PER_INCH;
  9618. return scale;
  9619. },
  9620. /**
  9621. * @memberOf CommonUtil
  9622. * @description 获取浏览器相关信息。支持的浏览器包括:Opera,Internet Explorer,Safari,Firefox。
  9623. * @returns {Object} 浏览器名称、版本、设备名称。对应的属性分别为 name, version, device。
  9624. */
  9625. getBrowser: function getBrowser() {
  9626. return Browser;
  9627. },
  9628. /**
  9629. * @memberOf CommonUtil
  9630. * @description 浏览器是否支持 Canvas。
  9631. * @returns {boolean} 当前浏览器是否支持 HTML5 Canvas。
  9632. */
  9633. isSupportCanvas: isSupportCanvas,
  9634. /**
  9635. * @memberOf CommonUtil
  9636. * @description 判断浏览器是否支持 Canvas。
  9637. * @returns {boolean} 当前浏览器是否支持 HTML5 Canvas 。
  9638. */
  9639. supportCanvas: function supportCanvas() {
  9640. return Util_Util.isSupportCanvas;
  9641. },
  9642. /**
  9643. * @memberOf CommonUtil
  9644. * @description 判断一个 URL 请求是否在当前域中。
  9645. * @param {string} url - URL 请求字符串。
  9646. * @returns {boolean} URL 请求是否在当前域中。
  9647. */
  9648. isInTheSameDomain: function isInTheSameDomain(url) {
  9649. if (!url) {
  9650. return true;
  9651. }
  9652. var index = url.indexOf('//');
  9653. var documentUrl = document.location.toString();
  9654. var documentIndex = documentUrl.indexOf('//');
  9655. if (index === -1) {
  9656. return true;
  9657. } else {
  9658. var protocol;
  9659. var substring = protocol = url.substring(0, index);
  9660. var documentSubString = documentUrl.substring(documentIndex + 2);
  9661. documentIndex = documentSubString.indexOf('/');
  9662. var documentPortIndex = documentSubString.indexOf(':');
  9663. var documentDomainWithPort = documentSubString.substring(0, documentIndex);
  9664. //var documentPort;
  9665. var documentprotocol = document.location.protocol;
  9666. if (documentPortIndex !== -1) {
  9667. // documentPort = +documentSubString.substring(documentPortIndex, documentIndex);
  9668. } else {
  9669. documentDomainWithPort += ':' + (documentprotocol.toLowerCase() === 'http:' ? 80 : 443);
  9670. }
  9671. if (documentprotocol.toLowerCase() !== substring.toLowerCase()) {
  9672. return false;
  9673. }
  9674. substring = url.substring(index + 2);
  9675. var portIndex = substring.indexOf(':');
  9676. index = substring.indexOf('/');
  9677. var domainWithPort = substring.substring(0, index);
  9678. var domain;
  9679. if (portIndex !== -1) {
  9680. domain = substring.substring(0, portIndex);
  9681. } else {
  9682. domain = substring.substring(0, index);
  9683. domainWithPort += ':' + (protocol.toLowerCase() === 'http:' ? 80 : 443);
  9684. }
  9685. var documentDomain = document.domain;
  9686. if (domain === documentDomain && domainWithPort === documentDomainWithPort) {
  9687. return true;
  9688. }
  9689. }
  9690. return false;
  9691. },
  9692. /**
  9693. * @memberOf CommonUtil
  9694. * @description 计算 iServer 服务的 REST 图层的显示分辨率,需要从 iServer 的 REST 图层表述中获取 viewBounds、viewer、scale、coordUnit、datumAxis 五个参数,来进行计算。
  9695. * @param {Bounds} viewBounds - 地图的参照可视范围,即地图初始化时默认的地图显示范围。
  9696. * @param {Size} viewer - 地图初始化时默认的地图图片的尺寸。
  9697. * @param {number} scale - 地图初始化时默认的显示比例尺。
  9698. * @param {string} [coordUnit='degrees'] - 投影坐标系统的地图单位。
  9699. * @param {number} [datumAxis=6378137] - 地理坐标系统椭球体长半轴。用户自定义地图的 Options 时,若未指定该参数的值,则系统默认为 WGS84 参考系的椭球体长半轴 6378137。
  9700. * @returns {number} 图层显示分辨率。
  9701. */
  9702. calculateDpi: function calculateDpi(viewBounds, viewer, scale, coordUnit, datumAxis) {
  9703. //10000 是 0.1毫米与米的转换。DPI的计算公式:Viewer / DPI * 0.0254 * 10000 = ViewBounds * scale ,公式中的10000是为了提高计算结果的精度,以下出现的ratio皆为如此。
  9704. if (!viewBounds || !viewer || !scale) {
  9705. return;
  9706. }
  9707. var ratio = 10000,
  9708. rvbWidth = viewBounds.getWidth(),
  9709. rvbHeight = viewBounds.getHeight(),
  9710. rvWidth = viewer.w,
  9711. rvHeight = viewer.h;
  9712. //用户自定义地图的Options时,若未指定该参数的值,则系统默认为6378137米,即WGS84参考系的椭球体长半轴。
  9713. datumAxis = datumAxis || 6378137;
  9714. coordUnit = coordUnit || 'degrees';
  9715. var dpi;
  9716. if (coordUnit.toLowerCase() === 'degree' || coordUnit.toLowerCase() === 'degrees' || coordUnit.toLowerCase() === 'dd') {
  9717. var num1 = rvbWidth / rvWidth,
  9718. num2 = rvbHeight / rvHeight,
  9719. resolution = num1 > num2 ? num1 : num2;
  9720. dpi = 0.0254 * ratio / resolution / scale / (Math.PI * 2 * datumAxis / 360) / ratio;
  9721. } else {
  9722. var _resolution = rvbWidth / rvWidth;
  9723. dpi = 0.0254 * ratio / _resolution / scale / ratio;
  9724. }
  9725. return dpi;
  9726. },
  9727. /**
  9728. * @memberOf CommonUtil
  9729. * @description 将对象转换成 JSON 字符串。
  9730. * @param {Object} obj - 要转换成 JSON 的 Object 对象。
  9731. * @returns {string} 转换后的 JSON 对象。
  9732. */
  9733. toJSON: function toJSON(obj) {
  9734. var objInn = obj;
  9735. if (objInn == null) {
  9736. return null;
  9737. }
  9738. switch (objInn.constructor) {
  9739. case String:
  9740. //s = "'" + str.replace(/(["\\])/g, "\\$1") + "'"; string含有单引号出错
  9741. objInn = '"' + objInn.replace(/(["\\])/g, '\\$1') + '"';
  9742. objInn = objInn.replace(/\n/g, '\\n');
  9743. objInn = objInn.replace(/\r/g, '\\r');
  9744. objInn = objInn.replace('<', '&lt;');
  9745. objInn = objInn.replace('>', '&gt;');
  9746. objInn = objInn.replace(/%/g, '%25');
  9747. objInn = objInn.replace(/&/g, '%26');
  9748. return objInn;
  9749. case Array:
  9750. var arr = '';
  9751. for (var i = 0, len = objInn.length; i < len; i++) {
  9752. arr += Util_Util.toJSON(objInn[i]);
  9753. if (i !== objInn.length - 1) {
  9754. arr += ',';
  9755. }
  9756. }
  9757. return "[" + arr + "]";
  9758. case Number:
  9759. return isFinite(objInn) ? String(objInn) : null;
  9760. case Boolean:
  9761. return String(objInn);
  9762. case Date:
  9763. 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() + '}';
  9764. return dateStr;
  9765. default:
  9766. if (objInn['toJSON'] != null && typeof objInn['toJSON'] === 'function') {
  9767. return objInn.toJSON();
  9768. }
  9769. if (_typeof(objInn) === 'object') {
  9770. if (objInn.length) {
  9771. var _arr = [];
  9772. for (var _i2 = 0, _len2 = objInn.length; _i2 < _len2; _i2++) {
  9773. _arr.push(Util_Util.toJSON(objInn[_i2]));
  9774. }
  9775. return '[' + _arr.join(',') + ']';
  9776. }
  9777. var _arr2 = [];
  9778. for (var attr in objInn) {
  9779. //为解决Geometry类型头json时堆栈溢出的问题,attr == "parent"时不进行json转换
  9780. if (typeof objInn[attr] !== 'function' && attr !== 'CLASS_NAME' && attr !== 'parent') {
  9781. _arr2.push("'" + attr + "':" + Util_Util.toJSON(objInn[attr]));
  9782. }
  9783. }
  9784. if (_arr2.length > 0) {
  9785. return '{' + _arr2.join(',') + '}';
  9786. } else {
  9787. return '{}';
  9788. }
  9789. }
  9790. return objInn.toString();
  9791. }
  9792. },
  9793. /**
  9794. * @memberOf CommonUtil
  9795. * @description 根据比例尺和 DPI 计算屏幕分辨率。
  9796. * @category BaseTypes Util
  9797. * @param {number} scale - 比例尺。
  9798. * @param {number} dpi - 图像分辨率,表示每英寸内的像素个数。
  9799. * @param {string} [coordUnit] - 投影坐标系统的地图单位。
  9800. * @param {number} [datumAxis=6378137] - 地理坐标系统椭球体长半轴。用户自定义地图的 Options 时,若未指定该参数的值,则 DPI 默认按照 WGS84 参考系的椭球体长半轴 6378137 来计算。
  9801. * @returns {number} 当前比例尺下的屏幕分辨率。
  9802. */
  9803. getResolutionFromScaleDpi: function getResolutionFromScaleDpi(scale, dpi, coordUnit, datumAxis) {
  9804. var resolution = null,
  9805. ratio = 10000;
  9806. //用户自定义地图的Options时,若未指定该参数的值,则系统默认为6378137米,即WGS84参考系的椭球体长半轴。
  9807. datumAxis = datumAxis || 6378137;
  9808. coordUnit = coordUnit || '';
  9809. if (scale > 0 && dpi > 0) {
  9810. scale = Util_Util.normalizeScale(scale);
  9811. if (coordUnit.toLowerCase() === 'degree' || coordUnit.toLowerCase() === 'degrees' || coordUnit.toLowerCase() === 'dd') {
  9812. //scale = Util.normalizeScale(scale);
  9813. resolution = 0.0254 * ratio / dpi / scale / (Math.PI * 2 * datumAxis / 360) / ratio;
  9814. return resolution;
  9815. } else {
  9816. resolution = 0.0254 * ratio / dpi / scale / ratio;
  9817. return resolution;
  9818. }
  9819. }
  9820. return -1;
  9821. },
  9822. /**
  9823. * @memberOf CommonUtil
  9824. * @description 根据 resolution、dpi、coordUnit 和 datumAxis 计算比例尺。
  9825. * @param {number} resolution - 用于计算比例尺的地图分辨率。
  9826. * @param {number} dpi - 图像分辨率,表示每英寸内的像素个数。
  9827. * @param {string} [coordUnit] - 投影坐标系统的地图单位。
  9828. * @param {number} [datumAxis=6378137] - 地理坐标系统椭球体长半轴。用户自定义地图的 Options 时,若未指定该参数的值,则 DPI 默认按照 WGS84 参考系的椭球体长半轴 6378137 来计算。
  9829. * @returns {number} 当前屏幕分辨率下的比例尺。
  9830. */
  9831. getScaleFromResolutionDpi: function getScaleFromResolutionDpi(resolution, dpi, coordUnit, datumAxis) {
  9832. var scale = null,
  9833. ratio = 10000;
  9834. //用户自定义地图的Options时,若未指定该参数的值,则系统默认为6378137米,即WGS84参考系的椭球体长半轴。
  9835. datumAxis = datumAxis || 6378137;
  9836. coordUnit = coordUnit || '';
  9837. if (resolution > 0 && dpi > 0) {
  9838. if (coordUnit.toLowerCase() === 'degree' || coordUnit.toLowerCase() === 'degrees' || coordUnit.toLowerCase() === 'dd') {
  9839. scale = 0.0254 * ratio / dpi / resolution / (Math.PI * 2 * datumAxis / 360) / ratio;
  9840. return scale;
  9841. } else {
  9842. scale = 0.0254 * ratio / dpi / resolution / ratio;
  9843. return scale;
  9844. }
  9845. }
  9846. return -1;
  9847. },
  9848. /**
  9849. * @memberOf CommonUtil
  9850. * @description 转换查询结果。
  9851. * @param {Object} result - 查询结果。
  9852. * @returns {Object} 转换后的查询结果。
  9853. */
  9854. transformResult: function transformResult(result) {
  9855. if (result.responseText && typeof result.responseText === 'string') {
  9856. result = JSON.parse(result.responseText);
  9857. }
  9858. return result;
  9859. },
  9860. /**
  9861. * @memberOf CommonUtil
  9862. * @description 属性拷贝,不拷贝方法类名(CLASS_NAME)等。
  9863. * @param {Object} [destination] - 拷贝目标。
  9864. * @param {Object} source - 源对象。
  9865. *
  9866. */
  9867. copyAttributes: function copyAttributes(destination, source) {
  9868. destination = destination || {};
  9869. if (source) {
  9870. for (var property in source) {
  9871. var value = source[property];
  9872. if (value !== undefined && property !== 'CLASS_NAME' && typeof value !== 'function') {
  9873. destination[property] = value;
  9874. }
  9875. }
  9876. }
  9877. return destination;
  9878. },
  9879. /**
  9880. * @memberOf CommonUtil
  9881. * @description 将源对象上的属性拷贝到目标对象上。(不拷贝 CLASS_NAME 和方法)
  9882. * @param {Object} [destination] - 目标对象。
  9883. * @param {Object} source - 源对象。
  9884. * @param {Array.<string>} clip - 源对象中禁止拷贝到目标对象的属性,目的是防止目标对象上不可修改的属性被篡改。
  9885. *
  9886. */
  9887. copyAttributesWithClip: function copyAttributesWithClip(destination, source, clip) {
  9888. destination = destination || {};
  9889. if (source) {
  9890. for (var property in source) {
  9891. //去掉禁止拷贝的属性
  9892. var isInClip = false;
  9893. if (clip && clip.length) {
  9894. for (var i = 0, len = clip.length; i < len; i++) {
  9895. if (property === clip[i]) {
  9896. isInClip = true;
  9897. break;
  9898. }
  9899. }
  9900. }
  9901. if (isInClip === true) {
  9902. continue;
  9903. }
  9904. var value = source[property];
  9905. if (value !== undefined && property !== 'CLASS_NAME' && typeof value !== 'function') {
  9906. destination[property] = value;
  9907. }
  9908. }
  9909. }
  9910. return destination;
  9911. },
  9912. /**
  9913. * @memberOf CommonUtil
  9914. * @description 克隆一个 Object 对象。
  9915. * @param {Object} obj - 需要克隆的对象。
  9916. * @returns {Object} 对象的拷贝对象,注意是新的对象,不是指向。
  9917. */
  9918. cloneObject: function cloneObject(obj) {
  9919. // Handle the 3 simple types, and null or undefined
  9920. if (null === obj || 'object' !== _typeof(obj)) {
  9921. return obj;
  9922. }
  9923. // Handle Date
  9924. if (obj instanceof Date) {
  9925. var copy = new Date();
  9926. copy.setTime(obj.getTime());
  9927. return copy;
  9928. }
  9929. // Handle Array
  9930. if (obj instanceof Array) {
  9931. var _copy = obj.slice(0);
  9932. return _copy;
  9933. }
  9934. // Handle Object
  9935. if (obj instanceof Object) {
  9936. var _copy2 = {};
  9937. for (var attr in obj) {
  9938. if (obj.hasOwnProperty(attr)) {
  9939. _copy2[attr] = Util_Util.cloneObject(obj[attr]);
  9940. }
  9941. }
  9942. return _copy2;
  9943. }
  9944. throw new Error("Unable to copy obj! Its type isn't supported.");
  9945. },
  9946. /**
  9947. * @memberOf CommonUtil
  9948. * @description 判断两条线段是不是有交点。
  9949. * @param {GeometryPoint} a1 - 第一条线段的起始节点。
  9950. * @param {GeometryPoint} a2 - 第一条线段的结束节点。
  9951. * @param {GeometryPoint} b1 - 第二条线段的起始节点。
  9952. * @param {GeometryPoint} b2 - 第二条线段的结束节点。
  9953. * @returns {Object} 如果相交返回交点,如果不相交返回两条线段的位置关系。
  9954. */
  9955. lineIntersection: function lineIntersection(a1, a2, b1, b2) {
  9956. var intersectValue = null;
  9957. var k1;
  9958. var k2;
  9959. var b = (b2.x - b1.x) * (a1.y - b1.y) - (b2.y - b1.y) * (a1.x - b1.x);
  9960. var a = (a2.x - a1.x) * (a1.y - b1.y) - (a2.y - a1.y) * (a1.x - b1.x);
  9961. var ab = (b2.y - b1.y) * (a2.x - a1.x) - (b2.x - b1.x) * (a2.y - a1.y);
  9962. //ab==0代表两条线断的斜率一样
  9963. if (ab != 0) {
  9964. k1 = b / ab;
  9965. k2 = a / ab;
  9966. if (k1 >= 0 && k2 <= 1 && k1 <= 1 && k2 >= 0) {
  9967. intersectValue = new Geometry_Geometry.Point(a1.x + k1 * (a2.x - a1.x), a1.y + k1 * (a2.y - a1.y));
  9968. } else {
  9969. intersectValue = 'No Intersection';
  9970. }
  9971. } else {
  9972. if (b == 0 && a == 0) {
  9973. var maxy = Math.max(a1.y, a2.y);
  9974. var miny = Math.min(a1.y, a2.y);
  9975. var maxx = Math.max(a1.x, a2.x);
  9976. var minx = Math.min(a1.x, a2.x);
  9977. 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) {
  9978. intersectValue = 'Coincident'; //重合
  9979. } else {
  9980. intersectValue = 'Parallel'; //平行
  9981. }
  9982. } else {
  9983. intersectValue = 'Parallel'; //平行
  9984. }
  9985. }
  9986. return intersectValue;
  9987. },
  9988. /**
  9989. * @memberOf CommonUtil
  9990. * @description 获取文本外接矩形宽度与高度。
  9991. * @param {ThemeStyle} style - 文本样式。
  9992. * @param {string} text - 文本内容。
  9993. * @param {Object} element - DOM 元素。
  9994. * @returns {Object} 裁剪后的宽度,高度信息。
  9995. */
  9996. getTextBounds: function getTextBounds(style, text, element) {
  9997. document.body.appendChild(element);
  9998. element.style.width = 'auto';
  9999. element.style.height = 'auto';
  10000. if (style.fontSize) {
  10001. element.style.fontSize = style.fontSize;
  10002. }
  10003. if (style.fontFamily) {
  10004. element.style.fontFamily = style.fontFamily;
  10005. }
  10006. if (style.fontWeight) {
  10007. element.style.fontWeight = style.fontWeight;
  10008. }
  10009. element.style.position = 'relative';
  10010. element.style.visibility = 'hidden';
  10011. //fix 在某些情况下,element内的文本变成竖起排列,导致宽度计算不正确的bug
  10012. element.style.display = 'inline-block';
  10013. element.innerHTML = text;
  10014. var textWidth = element.clientWidth;
  10015. var textHeight = element.clientHeight;
  10016. document.body.removeChild(element);
  10017. return {
  10018. textWidth: textWidth,
  10019. textHeight: textHeight
  10020. };
  10021. },
  10022. /**
  10023. * @memberOf CommonUtil
  10024. * @description 获取转换后的path路径。
  10025. * @param {string} path - 待转换的path,包含`{param}`。
  10026. * @param {Object} pathParams - path中待替换的参数。
  10027. * @returns {string} 转换后的path路径。
  10028. */
  10029. convertPath: function convertPath(path, pathParams) {
  10030. if (!pathParams) {
  10031. return path;
  10032. }
  10033. return path.replace(/\{([\w-\.]+)\}/g, function (fullMatch, key) {
  10034. var value;
  10035. if (pathParams.hasOwnProperty(key)) {
  10036. value = paramToString(pathParams[key]);
  10037. } else {
  10038. value = fullMatch;
  10039. }
  10040. return encodeURIComponent(value);
  10041. });
  10042. }
  10043. };
  10044. /**
  10045. * @enum INCHES_PER_UNIT
  10046. * @description 每单位的英尺数。
  10047. * @type {number}
  10048. * @private
  10049. */
  10050. var INCHES_PER_UNIT = {
  10051. inches: 1.0,
  10052. ft: 12.0,
  10053. mi: 63360.0,
  10054. m: 39.3701,
  10055. km: 39370.1,
  10056. dd: 4374754,
  10057. yd: 36
  10058. };
  10059. INCHES_PER_UNIT['in'] = INCHES_PER_UNIT.inches;
  10060. INCHES_PER_UNIT['degrees'] = INCHES_PER_UNIT.dd;
  10061. INCHES_PER_UNIT['nmi'] = 1852 * INCHES_PER_UNIT.m;
  10062. // Units from CS-Map
  10063. var METERS_PER_INCH = 0.0254000508001016002;
  10064. Util_Util.extend(INCHES_PER_UNIT, {
  10065. Inch: INCHES_PER_UNIT.inches,
  10066. Meter: 1.0 / METERS_PER_INCH,
  10067. //EPSG:9001
  10068. Foot: 0.30480060960121920243 / METERS_PER_INCH,
  10069. //EPSG:9003
  10070. IFoot: 0.3048 / METERS_PER_INCH,
  10071. //EPSG:9002
  10072. ClarkeFoot: 0.3047972651151 / METERS_PER_INCH,
  10073. //EPSG:9005
  10074. SearsFoot: 0.30479947153867624624 / METERS_PER_INCH,
  10075. //EPSG:9041
  10076. GoldCoastFoot: 0.30479971018150881758 / METERS_PER_INCH,
  10077. //EPSG:9094
  10078. IInch: 0.0254 / METERS_PER_INCH,
  10079. MicroInch: 0.0000254 / METERS_PER_INCH,
  10080. Mil: 0.0000000254 / METERS_PER_INCH,
  10081. Centimeter: 0.01 / METERS_PER_INCH,
  10082. Kilometer: 1000.0 / METERS_PER_INCH,
  10083. //EPSG:9036
  10084. Yard: 0.91440182880365760731 / METERS_PER_INCH,
  10085. SearsYard: 0.914398414616029 / METERS_PER_INCH,
  10086. //EPSG:9040
  10087. IndianYard: 0.91439853074444079983 / METERS_PER_INCH,
  10088. //EPSG:9084
  10089. IndianYd37: 0.91439523 / METERS_PER_INCH,
  10090. //EPSG:9085
  10091. IndianYd62: 0.9143988 / METERS_PER_INCH,
  10092. //EPSG:9086
  10093. IndianYd75: 0.9143985 / METERS_PER_INCH,
  10094. //EPSG:9087
  10095. IndianFoot: 0.30479951 / METERS_PER_INCH,
  10096. //EPSG:9080
  10097. IndianFt37: 0.30479841 / METERS_PER_INCH,
  10098. //EPSG:9081
  10099. IndianFt62: 0.3047996 / METERS_PER_INCH,
  10100. //EPSG:9082
  10101. IndianFt75: 0.3047995 / METERS_PER_INCH,
  10102. //EPSG:9083
  10103. Mile: 1609.34721869443738887477 / METERS_PER_INCH,
  10104. IYard: 0.9144 / METERS_PER_INCH,
  10105. //EPSG:9096
  10106. IMile: 1609.344 / METERS_PER_INCH,
  10107. //EPSG:9093
  10108. NautM: 1852.0 / METERS_PER_INCH,
  10109. //EPSG:9030
  10110. 'Lat-66': 110943.316488932731 / METERS_PER_INCH,
  10111. 'Lat-83': 110946.25736872234125 / METERS_PER_INCH,
  10112. Decimeter: 0.1 / METERS_PER_INCH,
  10113. Millimeter: 0.001 / METERS_PER_INCH,
  10114. Dekameter: 10.0 / METERS_PER_INCH,
  10115. Decameter: 10.0 / METERS_PER_INCH,
  10116. Hectometer: 100.0 / METERS_PER_INCH,
  10117. GermanMeter: 1.0000135965 / METERS_PER_INCH,
  10118. //EPSG:9031
  10119. CaGrid: 0.999738 / METERS_PER_INCH,
  10120. ClarkeChain: 20.1166194976 / METERS_PER_INCH,
  10121. //EPSG:9038
  10122. GunterChain: 20.11684023368047 / METERS_PER_INCH,
  10123. //EPSG:9033
  10124. BenoitChain: 20.116782494375872 / METERS_PER_INCH,
  10125. //EPSG:9062
  10126. SearsChain: 20.11676512155 / METERS_PER_INCH,
  10127. //EPSG:9042
  10128. ClarkeLink: 0.201166194976 / METERS_PER_INCH,
  10129. //EPSG:9039
  10130. GunterLink: 0.2011684023368047 / METERS_PER_INCH,
  10131. //EPSG:9034
  10132. BenoitLink: 0.20116782494375872 / METERS_PER_INCH,
  10133. //EPSG:9063
  10134. SearsLink: 0.2011676512155 / METERS_PER_INCH,
  10135. //EPSG:9043
  10136. Rod: 5.02921005842012 / METERS_PER_INCH,
  10137. IntnlChain: 20.1168 / METERS_PER_INCH,
  10138. //EPSG:9097
  10139. IntnlLink: 0.201168 / METERS_PER_INCH,
  10140. //EPSG:9098
  10141. Perch: 5.02921005842012 / METERS_PER_INCH,
  10142. Pole: 5.02921005842012 / METERS_PER_INCH,
  10143. Furlong: 201.1684023368046 / METERS_PER_INCH,
  10144. Rood: 3.778266898 / METERS_PER_INCH,
  10145. CapeFoot: 0.3047972615 / METERS_PER_INCH,
  10146. Brealey: 375.0 / METERS_PER_INCH,
  10147. ModAmFt: 0.304812252984505969011938 / METERS_PER_INCH,
  10148. Fathom: 1.8288 / METERS_PER_INCH,
  10149. 'NautM-UK': 1853.184 / METERS_PER_INCH,
  10150. '50kilometers': 50000.0 / METERS_PER_INCH,
  10151. '150kilometers': 150000.0 / METERS_PER_INCH
  10152. });
  10153. //unit abbreviations supported by PROJ.4
  10154. Util_Util.extend(INCHES_PER_UNIT, {
  10155. mm: INCHES_PER_UNIT['Meter'] / 1000.0,
  10156. cm: INCHES_PER_UNIT['Meter'] / 100.0,
  10157. dm: INCHES_PER_UNIT['Meter'] * 100.0,
  10158. km: INCHES_PER_UNIT['Meter'] * 1000.0,
  10159. kmi: INCHES_PER_UNIT['nmi'],
  10160. //International Nautical Mile
  10161. fath: INCHES_PER_UNIT['Fathom'],
  10162. //International Fathom
  10163. ch: INCHES_PER_UNIT['IntnlChain'],
  10164. //International Chain
  10165. link: INCHES_PER_UNIT['IntnlLink'],
  10166. //International Link
  10167. 'us-in': INCHES_PER_UNIT['inches'],
  10168. //U.S. Surveyor's Inch
  10169. 'us-ft': INCHES_PER_UNIT['Foot'],
  10170. //U.S. Surveyor's Foot
  10171. 'us-yd': INCHES_PER_UNIT['Yard'],
  10172. //U.S. Surveyor's Yard
  10173. 'us-ch': INCHES_PER_UNIT['GunterChain'],
  10174. //U.S. Surveyor's Chain
  10175. 'us-mi': INCHES_PER_UNIT['Mile'],
  10176. //U.S. Surveyor's Statute Mile
  10177. 'ind-yd': INCHES_PER_UNIT['IndianYd37'],
  10178. //Indian Yard
  10179. 'ind-ft': INCHES_PER_UNIT['IndianFt37'],
  10180. //Indian Foot
  10181. 'ind-ch': 20.11669506 / METERS_PER_INCH //Indian Chain
  10182. });
  10183. //将服务端的地图单位转成SuperMap的地图单位
  10184. INCHES_PER_UNIT['degree'] = INCHES_PER_UNIT.dd;
  10185. INCHES_PER_UNIT['meter'] = INCHES_PER_UNIT.m;
  10186. INCHES_PER_UNIT['foot'] = INCHES_PER_UNIT.ft;
  10187. INCHES_PER_UNIT['inch'] = INCHES_PER_UNIT.inches;
  10188. INCHES_PER_UNIT['mile'] = INCHES_PER_UNIT.mi;
  10189. INCHES_PER_UNIT['kilometer'] = INCHES_PER_UNIT.km;
  10190. INCHES_PER_UNIT['yard'] = INCHES_PER_UNIT.yd;
  10191. function paramToString(param) {
  10192. if (param == undefined || param == null) {
  10193. return '';
  10194. }
  10195. if (param instanceof Date) {
  10196. return param.toJSON();
  10197. }
  10198. if (canBeJsonified(param)) {
  10199. return JSON.stringify(param);
  10200. }
  10201. return param.toString();
  10202. }
  10203. function canBeJsonified(str) {
  10204. if (typeof str !== 'string' && _typeof(str) !== 'object') {
  10205. return false;
  10206. }
  10207. try {
  10208. var type = str.toString();
  10209. return type === '[object Object]' || type === '[object Array]';
  10210. } catch (err) {
  10211. return false;
  10212. }
  10213. }
  10214. ;// CONCATENATED MODULE: ./src/common/commontypes/LonLat.js
  10215. function LonLat_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  10216. function LonLat_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  10217. function LonLat_createClass(Constructor, protoProps, staticProps) { if (protoProps) LonLat_defineProperties(Constructor.prototype, protoProps); if (staticProps) LonLat_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  10218. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  10219. * This program are made available under the terms of the Apache License, Version 2.0
  10220. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  10221. /**
  10222. * @class LonLat
  10223. * @category BaseTypes Geometry
  10224. * @classdesc 这个类用来表示经度和纬度对。
  10225. * @param {number|Array.<number>} [lon=0.0] - 地图单位上的 X 轴坐标或者横纵坐标组成的数组;如果地图是地理投影,则此值是经度,否则,此值是地图地理位置的 x 坐标。
  10226. * @param {number} [lat=0.0] - 地图单位上的 Y 轴坐标,如果地图是地理投影,则此值是纬度,否则,此值是地图地理位置的 y 坐标。
  10227. * @example
  10228. * var lonLat = new LonLat(30,45);
  10229. * @usage
  10230. */
  10231. var LonLat = /*#__PURE__*/function () {
  10232. function LonLat(lon, lat) {
  10233. LonLat_classCallCheck(this, LonLat);
  10234. if (Util_Util.isArray(lon)) {
  10235. lat = lon[1];
  10236. lon = lon[0];
  10237. }
  10238. /**
  10239. * @member {number} [LonLat.prototype.lon=0.0]
  10240. * @description 地图的单位的 X 轴(横轴)坐标。
  10241. */
  10242. this.lon = lon ? Util_Util.toFloat(lon) : 0.0;
  10243. /**
  10244. * @member {number} [LonLat.prototype.lat=0.0]
  10245. * @description 地图的单位的 Y 轴(纵轴)坐标。
  10246. */
  10247. this.lat = lat ? Util_Util.toFloat(lat) : 0.0;
  10248. this.CLASS_NAME = "SuperMap.LonLat";
  10249. }
  10250. /**
  10251. * @function LonLat.prototype.toString
  10252. * @description 返回此对象的字符串形式。
  10253. * @example
  10254. * var lonLat = new LonLat(100,50);
  10255. * var str = lonLat.toString();
  10256. * @returns {string} 例如: "lon=100,lat=50"。
  10257. */
  10258. LonLat_createClass(LonLat, [{
  10259. key: "toString",
  10260. value: function toString() {
  10261. return "lon=" + this.lon + ",lat=" + this.lat;
  10262. }
  10263. /**
  10264. * @function LonLat.prototype.toShortString
  10265. * @description 将经度纬度转换成简单字符串。
  10266. * @example
  10267. * var lonLat = new LonLat(100,50);
  10268. * var str = lonLat.toShortString();
  10269. * @returns {string} 处理后的经纬度字符串。例如:"100,50"。
  10270. */
  10271. }, {
  10272. key: "toShortString",
  10273. value: function toShortString() {
  10274. return this.lon + "," + this.lat;
  10275. }
  10276. /**
  10277. * @function LonLat.prototype.clone
  10278. * @description 复制坐标对象,并返回复制后的新对象。
  10279. * @example
  10280. * var lonLat1 = new LonLat(100,50);
  10281. * var lonLat2 = lonLat1.clone();
  10282. * @returns {LonLat} 相同坐标值的新的坐标对象。
  10283. */
  10284. }, {
  10285. key: "clone",
  10286. value: function clone() {
  10287. return new LonLat(this.lon, this.lat);
  10288. }
  10289. /**
  10290. * @function LonLat.prototype.add
  10291. * @description 在已有坐标对象的经纬度基础上加上新的坐标经纬度,并返回新的坐标对象。
  10292. * @example
  10293. * var lonLat1 = new LonLat(100,50);
  10294. * //lonLat2 是新的对象
  10295. * var lonLat2 = lonLat1.add(100,50);
  10296. * @param {number} lon - 经度参数。
  10297. * @param {number} lat - 纬度参数。
  10298. * @returns {LonLat} 新的 LonLat 对象,此对象的经纬度是由传入的经纬度与当前的经纬度相加所得。
  10299. */
  10300. }, {
  10301. key: "add",
  10302. value: function add(lon, lat) {
  10303. if (lon == null || lat == null) {
  10304. throw new TypeError('LonLat.add cannot receive null values');
  10305. }
  10306. return new LonLat(this.lon + Util_Util.toFloat(lon), this.lat + Util_Util.toFloat(lat));
  10307. }
  10308. /**
  10309. * @function LonLat.prototype.equals
  10310. * @description 判断两个坐标对象是否相等。
  10311. * @example
  10312. * var lonLat1 = new LonLat(100,50);
  10313. * var lonLat2 = new LonLat(100,50);
  10314. * var isEquals = lonLat1.equals(lonLat2);
  10315. * @param {LonLat} ll - 需要进行比较的坐标对象。
  10316. * @returns {boolean} 如果LonLat对象的经纬度和传入的经纬度一致则返回true,不一
  10317. * 致或传入的ll参数为NULL则返回false。
  10318. */
  10319. }, {
  10320. key: "equals",
  10321. value: function equals(ll) {
  10322. var equals = false;
  10323. if (ll != null) {
  10324. equals = this.lon === ll.lon && this.lat === ll.lat || isNaN(this.lon) && isNaN(this.lat) && isNaN(ll.lon) && isNaN(ll.lat);
  10325. }
  10326. return equals;
  10327. }
  10328. /**
  10329. * @function LonLat.prototype.wrapDateLine
  10330. * @description 通过传入的范围对象对坐标对象转换到该范围内。
  10331. * 如果经度小于给定范围最小精度,则在原经度基础上加上范围宽度,直到精度在范围内为止,如果经度大于给定范围则在原经度基础上减去范围宽度。
  10332. * 即指将不在经度范围内的坐标转换到范围以内(只会转换 lon,不会转换 lat,主要用于转移到日界线以内)。
  10333. * @example
  10334. * var lonLat1 = new LonLat(420,50);
  10335. * var lonLat2 = lonLat1.wrapDateLine(
  10336. * new Bounds(-180,-90,180,90)
  10337. * );
  10338. * @param {Bounds} maxExtent - 最大边界的范围。
  10339. * @returns {LonLat} 将坐标转换到范围对象以内,并返回新的坐标。
  10340. */
  10341. }, {
  10342. key: "wrapDateLine",
  10343. value: function wrapDateLine(maxExtent) {
  10344. var newLonLat = this.clone();
  10345. if (maxExtent) {
  10346. //shift right?
  10347. while (newLonLat.lon < maxExtent.left) {
  10348. newLonLat.lon += maxExtent.getWidth();
  10349. }
  10350. //shift left?
  10351. while (newLonLat.lon > maxExtent.right) {
  10352. newLonLat.lon -= maxExtent.getWidth();
  10353. }
  10354. }
  10355. return newLonLat;
  10356. }
  10357. /**
  10358. *
  10359. * @function LonLat.prototype.destroy
  10360. * @description 销毁此对象。
  10361. * 销毁后此对象的所有属性为 null,而不是初始值。
  10362. * @example
  10363. * var lonLat = new LonLat(100,50);
  10364. * lonLat.destroy();
  10365. */
  10366. }, {
  10367. key: "destroy",
  10368. value: function destroy() {
  10369. this.lon = null;
  10370. this.lat = null;
  10371. }
  10372. /**
  10373. * @function LonLat.fromString
  10374. * @description 通过字符串生成一个 {@link LonLat} 对象。
  10375. * @example
  10376. * var str = "100,50";
  10377. * var lonLat = LonLat.fromString(str);
  10378. * @param {string} str - 字符串的格式:Lon+","+Lat。如:"100,50"。
  10379. * @returns {LonLat} {@link LonLat} 对象。
  10380. */
  10381. }], [{
  10382. key: "fromString",
  10383. value: function fromString(str) {
  10384. var pair = str.split(",");
  10385. return new LonLat(pair[0], pair[1]);
  10386. }
  10387. /**
  10388. * @function LonLat.fromArray
  10389. * @description 通过数组生成一个 {@link LonLat} 对象。
  10390. * @param {Array.<number>} arr - 数组的格式,长度只能为2,:[Lon,Lat]。如:[5,-42]。
  10391. * @returns {LonLat} {@link LonLat} 对象。
  10392. */
  10393. }, {
  10394. key: "fromArray",
  10395. value: function fromArray(arr) {
  10396. var gotArr = Util_Util.isArray(arr),
  10397. lon = gotArr && arr[0],
  10398. lat = gotArr && arr[1];
  10399. return new LonLat(lon, lat);
  10400. }
  10401. }]);
  10402. return LonLat;
  10403. }();
  10404. ;// CONCATENATED MODULE: ./src/common/commontypes/Bounds.js
  10405. function Bounds_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  10406. function Bounds_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  10407. function Bounds_createClass(Constructor, protoProps, staticProps) { if (protoProps) Bounds_defineProperties(Constructor.prototype, protoProps); if (staticProps) Bounds_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  10408. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  10409. * This program are made available under the terms of the Apache License, Version 2.0
  10410. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  10411. /**
  10412. * @class Bounds
  10413. * @deprecatedclass SuperMap.Bounds
  10414. * @category BaseTypes Geometry
  10415. * @classdesc 表示边界类实例。使用 bounds 之前需要设置 left,bottom,right,top 四个属性,这些属性的初始值为 null。
  10416. * @param {number|Array.<number>} [left] - 如果是number,则表示左边界,注意考虑宽度,理论上小于 right 值。如果是数组,则表示 [left, bottom, right, top] 左下右上组成的数组。
  10417. * @param {number} [bottom] - 下边界。考虑高度,理论上小于 top 值。
  10418. * @param {number} [right] - 右边界。
  10419. * @param {number} [top] - 上边界。
  10420. * @example
  10421. * var bounds = new Bounds();
  10422. * bounds.extend(new LonLat(4,5));
  10423. * bounds.extend(new LonLat(5,6));
  10424. * bounds.toBBOX(); // returns 4,5,5,6
  10425. * @usage
  10426. */
  10427. var Bounds = /*#__PURE__*/function () {
  10428. function Bounds(left, bottom, right, top) {
  10429. Bounds_classCallCheck(this, Bounds);
  10430. if (Util_Util.isArray(left)) {
  10431. top = left[3];
  10432. right = left[2];
  10433. bottom = left[1];
  10434. left = left[0];
  10435. }
  10436. /**
  10437. * @member {number} Bounds.prototype.left
  10438. * @description 最小的水平坐标系。
  10439. */
  10440. this.left = left != null ? Util_Util.toFloat(left) : this.left;
  10441. /**
  10442. * @member {number} Bounds.prototype.bottom
  10443. * @description 最小的垂直坐标系。
  10444. */
  10445. this.bottom = bottom != null ? Util_Util.toFloat(bottom) : this.bottom;
  10446. /**
  10447. * @member {number} Bounds.prototype.right
  10448. * @description 最大的水平坐标系。
  10449. */
  10450. this.right = right != null ? Util_Util.toFloat(right) : this.right;
  10451. /**
  10452. * @member {number} Bounds.prototype.top
  10453. * @description 最大的垂直坐标系。
  10454. */
  10455. this.top = top != null ? Util_Util.toFloat(top) : this.top;
  10456. /**
  10457. * @member {LonLat} Bounds.prototype.centerLonLat
  10458. * @description bounds 的地图空间的中心点。用 getCenterLonLat() 获得。
  10459. */
  10460. this.centerLonLat = null;
  10461. this.CLASS_NAME = "SuperMap.Bounds";
  10462. }
  10463. /**
  10464. * @function Bounds.prototype.clone
  10465. * @description 复制当前 bounds 对象。
  10466. * @example
  10467. * var bounds1 = new Bounds(-180,-90,180,90);
  10468. * var bounds2 = bounds1.clone();
  10469. * @returns {Bounds} 克隆后的 bounds。
  10470. */
  10471. Bounds_createClass(Bounds, [{
  10472. key: "clone",
  10473. value: function clone() {
  10474. return new Bounds(this.left, this.bottom, this.right, this.top);
  10475. }
  10476. /**
  10477. * @function Bounds.prototype.equals
  10478. * @description 判断两个 bounds 对象是否相等。
  10479. * @example
  10480. * var bounds1 = new Bounds(-180,-90,180,90);
  10481. * var bounds2 = new Bounds(-180,-90,180,90);
  10482. * var isEquals = bounds1.equals(bounds2);
  10483. * @param {Bounds} bounds - 需要进行计较的 bounds。
  10484. * @returns {boolean} 如果 bounds 对象的边和传入的 bounds 一致则返回 true,不一致或传入的 bounds 参数为 NULL 则返回 false。
  10485. */
  10486. }, {
  10487. key: "equals",
  10488. value: function equals(bounds) {
  10489. var equals = false;
  10490. if (bounds != null) {
  10491. equals = this.left === bounds.left && this.right === bounds.right && this.top === bounds.top && this.bottom === bounds.bottom;
  10492. }
  10493. return equals;
  10494. }
  10495. /**
  10496. * @function Bounds.prototype.toString
  10497. * @description 返回此对象的字符串形式。
  10498. * @example
  10499. * var bounds = new Bounds(-180,-90,180,90);
  10500. * var str = bounds.toString();
  10501. * @returns {string} 边界对象的字符串表示形式(left,bottom,right,top),例如: "-180,-90,180,90"。
  10502. */
  10503. }, {
  10504. key: "toString",
  10505. value: function toString() {
  10506. return [this.left, this.bottom, this.right, this.top].join(",");
  10507. }
  10508. /**
  10509. * @function Bounds.prototype.toArray
  10510. * @description 边界对象的数组表示形式。
  10511. * @example
  10512. * var bounds = new Bounds(-180,-90,100,80);
  10513. * //array1 = [-180,-90,100,80];
  10514. * var array1 = bounds.toArray();
  10515. * //array1 = [-90,-180,80,100];
  10516. * var array2 = bounds.toArray(true);
  10517. * @param {boolean} [reverseAxisOrder=false] - 是否反转轴顺序。
  10518. * 如果设为 true,则倒转顺序(bottom,left,top,right),否则按正常轴顺序(left,bottom,right,top)。
  10519. * @returns {Array.<number>} left, bottom, right, top 数组。
  10520. */
  10521. }, {
  10522. key: "toArray",
  10523. value: function toArray(reverseAxisOrder) {
  10524. if (reverseAxisOrder === true) {
  10525. return [this.bottom, this.left, this.top, this.right];
  10526. } else {
  10527. return [this.left, this.bottom, this.right, this.top];
  10528. }
  10529. }
  10530. /**
  10531. * @function Bounds.prototype.toBBOX
  10532. * @description 取小数点后 decimal 位数字进行四舍五入再转换为 BBOX 字符串。
  10533. * @example
  10534. * var bounds = new Bounds(-1.1234567,-1.7654321,1.4444444,1.5555555);
  10535. * //str1 = "-1.123457,-1.765432,1.444444,1.555556";
  10536. * var str1 = bounds.toBBOX();
  10537. * //str2 = "-1.1,-1.8,1.4,1.6";
  10538. * var str2 = bounds.toBBOX(1);
  10539. * //str2 = "-1.8,-1.1,1.6,1.4";
  10540. * var str2 = bounds.toBBOX(1,true);
  10541. * @param {number} [decimal=6] - 边界方位坐标的有效数字个数。
  10542. * @param {boolean} [reverseAxisOrder=false] - 是否是反转轴顺序。
  10543. * 如果设为true,则倒转顺序(bottom,left,top,right),否则按正常轴顺序(left,bottom,right,top)。
  10544. * @returns {string} 边界对象的字符串表示形式,如:"5,42,10,45"。
  10545. */
  10546. }, {
  10547. key: "toBBOX",
  10548. value: function toBBOX(decimal, reverseAxisOrder) {
  10549. if (decimal == null) {
  10550. decimal = 6;
  10551. }
  10552. var mult = Math.pow(10, decimal);
  10553. var xmin = Math.round(this.left * mult) / mult;
  10554. var ymin = Math.round(this.bottom * mult) / mult;
  10555. var xmax = Math.round(this.right * mult) / mult;
  10556. var ymax = Math.round(this.top * mult) / mult;
  10557. if (reverseAxisOrder === true) {
  10558. return ymin + "," + xmin + "," + ymax + "," + xmax;
  10559. } else {
  10560. return xmin + "," + ymin + "," + xmax + "," + ymax;
  10561. }
  10562. }
  10563. ///**
  10564. // * @function Bounds.prototype.toGeometry
  10565. // * @description 基于当前边界范围创建一个新的多边形对象。
  10566. // * @example
  10567. // * var bounds = new Bounds(-180,-90,100,80);
  10568. // * // Polygon对象
  10569. // * var geo = bounds.toGeometry();
  10570. // * @returns {GeometryPolygon} 基于当前 bounds 坐标创建的新的多边形。
  10571. // */
  10572. // toGeometry() {
  10573. // return new Polygon([
  10574. // new LinearRing([
  10575. // new Point(this.left, this.bottom),
  10576. // new Point(this.right, this.bottom),
  10577. // new Point(this.right, this.top),
  10578. // new Point(this.left, this.top)
  10579. // ])
  10580. // ]);
  10581. // }
  10582. /**
  10583. * @function Bounds.prototype.getWidth
  10584. * @description 获取 bounds 的宽度。
  10585. * @example
  10586. * var bounds = new Bounds(-180,-90,100,80);
  10587. * //width = 280;
  10588. * var width = bounds.getWidth();
  10589. * @returns {number} 获取当前 bounds 的宽度(right 减去 left)。
  10590. */
  10591. }, {
  10592. key: "getWidth",
  10593. value: function getWidth() {
  10594. return this.right - this.left;
  10595. }
  10596. /**
  10597. * @function Bounds.prototype.getHeight
  10598. * @description 获取 bounds 的高度。
  10599. * @example
  10600. * var bounds = new Bounds(-180,-90,100,80);
  10601. * //height = 170;
  10602. * var height = bounds.getHeight();
  10603. * @returns {number} 边界高度(top 减去 bottom)。
  10604. */
  10605. }, {
  10606. key: "getHeight",
  10607. value: function getHeight() {
  10608. return this.top - this.bottom;
  10609. }
  10610. /**
  10611. * @function Bounds.prototype.getSize
  10612. * @description 获取边框大小。
  10613. * @example
  10614. * var bounds = new Bounds(-180,-90,100,80);
  10615. * var size = bounds.getSize();
  10616. * @returns {Size} 边框大小。
  10617. */
  10618. }, {
  10619. key: "getSize",
  10620. value: function getSize() {
  10621. return new Size(this.getWidth(), this.getHeight());
  10622. }
  10623. /**
  10624. * @function Bounds.prototype.getCenterPixel
  10625. * @description 获取像素格式的范围中心点。
  10626. * @example
  10627. * var bounds = new Bounds(-180,-90,100,80);
  10628. * var pixel = bounds.getCenterPixel();
  10629. * @returns {Pixel} 像素格式的当前范围的中心点。
  10630. */
  10631. }, {
  10632. key: "getCenterPixel",
  10633. value: function getCenterPixel() {
  10634. return new Pixel((this.left + this.right) / 2, (this.bottom + this.top) / 2);
  10635. }
  10636. /**
  10637. * @function Bounds.prototype.getCenterLonLat
  10638. * @description 获取地理格式的范围中心点。
  10639. * @example
  10640. * var bounds = new Bounds(-180,-90,100,80);
  10641. * var lonlat = bounds.getCenterLonLat();
  10642. * @returns {LonLat} 当前地理范围的中心点。
  10643. */
  10644. }, {
  10645. key: "getCenterLonLat",
  10646. value: function getCenterLonLat() {
  10647. if (!this.centerLonLat) {
  10648. this.centerLonLat = new LonLat((this.left + this.right) / 2, (this.bottom + this.top) / 2);
  10649. }
  10650. return this.centerLonLat;
  10651. }
  10652. /**
  10653. * @function Bounds.prototype.scale
  10654. * @description 按照比例扩大/缩小出一个新的 bounds。
  10655. * @example
  10656. * var bounds = new Bounds(-50,-50,40,40);
  10657. * var bounds2 = bounds.scale(2);
  10658. * @param {number} [ratio=1] - 需要扩大的比例。
  10659. * @param {(Pixel|LonLat)} [origin] - 扩大时的基准点,默认为当前 bounds 的中心点。
  10660. * @returns {Bounds} 通过 ratio、origin 计算得到的新的边界范围。
  10661. */
  10662. }, {
  10663. key: "scale",
  10664. value: function scale(ratio, origin) {
  10665. ratio = ratio ? ratio : 1;
  10666. if (origin == null) {
  10667. origin = this.getCenterLonLat();
  10668. }
  10669. var origx, origy;
  10670. // get origin coordinates
  10671. if (origin.CLASS_NAME === "SuperMap.LonLat") {
  10672. origx = origin.lon;
  10673. origy = origin.lat;
  10674. } else {
  10675. origx = origin.x;
  10676. origy = origin.y;
  10677. }
  10678. var left = (this.left - origx) * ratio + origx;
  10679. var bottom = (this.bottom - origy) * ratio + origy;
  10680. var right = (this.right - origx) * ratio + origx;
  10681. var top = (this.top - origy) * ratio + origy;
  10682. return new Bounds(left, bottom, right, top);
  10683. }
  10684. /**
  10685. * @function Bounds.prototype.add
  10686. * @description 在当前的 Bounds 上按照传入的坐标点进行平移,返回新的范围。
  10687. * @example
  10688. * var bounds1 = new Bounds(-50,-50,40,40);
  10689. * //bounds2 是新的 bounds
  10690. * var bounds2 = bounds.add(20,10);
  10691. * @param {number} x - 坐标点的 x 坐标。
  10692. * @param {number} y - 坐标点的 y 坐标。
  10693. * @returns {Bounds} 新的 bounds,此 bounds 的坐标是由传入的 x,y 参数与当前 bounds 坐标计算所得。
  10694. */
  10695. }, {
  10696. key: "add",
  10697. value: function add(x, y) {
  10698. if (x == null || y == null) {
  10699. throw new TypeError('Bounds.add cannot receive null values');
  10700. }
  10701. return new Bounds(this.left + x, this.bottom + y, this.right + x, this.top + y);
  10702. }
  10703. /**
  10704. * @function Bounds.prototype.extend
  10705. * @description 在当前 bounds 上扩展 bounds,支持 point,lonlat 和 bounds。扩展后的 bounds 的范围是两者的结合。
  10706. * @example
  10707. * var bounds1 = new Bounds(-50,-50,40,40);
  10708. * //bounds 改变
  10709. * bounds.extend(new LonLat(50,60));
  10710. * @param {GeometryPoint|LonLat|Bounds} object - 可以是 point、lonlat 和 bounds。
  10711. */
  10712. }, {
  10713. key: "extend",
  10714. value: function extend(object) {
  10715. var bounds = null;
  10716. if (object) {
  10717. // clear cached center location
  10718. switch (object.CLASS_NAME) {
  10719. case "SuperMap.LonLat":
  10720. bounds = new Bounds(object.lon, object.lat, object.lon, object.lat);
  10721. break;
  10722. case "SuperMap.Geometry.Point":
  10723. bounds = new Bounds(object.x, object.y, object.x, object.y);
  10724. break;
  10725. case "SuperMap.Bounds":
  10726. bounds = object;
  10727. break;
  10728. }
  10729. if (bounds) {
  10730. this.centerLonLat = null;
  10731. if (this.left == null || bounds.left < this.left) {
  10732. this.left = bounds.left;
  10733. }
  10734. if (this.bottom == null || bounds.bottom < this.bottom) {
  10735. this.bottom = bounds.bottom;
  10736. }
  10737. if (this.right == null || bounds.right > this.right) {
  10738. this.right = bounds.right;
  10739. }
  10740. if (this.top == null || bounds.top > this.top) {
  10741. this.top = bounds.top;
  10742. }
  10743. }
  10744. }
  10745. }
  10746. /**
  10747. * @function Bounds.prototype.containsLonLat
  10748. * @description 判断传入的坐标是否在范围内。
  10749. * @example
  10750. * var bounds1 = new Bounds(-50,-50,40,40);
  10751. * //isContains1 = true
  10752. * //这里的第二个参数可以直接为 boolean 类型,也就是inclusive
  10753. * var isContains1 = bounds.containsLonLat(new LonLat(40,40),true);
  10754. *
  10755. * //(40,40)在范围内,同样(40+360,40)也在范围内
  10756. * var bounds2 = new Bounds(-50,-50,40,40);
  10757. * //isContains2 = true;
  10758. * var isContains2 = bounds2.containsLonLat(
  10759. * new LonLat(400,40),
  10760. * {
  10761. * inclusive:true,
  10762. * //全球的范围
  10763. * worldBounds: new Bounds(-180,-90,180,90)
  10764. * }
  10765. * );
  10766. * @param {(LonLat|Object)} ll - <LonLat> 对象或者是一个包含 'lon' 与 'lat' 属性的对象。
  10767. * @param {Object} options - 可选参数。
  10768. * @param {boolean} [options.inclusive=true] - 是否包含边界。
  10769. * @param {Bounds} [options.worldBounds] - 如果提供 worldBounds 参数, 如果 ll 参数提供的坐标超出了世界边界(worldBounds),
  10770. * 但是通过日界线的转化可以被包含, 它将被认为是包含在该范围内的。
  10771. * @returns {boolean} 传入坐标是否包含在范围内。
  10772. */
  10773. }, {
  10774. key: "containsLonLat",
  10775. value: function containsLonLat(ll, options) {
  10776. if (typeof options === "boolean") {
  10777. options = {
  10778. inclusive: options
  10779. };
  10780. }
  10781. options = options || {};
  10782. var contains = this.contains(ll.lon, ll.lat, options.inclusive),
  10783. worldBounds = options.worldBounds;
  10784. //日界线以外的也有可能算包含,
  10785. if (worldBounds && !contains) {
  10786. var worldWidth = worldBounds.getWidth();
  10787. var worldCenterX = (worldBounds.left + worldBounds.right) / 2;
  10788. //这一步很关键
  10789. var worldsAway = Math.round((ll.lon - worldCenterX) / worldWidth);
  10790. contains = this.containsLonLat({
  10791. lon: ll.lon - worldsAway * worldWidth,
  10792. lat: ll.lat
  10793. }, {
  10794. inclusive: options.inclusive
  10795. });
  10796. }
  10797. return contains;
  10798. }
  10799. /**
  10800. * @function Bounds.prototype.containsPixel
  10801. * @description 判断传入的像素是否在范围内。直接匹配大小,不涉及像素和地理转换。
  10802. * @example
  10803. * var bounds = new Bounds(-50,-50,40,40);
  10804. * //isContains = true
  10805. * var isContains = bounds.containsPixel(new Pixel(40,40),true);
  10806. * @param {Pixel} px - 提供的像素参数。
  10807. * @param {boolean} [inclusive=true] - 是否包含边界。
  10808. * @returns {boolean} 传入的 pixel 在当前边界范围之内。
  10809. */
  10810. }, {
  10811. key: "containsPixel",
  10812. value: function containsPixel(px, inclusive) {
  10813. return this.contains(px.x, px.y, inclusive);
  10814. }
  10815. /**
  10816. * @function Bounds.prototype.contains
  10817. * @description 判断传入的 x,y 坐标值是否在范围内。
  10818. * @example
  10819. * var bounds = new Bounds(-50,-50,40,40);
  10820. * //isContains = true
  10821. * var isContains = bounds.contains(40,40,true);
  10822. * @param {number} x - x 坐标值。
  10823. * @param {number} y - y 坐标值。
  10824. * @param {boolean} [inclusive=true] - 是否包含边界。
  10825. * @returns {boolean} 传入的 x,y 坐标是否在当前范围内。
  10826. */
  10827. }, {
  10828. key: "contains",
  10829. value: function contains(x, y, inclusive) {
  10830. //set default
  10831. if (inclusive == null) {
  10832. inclusive = true;
  10833. }
  10834. if (x == null || y == null) {
  10835. return false;
  10836. }
  10837. //x = Util.toFloat(x);
  10838. //y = Util.toFloat(y);
  10839. var contains = false;
  10840. if (inclusive) {
  10841. contains = x >= this.left && x <= this.right && y >= this.bottom && y <= this.top;
  10842. } else {
  10843. contains = x > this.left && x < this.right && y > this.bottom && y < this.top;
  10844. }
  10845. return contains;
  10846. }
  10847. /**
  10848. * @function Bounds.prototype.intersectsBounds
  10849. * @description 判断目标边界范围是否与当前边界范围相交。如果两个边界范围中的任意边缘相交或者一个边界包含了另外一个就认为这两个边界相交。
  10850. * @example
  10851. * var bounds = new Bounds(-180,-90,100,80);
  10852. * var isIntersects = bounds.intersectsBounds(
  10853. * new Bounds(-170,-90,120,80)
  10854. * );
  10855. * @param {Bounds} bounds - 目标边界。
  10856. * @param {Object} options - 参数。
  10857. * @param {boolean} [options.inclusive=true] - 边缘重合也看成相交。如果是false,两个边界范围没有重叠部分仅仅是在边缘相接(重合),这种情况被认为没有相交。
  10858. * @param {Bounds} [options.worldBounds] - 提供了 worldBounds 参数,如果他们相交时是在全球范围内,两个边界将被视为相交。这仅适用于交叉或完全不在世界范围的边界。
  10859. * @returns {boolean} 传入的 bounds 对象与当前 bounds 相交。
  10860. */
  10861. }, {
  10862. key: "intersectsBounds",
  10863. value: function intersectsBounds(bounds, options) {
  10864. if (typeof options === "boolean") {
  10865. options = {
  10866. inclusive: options
  10867. };
  10868. }
  10869. options = options || {};
  10870. if (options.worldBounds) {
  10871. var self = this.wrapDateLine(options.worldBounds);
  10872. bounds = bounds.wrapDateLine(options.worldBounds);
  10873. } else {
  10874. self = this;
  10875. }
  10876. if (options.inclusive == null) {
  10877. options.inclusive = true;
  10878. }
  10879. var intersects = false;
  10880. var mightTouch = self.left === bounds.right || self.right === bounds.left || self.top === bounds.bottom || self.bottom === bounds.top;
  10881. // if the two bounds only touch at an edge, and inclusive is false,
  10882. // then the bounds don't *really* intersect.
  10883. if (options.inclusive || !mightTouch) {
  10884. // otherwise, if one of the boundaries even partially contains another,
  10885. // inclusive of the edges, then they do intersect.
  10886. var inBottom = bounds.bottom >= self.bottom && bounds.bottom <= self.top || self.bottom >= bounds.bottom && self.bottom <= bounds.top;
  10887. var inTop = bounds.top >= self.bottom && bounds.top <= self.top || self.top > bounds.bottom && self.top < bounds.top;
  10888. var inLeft = bounds.left >= self.left && bounds.left <= self.right || self.left >= bounds.left && self.left <= bounds.right;
  10889. var inRight = bounds.right >= self.left && bounds.right <= self.right || self.right >= bounds.left && self.right <= bounds.right;
  10890. intersects = (inBottom || inTop) && (inLeft || inRight);
  10891. }
  10892. // document me
  10893. if (options.worldBounds && !intersects) {
  10894. var world = options.worldBounds;
  10895. var width = world.getWidth();
  10896. var selfCrosses = !world.containsBounds(self);
  10897. var boundsCrosses = !world.containsBounds(bounds);
  10898. if (selfCrosses && !boundsCrosses) {
  10899. bounds = bounds.add(-width, 0);
  10900. intersects = self.intersectsBounds(bounds, {
  10901. inclusive: options.inclusive
  10902. });
  10903. } else if (boundsCrosses && !selfCrosses) {
  10904. self = self.add(-width, 0);
  10905. intersects = bounds.intersectsBounds(self, {
  10906. inclusive: options.inclusive
  10907. });
  10908. }
  10909. }
  10910. return intersects;
  10911. }
  10912. /**
  10913. * @function Bounds.prototype.containsBounds
  10914. * @description 判断目标边界是否被当前边界包含在内。
  10915. * @example
  10916. * var bounds = new Bounds(-180,-90,100,80);
  10917. * var isContains = bounds.containsBounds(
  10918. * new Bounds(-170,-90,100,80),true,true
  10919. * );
  10920. * @param {Bounds} bounds - 目标边界。
  10921. * @param {boolean} [partial=false] - 目标边界的任意部分都包含在当前边界中则被认为是包含关系。
  10922. * 如果设为 false,整个目标边界全部被包含在当前边界范围内。
  10923. * @param {boolean} [inclusive=true] - 边缘共享是否被视为包含。
  10924. * @returns {boolean} 传入的边界是否被当前边界包含。
  10925. */
  10926. }, {
  10927. key: "containsBounds",
  10928. value: function containsBounds(bounds, partial, inclusive) {
  10929. if (partial == null) {
  10930. partial = false;
  10931. }
  10932. if (inclusive == null) {
  10933. inclusive = true;
  10934. }
  10935. var bottomLeft = this.contains(bounds.left, bounds.bottom, inclusive);
  10936. var bottomRight = this.contains(bounds.right, bounds.bottom, inclusive);
  10937. var topLeft = this.contains(bounds.left, bounds.top, inclusive);
  10938. var topRight = this.contains(bounds.right, bounds.top, inclusive);
  10939. return partial ? bottomLeft || bottomRight || topLeft || topRight : bottomLeft && bottomRight && topLeft && topRight;
  10940. }
  10941. /**
  10942. * @function Bounds.prototype.determineQuadrant
  10943. * @description 判断传入坐标是否在 bounds 范围内的象限。以 bounds 中心点为坐标原点。
  10944. * @example
  10945. * var bounds = new Bounds(-180,-90,100,80);
  10946. * //str = "tr";
  10947. * var str = bounds.determineQuadrant(
  10948. * new LonLat(20,20)
  10949. * );
  10950. * @param {LonLat} lonlat - 传入的坐标对象。
  10951. * @returns {string} 传入坐标所在的象限("br" "tr" "tl" "bl" 分别对应"右下","右上","左上" "左下")。
  10952. */
  10953. }, {
  10954. key: "determineQuadrant",
  10955. value: function determineQuadrant(lonlat) {
  10956. var quadrant = "";
  10957. var center = this.getCenterLonLat();
  10958. quadrant += lonlat.lat < center.lat ? "b" : "t";
  10959. quadrant += lonlat.lon < center.lon ? "l" : "r";
  10960. return quadrant;
  10961. }
  10962. /**
  10963. * @function Bounds.prototype.wrapDateLine
  10964. * @description 将当前 bounds 移动到最大边界范围内部(所谓的内部是相交或者内部)。
  10965. * @example
  10966. * var bounds = new Bounds(380,-40,400,-20);
  10967. * var maxExtent = new Bounds(-180,-90,100,80);
  10968. * //新的bounds
  10969. * var newBounds = bounds.wrapDateLine(maxExtent);
  10970. * @param {Bounds} maxExtent - 最大的边界范围(一般是全球范围)。
  10971. * @param {Object} options - 可选选项参数。
  10972. * @param {number} [options.leftTolerance=0] - left 允许的误差。
  10973. * @param {number} [options.rightTolerance=0] - right 允许的误差。
  10974. * @returns {Bounds} 克隆当前边界。如果当前边界完全在最大范围之外此函数则返回一个不同值的边界,
  10975. * 若落在最大边界的左边,则给当前的bounds值加上最大范围的宽度,即向右移动,
  10976. * 若落在右边,则向左移动,即给当前的bounds值加上负的最大范围的宽度。
  10977. */
  10978. }, {
  10979. key: "wrapDateLine",
  10980. value: function wrapDateLine(maxExtent, options) {
  10981. options = options || {};
  10982. var leftTolerance = options.leftTolerance || 0;
  10983. var rightTolerance = options.rightTolerance || 0;
  10984. var newBounds = this.clone();
  10985. if (maxExtent) {
  10986. var width = maxExtent.getWidth();
  10987. //如果 newBounds 在 maxExtent 的左边,那么一直向右移动,直到相交或者包含为止,每次移动width
  10988. //shift right?
  10989. while (newBounds.left < maxExtent.left && newBounds.right - rightTolerance <= maxExtent.left) {
  10990. newBounds = newBounds.add(width, 0);
  10991. }
  10992. //如果 newBounds 在 maxExtent 的右边,那么一直向左移动,直到相交或者包含为止,每次移动width
  10993. //shift left?
  10994. while (newBounds.left + leftTolerance >= maxExtent.right && newBounds.right > maxExtent.right) {
  10995. newBounds = newBounds.add(-width, 0);
  10996. }
  10997. //如果和右边相交,左边又在内部,那么再次向左边移动一次
  10998. // crosses right only? force left
  10999. var newLeft = newBounds.left + leftTolerance;
  11000. if (newLeft < maxExtent.right && newLeft > maxExtent.left && newBounds.right - rightTolerance > maxExtent.right) {
  11001. newBounds = newBounds.add(-width, 0);
  11002. }
  11003. }
  11004. return newBounds;
  11005. }
  11006. /**
  11007. * @function Bounds.prototype.toServerJSONObject
  11008. * @description 转换成对应的 JSON 格式对象。
  11009. * @example
  11010. * var bounds = new Bounds(-180,-90,100,80);
  11011. * var obj = bounds.toServerJSONObject();
  11012. * @returns {Object} JSON 格式的 Object 对象。
  11013. */
  11014. }, {
  11015. key: "toServerJSONObject",
  11016. value: function toServerJSONObject() {
  11017. var jsonObject = {
  11018. rightTop: {
  11019. x: this.right,
  11020. y: this.top
  11021. },
  11022. leftBottom: {
  11023. x: this.left,
  11024. y: this.bottom
  11025. },
  11026. left: this.left,
  11027. right: this.right,
  11028. top: this.top,
  11029. bottom: this.bottom
  11030. };
  11031. return jsonObject;
  11032. }
  11033. /**
  11034. *
  11035. * @function Bounds.prototype.destroy
  11036. * @description 销毁此对象。
  11037. * 销毁后此对象的所有属性为 null,而不是初始值。
  11038. * @example
  11039. * var bounds = new Bounds(-180,-90,100,80);
  11040. * bounds.destroy();
  11041. */
  11042. }, {
  11043. key: "destroy",
  11044. value: function destroy() {
  11045. this.left = null;
  11046. this.right = null;
  11047. this.top = null;
  11048. this.bottom = null;
  11049. this.centerLonLat = null;
  11050. }
  11051. /**
  11052. * @function Bounds.fromString
  11053. * @description 通过字符串参数创建新的 bounds 的构造函数。
  11054. * @example
  11055. * var bounds = Bounds.fromString("-180,-90,100,80");
  11056. * @param {string} str - 边界字符串,用逗号隔开(e.g. <i>"5,42,10,45"</i>)。
  11057. * @param {boolean} [reverseAxisOrder=false] - 是否反转轴顺序。
  11058. * 如果设为true,则倒转顺序(bottom,left,top,right),否则按正常轴顺序(left,bottom,right,top)。
  11059. * @returns {Bounds} 给定的字符串创建的新的边界对象。
  11060. */
  11061. }], [{
  11062. key: "fromString",
  11063. value: function fromString(str, reverseAxisOrder) {
  11064. var bounds = str.split(",");
  11065. return Bounds.fromArray(bounds, reverseAxisOrder);
  11066. }
  11067. /**
  11068. * @function Bounds.fromArray
  11069. * @description 通过边界框数组创建 Bounds。
  11070. * @example
  11071. * var bounds = Bounds.fromArray([-180,-90,100,80]);
  11072. * @param {Array.<number>} bbox - 边界值数组。(e.g. <i>[5,42,10,45]</i>)。
  11073. * @param {boolean} [reverseAxisOrder=false] - 是否是反转轴顺序。如果设为true,则倒转顺序(bottom,left,top,right),否则按正常轴顺序(left,bottom,right,top)。
  11074. * @returns {Bounds} 根据传入的数组创建的新的边界对象。
  11075. */
  11076. }, {
  11077. key: "fromArray",
  11078. value: function fromArray(bbox, reverseAxisOrder) {
  11079. return reverseAxisOrder === true ? new Bounds(bbox[1], bbox[0], bbox[3], bbox[2]) : new Bounds(bbox[0], bbox[1], bbox[2], bbox[3]);
  11080. }
  11081. /**
  11082. * @function Bounds.fromSize
  11083. * @description 通过传入的边界大小来创建新的边界。
  11084. * @example
  11085. * var bounds = Bounds.fromSize(new Size(20,10));
  11086. * @param {Size} size - 边界大小。
  11087. * @returns {Bounds} 根据传入的边界大小的创建新的边界。
  11088. */
  11089. }, {
  11090. key: "fromSize",
  11091. value: function fromSize(size) {
  11092. return new Bounds(0, size.h, size.w, 0);
  11093. }
  11094. /**
  11095. * @function Bounds.oppositeQuadrant
  11096. * @description 反转象限。"t"和"b" 交换,"r"和"l"交换, 如:"tl"变为"br"。
  11097. * @param {string} quadrant - 代表象限的字符串,如:"tl"。
  11098. * @returns {string} 反转后的象限。
  11099. */
  11100. }, {
  11101. key: "oppositeQuadrant",
  11102. value: function oppositeQuadrant(quadrant) {
  11103. var opp = "";
  11104. opp += quadrant.charAt(0) === 't' ? 'b' : 't';
  11105. opp += quadrant.charAt(1) === 'l' ? 'r' : 'l';
  11106. return opp;
  11107. }
  11108. }]);
  11109. return Bounds;
  11110. }();
  11111. ;// CONCATENATED MODULE: ./src/common/commontypes/geometry/Point.js
  11112. function Point_typeof(obj) { "@babel/helpers - typeof"; return Point_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, Point_typeof(obj); }
  11113. function Point_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  11114. function Point_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  11115. function Point_createClass(Constructor, protoProps, staticProps) { if (protoProps) Point_defineProperties(Constructor.prototype, protoProps); if (staticProps) Point_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  11116. function _get() { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }
  11117. function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }
  11118. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
  11119. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  11120. 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); }; }
  11121. function _possibleConstructorReturn(self, call) { if (call && (Point_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
  11122. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  11123. function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  11124. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  11125. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  11126. * This program are made available under the terms of the Apache License, Version 2.0
  11127. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  11128. /**
  11129. * @class GeometryPoint
  11130. * @aliasclass Geometry.Point
  11131. * @deprecatedclass SuperMap.Geometry.Point
  11132. * @classdesc 点几何对象类。
  11133. * @category BaseTypes Geometry
  11134. * @extends {Geometry}
  11135. * @param {number} x - x 坐标。
  11136. * @param {number} y - y 坐标。
  11137. * @param {string} [type = 'Point'] - 点的类型。
  11138. * @param {number} [tag] - 额外的属性,比如插值分析中的 Z 值。
  11139. * @example
  11140. * var point = new GeometryPoint(-111.04, 45.68);
  11141. * @usage
  11142. */
  11143. var Point = /*#__PURE__*/function (_Geometry) {
  11144. _inherits(Point, _Geometry);
  11145. var _super = _createSuper(Point);
  11146. function Point(x, y, type, tag) {
  11147. var _this;
  11148. Point_classCallCheck(this, Point);
  11149. _this = _super.call(this, x, y, type, tag);
  11150. /**
  11151. * @member {number} GeometryPoint.prototype.x
  11152. * @description 横坐标。
  11153. */
  11154. _this.x = parseFloat(x);
  11155. /**
  11156. * @member {number} GeometryPoint.prototype.y
  11157. * @description 纵坐标。
  11158. */
  11159. _this.y = parseFloat(y);
  11160. /**
  11161. * @member {string} GeometryPoint.prototype.tag
  11162. * @description 用来存储额外的属性,比如插值分析中的 Z 值。
  11163. */
  11164. _this.tag = tag || tag == 0 ? parseFloat(tag) : null;
  11165. /**
  11166. * @member {string} GeometryPoint.prototype.type
  11167. * @description 用来存储点的类型。
  11168. */
  11169. _this.type = type || "Point";
  11170. _this.CLASS_NAME = "SuperMap.Geometry.Point";
  11171. _this.geometryType = "Point";
  11172. return _this;
  11173. }
  11174. /**
  11175. * @function GeometryPoint.prototype.clone
  11176. * @description 克隆点对象。
  11177. * @returns {GeometryPoint} 克隆后的点对象。
  11178. */
  11179. Point_createClass(Point, [{
  11180. key: "clone",
  11181. value: function clone(obj) {
  11182. if (obj == null) {
  11183. obj = new Point(this.x, this.y);
  11184. }
  11185. // catch any randomly tagged-on properties
  11186. Util_Util.applyDefaults(obj, this);
  11187. return obj;
  11188. }
  11189. /**
  11190. * @function GeometryPoint.prototype.calculateBounds
  11191. * @description 计算点对象的范围。
  11192. */
  11193. }, {
  11194. key: "calculateBounds",
  11195. value: function calculateBounds() {
  11196. this.bounds = new Bounds(this.x, this.y, this.x, this.y);
  11197. }
  11198. /**
  11199. * @function GeometryPoint.prototype.equals
  11200. * @description 判断两个点对象是否相等。如果两个点对象具有相同的坐标,则认为是相等的。
  11201. * @example
  11202. * var point= new GeometryPoint(0,0);
  11203. * var point1={x:0,y:0};
  11204. * var result= point.equals(point1);
  11205. * @param {GeometryPoint} geom - 需要判断的点对象。
  11206. * @returns {boolean} 两个点对象是否相等(true 为相等,false 为不等)。
  11207. */
  11208. }, {
  11209. key: "equals",
  11210. value: function equals(geom) {
  11211. var equals = false;
  11212. if (geom != null) {
  11213. equals = this.x === geom.x && this.y === geom.y || isNaN(this.x) && isNaN(this.y) && isNaN(geom.x) && isNaN(geom.y);
  11214. }
  11215. return equals;
  11216. }
  11217. /**
  11218. * @function GeometryPoint.prototype.move
  11219. * @description 沿着 x、y 轴的正方向上按照给定的位移移动点对象,move 不仅改变了几何对象的位置并且清理了边界缓存。
  11220. * @param {number} x - x 轴正方向上的偏移量。
  11221. * @param {number} y - y 轴正方向上偏移量。
  11222. */
  11223. }, {
  11224. key: "move",
  11225. value: function move(x, y) {
  11226. this.x = this.x + x;
  11227. this.y = this.y + y;
  11228. this.clearBounds();
  11229. }
  11230. /**
  11231. * @function GeometryPoint.prototype.toShortString
  11232. * @description 将 x/y 坐标转换成简单字符串。
  11233. * @returns {string} 字符串代表点对象。(ex. <i>"5, 42"</i>)
  11234. */
  11235. }, {
  11236. key: "toShortString",
  11237. value: function toShortString() {
  11238. return this.x + ", " + this.y;
  11239. }
  11240. /**
  11241. * @function GeometryPoint.prototype.destroy
  11242. * @description 释放点对象的资源。
  11243. */
  11244. }, {
  11245. key: "destroy",
  11246. value: function destroy() {
  11247. this.x = null;
  11248. this.y = null;
  11249. this.tag = null;
  11250. _get(_getPrototypeOf(Point.prototype), "destroy", this).call(this);
  11251. }
  11252. /**
  11253. * @function GeometryPoint.prototype.getVertices
  11254. * @description 获取几何图形所有顶点的列表。
  11255. * @returns {Array} 几何图形的顶点列表。
  11256. */
  11257. }, {
  11258. key: "getVertices",
  11259. value: function getVertices() {
  11260. return [this];
  11261. }
  11262. }]);
  11263. return Point;
  11264. }(Geometry_Geometry);
  11265. ;// CONCATENATED MODULE: ./src/common/commontypes/geometry/Collection.js
  11266. function Collection_typeof(obj) { "@babel/helpers - typeof"; return Collection_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, Collection_typeof(obj); }
  11267. function Collection_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  11268. function Collection_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  11269. function Collection_createClass(Constructor, protoProps, staticProps) { if (protoProps) Collection_defineProperties(Constructor.prototype, protoProps); if (staticProps) Collection_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  11270. function Collection_get() { if (typeof Reflect !== "undefined" && Reflect.get) { Collection_get = Reflect.get.bind(); } else { Collection_get = function _get(target, property, receiver) { var base = Collection_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return Collection_get.apply(this, arguments); }
  11271. function Collection_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Collection_getPrototypeOf(object); if (object === null) break; } return object; }
  11272. function Collection_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) Collection_setPrototypeOf(subClass, superClass); }
  11273. function Collection_setPrototypeOf(o, p) { Collection_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Collection_setPrototypeOf(o, p); }
  11274. function Collection_createSuper(Derived) { var hasNativeReflectConstruct = Collection_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Collection_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Collection_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Collection_possibleConstructorReturn(this, result); }; }
  11275. function Collection_possibleConstructorReturn(self, call) { if (call && (Collection_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return Collection_assertThisInitialized(self); }
  11276. function Collection_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  11277. function Collection_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  11278. function Collection_getPrototypeOf(o) { Collection_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Collection_getPrototypeOf(o); }
  11279. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  11280. * This program are made available under the terms of the Apache License, Version 2.0
  11281. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  11282. /**
  11283. * @class GeometryCollection
  11284. * @aliasclass Geometry.Collection
  11285. * @deprecatedclass SuperMap.Geometry.Collection
  11286. * @classdesc 几何对象集合类,存储在本地的 components 属性中(可作为参数传递给构造函数)。<br>
  11287. * 随着新的几何图形添加到集合中,将不能被克隆,当移动几何图形时,需要指定参照物。<br>
  11288. * getArea 和 getLength 函数只能通过遍历存储几何对象的 components 数组,总计所有几何图形的面积和长度。
  11289. * @category BaseTypes Geometry
  11290. * @extends {Geometry}
  11291. * @param {Array.<Geometry>} components - 几何对象数组。
  11292. * @example
  11293. * var point1 = new GeometryPoint(10,20);
  11294. * var point2 = new GeometryPoint(30,40);
  11295. * var col = new GeometryCollection([point1,point2]);
  11296. * @usage
  11297. */
  11298. var Collection = /*#__PURE__*/function (_Geometry) {
  11299. Collection_inherits(Collection, _Geometry);
  11300. var _super = Collection_createSuper(Collection);
  11301. function Collection(components) {
  11302. var _this;
  11303. Collection_classCallCheck(this, Collection);
  11304. _this = _super.call(this);
  11305. /**
  11306. * @description 存储几何对象的数组。
  11307. * @member {Array.<Geometry>} GeometryCollection.prototype.components
  11308. */
  11309. _this.components = [];
  11310. /**
  11311. * @member {Array.<string>} GeometryCollection.prototype.componentTypes
  11312. * @description components 存储的几何对象所支持的几何类型数组,为空表示类型不受限制。
  11313. */
  11314. _this.componentTypes = null;
  11315. if (components != null) {
  11316. _this.addComponents(components);
  11317. }
  11318. _this.CLASS_NAME = "SuperMap.Geometry.Collection";
  11319. _this.geometryType = "Collection";
  11320. return _this;
  11321. }
  11322. /**
  11323. * @function GeometryCollection.prototype.destroy
  11324. * @description 销毁几何图形。
  11325. */
  11326. Collection_createClass(Collection, [{
  11327. key: "destroy",
  11328. value: function destroy() {
  11329. this.components.length = 0;
  11330. this.components = null;
  11331. Collection_get(Collection_getPrototypeOf(Collection.prototype), "destroy", this).call(this);
  11332. }
  11333. /**
  11334. * @function GeometryCollection.prototype.clone
  11335. * @description 克隆当前几何对象。
  11336. * @returns {GeometryCollection} 克隆的几何对象集合。
  11337. */
  11338. }, {
  11339. key: "clone",
  11340. value: function clone() {
  11341. var geometry = new Collection();
  11342. for (var i = 0, len = this.components.length; i < len; i++) {
  11343. geometry.addComponent(this.components[i].clone());
  11344. }
  11345. // catch any randomly tagged-on properties
  11346. Util_Util.applyDefaults(geometry, this);
  11347. return geometry;
  11348. }
  11349. /**
  11350. * @function GeometryCollection.prototype.getComponentsString
  11351. * @description 获取 components 字符串。
  11352. * @returns {string} components 字符串。
  11353. */
  11354. }, {
  11355. key: "getComponentsString",
  11356. value: function getComponentsString() {
  11357. var strings = [];
  11358. for (var i = 0, len = this.components.length; i < len; i++) {
  11359. strings.push(this.components[i].toShortString());
  11360. }
  11361. return strings.join(",");
  11362. }
  11363. /**
  11364. * @function GeometryCollection.prototype.calculateBounds
  11365. * @description 通过遍历数组重新计算边界,在遍历每一子项中时调用 extend 方法。
  11366. */
  11367. }, {
  11368. key: "calculateBounds",
  11369. value: function calculateBounds() {
  11370. this.bounds = null;
  11371. var bounds = new Bounds();
  11372. var components = this.components;
  11373. if (components) {
  11374. for (var i = 0, len = components.length; i < len; i++) {
  11375. bounds.extend(components[i].getBounds());
  11376. }
  11377. }
  11378. // to preserve old behavior, we only set bounds if non-null
  11379. // in the future, we could add bounds.isEmpty()
  11380. if (bounds.left != null && bounds.bottom != null && bounds.right != null && bounds.top != null) {
  11381. this.setBounds(bounds);
  11382. }
  11383. }
  11384. /**
  11385. * @function GeometryCollection.prototype.addComponents
  11386. * @description 给几何图形对象添加元素。
  11387. * @param {Array.<Geometry>} components - 几何对象组件。
  11388. * @example
  11389. * var geometryCollection = new GeometryCollection();
  11390. * geometryCollection.addComponents(new SuerpMap.Geometry.Point(10,10));
  11391. */
  11392. }, {
  11393. key: "addComponents",
  11394. value: function addComponents(components) {
  11395. if (!Util_Util.isArray(components)) {
  11396. components = [components];
  11397. }
  11398. for (var i = 0, len = components.length; i < len; i++) {
  11399. this.addComponent(components[i]);
  11400. }
  11401. }
  11402. /**
  11403. * @function GeometryCollection.prototype.addComponent
  11404. * @description 添加几何对象到集合中。如果设置了 componentTypes 类型,则添加的几何对象必须是 componentTypes 中的类型。
  11405. * @param {Geometry} component - 待添加的几何对象。
  11406. * @param {number} [index] - 几何对象插入的位置。
  11407. * @returns {boolean} 是否添加成功。
  11408. */
  11409. }, {
  11410. key: "addComponent",
  11411. value: function addComponent(component, index) {
  11412. var added = false;
  11413. if (component) {
  11414. if (this.componentTypes == null || Util_Util.indexOf(this.componentTypes, component.CLASS_NAME) > -1) {
  11415. if (index != null && index < this.components.length) {
  11416. var components1 = this.components.slice(0, index);
  11417. var components2 = this.components.slice(index, this.components.length);
  11418. components1.push(component);
  11419. this.components = components1.concat(components2);
  11420. } else {
  11421. this.components.push(component);
  11422. }
  11423. component.parent = this;
  11424. this.clearBounds();
  11425. added = true;
  11426. }
  11427. }
  11428. return added;
  11429. }
  11430. /**
  11431. * @function GeometryCollection.prototype.removeComponents
  11432. * @description 清除几何对象。
  11433. * @param {Array.<Geometry>} components - 需要清除的几何对象。
  11434. * @returns {boolean} 元素是否被删除。
  11435. */
  11436. }, {
  11437. key: "removeComponents",
  11438. value: function removeComponents(components) {
  11439. var removed = false;
  11440. if (!Util_Util.isArray(components)) {
  11441. components = [components];
  11442. }
  11443. for (var i = components.length - 1; i >= 0; --i) {
  11444. removed = this.removeComponent(components[i]) || removed;
  11445. }
  11446. return removed;
  11447. }
  11448. /**
  11449. * @function GeometryCollection.prototype.removeComponent
  11450. * @description 从集合中移除几何对象。
  11451. * @param {Geometry} component - 要移除的几何对象。
  11452. * @returns {boolean} 几何对象是否移除成功。
  11453. */
  11454. }, {
  11455. key: "removeComponent",
  11456. value: function removeComponent(component) {
  11457. Util_Util.removeItem(this.components, component);
  11458. // clearBounds() so that it gets recalculated on the next call
  11459. // to this.getBounds();
  11460. this.clearBounds();
  11461. return true;
  11462. }
  11463. /**
  11464. * @function GeometryCollection.prototype.getArea
  11465. * @description 计算几何对象的面积。注意,这个方法在 {@link GeometryPolygon} 类中需要重写。
  11466. * @returns {number} 几何图形的面积,是几何对象中所有组成部分的面积之和。
  11467. */
  11468. }, {
  11469. key: "getArea",
  11470. value: function getArea() {
  11471. var area = 0.0;
  11472. for (var i = 0, len = this.components.length; i < len; i++) {
  11473. area += this.components[i].getArea();
  11474. }
  11475. return area;
  11476. }
  11477. /**
  11478. * @function GeometryCollection.prototype.equals
  11479. * @description 判断两个几何图形是否相等。如果所有的 components 具有相同的坐标,则认为是相等的。
  11480. * @param {Geometry} geometry - 需要判断的几何图形。
  11481. * @returns {boolean} 输入的几何图形与当前几何图形是否相等。
  11482. */
  11483. }, {
  11484. key: "equals",
  11485. value: function equals(geometry) {
  11486. var equivalent = true;
  11487. if (!geometry || !geometry.CLASS_NAME || this.CLASS_NAME !== geometry.CLASS_NAME) {
  11488. equivalent = false;
  11489. } else if (!Util_Util.isArray(geometry.components) || geometry.components.length !== this.components.length) {
  11490. equivalent = false;
  11491. } else {
  11492. for (var i = 0, len = this.components.length; i < len; ++i) {
  11493. if (!this.components[i].equals(geometry.components[i])) {
  11494. equivalent = false;
  11495. break;
  11496. }
  11497. }
  11498. }
  11499. return equivalent;
  11500. }
  11501. /**
  11502. * @function GeometryCollection.prototype.getVertices
  11503. * @description 返回几何对象的所有结点的列表。
  11504. * @param {boolean} [nodes] - 对于线来说,仅仅返回作为端点的顶点,如果设为 false,则返回非端点的顶点,如果没有设置此参数,则返回所有顶点。
  11505. * @returns {Array} 几何对象的顶点列表。
  11506. */
  11507. }, {
  11508. key: "getVertices",
  11509. value: function getVertices(nodes) {
  11510. var vertices = [];
  11511. for (var i = 0, len = this.components.length; i < len; ++i) {
  11512. Array.prototype.push.apply(vertices, this.components[i].getVertices(nodes));
  11513. }
  11514. return vertices;
  11515. }
  11516. }]);
  11517. return Collection;
  11518. }(Geometry_Geometry);
  11519. ;// CONCATENATED MODULE: ./src/common/commontypes/geometry/MultiPoint.js
  11520. function MultiPoint_typeof(obj) { "@babel/helpers - typeof"; return MultiPoint_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, MultiPoint_typeof(obj); }
  11521. function MultiPoint_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  11522. function MultiPoint_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  11523. function MultiPoint_createClass(Constructor, protoProps, staticProps) { if (protoProps) MultiPoint_defineProperties(Constructor.prototype, protoProps); if (staticProps) MultiPoint_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  11524. function MultiPoint_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) MultiPoint_setPrototypeOf(subClass, superClass); }
  11525. function MultiPoint_setPrototypeOf(o, p) { MultiPoint_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return MultiPoint_setPrototypeOf(o, p); }
  11526. function MultiPoint_createSuper(Derived) { var hasNativeReflectConstruct = MultiPoint_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = MultiPoint_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = MultiPoint_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return MultiPoint_possibleConstructorReturn(this, result); }; }
  11527. function MultiPoint_possibleConstructorReturn(self, call) { if (call && (MultiPoint_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return MultiPoint_assertThisInitialized(self); }
  11528. function MultiPoint_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  11529. function MultiPoint_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  11530. function MultiPoint_getPrototypeOf(o) { MultiPoint_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return MultiPoint_getPrototypeOf(o); }
  11531. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  11532. * This program are made available under the terms of the Apache License, Version 2.0
  11533. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  11534. /**
  11535. * @class GeometryMultiPoint
  11536. * @aliasclass Geometry.MultiPoint
  11537. * @deprecatedclass SuperMap.Geometry.MultiPoint
  11538. * @classdesc 几何对象多点类。
  11539. * @category BaseTypes Geometry
  11540. * @extends GeometryCollection
  11541. * @param {Array.<GeometryPoint>} components - 点对象数组。
  11542. * @example
  11543. * var point1 = new GeometryPoint(5,6);
  11544. * var poine2 = new GeometryMultiPoint(7,8);
  11545. * var multiPoint = new MultiPoint([point1,point2]);
  11546. * @usage
  11547. */
  11548. var MultiPoint = /*#__PURE__*/function (_Collection) {
  11549. MultiPoint_inherits(MultiPoint, _Collection);
  11550. var _super = MultiPoint_createSuper(MultiPoint);
  11551. function MultiPoint(components) {
  11552. var _this;
  11553. MultiPoint_classCallCheck(this, MultiPoint);
  11554. _this = _super.call(this, components);
  11555. /**
  11556. * @member {Array.<string>} [GeometryMultiPoint.prototype.componentTypes=["SuperMap.Geometry.Point"]]
  11557. * @description components 存储的几何对象所支持的几何类型数组。
  11558. * @readonly
  11559. */
  11560. _this.componentTypes = ["SuperMap.Geometry.Point"];
  11561. _this.CLASS_NAME = "SuperMap.Geometry.MultiPoint";
  11562. _this.geometryType = "MultiPoint";
  11563. return _this;
  11564. }
  11565. /**
  11566. * @function GeometryMultiPoint.prototype.addPoint
  11567. * @description 添加点,封装了 {@link GeometryCollection|GeometryCollection.addComponent} 方法。
  11568. * @param {GeometryPoint} point - 添加的点。
  11569. * @param {number} [index] - 下标。
  11570. */
  11571. MultiPoint_createClass(MultiPoint, [{
  11572. key: "addPoint",
  11573. value: function addPoint(point, index) {
  11574. this.addComponent(point, index);
  11575. }
  11576. /**
  11577. * @function GeometryMultiPoint.prototype.removePoint
  11578. * @description 移除点,封装了 {@link GeometryCollection|GeometryCollection.removeComponent} 方法。
  11579. * @param {GeometryPoint} point - 移除的点对象。
  11580. */
  11581. }, {
  11582. key: "removePoint",
  11583. value: function removePoint(point) {
  11584. this.removeComponent(point);
  11585. }
  11586. }]);
  11587. return MultiPoint;
  11588. }(Collection);
  11589. ;// CONCATENATED MODULE: ./src/common/commontypes/geometry/Curve.js
  11590. function Curve_typeof(obj) { "@babel/helpers - typeof"; return Curve_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, Curve_typeof(obj); }
  11591. function Curve_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  11592. function Curve_createClass(Constructor, protoProps, staticProps) { if (protoProps) Curve_defineProperties(Constructor.prototype, protoProps); if (staticProps) Curve_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  11593. function Curve_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  11594. function Curve_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) Curve_setPrototypeOf(subClass, superClass); }
  11595. function Curve_setPrototypeOf(o, p) { Curve_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Curve_setPrototypeOf(o, p); }
  11596. function Curve_createSuper(Derived) { var hasNativeReflectConstruct = Curve_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Curve_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Curve_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Curve_possibleConstructorReturn(this, result); }; }
  11597. function Curve_possibleConstructorReturn(self, call) { if (call && (Curve_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return Curve_assertThisInitialized(self); }
  11598. function Curve_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  11599. function Curve_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  11600. function Curve_getPrototypeOf(o) { Curve_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Curve_getPrototypeOf(o); }
  11601. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  11602. * This program are made available under the terms of the Apache License, Version 2.0
  11603. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  11604. /**
  11605. * @class GeometryCurve
  11606. * @aliasclass Geometry.Curve
  11607. * @deprecatedclass SuperMap.Geometry.Curve
  11608. * @classdesc 几何对象曲线类。
  11609. * @category BaseTypes Geometry
  11610. * @extends GeometryMultiPoint
  11611. * @param {Array.<GeometryPoint>} components - 几何对象数组。
  11612. * @example
  11613. * var point1 = new GeometryPoint(10,20);
  11614. * var point2 = new GeometryPoint(30,40);
  11615. * var curve = new Curve([point1,point2]);
  11616. * @usage
  11617. */
  11618. var Curve = /*#__PURE__*/function (_MultiPoint) {
  11619. Curve_inherits(Curve, _MultiPoint);
  11620. var _super = Curve_createSuper(Curve);
  11621. function Curve(components) {
  11622. var _this;
  11623. Curve_classCallCheck(this, Curve);
  11624. _this = _super.call(this, components);
  11625. /**
  11626. * @member {Array.<string>} [GeometryCurve.prototype.componentTypes=["SuperMap.Geometry.Point", "SuperMap.PointWithMeasure"]]
  11627. * @description components 存储的几何对象所支持的几何类型数组。
  11628. * @readonly
  11629. */
  11630. _this.componentTypes = ["SuperMap.Geometry.Point", "SuperMap.PointWithMeasure"];
  11631. _this.CLASS_NAME = "SuperMap.Geometry.Curve";
  11632. _this.geometryType = "Curve";
  11633. return _this;
  11634. }
  11635. return Curve_createClass(Curve);
  11636. }(MultiPoint);
  11637. ;// CONCATENATED MODULE: ./src/common/commontypes/geometry/LineString.js
  11638. function LineString_typeof(obj) { "@babel/helpers - typeof"; return LineString_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, LineString_typeof(obj); }
  11639. function LineString_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  11640. function LineString_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  11641. function LineString_createClass(Constructor, protoProps, staticProps) { if (protoProps) LineString_defineProperties(Constructor.prototype, protoProps); if (staticProps) LineString_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  11642. function LineString_get() { if (typeof Reflect !== "undefined" && Reflect.get) { LineString_get = Reflect.get.bind(); } else { LineString_get = function _get(target, property, receiver) { var base = LineString_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return LineString_get.apply(this, arguments); }
  11643. function LineString_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = LineString_getPrototypeOf(object); if (object === null) break; } return object; }
  11644. function LineString_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) LineString_setPrototypeOf(subClass, superClass); }
  11645. function LineString_setPrototypeOf(o, p) { LineString_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return LineString_setPrototypeOf(o, p); }
  11646. function LineString_createSuper(Derived) { var hasNativeReflectConstruct = LineString_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = LineString_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = LineString_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return LineString_possibleConstructorReturn(this, result); }; }
  11647. function LineString_possibleConstructorReturn(self, call) { if (call && (LineString_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return LineString_assertThisInitialized(self); }
  11648. function LineString_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  11649. function LineString_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  11650. function LineString_getPrototypeOf(o) { LineString_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return LineString_getPrototypeOf(o); }
  11651. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  11652. * This program are made available under the terms of the Apache License, Version 2.0
  11653. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  11654. /**
  11655. * @class GeometryLineString
  11656. * @aliasclass Geometry.LineString
  11657. * @deprecatedclass SuperMap.Geometry.LineString
  11658. * @classdesc 几何对象线串类。
  11659. * @category BaseTypes Geometry
  11660. * @param {Array.<GeometryPoint>} points - 用来生成线串的点数组。
  11661. * @extends GeometryCurve
  11662. * @example
  11663. * var points = [new GeometryPoint(4933.319287022352, -3337.3849141502124),
  11664. * new GeometryPoint(4960.9674060199022, -3349.3316322355736),
  11665. * new GeometryPoint(5006.0235999418364, -3358.8890067038628),
  11666. * new GeometryPoint(5075.3145648369318, -3378.0037556404409),
  11667. * new GeometryPoint(5305.19551436013, -3376.9669111768926)],
  11668. * var roadLine = new GeometryLineString(points);
  11669. * @usage
  11670. */
  11671. var LineString = /*#__PURE__*/function (_Curve) {
  11672. LineString_inherits(LineString, _Curve);
  11673. var _super = LineString_createSuper(LineString);
  11674. function LineString(points) {
  11675. var _this;
  11676. LineString_classCallCheck(this, LineString);
  11677. _this = _super.call(this, points);
  11678. _this.CLASS_NAME = "SuperMap.Geometry.LineString";
  11679. _this.geometryType = "LineString";
  11680. return _this;
  11681. }
  11682. /**
  11683. * @function GeometryLineString.prototype.removeComponent
  11684. * @description 只有在线串上有三个或更多的点的时候,才会允许移除点(否则结果将会是单一的点)。
  11685. * @param {GeometryPoint} point - 将被删除的点。
  11686. * @returns {boolean} 删除的点。
  11687. */
  11688. LineString_createClass(LineString, [{
  11689. key: "removeComponent",
  11690. value: function removeComponent(point) {
  11691. // eslint-disable-line no-unused-vars
  11692. var removed = this.components && this.components.length > 2;
  11693. if (removed) {
  11694. LineString_get(LineString_getPrototypeOf(LineString.prototype), "removeComponent", this).apply(this, arguments);
  11695. }
  11696. return removed;
  11697. }
  11698. /**
  11699. * @function GeometryLineString.prototype.getSortedSegments
  11700. * @description 获取升序排列的点坐标对象数组。
  11701. * @returns {Array} 升序排列的点坐标对象数组。
  11702. */
  11703. }, {
  11704. key: "getSortedSegments",
  11705. value: function getSortedSegments() {
  11706. var numSeg = this.components.length - 1;
  11707. var segments = new Array(numSeg),
  11708. point1,
  11709. point2;
  11710. for (var i = 0; i < numSeg; ++i) {
  11711. point1 = this.components[i];
  11712. point2 = this.components[i + 1];
  11713. if (point1.x < point2.x) {
  11714. segments[i] = {
  11715. x1: point1.x,
  11716. y1: point1.y,
  11717. x2: point2.x,
  11718. y2: point2.y
  11719. };
  11720. } else {
  11721. segments[i] = {
  11722. x1: point2.x,
  11723. y1: point2.y,
  11724. x2: point1.x,
  11725. y2: point1.y
  11726. };
  11727. }
  11728. }
  11729. // more efficient to define this somewhere static
  11730. function byX1(seg1, seg2) {
  11731. return seg1.x1 - seg2.x1;
  11732. }
  11733. return segments.sort(byX1);
  11734. }
  11735. /**
  11736. * @function GeometryLineString.prototype.getVertices
  11737. * @description 返回几何图形的所有顶点的列表。
  11738. * @param {boolean} [nodes] - 对于线来说,仅仅返回作为端点的顶点,如果设为 false,则返回非端点的顶点,如果没有设置此参数,则返回所有顶点。
  11739. * @returns {Array} 几何图形的顶点列表。
  11740. */
  11741. }, {
  11742. key: "getVertices",
  11743. value: function getVertices(nodes) {
  11744. var vertices;
  11745. if (nodes === true) {
  11746. vertices = [this.components[0], this.components[this.components.length - 1]];
  11747. } else if (nodes === false) {
  11748. vertices = this.components.slice(1, this.components.length - 1);
  11749. } else {
  11750. vertices = this.components.slice();
  11751. }
  11752. return vertices;
  11753. }
  11754. /**
  11755. * @function GeometryLineString.calculateCircle
  11756. * @description 三点画圆弧。
  11757. * @param {Array.<GeometryPoint>} points - 传入的待计算的初始点串。
  11758. * @returns {Array.<GeometryPoint>} 计算出相应的圆弧控制点。
  11759. * @example
  11760. * var points = [];
  11761. * points.push(new GeometryPoint(-50,30));
  11762. * points.push(new GeometryPoint(-30,50));
  11763. * points.push(new GeometryPoint(2,60));
  11764. * var circle = GeometryLineString.calculateCircle(points);
  11765. */
  11766. }], [{
  11767. key: "calculateCircle",
  11768. value: function calculateCircle(points) {
  11769. if (points.length < 3) {
  11770. return points;
  11771. }
  11772. var centerPoint = {},
  11773. p1 = points[0],
  11774. p2 = points[1],
  11775. p3 = points[2];
  11776. var R = 0,
  11777. dStep = 0,
  11778. direc = true,
  11779. dRotation = 0,
  11780. dRotationBegin = 0,
  11781. dRotationAngle = 0,
  11782. nSegmentCount = 72,
  11783. circlePoints = [];
  11784. var KTan13 = (p3.y - p1.y) / (p3.x - p1.x);
  11785. var B13 = p3.y - KTan13 * p3.x;
  11786. if (p3.x != p1.x && p3.y != p1.y && p2.y == KTan13 * p2.x + B13 || p3.x == p1.x && p2.x == p1.x || p3.y == p1.y && p2.y == p1.y || p3.x == p1.x && p3.y == p1.y || p3.x == p2.x && p3.y == p2.y || p1.x == p2.x && p1.y == p2.y) {
  11787. circlePoints.push(p1);
  11788. circlePoints.push(p2);
  11789. circlePoints.push(p3);
  11790. } else {
  11791. var D = (p2.x * p2.x + p2.y * p2.y - (p1.x * p1.x + p1.y * p1.y)) * (2 * (p3.y - p1.y)) - (p3.x * p3.x + p3.y * p3.y - (p1.x * p1.x + p1.y * p1.y)) * (2 * (p2.y - p1.y));
  11792. var E = 2 * (p2.x - p1.x) * (p3.x * p3.x + p3.y * p3.y - (p1.x * p1.x + p1.y * p1.y)) - 2 * (p3.x - p1.x) * (p2.x * p2.x + p2.y * p2.y - (p1.x * p1.x + p1.y * p1.y));
  11793. var F = 4 * ((p2.x - p1.x) * (p3.y - p1.y) - (p3.x - p1.x) * (p2.y - p1.y));
  11794. centerPoint.x = D / F;
  11795. centerPoint.y = E / F;
  11796. R = Math.sqrt((p1.x - centerPoint.x) * (p1.x - centerPoint.x) + (p1.y - centerPoint.y) * (p1.y - centerPoint.y));
  11797. var dis = (p1.x - p3.x) * (p1.x - p3.x) + (p1.y - p3.y) * (p1.y - p3.y);
  11798. var cons = (2 * R * R - dis) / (2 * R * R);
  11799. cons = cons >= 1 ? 1 : cons;
  11800. cons = cons <= -1 ? -1 : cons;
  11801. dRotationAngle = Math.acos(cons) * 180 / Math.PI;
  11802. if (p3.x == p1.x) {
  11803. dRotationAngle = centerPoint.x > p1.x && p2.x > p1.x || centerPoint.x < p1.x && p2.x < p1.x ? 360 - dRotationAngle : dRotationAngle;
  11804. } else {
  11805. dRotationAngle = centerPoint.y > KTan13 * centerPoint.x + B13 && p2.y > KTan13 * p2.x + B13 || centerPoint.y < KTan13 * centerPoint.x + B13 && p2.y < KTan13 * p2.x + B13 ? 360 - dRotationAngle : dRotationAngle;
  11806. }
  11807. dStep = dRotationAngle / 72;
  11808. if (p3.y != p1.y) {
  11809. if (p3.x == p1.x) {
  11810. if (p3.y > p1.y) {
  11811. if (p2.x < p1.x) {
  11812. direc = false;
  11813. }
  11814. } else {
  11815. if (p2.x > p1.x) {
  11816. direc = false;
  11817. }
  11818. }
  11819. } else if (p3.x < p1.x) {
  11820. if (p2.y < KTan13 * p2.x + B13) {
  11821. direc = false;
  11822. }
  11823. } else {
  11824. if (p2.y > KTan13 * p2.x + B13) {
  11825. direc = false;
  11826. }
  11827. }
  11828. } else {
  11829. if (p3.x > p1.x) {
  11830. if (p2.y > p1.y) {
  11831. direc = false;
  11832. }
  11833. } else {
  11834. if (p2.y < p1.y) {
  11835. direc = false;
  11836. }
  11837. }
  11838. }
  11839. var K10 = (p1.y - centerPoint.y) / (p1.x - centerPoint.x);
  11840. var atan10 = K10 >= 0 ? Math.atan(K10) * 180 / Math.PI : Math.abs(Math.atan(K10) * 180 / Math.PI) + 90;
  11841. var CY = Math.abs(centerPoint.y);
  11842. if (p1.y == CY && CY == p3.y) {
  11843. if (p1.x < p3.x) {
  11844. atan10 = atan10 + 180;
  11845. }
  11846. }
  11847. var newPY = p1.y - centerPoint.y;
  11848. circlePoints.push(p1);
  11849. for (var i = 1; i < nSegmentCount; i++) {
  11850. dRotation = dStep * i;
  11851. dRotationBegin = atan10;
  11852. if (direc) {
  11853. if (newPY >= 0) {
  11854. if (K10 >= 0) {
  11855. dRotationBegin = dRotationBegin + dRotation;
  11856. } else {
  11857. dRotationBegin = 180 - (dRotationBegin - 90) + dRotation;
  11858. }
  11859. } else {
  11860. if (K10 > 0) {
  11861. dRotationBegin = dRotationBegin - 180 + dRotation;
  11862. } else {
  11863. dRotationBegin = 90 - dRotationBegin + dRotation;
  11864. }
  11865. }
  11866. } else {
  11867. if (newPY >= 0) {
  11868. if (K10 >= 0) {
  11869. dRotationBegin = dRotationBegin - dRotation;
  11870. } else {
  11871. dRotationBegin = 180 - (dRotationBegin - 90) - dRotation;
  11872. }
  11873. } else {
  11874. if (K10 >= 0) {
  11875. dRotationBegin = dRotationBegin - 180 - dRotation;
  11876. } else {
  11877. dRotationBegin = 90 - dRotationBegin - dRotation;
  11878. }
  11879. }
  11880. }
  11881. dRotationBegin = dRotationBegin * Math.PI / 180;
  11882. var x = centerPoint.x + R * Math.cos(dRotationBegin);
  11883. var y = centerPoint.y + R * Math.sin(dRotationBegin);
  11884. circlePoints.push(new Point(x, y));
  11885. }
  11886. circlePoints.push(p3);
  11887. }
  11888. return circlePoints;
  11889. }
  11890. /**
  11891. * @function GeometryLineString.createLineEPS
  11892. * @description 根据点的类型画出不同类型的曲线。
  11893. * 点的类型有三种:LTypeArc,LTypeCurve,NONE。
  11894. * @param {Array.<GeometryPoint>} points - 传入的待计算的初始点串。
  11895. * @returns {Array.<GeometryPoint>} 计算出相应的 lineEPS 控制点。
  11896. * @example
  11897. * var points = [];
  11898. * points.push(new GeometryPoint(-50,30));
  11899. * points.push(new GeometryPoint(-30,50,"LTypeArc"));
  11900. * points.push(new GeometryPoint(2,60));
  11901. * points.push(new GeometryPoint(8,20));
  11902. * var lineEPS = GeometryLineString.createLineEPS(points);
  11903. */
  11904. }, {
  11905. key: "createLineEPS",
  11906. value: function createLineEPS(points) {
  11907. var list = [],
  11908. len = points.length;
  11909. if (len < 2) {
  11910. return points;
  11911. }
  11912. for (var i = 0; i < len;) {
  11913. var type = points[i].type;
  11914. if (type == 'LTypeArc') {
  11915. var listObj = LineString.createLineArc(list, i, len, points);
  11916. list = listObj[0];
  11917. i = listObj[1];
  11918. } else {
  11919. list.push(points[i]);
  11920. i++;
  11921. }
  11922. }
  11923. return list;
  11924. }
  11925. }, {
  11926. key: "createLineArc",
  11927. value: function createLineArc(list, i, len, points) {
  11928. if (i == 0) {
  11929. var bezierPtsObj = LineString.addPointEPS(points, i, len, 'LTypeArc');
  11930. Array.prototype.push.apply(list, bezierPtsObj[0]);
  11931. i = bezierPtsObj[1] + 1;
  11932. } else if (i == len - 1) {
  11933. var bezierP = [points[i - 1], points[i]],
  11934. bezierPts = LineString.calculateCircle(bezierP);
  11935. Array.prototype.push.apply(list, bezierPts);
  11936. i++;
  11937. } else {
  11938. var _bezierPtsObj = LineString.addPointEPS(points, i, len, 'LTypeArc');
  11939. list.pop();
  11940. Array.prototype.push.apply(list, _bezierPtsObj[0]);
  11941. i = _bezierPtsObj[1] + 1;
  11942. }
  11943. return [list, i];
  11944. }
  11945. }, {
  11946. key: "addPointEPS",
  11947. value: function addPointEPS(points, i, len, type) {
  11948. var bezierP = [],
  11949. j = i + 1;
  11950. if (i == 0) {
  11951. Array.prototype.push.apply(bezierP, [points[i], points[i + 1]]);
  11952. } else if (i == len - 1) {
  11953. Array.prototype.push.apply(bezierP, [points[i - 1], points[i]]);
  11954. } else {
  11955. Array.prototype.push.apply(bezierP, [points[i - 1], points[i], points[i + 1]]);
  11956. }
  11957. var bezierPts;
  11958. if (type == 'LTypeCurve') {
  11959. bezierPts = LineString.calculatePointsFBZN(bezierP);
  11960. } else if (type == 'LTypeArc') {
  11961. bezierPts = LineString.calculateCircle(bezierP);
  11962. }
  11963. return [bezierPts, j];
  11964. }
  11965. }]);
  11966. return LineString;
  11967. }(Curve);
  11968. ;// CONCATENATED MODULE: ./src/common/commontypes/geometry/LinearRing.js
  11969. function LinearRing_typeof(obj) { "@babel/helpers - typeof"; return LinearRing_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, LinearRing_typeof(obj); }
  11970. function LinearRing_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  11971. function LinearRing_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  11972. function LinearRing_createClass(Constructor, protoProps, staticProps) { if (protoProps) LinearRing_defineProperties(Constructor.prototype, protoProps); if (staticProps) LinearRing_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  11973. function LinearRing_get() { if (typeof Reflect !== "undefined" && Reflect.get) { LinearRing_get = Reflect.get.bind(); } else { LinearRing_get = function _get(target, property, receiver) { var base = LinearRing_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return LinearRing_get.apply(this, arguments); }
  11974. function LinearRing_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = LinearRing_getPrototypeOf(object); if (object === null) break; } return object; }
  11975. function LinearRing_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) LinearRing_setPrototypeOf(subClass, superClass); }
  11976. function LinearRing_setPrototypeOf(o, p) { LinearRing_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return LinearRing_setPrototypeOf(o, p); }
  11977. function LinearRing_createSuper(Derived) { var hasNativeReflectConstruct = LinearRing_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = LinearRing_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = LinearRing_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return LinearRing_possibleConstructorReturn(this, result); }; }
  11978. function LinearRing_possibleConstructorReturn(self, call) { if (call && (LinearRing_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return LinearRing_assertThisInitialized(self); }
  11979. function LinearRing_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  11980. function LinearRing_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  11981. function LinearRing_getPrototypeOf(o) { LinearRing_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return LinearRing_getPrototypeOf(o); }
  11982. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  11983. * This program are made available under the terms of the Apache License, Version 2.0
  11984. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  11985. /**
  11986. * @class GeometryLinearRing
  11987. * @aliasclass Geometry.LinearRing
  11988. * @deprecatedclass SuperMap.Geometry.LinearRing
  11989. * @classdesc 几何对象线环类,是一个特殊的封闭的线串,在每次 addPoint/removePoint 之后会通过添加一个点(此点是复制的第一个点得到的)
  11990. * 作为最后的一个点来自动关闭线环。
  11991. * @category BaseTypes Geometry
  11992. * @extends GeometryLineString
  11993. * @param {Array.<GeometryPoint>} points - 组成线性环的点。
  11994. * @example
  11995. * var points = [new GeometryPoint(4933.319287022352, -3337.3849141502124),
  11996. * new GeometryPoint(4960.9674060199022, -3349.3316322355736),
  11997. * new GeometryPoint(5006.0235999418364, -3358.8890067038628),
  11998. * new GeometryPoint(5075.3145648369318, -3378.0037556404409),
  11999. * new GeometryPoint(5305.19551436013, -3376.9669111768926)],
  12000. * var linearRing = new GeometryLinearRing(points);
  12001. * @usage
  12002. */
  12003. var LinearRing_LinearRing = /*#__PURE__*/function (_LineString) {
  12004. LinearRing_inherits(LinearRing, _LineString);
  12005. var _super = LinearRing_createSuper(LinearRing);
  12006. function LinearRing(points) {
  12007. var _this;
  12008. LinearRing_classCallCheck(this, LinearRing);
  12009. _this = _super.call(this, points);
  12010. /**
  12011. * @member {Array.<string>} [GeometryLinearRing.prototype.componentTypes=["SuperMap.Geometry.Point"]]
  12012. * @description components 存储的几何对象所支持的几何类型数组,为空表示类型不受限制。
  12013. * @readonly
  12014. */
  12015. _this.componentTypes = ["SuperMap.Geometry.Point"];
  12016. _this.CLASS_NAME = "SuperMap.Geometry.LinearRing";
  12017. _this.geometryType = "LinearRing";
  12018. return _this;
  12019. }
  12020. /**
  12021. * @function GeometryLinearRing.prototype.addComponent
  12022. * @description 添加一个点到几何图形数组中,如果这个点将要被添加到组件数组的末端,并且与数组中已经存在的最后一个点相同,
  12023. * 重复的点是不能被添加的。这将影响未关闭环的关闭。
  12024. * 这个方法可以通过将非空索引(组件数组的下标)作为第二个参数重写。
  12025. * @param {GeometryPoint} point - 点对象。
  12026. * @param {number} [index] - 插入组件数组的下标。
  12027. * @returns {boolean} 点对象是否添加成功。
  12028. */
  12029. LinearRing_createClass(LinearRing, [{
  12030. key: "addComponent",
  12031. value: function addComponent(point, index) {
  12032. var added = false;
  12033. //remove last point
  12034. var lastPoint = this.components.pop();
  12035. // given an index, add the point
  12036. // without an index only add non-duplicate points
  12037. if (index != null || !point.equals(lastPoint)) {
  12038. added = LinearRing_get(LinearRing_getPrototypeOf(LinearRing.prototype), "addComponent", this).apply(this, arguments);
  12039. }
  12040. //append copy of first point
  12041. var firstPoint = this.components[0];
  12042. LinearRing_get(LinearRing_getPrototypeOf(LinearRing.prototype), "addComponent", this).apply(this, [firstPoint]);
  12043. return added;
  12044. }
  12045. /**
  12046. * @function GeometryLinearRing.prototype.removeComponent
  12047. * @description 从几何组件中删除一个点。
  12048. * @param {GeometryPoint} point - 点对象。
  12049. * @returns {boolean} 点对象是否删除。
  12050. */
  12051. }, {
  12052. key: "removeComponent",
  12053. value: function removeComponent(point) {
  12054. // eslint-disable-line no-unused-vars
  12055. var removed = this.components && this.components.length > 3;
  12056. if (removed) {
  12057. //remove last point
  12058. this.components.pop();
  12059. //remove our point
  12060. LinearRing_get(LinearRing_getPrototypeOf(LinearRing.prototype), "removeComponent", this).apply(this, arguments);
  12061. //append copy of first point
  12062. var firstPoint = this.components[0];
  12063. LinearRing_get(LinearRing_getPrototypeOf(LinearRing.prototype), "addComponent", this).apply(this, [firstPoint]);
  12064. }
  12065. return removed;
  12066. }
  12067. /**
  12068. * @function GeometryLinearRing.prototype.getArea
  12069. * @description 获得当前几何对象区域大小,如果是沿顺时针方向的环则是正值,否则为负值。
  12070. * @returns {number} 环的面积。
  12071. */
  12072. }, {
  12073. key: "getArea",
  12074. value: function getArea() {
  12075. var area = 0.0;
  12076. if (this.components && this.components.length > 2) {
  12077. var sum = 0.0;
  12078. for (var i = 0, len = this.components.length; i < len - 1; i++) {
  12079. var b = this.components[i];
  12080. var c = this.components[i + 1];
  12081. sum += (b.x + c.x) * (c.y - b.y);
  12082. }
  12083. area = -sum / 2.0;
  12084. }
  12085. return area;
  12086. }
  12087. /**
  12088. * @function GeometryLinearRing.prototype.getVertices
  12089. * @description 返回几何图形的所有点的列表。
  12090. * @param {boolean} [nodes] - 对于线来说,仅仅返回作为端点的顶点,如果设为 false ,则返回非端点的顶点,如果没有设置此参数,则返回所有顶点。
  12091. * @returns {Array} 几何对象所有点的列表。
  12092. */
  12093. }, {
  12094. key: "getVertices",
  12095. value: function getVertices(nodes) {
  12096. return nodes === true ? [] : this.components.slice(0, this.components.length - 1);
  12097. }
  12098. }]);
  12099. return LinearRing;
  12100. }(LineString);
  12101. ;// CONCATENATED MODULE: ./src/common/commontypes/geometry/Polygon.js
  12102. function Polygon_typeof(obj) { "@babel/helpers - typeof"; return Polygon_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, Polygon_typeof(obj); }
  12103. function Polygon_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  12104. function Polygon_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  12105. function Polygon_createClass(Constructor, protoProps, staticProps) { if (protoProps) Polygon_defineProperties(Constructor.prototype, protoProps); if (staticProps) Polygon_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  12106. function Polygon_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) Polygon_setPrototypeOf(subClass, superClass); }
  12107. function Polygon_setPrototypeOf(o, p) { Polygon_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Polygon_setPrototypeOf(o, p); }
  12108. function Polygon_createSuper(Derived) { var hasNativeReflectConstruct = Polygon_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Polygon_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Polygon_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Polygon_possibleConstructorReturn(this, result); }; }
  12109. function Polygon_possibleConstructorReturn(self, call) { if (call && (Polygon_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return Polygon_assertThisInitialized(self); }
  12110. function Polygon_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  12111. function Polygon_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  12112. function Polygon_getPrototypeOf(o) { Polygon_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Polygon_getPrototypeOf(o); }
  12113. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  12114. * This program are made available under the terms of the Apache License, Version 2.0
  12115. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  12116. /**
  12117. * @class GeometryPolygon
  12118. * @aliasclass Geometry.Polygon
  12119. * @deprecatedclass SuperMap.Geometry.Polygon
  12120. * @classdesc 多边形几何对象类。
  12121. * @category BaseTypes Geometry
  12122. * @extends GeometryCollection
  12123. * @param {Array.<GeometryLinearRing>} components - 多边形的线环数组。
  12124. * @example
  12125. * var points =[new GeometryPoint(0,4010338),
  12126. * new GeometryPoint(1063524,4010338),
  12127. * new GeometryPoint(1063524,3150322),
  12128. * new GeometryPoint(0,3150322)
  12129. * ],
  12130. * var linearRings = new GeometryLinearRing(points),
  12131. * var region = new GeometryPolygon([linearRings]);
  12132. * @usage
  12133. */
  12134. var Polygon_Polygon = /*#__PURE__*/function (_Collection) {
  12135. Polygon_inherits(Polygon, _Collection);
  12136. var _super = Polygon_createSuper(Polygon);
  12137. function Polygon(components) {
  12138. var _this;
  12139. Polygon_classCallCheck(this, Polygon);
  12140. _this = _super.call(this, components);
  12141. /**
  12142. * @member {Array.<string>} [GeometryPolygon.prototype.componentTypes=["SuperMap.Geometry.LinearRing"]]
  12143. * @description components 存储的几何对象所支持的几何类型数组。
  12144. * @readonly
  12145. */
  12146. _this.componentTypes = ["SuperMap.Geometry.LinearRing"];
  12147. _this.CLASS_NAME = "SuperMap.Geometry.Polygon";
  12148. _this.geometryType = "Polygon";
  12149. return _this;
  12150. }
  12151. /**
  12152. * @function GeometryMultiPoint.prototype.getArea
  12153. * @description 获得区域面积,从区域的外部口径减去计此区域内部口径算所得的面积。
  12154. * @returns {number} 几何对象的面积。
  12155. */
  12156. Polygon_createClass(Polygon, [{
  12157. key: "getArea",
  12158. value: function getArea() {
  12159. var area = 0.0;
  12160. if (this.components && this.components.length > 0) {
  12161. area += Math.abs(this.components[0].getArea());
  12162. for (var i = 1, len = this.components.length; i < len; i++) {
  12163. area -= Math.abs(this.components[i].getArea());
  12164. }
  12165. }
  12166. return area;
  12167. }
  12168. }]);
  12169. return Polygon;
  12170. }(Collection);
  12171. ;// CONCATENATED MODULE: ./src/common/commontypes/Feature.js
  12172. function Feature_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  12173. function Feature_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  12174. function Feature_createClass(Constructor, protoProps, staticProps) { if (protoProps) Feature_defineProperties(Constructor.prototype, protoProps); if (staticProps) Feature_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  12175. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  12176. * This program are made available under the terms of the Apache License, Version 2.0
  12177. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  12178. /**
  12179. * @class Feature
  12180. * @deprecatedclass SuperMap.Feature
  12181. * @category BaseTypes Geometry
  12182. * @classdesc 要素类组合了地理和属性,Feature 类同时具有 marker 和 lonlat 属性。
  12183. * @param {SuperMap.Layer} layer - 图层。
  12184. * @param {LonLat} lonlat - 经纬度。
  12185. * @param {Object} data - 数据对象。
  12186. * @usage
  12187. */
  12188. var Feature_Feature = /*#__PURE__*/function () {
  12189. function Feature(layer, lonlat, data) {
  12190. Feature_classCallCheck(this, Feature);
  12191. this.CLASS_NAME = "SuperMap.Feature";
  12192. /**
  12193. * @deprecated
  12194. * @member {SuperMap.Layer} Feature.prototype.layer
  12195. * @description 图层。
  12196. */
  12197. this.layer = layer;
  12198. /**
  12199. * @member {string} Feature.prototype.id
  12200. * @description 要素 ID。
  12201. */
  12202. this.id = Util_Util.createUniqueID(this.CLASS_NAME + "_");
  12203. /**
  12204. * @member {LonLat} Feature.prototype.lonlat
  12205. * @description 经纬度。
  12206. *
  12207. */
  12208. this.lonlat = lonlat;
  12209. /**
  12210. * @member {Object} Feature.prototype.data
  12211. * @description 数据对象。
  12212. */
  12213. this.data = data != null ? data : {};
  12214. }
  12215. /**
  12216. * @function Feature.prototype.destroy
  12217. * @description 释放相关资源。
  12218. */
  12219. Feature_createClass(Feature, [{
  12220. key: "destroy",
  12221. value: function destroy() {
  12222. this.id = null;
  12223. this.lonlat = null;
  12224. this.data = null;
  12225. }
  12226. }]);
  12227. return Feature;
  12228. }();
  12229. ;// CONCATENATED MODULE: ./src/common/commontypes/Vector.js
  12230. function Vector_typeof(obj) { "@babel/helpers - typeof"; return Vector_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, Vector_typeof(obj); }
  12231. function Vector_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  12232. function Vector_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  12233. function Vector_createClass(Constructor, protoProps, staticProps) { if (protoProps) Vector_defineProperties(Constructor.prototype, protoProps); if (staticProps) Vector_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  12234. function Vector_get() { if (typeof Reflect !== "undefined" && Reflect.get) { Vector_get = Reflect.get.bind(); } else { Vector_get = function _get(target, property, receiver) { var base = Vector_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return Vector_get.apply(this, arguments); }
  12235. function Vector_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Vector_getPrototypeOf(object); if (object === null) break; } return object; }
  12236. function Vector_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) Vector_setPrototypeOf(subClass, superClass); }
  12237. function Vector_setPrototypeOf(o, p) { Vector_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Vector_setPrototypeOf(o, p); }
  12238. function Vector_createSuper(Derived) { var hasNativeReflectConstruct = Vector_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Vector_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Vector_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Vector_possibleConstructorReturn(this, result); }; }
  12239. function Vector_possibleConstructorReturn(self, call) { if (call && (Vector_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return Vector_assertThisInitialized(self); }
  12240. function Vector_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  12241. function Vector_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  12242. function Vector_getPrototypeOf(o) { Vector_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Vector_getPrototypeOf(o); }
  12243. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  12244. * This program are made available under the terms of the Apache License, Version 2.0
  12245. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  12246. /**
  12247. * @class FeatureVector
  12248. * @aliasclass Feature.Vector
  12249. * @deprecatedclass SuperMap.Feature.Vector
  12250. * @category BaseTypes Geometry
  12251. * @classdesc 矢量要素类。该类具有 Geometry 属性存放几何信息,
  12252. * attributes 属性存放非几何信息,另外还包含了 style 属性,用来定义矢量要素的样式,
  12253. * 其中,默认的样式在 {@link FeatureVector.style} 类中定义,如果没有特别的指定将使用默认的样式。
  12254. * @extends {Feature}
  12255. * @param {Geometry} geometry - 要素的几何信息。
  12256. * @param {Object} [attributes] - 描述要素的任意的可序列化属性,将要映射到 attributes 属性中的对象。
  12257. * @param {Object} [style] - 样式对象。
  12258. * @example
  12259. * var geometry = new GeometryPoint(-115,10);
  12260. * var style = {
  12261. * strokeColor:"#339933",
  12262. * strokeOpacity:1,
  12263. * strokeWidth:3,
  12264. * pointRadius:6
  12265. * }
  12266. * var pointFeature = new FeatureVector(geometry,null,style);
  12267. * vectorLayer.addFeatures(pointFeature);
  12268. * @usage
  12269. */
  12270. // TRASH THIS
  12271. var State = {
  12272. /** states */
  12273. UNKNOWN: 'Unknown',
  12274. INSERT: 'Insert',
  12275. UPDATE: 'Update',
  12276. DELETE: 'Delete'
  12277. };
  12278. var Vector = /*#__PURE__*/function (_Feature) {
  12279. Vector_inherits(Vector, _Feature);
  12280. var _super = Vector_createSuper(Vector);
  12281. function Vector(geometry, attributes, style) {
  12282. var _this;
  12283. Vector_classCallCheck(this, Vector);
  12284. _this = _super.call(this, null, null, attributes);
  12285. /**
  12286. * @member {string} FeatureVector.prototype.fid
  12287. * @description fid。
  12288. */
  12289. _this.fid = null;
  12290. /**
  12291. * @member {Geometry} FeatureVector.prototype.geometry
  12292. * @description 存放几何信息。
  12293. */
  12294. _this.geometry = geometry ? geometry : null;
  12295. /**
  12296. * @member {Object} FeatureVector.prototype.attributes
  12297. * @description 描述要素的任意的可序列化属性。
  12298. */
  12299. _this.attributes = {};
  12300. if (attributes) {
  12301. _this.attributes = Util_Util.extend(_this.attributes, attributes);
  12302. }
  12303. /**
  12304. * @member {Bounds} FeatureVector.prototype.bounds
  12305. * @description 限制要素几何的边界。
  12306. */
  12307. _this.bounds = null;
  12308. /**
  12309. * @member {string} FeatureVector.prototype.state
  12310. * @description state。
  12311. */
  12312. _this.state = null;
  12313. /**
  12314. * @member {Object} FeatureVector.prototype.style
  12315. * @description 要素的样式属性,地图查询返回的 feature 的 style,8C 变为null。
  12316. */
  12317. _this.style = style ? style : null;
  12318. /**
  12319. * @member {string} FeatureVector.prototype.url
  12320. * @description 如果设置了这个属性,在更新或者删除要素时需要考虑 {@link HTTP} 。
  12321. */
  12322. _this.url = null;
  12323. _this.lonlat = null;
  12324. _this.CLASS_NAME = "SuperMap.Feature.Vector";
  12325. Vector.style = {
  12326. 'default': {
  12327. fillColor: "#ee9900",
  12328. fillOpacity: 0.4,
  12329. hoverFillColor: "white",
  12330. hoverFillOpacity: 0.8,
  12331. strokeColor: "#ee9900",
  12332. strokeOpacity: 1,
  12333. strokeWidth: 1,
  12334. strokeLinecap: "round",
  12335. strokeDashstyle: "solid",
  12336. hoverStrokeColor: "red",
  12337. hoverStrokeOpacity: 1,
  12338. hoverStrokeWidth: 0.2,
  12339. pointRadius: 6,
  12340. hoverPointRadius: 1,
  12341. hoverPointUnit: "%",
  12342. pointerEvents: "visiblePainted",
  12343. cursor: "inherit",
  12344. fontColor: "#000000",
  12345. labelAlign: "cm",
  12346. labelOutlineColor: "white",
  12347. labelOutlineWidth: 3
  12348. },
  12349. 'select': {
  12350. fillColor: "blue",
  12351. fillOpacity: 0.4,
  12352. hoverFillColor: "white",
  12353. hoverFillOpacity: 0.8,
  12354. strokeColor: "blue",
  12355. strokeOpacity: 1,
  12356. strokeWidth: 2,
  12357. strokeLinecap: "round",
  12358. strokeDashstyle: "solid",
  12359. hoverStrokeColor: "red",
  12360. hoverStrokeOpacity: 1,
  12361. hoverStrokeWidth: 0.2,
  12362. pointRadius: 6,
  12363. hoverPointRadius: 1,
  12364. hoverPointUnit: "%",
  12365. pointerEvents: "visiblePainted",
  12366. cursor: "pointer",
  12367. fontColor: "#000000",
  12368. labelAlign: "cm",
  12369. labelOutlineColor: "white",
  12370. labelOutlineWidth: 3
  12371. },
  12372. 'temporary': {
  12373. fillColor: "#66cccc",
  12374. fillOpacity: 0.2,
  12375. hoverFillColor: "white",
  12376. hoverFillOpacity: 0.8,
  12377. strokeColor: "#66cccc",
  12378. strokeOpacity: 1,
  12379. strokeLinecap: "round",
  12380. strokeWidth: 2,
  12381. strokeDashstyle: "solid",
  12382. hoverStrokeColor: "red",
  12383. hoverStrokeOpacity: 1,
  12384. hoverStrokeWidth: 0.2,
  12385. pointRadius: 6,
  12386. hoverPointRadius: 1,
  12387. hoverPointUnit: "%",
  12388. pointerEvents: "visiblePainted",
  12389. //cursor:"inherit",
  12390. cursor: "default",
  12391. fontColor: "#000000",
  12392. labelAlign: "cm",
  12393. labelOutlineColor: "white",
  12394. labelOutlineWidth: 3
  12395. },
  12396. 'delete': {
  12397. display: "none"
  12398. }
  12399. };
  12400. return _this;
  12401. }
  12402. /**
  12403. * @function FeatureVector.prototype.destroy
  12404. * @description 释放资源,将引用资源的属性置空。
  12405. */
  12406. Vector_createClass(Vector, [{
  12407. key: "destroy",
  12408. value: function destroy() {
  12409. if (this.layer) {
  12410. this.layer.removeFeatures(this);
  12411. this.layer = null;
  12412. }
  12413. this.geometry = null;
  12414. Vector_get(Vector_getPrototypeOf(Vector.prototype), "destroy", this).call(this);
  12415. }
  12416. /**
  12417. * @function FeatureVector.prototype.clone
  12418. * @description 复制矢量要素,并返回复制后的新对象。
  12419. * @returns {FeatureVector} 相同要素的新的矢量要素。
  12420. */
  12421. }, {
  12422. key: "clone",
  12423. value: function clone() {
  12424. return new Vector(this.geometry ? this.geometry.clone() : null, this.attributes, this.style);
  12425. }
  12426. /**
  12427. * @function FeatureVector.prototype.toState
  12428. * @description 设置新状态。
  12429. * @param {string} state - 状态。
  12430. */
  12431. }, {
  12432. key: "toState",
  12433. value: function toState(state) {
  12434. if (state === State.UPDATE) {
  12435. switch (this.state) {
  12436. case State.UNKNOWN:
  12437. case State.DELETE:
  12438. this.state = state;
  12439. break;
  12440. case State.UPDATE:
  12441. case State.INSERT:
  12442. break;
  12443. }
  12444. } else if (state === State.INSERT) {
  12445. switch (this.state) {
  12446. case State.UNKNOWN:
  12447. break;
  12448. default:
  12449. this.state = state;
  12450. break;
  12451. }
  12452. } else if (state === State.DELETE) {
  12453. switch (this.state) {
  12454. case State.INSERT:
  12455. // the feature should be destroyed
  12456. break;
  12457. case State.DELETE:
  12458. break;
  12459. case State.UNKNOWN:
  12460. case State.UPDATE:
  12461. this.state = state;
  12462. break;
  12463. }
  12464. } else if (state === State.UNKNOWN) {
  12465. this.state = state;
  12466. }
  12467. }
  12468. }]);
  12469. return Vector;
  12470. }(Feature_Feature);
  12471. /**
  12472. *
  12473. * @typedef {Object} FeatureVector.style
  12474. * @description Feature 有大量的样式属性,如果没有特别的指定将使用默认的样式,
  12475. * 大部分样式通过 SVG 标准定义属性。
  12476. * - fill properties 资料介绍:{@link http://www.w3.org/TR/SVG/painting.html#FillProperties}
  12477. * - stroke properties 资料介绍:{@link http://www.w3.org/TR/SVG/painting.html#StrokeProperties}
  12478. * @property {boolean} [fill] - 不需要填充则设置为 false。
  12479. * @property {string} [fillColor='#ee9900'] - 十六进制填充颜色。
  12480. * @property {number} [fillOpacity=0.4] - 填充不透明度。
  12481. * @property {boolean} [stroke] - 不需要描边则设为 false。
  12482. * @property {string} [strokeColor='#ee9900'] - 十六进制描边颜色。
  12483. * @property {number} [strokeOpacity=0.4] - 描边的不透明度(0-1)。
  12484. * @property {number} [strokeWidth=1] - 像素描边宽度。
  12485. * @property {string} [strokeLinecap='round'] - strokeLinecap 有三种类型 butt,round,square。
  12486. * @property {string} [strokeDashstyle='solid'] - 有 dot,dash,dashdot,longdash,longdashdot,solid 几种样式。
  12487. * @property {boolean} [graphic] - 不需要则设置为 false。
  12488. * @property {number} [pointRadius=6] - 像素点半径。
  12489. * @property {string} [pointerEvents='visiblePainted'] - pointerEvents。
  12490. * @property {string} [cursor] - cursor。
  12491. * @property {boolean} [allowRotate='false'] - 是否允许图标随着运行方向旋转。用于时空数据图层。
  12492. * @property {string} [externalGraphic] - 连接到用来渲染点的外部的图形。
  12493. * @property {number} [graphicWidth] - 外部图表的像素宽度。
  12494. * @property {number} [graphicHeight] - 外部图表的像素高度。
  12495. * @property {number} [graphicOpacity] - 外部图表的不透明度(0-1)。
  12496. * @property {number} [graphicXOffset] - 外部图表沿着x方向的偏移量。
  12497. * @property {number} [graphicYOffset] - 外部图表沿着y方向的偏移量。
  12498. * @property {number} [rotation] - 一个图表沿着其中心点(或者偏移中心指定点)在顺时针方向旋转。
  12499. * @property {number} [graphicZIndex] - 渲染时使用的索引值。
  12500. * @property {string} [graphicName='circle'] - 渲染点时图标使用的名字。支持"circle" , "square", "star", "x", "cross", "triangle"。
  12501. * @property {string} [graphicTitle] - 外部图表的提示框。
  12502. * @property {string} [backgroundGraphic] - 外部图表的背景。
  12503. * @property {number} [backgroundGraphicZIndex] - 背景图渲染时使用的索引值。
  12504. * @property {number} [backgroundXOffset] - 背景图在 x 轴的偏移量。
  12505. * @property {number} [backgroundYOffset] - 背景图在 y 轴的偏移量。
  12506. * @property {number} [backgroundHeight] - 背景图的高度。如果没有设置,将用 graphicHeight。
  12507. * @property {number} [backgroundWidth] - 背景图的宽度。如果没有设置,将用 graphicWidth。
  12508. * @property {boolean} [isUnicode=false] - 这个属性要配合 label 属性来用,当为 true时,label 就可以使用 unicode 编码,
  12509. * 比如 "a" 的 unicode 十六进制编码为 61,则 label 属性可以为 "&#x61;",其中 "&#" 为前缀,标志这个为 unicode 编码,
  12510. * "x" 是指 16 进制,这时页面显示的是 "a";当此值为 false 的时候,label 的内容会被直接输出,
  12511. * 比如,label 为 "&#x61;",这时页面显示的也是 "&#x61;"。
  12512. * @property {string} [label] - 可选的标签文本。
  12513. * @property {string} [labelAlign='cm'] - 标签对齐,是由两个字符组成的字符串,如:"lt", "cm", "rb",
  12514. * 其中第一个字符代表水平方向上的对齐,"l"=left, "c"=center, "r"=right;
  12515. * 第二个字符代表垂直方向上的对齐,"t"=top, "m"=middle, "b"=bottom。
  12516. * @property {number} [labelXOffset] - 标签在 x 轴方向的偏移量。
  12517. * @property {number} [labelYOffset] - 标签在 y 轴方向的偏移量。
  12518. * @property {boolean} [labelSelect=false] - 如果设为 true,标签可以选用 SelectFeature 或者 similar 控件。
  12519. * @property {string} [fontColor='#000000'] - 标签字体颜色。
  12520. * @property {number} [fontOpacity] - 标签透明度 (0-1)。
  12521. * @property {string} [fontFamily] - 标签的字体类型。
  12522. * @property {string} [fontSize] - 标签的字体大小。
  12523. * @property {string} [fontStyle] - 标签的字体样式。
  12524. * @property {string} [fontWeight] - 标签的字体粗细。
  12525. * @property {string} [display] - 如果 display 属性设置为 “none”,符号将没有任何效果。
  12526. * @example
  12527. * // label的用法如下:
  12528. * function addGeoTest(){
  12529. * var geometry = new GeometryPoint(105, 35);
  12530. * var pointFeature = new FeatureVector(geometry);
  12531. * var styleTest = {
  12532. * label:"supermap",
  12533. * fontColor:"#0000ff",
  12534. * fontOpacity:"0.5",
  12535. * fontFamily:"隶书",
  12536. * fontSize:"8em",
  12537. * fontWeight:"bold",
  12538. * fontStyle:"italic",
  12539. * labelSelect:"true",
  12540. * }
  12541. * pointFeature.style = styleTest;
  12542. * vectorLayer.addFeatures([pointFeature]);
  12543. * }
  12544. */
  12545. ;// CONCATENATED MODULE: ./src/common/format/Format.js
  12546. function Format_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  12547. 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); } }
  12548. function Format_createClass(Constructor, protoProps, staticProps) { if (protoProps) Format_defineProperties(Constructor.prototype, protoProps); if (staticProps) Format_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  12549. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  12550. * This program are made available under the terms of the Apache License, Version 2.0
  12551. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  12552. /**
  12553. * @class Format
  12554. * @deprecatedclass SuperMap.Format
  12555. * @classdesc 读写各种格式的格式类基类。其子类应该包含并实现 read 和 write 方法。
  12556. * @category BaseTypes Format
  12557. * @param {Object} options - 可选参数。
  12558. * @param {boolean} [options.keepData=false] - 如果设置为 true, data 属性会指向被解析的对象(例如 JSON 或 xml 数据对象)。
  12559. * @param {Object} [options.data] - 当 keepData 属性设置为 true,这是传递给 read 操作的要被解析的字符串。
  12560. * @usage
  12561. */
  12562. var Format = /*#__PURE__*/function () {
  12563. function Format(options) {
  12564. Format_classCallCheck(this, Format);
  12565. /**
  12566. * @member {Object} Format.prototype.data
  12567. * @description 当 keepData 属性设置为 true,这是传递给 read 操作的要被解析的字符串。
  12568. */
  12569. this.data = null;
  12570. /**
  12571. * @member {Object} [Format.prototype.keepData=false]
  12572. * @description 保持最近读到的数据的引用(通过 data 属性)。
  12573. */
  12574. this.keepData = false;
  12575. Util_Util.extend(this, options);
  12576. this.options = options;
  12577. this.CLASS_NAME = "SuperMap.Format";
  12578. }
  12579. /**
  12580. * @function Format.prototype.destroy
  12581. * @description 销毁该格式类,释放相关资源。
  12582. */
  12583. Format_createClass(Format, [{
  12584. key: "destroy",
  12585. value: function destroy() {
  12586. //用来销毁该格式类,释放相关资源
  12587. }
  12588. /**
  12589. * @function Format.prototype.read
  12590. * @description 来从字符串中读取数据。
  12591. * @param {string} data - 读取的数据。
  12592. */
  12593. }, {
  12594. key: "read",
  12595. value: function read(data) {// eslint-disable-line no-unused-vars
  12596. //用来从字符串中读取数据
  12597. }
  12598. /**
  12599. * @function Format.prototype.write
  12600. * @description 将对象写成字符串。
  12601. * @param {Object} object - 可序列化的对象。
  12602. * @returns {string} 对象转化后的字符串。
  12603. */
  12604. }, {
  12605. key: "write",
  12606. value: function write(object) {// eslint-disable-line no-unused-vars
  12607. //用来写字符串
  12608. }
  12609. }]);
  12610. return Format;
  12611. }();
  12612. ;// CONCATENATED MODULE: ./src/common/format/JSON.js
  12613. function JSON_typeof(obj) { "@babel/helpers - typeof"; return JSON_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, JSON_typeof(obj); }
  12614. function JSON_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  12615. 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); } }
  12616. function JSON_createClass(Constructor, protoProps, staticProps) { if (protoProps) JSON_defineProperties(Constructor.prototype, protoProps); if (staticProps) JSON_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  12617. function JSON_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) JSON_setPrototypeOf(subClass, superClass); }
  12618. function JSON_setPrototypeOf(o, p) { JSON_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return JSON_setPrototypeOf(o, p); }
  12619. 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); }; }
  12620. function JSON_possibleConstructorReturn(self, call) { if (call && (JSON_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return JSON_assertThisInitialized(self); }
  12621. function JSON_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  12622. function JSON_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  12623. function JSON_getPrototypeOf(o) { JSON_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return JSON_getPrototypeOf(o); }
  12624. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  12625. * This program are made available under the terms of the Apache License, Version 2.0
  12626. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  12627. /**
  12628. * @class JSONFormat
  12629. * @aliasclass Format.JSON
  12630. * @deprecatedclass SuperMap.Format.JSON
  12631. * @classdesc 安全的读写 JSON 的解析类。使用 {@link JSONFormat} 构造函数创建新实例。
  12632. * @category BaseTypes Format
  12633. * @param {Object} [options] - 可选参数。
  12634. * @param {string} [options.indent=" "] - 用于格式化输出,indent 字符串会在每次缩进的时候使用一次。
  12635. * @param {string} [options.space=" "] - 用于格式化输出,space 字符串会在名值对的 ":" 后边添加。
  12636. * @param {string} [options.newline="\n"] - 用于格式化输出, newline 字符串会用在每一个名值对或数组项末尾。
  12637. * @param {number} [options.level=0] - 用于格式化输出, 表示的是缩进级别。
  12638. * @param {boolean} [options.pretty=false] - 是否在序列化的时候使用额外的空格控制结构。在 write 方法中使用。
  12639. * @param {boolean} [options.nativeJSON] - 需要被注册的监听器对象。
  12640. * @extends {Format}
  12641. * @usage
  12642. */
  12643. var JSONFormat = /*#__PURE__*/function (_Format) {
  12644. JSON_inherits(JSONFormat, _Format);
  12645. var _super = JSON_createSuper(JSONFormat);
  12646. function JSONFormat(options) {
  12647. var _this;
  12648. JSON_classCallCheck(this, JSONFormat);
  12649. _this = _super.call(this, options);
  12650. /**
  12651. * @member {string} [JSONFormat.prototype.indent=" "]
  12652. * @description 用于格式化输出,indent 字符串会在每次缩进的时候使用一次。
  12653. */
  12654. _this.indent = " ";
  12655. /**
  12656. * @member {string} [JSONFormat.prototype.space=" "]
  12657. * @description 用于格式化输出,space 字符串会在名值对的 ":" 后边添加。
  12658. */
  12659. _this.space = " ";
  12660. /**
  12661. * @member {string} [JSONFormat.prototype.newline="\n"]
  12662. * @description 用于格式化输出, newline 字符串会用在每一个名值对或数组项末尾。
  12663. */
  12664. _this.newline = "\n";
  12665. /**
  12666. * @member {number} [JSONFormat.prototype.level=0]
  12667. * @description 用于格式化输出, 表示的是缩进级别。
  12668. */
  12669. _this.level = 0;
  12670. /**
  12671. * @member {boolean} [JSONFormat.prototype.pretty=false]
  12672. * @description 是否在序列化的时候使用额外的空格控制结构。在 write 方法中使用。
  12673. */
  12674. _this.pretty = false;
  12675. /**
  12676. * @member {boolean} JSONFormat.prototype.nativeJSON
  12677. * @description 判断浏览器是否原生支持 JSON 格式数据。
  12678. */
  12679. _this.nativeJSON = function () {
  12680. return !!(window.JSON && typeof JSON.parse === "function" && typeof JSON.stringify === "function");
  12681. }();
  12682. _this.CLASS_NAME = "SuperMap.Format.JSON";
  12683. /**
  12684. * @member JSONFormat.prototype.serialize
  12685. * @description 提供一些类型对象转 JSON 字符串的方法。
  12686. */
  12687. _this.serialize = {
  12688. /**
  12689. * @function JSONFormat.serialize.object
  12690. * @description 把对象转换为 JSON 字符串。
  12691. * @param {Object} object - 可序列化的对象。
  12692. * @returns {string} JSON 字符串。
  12693. */
  12694. 'object': function object(_object) {
  12695. // three special objects that we want to treat differently
  12696. if (_object == null) {
  12697. return "null";
  12698. }
  12699. if (_object.constructor === Date) {
  12700. return this.serialize.date.apply(this, [_object]);
  12701. }
  12702. if (_object.constructor === Array) {
  12703. return this.serialize.array.apply(this, [_object]);
  12704. }
  12705. var pieces = ['{'];
  12706. this.level += 1;
  12707. var key, keyJSON, valueJSON;
  12708. var addComma = false;
  12709. for (key in _object) {
  12710. if (_object.hasOwnProperty(key)) {
  12711. // recursive calls need to allow for sub-classing
  12712. keyJSON = this.write.apply(this, [key, this.pretty]);
  12713. valueJSON = this.write.apply(this, [_object[key], this.pretty]);
  12714. if (keyJSON != null && valueJSON != null) {
  12715. if (addComma) {
  12716. pieces.push(',');
  12717. }
  12718. pieces.push(this.writeNewline(), this.writeIndent(), keyJSON, ':', this.writeSpace(), valueJSON);
  12719. addComma = true;
  12720. }
  12721. }
  12722. }
  12723. this.level -= 1;
  12724. pieces.push(this.writeNewline(), this.writeIndent(), '}');
  12725. return pieces.join('');
  12726. },
  12727. /**
  12728. * @function JSONFormat.serialize.array
  12729. * @description 把数组转换成 JSON 字符串。
  12730. * @param {Array} array - 可序列化的数组。
  12731. * @returns {string} JSON 字符串。
  12732. */
  12733. 'array': function array(_array) {
  12734. var json;
  12735. var pieces = ['['];
  12736. this.level += 1;
  12737. for (var i = 0, len = _array.length; i < len; ++i) {
  12738. // recursive calls need to allow for sub-classing
  12739. json = this.write.apply(this, [_array[i], this.pretty]);
  12740. if (json != null) {
  12741. if (i > 0) {
  12742. pieces.push(',');
  12743. }
  12744. pieces.push(this.writeNewline(), this.writeIndent(), json);
  12745. }
  12746. }
  12747. this.level -= 1;
  12748. pieces.push(this.writeNewline(), this.writeIndent(), ']');
  12749. return pieces.join('');
  12750. },
  12751. /**
  12752. * @function JSONFormat.serialize.string
  12753. * @description 把字符串转换成 JSON 字符串。
  12754. * @param {string} string - 可序列化的字符串。
  12755. * @returns {string} JSON 字符串。
  12756. */
  12757. 'string': function string(_string) {
  12758. // If the string contains no control characters, no quote characters, and no
  12759. // backslash characters, then we can simply slap some quotes around it.
  12760. // Otherwise we must also replace the offending characters with safe
  12761. // sequences.
  12762. var m = {
  12763. '\b': '\\b',
  12764. '\t': '\\t',
  12765. '\n': '\\n',
  12766. '\f': '\\f',
  12767. '\r': '\\r',
  12768. '"': '\\"',
  12769. '\\': '\\\\'
  12770. };
  12771. /*eslint-disable no-control-regex*/
  12772. if (/["\\\x00-\x1f]/.test(_string)) {
  12773. return '"' + _string.replace(/([\x00-\x1f\\"])/g, function (a, b) {
  12774. var c = m[b];
  12775. if (c) {
  12776. return c;
  12777. }
  12778. c = b.charCodeAt();
  12779. return "\\u00" + Math.floor(c / 16).toString(16) + (c % 16).toString(16);
  12780. }) + '"';
  12781. }
  12782. return '"' + _string + '"';
  12783. },
  12784. /**
  12785. * @function JSONFormat.serialize.number
  12786. * @description 把数字转换成 JSON 字符串。
  12787. * @param {number} number - 可序列化的数字。
  12788. * @returns {string} JSON 字符串。
  12789. */
  12790. 'number': function number(_number) {
  12791. return isFinite(_number) ? String(_number) : "null";
  12792. },
  12793. /**
  12794. * @function JSONFormat.serialize.boolean
  12795. * @description Transform a boolean into a JSON string.
  12796. * @param {boolean} bool - The boolean to be serialized.
  12797. * @returns {string} A JSON string representing the boolean.
  12798. */
  12799. 'boolean': function boolean(bool) {
  12800. return String(bool);
  12801. },
  12802. /**
  12803. * @function JSONFormat.serialize.object
  12804. * @description 将日期对象转换成 JSON 字符串。
  12805. * @param {Date} date - 可序列化的日期对象。
  12806. * @returns {string} JSON 字符串。
  12807. */
  12808. 'date': function date(_date) {
  12809. function format(number) {
  12810. // Format integers to have at least two digits.
  12811. return number < 10 ? '0' + number : number;
  12812. }
  12813. return '"' + _date.getFullYear() + '-' + format(_date.getMonth() + 1) + '-' + format(_date.getDate()) + 'T' + format(_date.getHours()) + ':' + format(_date.getMinutes()) + ':' + format(_date.getSeconds()) + '"';
  12814. }
  12815. };
  12816. return _this;
  12817. }
  12818. /**
  12819. * @function JSONFormat.prototype.read
  12820. * @description 将一个符合 JSON 结构的字符串进行解析。
  12821. * @param {string} json - 符合 JSON 结构的字符串。
  12822. * @param {function} filter - 过滤方法,最终结果的每一个键值对都会调用该过滤方法,并在对应的值的位置替换成该方法返回的值。
  12823. * @returns {(Object|string|Array|number|boolean)} 对象,数组,字符串或数字。
  12824. */
  12825. JSON_createClass(JSONFormat, [{
  12826. key: "read",
  12827. value: function read(json, filter) {
  12828. var object;
  12829. if (this.nativeJSON) {
  12830. try {
  12831. object = JSON.parse(json, filter);
  12832. } catch (e) {
  12833. // Fall through if the regexp test fails.
  12834. return {
  12835. data: json
  12836. };
  12837. }
  12838. }
  12839. if (this.keepData) {
  12840. this.data = object;
  12841. }
  12842. return object;
  12843. }
  12844. /**
  12845. * @function JSONFormat.prototype.write
  12846. * @description 序列化一个对象到一个符合 JSON 格式的字符串。
  12847. * @param {Object|string|Array|number|boolean} value - 需要被序列化的对象,数组,字符串,数字,布尔值。
  12848. * @param {boolean} [pretty=false] - 是否在序列化的时候使用额外的空格控制结构。在 write 方法中使用。
  12849. * @returns {string} 符合 JSON 格式的字符串。
  12850. *
  12851. */
  12852. }, {
  12853. key: "write",
  12854. value: function write(value, pretty) {
  12855. this.pretty = !!pretty;
  12856. var json = null;
  12857. var type = JSON_typeof(value);
  12858. if (this.serialize[type]) {
  12859. try {
  12860. json = !this.pretty && this.nativeJSON ? JSON.stringify(value) : this.serialize[type].apply(this, [value]);
  12861. } catch (err) {
  12862. //console.error("Trouble serializing: " + err);
  12863. }
  12864. }
  12865. return json;
  12866. }
  12867. /**
  12868. * @function JSONFormat.prototype.writeIndent
  12869. * @description 根据缩进级别输出一个缩进字符串。
  12870. * @private
  12871. * @returns {string} 一个适当的缩进字符串。
  12872. */
  12873. }, {
  12874. key: "writeIndent",
  12875. value: function writeIndent() {
  12876. var pieces = [];
  12877. if (this.pretty) {
  12878. for (var i = 0; i < this.level; ++i) {
  12879. pieces.push(this.indent);
  12880. }
  12881. }
  12882. return pieces.join('');
  12883. }
  12884. /**
  12885. * @function JSONFormat.prototype.writeNewline
  12886. * @description 在格式化输出模式情况下输出代表新一行的字符串。
  12887. * @private
  12888. * @returns {string} 代表新的一行的字符串。
  12889. */
  12890. }, {
  12891. key: "writeNewline",
  12892. value: function writeNewline() {
  12893. return this.pretty ? this.newline : '';
  12894. }
  12895. /**
  12896. * @function JSONFormat.prototype.writeSpace
  12897. * @private
  12898. * @description 在格式化输出模式情况下输出一个代表空格的字符串。
  12899. * @returns {string} 空格字符串。
  12900. */
  12901. }, {
  12902. key: "writeSpace",
  12903. value: function writeSpace() {
  12904. return this.pretty ? this.space : '';
  12905. }
  12906. }]);
  12907. return JSONFormat;
  12908. }(Format);
  12909. ;// CONCATENATED MODULE: ./src/common/commontypes/geometry/MultiLineString.js
  12910. function MultiLineString_typeof(obj) { "@babel/helpers - typeof"; return MultiLineString_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, MultiLineString_typeof(obj); }
  12911. function MultiLineString_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  12912. function MultiLineString_createClass(Constructor, protoProps, staticProps) { if (protoProps) MultiLineString_defineProperties(Constructor.prototype, protoProps); if (staticProps) MultiLineString_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  12913. function MultiLineString_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  12914. function MultiLineString_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) MultiLineString_setPrototypeOf(subClass, superClass); }
  12915. function MultiLineString_setPrototypeOf(o, p) { MultiLineString_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return MultiLineString_setPrototypeOf(o, p); }
  12916. function MultiLineString_createSuper(Derived) { var hasNativeReflectConstruct = MultiLineString_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = MultiLineString_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = MultiLineString_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return MultiLineString_possibleConstructorReturn(this, result); }; }
  12917. function MultiLineString_possibleConstructorReturn(self, call) { if (call && (MultiLineString_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return MultiLineString_assertThisInitialized(self); }
  12918. function MultiLineString_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  12919. function MultiLineString_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  12920. function MultiLineString_getPrototypeOf(o) { MultiLineString_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return MultiLineString_getPrototypeOf(o); }
  12921. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  12922. * This program are made available under the terms of the Apache License, Version 2.0
  12923. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  12924. /**
  12925. * @class GeometryMultiLineString
  12926. * @aliasclass Geometry.MultiLineString
  12927. * @deprecatedclass SuperMap.Geometry.MultiLineString
  12928. * @classdesc 几何对象多线类。
  12929. * @category BaseTypes Geometry
  12930. * @extends GeometryCollection
  12931. * @param {Array.<GeometryLineString>} components - GeometryLineString 数组。
  12932. * @example
  12933. * var multi = new GeometryMultiLineString([
  12934. * new GeometryLineString([
  12935. * new GeometryPoint(1, 0),
  12936. * new GeometryPoint(0, 1)
  12937. * ])
  12938. * ]);
  12939. * @usage
  12940. */
  12941. var MultiLineString = /*#__PURE__*/function (_Collection) {
  12942. MultiLineString_inherits(MultiLineString, _Collection);
  12943. var _super = MultiLineString_createSuper(MultiLineString);
  12944. function MultiLineString(components) {
  12945. var _this;
  12946. MultiLineString_classCallCheck(this, MultiLineString);
  12947. _this = _super.call(this, components);
  12948. /**
  12949. * @member {Array.<string>} [GeometryMultiLineString.prototype.componentTypes=["SuperMap.Geometry.LineString"]]
  12950. * @description components 存储的几何对象所支持的几何类型数组。
  12951. * @readonly
  12952. */
  12953. _this.componentTypes = ["SuperMap.Geometry.LineString"];
  12954. _this.CLASS_NAME = "SuperMap.Geometry.MultiLineString";
  12955. _this.geometryType = "MultiLineString";
  12956. return _this;
  12957. }
  12958. return MultiLineString_createClass(MultiLineString);
  12959. }(Collection);
  12960. ;// CONCATENATED MODULE: ./src/common/commontypes/geometry/MultiPolygon.js
  12961. function MultiPolygon_typeof(obj) { "@babel/helpers - typeof"; return MultiPolygon_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, MultiPolygon_typeof(obj); }
  12962. function MultiPolygon_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  12963. function MultiPolygon_createClass(Constructor, protoProps, staticProps) { if (protoProps) MultiPolygon_defineProperties(Constructor.prototype, protoProps); if (staticProps) MultiPolygon_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  12964. function MultiPolygon_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  12965. function MultiPolygon_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) MultiPolygon_setPrototypeOf(subClass, superClass); }
  12966. function MultiPolygon_setPrototypeOf(o, p) { MultiPolygon_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return MultiPolygon_setPrototypeOf(o, p); }
  12967. function MultiPolygon_createSuper(Derived) { var hasNativeReflectConstruct = MultiPolygon_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = MultiPolygon_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = MultiPolygon_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return MultiPolygon_possibleConstructorReturn(this, result); }; }
  12968. function MultiPolygon_possibleConstructorReturn(self, call) { if (call && (MultiPolygon_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return MultiPolygon_assertThisInitialized(self); }
  12969. function MultiPolygon_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  12970. function MultiPolygon_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  12971. function MultiPolygon_getPrototypeOf(o) { MultiPolygon_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return MultiPolygon_getPrototypeOf(o); }
  12972. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  12973. * This program are made available under the terms of the Apache License, Version 2.0
  12974. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  12975. /**
  12976. * @class GeometryMultiPolygon
  12977. * @aliasclass Geometry.MultiPolygon
  12978. * @deprecatedclass SuperMap.Geometry.MultiPolygon
  12979. * @classdesc 几何对象多多边形类。
  12980. * @category BaseTypes Geometry
  12981. * @extends GeometryCollection
  12982. * @param {Array.<GeometryPolygon>} components - 形成 GeometryMultiPolygon 的多边形数组。
  12983. * @example
  12984. * var points1 = [new GeometryPoint(10,10),new GeometryPoint(0,0)];
  12985. * var points2 = [new GeometryPoint(10,10),new GeometryPoint(0,0),new GeometryPoint(3,3),new GeometryPoint(10,10)];
  12986. *
  12987. * var linearRing1 = new GeometryLinearRing(points1);
  12988. * var linearRing2 = new GeometryLinearRing(points2);
  12989. *
  12990. * var polygon1 = new GeometryPolygon([linearRing1]);
  12991. * var polygon2 = new GeometryPolygon([linearRing2]);
  12992. *
  12993. * var multiPolygon1 = new GeometryMultiPolygon([polygon1,polygon2]);
  12994. * @usage
  12995. */
  12996. var MultiPolygon = /*#__PURE__*/function (_Collection) {
  12997. MultiPolygon_inherits(MultiPolygon, _Collection);
  12998. var _super = MultiPolygon_createSuper(MultiPolygon);
  12999. function MultiPolygon(components) {
  13000. var _this;
  13001. MultiPolygon_classCallCheck(this, MultiPolygon);
  13002. _this = _super.call(this, components);
  13003. /**
  13004. * @member {Array.<string>} [GeometryMultiPolygon.prototype.componentTypes=["SuperMap.Geometry.Polygon"]]
  13005. * @description components 存储的几何对象所支持的几何类型数组。
  13006. * @readonly
  13007. */
  13008. _this.componentTypes = ["SuperMap.Geometry.Polygon"];
  13009. _this.CLASS_NAME = "SuperMap.Geometry.MultiPolygon";
  13010. _this.geometryType = "MultiPolygon";
  13011. return _this;
  13012. }
  13013. return MultiPolygon_createClass(MultiPolygon);
  13014. }(Collection);
  13015. ;// CONCATENATED MODULE: ./src/common/iServer/ServerColor.js
  13016. function ServerColor_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  13017. function ServerColor_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  13018. function ServerColor_createClass(Constructor, protoProps, staticProps) { if (protoProps) ServerColor_defineProperties(Constructor.prototype, protoProps); if (staticProps) ServerColor_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  13019. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  13020. * This program are made available under the terms of the Apache License, Version 2.0
  13021. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  13022. /**
  13023. * @class ServerColor
  13024. * @deprecatedclass SuperMap.ServerColor
  13025. * @category iServer Map Theme
  13026. * @classdesc 颜色类。该类使用三原色( RGB )来表达颜色。
  13027. * @param {Object} options - 可选参数。
  13028. * @param {number} [options.red=255] - 获取或设置红色值。
  13029. * @param {number} [options.green=0] - 获取或设置绿色值。
  13030. * @param {number} [options.blue=0] - 获取或设置蓝色值。
  13031. * @usage
  13032. */
  13033. var ServerColor = /*#__PURE__*/function () {
  13034. function ServerColor(red, green, blue) {
  13035. ServerColor_classCallCheck(this, ServerColor);
  13036. /**
  13037. * @member {number} [ServerColor.prototype.red=255]
  13038. * @description 获取或设置红色值。
  13039. */
  13040. this.red = !red && red != 0 ? 255 : red;
  13041. /**
  13042. * @member {number} [ServerColor.prototype.green=0]
  13043. * @description 获取或设置绿色值。
  13044. */
  13045. this.green = green || 0;
  13046. /**
  13047. * @member {number} [ServerColor.prototype.blue=0]
  13048. * @description 获取或设置蓝色值。
  13049. */
  13050. this.blue = blue || 0;
  13051. this.CLASS_NAME = "SuperMap.ServerColor";
  13052. }
  13053. /**
  13054. * @function ServerColor.prototype.destroy
  13055. * @description 释放资源,将引用资源的属性置空。
  13056. */
  13057. ServerColor_createClass(ServerColor, [{
  13058. key: "destroy",
  13059. value: function destroy() {
  13060. var me = this;
  13061. me.red = null;
  13062. me.green = null;
  13063. me.blue = null;
  13064. }
  13065. /**
  13066. * @function ServerColor.formJson
  13067. * @description 将 JSON 对象转化为 ServerColor 对象。
  13068. * @param {Object} jsonObject - 要转换的 JSON 对象。
  13069. * @returns {ServerColor} 转化后的 ServerColor 对象。
  13070. */
  13071. }], [{
  13072. key: "fromJson",
  13073. value: function fromJson(jsonObject) {
  13074. if (!jsonObject) {
  13075. return;
  13076. }
  13077. var color = new ServerColor();
  13078. var red = 255;
  13079. if (jsonObject.red !== null) {
  13080. red = Number(jsonObject.red);
  13081. }
  13082. color.red = red;
  13083. var green = 0;
  13084. if (jsonObject.green !== null) {
  13085. green = Number(jsonObject.green);
  13086. }
  13087. color.green = green;
  13088. var blue = 0;
  13089. if (jsonObject.blue !== null) {
  13090. blue = Number(jsonObject.blue);
  13091. }
  13092. color.blue = blue;
  13093. return color;
  13094. }
  13095. }]);
  13096. return ServerColor;
  13097. }();
  13098. ;// CONCATENATED MODULE: ./src/common/iServer/ServerStyle.js
  13099. function ServerStyle_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  13100. function ServerStyle_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  13101. function ServerStyle_createClass(Constructor, protoProps, staticProps) { if (protoProps) ServerStyle_defineProperties(Constructor.prototype, protoProps); if (staticProps) ServerStyle_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  13102. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  13103. * This program are made available under the terms of the Apache License, Version 2.0
  13104. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  13105. /**
  13106. * @class ServerStyle
  13107. * @deprecatedclass SuperMap.ServerStyle
  13108. * @category iServer Map Theme
  13109. * @classdesc 服务端矢量要素风格类。该类用于定义点状符号、线状符号、填充符号风格及其相关属性。
  13110. * @param {Object} options - 参数。
  13111. * @param {FillGradientMode} options.fillGradientMode - 渐变填充风格的渐变类型。
  13112. * @param {ServerColor} [options.fillBackColor=[255,255,255]] - 填充背景颜色。
  13113. * @param {boolean} [options.fillBackOpaque=false] - 背景是否不透明。
  13114. * @param {ServerColor} [options.fillForeColor=[255,0,0]] - 填充颜色。
  13115. * @param {number} [options.fillGradientAngle=0] - 渐变填充的旋转角度。
  13116. * @param {number} [options.fillGradientOffsetRatioX=0] - 渐变填充中心点相对于填充区域范围中心点的水平偏移百分比。
  13117. * @param {number} [options.fillGradientOffsetRatioY=0] - 填充中心点相对于填充区域范围中心点的垂直偏移百分比。
  13118. * @param {number} [options.fillOpaqueRate=100] - 填充不透明度。
  13119. * @param {number} [options.fillSymbolID=0] - 填充符号的编码。
  13120. * @param {ServerColor} [options.lineColor] - 矢量要素的边线颜色。默认 lineColor = new ServerColor(0, 0, 0)。
  13121. * @param {number} [options.lineSymbolID=0] - 线状符号的编码。
  13122. * @param {number} [options.lineWidth=1] - 边线的宽度。
  13123. * @param {number} [options.markerAngle=0] - 点状符号的旋转角度。
  13124. * @param {number} [options.markerSize=1] - 点状符号的大小。
  13125. * @param {number} [options.markerSymbolID=-1] - 点状符号的编码。
  13126. * @usage
  13127. */
  13128. var ServerStyle = /*#__PURE__*/function () {
  13129. function ServerStyle(options) {
  13130. ServerStyle_classCallCheck(this, ServerStyle);
  13131. /**
  13132. * @member {ServerColor} ServerStyle.prototype.fillBackColor
  13133. * @description 填充背景颜色。当填充模式为渐变填充时,该颜色为填充终止色。
  13134. */
  13135. this.fillBackColor = new ServerColor(255, 255, 255);
  13136. /**
  13137. * @member {boolean} [ServerStyle.prototype.fillBackOpaque=false]
  13138. * @description 背景是否不透明。false 表示透明。
  13139. */
  13140. this.fillBackOpaque = false;
  13141. /**
  13142. * @member {ServerColor} ServerStyle.prototype.fillForeColor
  13143. * @description 填充颜色。当填充模式为渐变填充时,该颜色为填充起始颜色。
  13144. */
  13145. this.fillForeColor = new ServerColor(255, 0, 0);
  13146. /**
  13147. * @member {FillGradientMode} ServerStyle.prototype.fillGradientMode
  13148. * @description 渐变填充风格的渐变类型。
  13149. */
  13150. this.fillGradientMode = null;
  13151. /**
  13152. * @member {number} ServerStyle.prototype.fillGradientAngle -
  13153. * @description 渐变填充的旋转角度。单位为度,精确到 0.1 度,逆时针方向为正方向。
  13154. */
  13155. this.fillGradientAngle = 0;
  13156. /**
  13157. * @member {number} ServerStyle.prototype.fillGradientOffsetRatioX
  13158. * @description 渐变填充中心点相对于填充区域范围中心点的水平偏移百分比。它们的关系如下:设填充区域范围中心点的坐标为(x0, y0),
  13159. * 填充中心点的坐标为(x, y),填充区域范围的宽度为 a,水平偏移百分比为 dx,则 x=x0 + a*dx/100。
  13160. */
  13161. this.fillGradientOffsetRatioX = 0;
  13162. /**
  13163. * @member {number} ServerStyle.prototype.fillGradientOffsetRatioY
  13164. * @description 填充中心点相对于填充区域范围中心点的垂直偏移百分比。它们的关系如下:<br>
  13165. * 设填充区域范围中心点的坐标为(x0, y0),填充中心点的坐标为(x, y),填充区域范围的高度为 b,垂直偏移百分比为 dy,则 y=y0 + b*dx/100。
  13166. */
  13167. this.fillGradientOffsetRatioY = 0;
  13168. /**
  13169. * @member {number} [ServerStyle.prototype.fillOpaqueRate=100]
  13170. * @description 填充不透明度。合法值为 0 - 100 的数值。其中为 0 表示完全透明;
  13171. * 100 表示完全不透明。赋值小于 0 时按照 0 处理,大于 100 时按照 100 处理。
  13172. */
  13173. this.fillOpaqueRate = 100;
  13174. /**
  13175. * @member {number} ServerStyle.prototype.fillSymbolID
  13176. * @description 填充符号的编码。此编码用于唯一标识各普通填充风格的填充符号。
  13177. * 关于填充符号的样式与对应的 ID 号请在 SuperMap 桌面软件中查找。
  13178. */
  13179. this.fillSymbolID = 0;
  13180. /**
  13181. * @member {ServerColor} ServerStyle.prototype.lineColor
  13182. * @description 矢量要素的边线颜色。如果等级符号是点符号,点符号的颜色由 lineColor 控制。
  13183. */
  13184. this.lineColor = new ServerColor(0, 0, 0);
  13185. /**
  13186. * @member {number} [ServerStyle.prototype.lineSymbolID=0]
  13187. * @description 线状符号的编码。此编码用于唯一标识各普通填充风格的填充符号。
  13188. * 关于线状符号的样式与对应的 ID 号请在 SuperMap 桌面软件中查找。
  13189. */
  13190. this.lineSymbolID = 0;
  13191. /**
  13192. * @member {number} [ServerStyle.prototype.lineWidth=1.0]
  13193. * @description 边线的宽度。单位为毫米,精度到 0.1。
  13194. */
  13195. this.lineWidth = 1;
  13196. /**
  13197. * @member {number} [ServerStyle.prototype.markerAngle=0]
  13198. * @description 点状符号的旋转角度。以度为单位,精确到 0.1 度,逆时针方向为正方向。
  13199. */
  13200. this.markerAngle = 0;
  13201. /**
  13202. * @member {number} [ServerStyle.prototype.markerSize=1.0]
  13203. * @description 点状符号的大小。单位为毫米,精度为 0.1。当该属性设置为0时,采用符号默认大小 1.0 显示。
  13204. * 当该属性设置为非法值时,交由服务器默认处理。
  13205. */
  13206. this.markerSize = 1;
  13207. /**
  13208. * @member {number} [ServerStyle.prototype.markerSymbolID=-1]
  13209. * @description 点状符号的编码。此编码用于唯一标识各点状符号。
  13210. * 关于线状符号的样式与对应的 ID 号请在 SuperMap 桌面软件中查找。
  13211. */
  13212. this.markerSymbolID = -1;
  13213. if (options) {
  13214. Util_Util.extend(this, options);
  13215. }
  13216. this.CLASS_NAME = "SuperMap.ServerStyle";
  13217. }
  13218. /**
  13219. * @function ServerStyle.prototype.destroy
  13220. * @description 释放资源,将引用资源的属性置空。
  13221. */
  13222. ServerStyle_createClass(ServerStyle, [{
  13223. key: "destroy",
  13224. value: function destroy() {
  13225. var me = this;
  13226. if (me.fillBackColor) {
  13227. me.fillBackColor.destroy();
  13228. me.fillBackColor = null;
  13229. }
  13230. me.fillBackOpaque = null;
  13231. if (me.fillForeColor) {
  13232. me.fillForeColor.destroy();
  13233. me.fillForeColor = null;
  13234. }
  13235. me.fillGradientMode = null;
  13236. me.fillGradientAngle = null;
  13237. me.fillGradientOffsetRatioX = null;
  13238. me.fillGradientOffsetRatioY = null;
  13239. me.fillOpaqueRate = null;
  13240. me.fillSymbolID = null;
  13241. if (me.lineColor) {
  13242. me.lineColor.destroy();
  13243. me.lineColor = null;
  13244. }
  13245. me.lineSymbolID = null;
  13246. me.lineWidth = null;
  13247. me.markerAngle = null;
  13248. me.markerSize = null;
  13249. me.markerSymbolID = null;
  13250. }
  13251. /**
  13252. * @function ServerStyle.prototype.toServerJSONObject
  13253. * @description 转换成对应的 JSON 格式对象。
  13254. * @returns {Object} 对应的 JSON 格式对象.
  13255. */
  13256. }, {
  13257. key: "toServerJSONObject",
  13258. value: function toServerJSONObject() {
  13259. var styleObj = {};
  13260. styleObj = Util_Util.copyAttributes(styleObj, this);
  13261. //暂时先忽略serverColor往Json的转换
  13262. return styleObj;
  13263. }
  13264. /**
  13265. * @function ServerStyle.fromJson
  13266. * @description 将JSON对象转换为 ServerStyle 对象。
  13267. * @param {Object} jsonObject - 要转换的 JSON 对象。
  13268. * @returns {ServerStyle} 转化后的 ServerStyle 对象。
  13269. */
  13270. }], [{
  13271. key: "fromJson",
  13272. value: function fromJson(jsonObject) {
  13273. if (!jsonObject) {
  13274. return;
  13275. }
  13276. return new ServerStyle({
  13277. fillBackColor: ServerColor.fromJson(jsonObject.fillBackColor),
  13278. fillBackOpaque: jsonObject.fillBackOpaque,
  13279. fillForeColor: ServerColor.fromJson(jsonObject.fillForeColor),
  13280. fillGradientMode: jsonObject.fillGradientMode,
  13281. fillGradientAngle: jsonObject.fillGradientAngle,
  13282. fillGradientOffsetRatioX: jsonObject.fillGradientOffsetRatioX,
  13283. fillGradientOffsetRatioY: jsonObject.fillGradientOffsetRatioY,
  13284. fillOpaqueRate: jsonObject.fillOpaqueRate,
  13285. fillSymbolID: jsonObject.fillSymbolID,
  13286. lineColor: ServerColor.fromJson(jsonObject.lineColor),
  13287. lineSymbolID: jsonObject.lineSymbolID,
  13288. lineWidth: jsonObject.lineWidth,
  13289. markerAngle: jsonObject.markerAngle,
  13290. markerSize: jsonObject.markerSize,
  13291. markerSymbolID: jsonObject.markerSymbolID
  13292. });
  13293. }
  13294. }]);
  13295. return ServerStyle;
  13296. }();
  13297. ;// CONCATENATED MODULE: ./src/common/iServer/PointWithMeasure.js
  13298. function PointWithMeasure_typeof(obj) { "@babel/helpers - typeof"; return PointWithMeasure_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, PointWithMeasure_typeof(obj); }
  13299. function PointWithMeasure_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  13300. function PointWithMeasure_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  13301. function PointWithMeasure_createClass(Constructor, protoProps, staticProps) { if (protoProps) PointWithMeasure_defineProperties(Constructor.prototype, protoProps); if (staticProps) PointWithMeasure_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  13302. function PointWithMeasure_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) PointWithMeasure_setPrototypeOf(subClass, superClass); }
  13303. function PointWithMeasure_setPrototypeOf(o, p) { PointWithMeasure_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return PointWithMeasure_setPrototypeOf(o, p); }
  13304. function PointWithMeasure_createSuper(Derived) { var hasNativeReflectConstruct = PointWithMeasure_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = PointWithMeasure_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = PointWithMeasure_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return PointWithMeasure_possibleConstructorReturn(this, result); }; }
  13305. function PointWithMeasure_possibleConstructorReturn(self, call) { if (call && (PointWithMeasure_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return PointWithMeasure_assertThisInitialized(self); }
  13306. function PointWithMeasure_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  13307. function PointWithMeasure_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  13308. function PointWithMeasure_getPrototypeOf(o) { PointWithMeasure_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return PointWithMeasure_getPrototypeOf(o); }
  13309. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  13310. * This program are made available under the terms of the Apache License, Version 2.0
  13311. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  13312. /**
  13313. * @class PointWithMeasure
  13314. * @deprecatedclass SuperMap.PointWithMeasure
  13315. * @category iServer SpatialAnalyst RouteLocator
  13316. * @classdesc 路由点类。路由点是指具有线性度量值 (Measure) 的二维地理坐标点。
  13317. * @param {Object} options - 参数。
  13318. * @param {number} options.measure - 度量值,即路由对象属性值 M。
  13319. * @param {number} options.x - 地理坐标系下的 X 坐标值。
  13320. * @param {number} options.y - 地理坐标系下的 Y 坐标值。
  13321. * @extends {GeometryPoint}
  13322. * @usage
  13323. */
  13324. var PointWithMeasure = /*#__PURE__*/function (_Point) {
  13325. PointWithMeasure_inherits(PointWithMeasure, _Point);
  13326. var _super = PointWithMeasure_createSuper(PointWithMeasure);
  13327. function PointWithMeasure(options) {
  13328. var _this;
  13329. PointWithMeasure_classCallCheck(this, PointWithMeasure);
  13330. _this = _super.call(this, options);
  13331. /**
  13332. * @member {number} PointWithMeasure.prototype.measure
  13333. * @description 度量值,即路由对象属性值 M。
  13334. */
  13335. _this.measure = null;
  13336. if (options) {
  13337. Util_Util.extend(PointWithMeasure_assertThisInitialized(_this), options);
  13338. }
  13339. _this.CLASS_NAME = "SuperMap.PointWithMeasure";
  13340. return _this;
  13341. }
  13342. /**
  13343. * @function PointWithMeasure.prototype.equals
  13344. * @description 判断两个路由点对象是否相等。如果两个路由点对象具有相同的坐标以及度量值,则认为是相等的。
  13345. * @param {PointWithMeasure} geom - 需要判断的路由点对象。
  13346. * @returns {boolean} 两个路由点对象是否相等(true 为相等,false 为不等)。
  13347. */
  13348. PointWithMeasure_createClass(PointWithMeasure, [{
  13349. key: "equals",
  13350. value: function equals(geom) {
  13351. var equals = false;
  13352. if (geom != null) {
  13353. var isValueEquals = this.x === geom.x && this.y === geom.y && this.measure === geom.measure;
  13354. var isNaNValue = isNaN(this.x) && isNaN(this.y) && isNaN(this.measure);
  13355. var isNaNGeometry = isNaN(geom.x) && isNaN(geom.y) && isNaN(geom.measure);
  13356. equals = isValueEquals || isNaNValue && isNaNGeometry;
  13357. }
  13358. return equals;
  13359. }
  13360. /**
  13361. * @function PointWithMeasure.prototype.toJson
  13362. * @description 转换为 JSON 对象。
  13363. * */
  13364. }, {
  13365. key: "toJson",
  13366. value: function toJson() {
  13367. var result = "{";
  13368. if (this.measure != null && this.measure != undefined) {
  13369. result += "\"measure\":" + this.measure + ",";
  13370. }
  13371. result += "\"x\":" + this.x + ",";
  13372. result += "\"y\":" + this.y;
  13373. result += "}";
  13374. return result;
  13375. }
  13376. /**
  13377. * @function PointWithMeasure.prototype.destroy
  13378. * @description 释放资源,将引用资源的属性置空。
  13379. */
  13380. }, {
  13381. key: "destroy",
  13382. value: function destroy() {
  13383. var me = this;
  13384. me.measure = null;
  13385. me.x = null;
  13386. me.y = null;
  13387. }
  13388. /**
  13389. * @function PointWithMeasure.fromJson
  13390. * @description 将 JSON 对象转换为{@link PointWithMeasure} 对象。
  13391. * @param {Object} jsonObject - JSON 对象表示的路由点。
  13392. * @returns {PointWithMeasure} 转化后的 PointWithMeasure 对象。
  13393. */
  13394. }], [{
  13395. key: "fromJson",
  13396. value: function fromJson(jsonObject) {
  13397. if (!jsonObject) {
  13398. return;
  13399. }
  13400. return new PointWithMeasure({
  13401. x: jsonObject.x,
  13402. y: jsonObject.y,
  13403. measure: jsonObject.measure
  13404. });
  13405. }
  13406. }]);
  13407. return PointWithMeasure;
  13408. }(Point);
  13409. ;// CONCATENATED MODULE: ./src/common/iServer/Route.js
  13410. function Route_typeof(obj) { "@babel/helpers - typeof"; return Route_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, Route_typeof(obj); }
  13411. function Route_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  13412. function Route_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  13413. function Route_createClass(Constructor, protoProps, staticProps) { if (protoProps) Route_defineProperties(Constructor.prototype, protoProps); if (staticProps) Route_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  13414. function Route_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) Route_setPrototypeOf(subClass, superClass); }
  13415. function Route_setPrototypeOf(o, p) { Route_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Route_setPrototypeOf(o, p); }
  13416. function Route_createSuper(Derived) { var hasNativeReflectConstruct = Route_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Route_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Route_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Route_possibleConstructorReturn(this, result); }; }
  13417. function Route_possibleConstructorReturn(self, call) { if (call && (Route_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return Route_assertThisInitialized(self); }
  13418. function Route_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  13419. function Route_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  13420. function Route_getPrototypeOf(o) { Route_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Route_getPrototypeOf(o); }
  13421. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  13422. * This program are made available under the terms of the Apache License, Version 2.0
  13423. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  13424. /**
  13425. * @class Route
  13426. * @deprecatedclass SuperMap.Route
  13427. * @category iServer SpatialAnalyst RouteCalculateMeasure
  13428. * @classdesc 路由对象类。路由对象为一系列有序的带有属性值 M 的 x,y 坐标对,其中 M 值为该结点的距离属性(到已知点的距离)。
  13429. * @param {Array.<Geometry>} points - 形成路由对象的线数组。
  13430. * @param {Object} options - 参数。
  13431. * @param {number} options.id - 路由对象在数据库中的 ID。
  13432. * @param {number} options.length - 路由对象的长度。单位与数据集的单位相同。
  13433. * @param {number} [options.maxM] - 最大线性度量值,即所有结点到起始点的量算距离中最大值。
  13434. * @param {number} [options.minM] - 最小线性度量值,即所有结点到起始点的量算距离中最小值。
  13435. * @param {string} [options.type] - 数据类型,如:"LINEM"。
  13436. * @extends GeometryCollection
  13437. * @usage
  13438. */
  13439. var Route = /*#__PURE__*/function (_Collection) {
  13440. Route_inherits(Route, _Collection);
  13441. var _super = Route_createSuper(Route);
  13442. function Route(points, options) {
  13443. var _this;
  13444. Route_classCallCheck(this, Route);
  13445. _this = _super.call(this, points, options);
  13446. /**
  13447. * @member {number} Route.prototype.id
  13448. * @description 路由对象在数据库中的 ID。
  13449. */
  13450. _this.id = null;
  13451. /**
  13452. * @member {number} Route.prototype.center
  13453. * @description 路由对象的中心点。
  13454. */
  13455. _this.center = null;
  13456. /**
  13457. * @member {string} Route.prototype.style
  13458. * @description 路由对象的样式。
  13459. */
  13460. _this.style = null;
  13461. /**
  13462. * @member {number} Route.prototype.length
  13463. * @description 路由对象的长度。单位与数据集的单位相同。
  13464. */
  13465. _this.length = null;
  13466. /**
  13467. * @member {number} Route.prototype.maxM
  13468. * @description 最大线性度量值,即所有结点到起始点的量算距离中最大值。
  13469. */
  13470. _this.maxM = null;
  13471. /**
  13472. * @member {number} Route.prototype.minM
  13473. * @description 最小线性度量值,即所有结点到起始点的量算距离中最小值。
  13474. */
  13475. _this.minM = null;
  13476. /**
  13477. * @member {Array.<number>} Route.prototype.parts
  13478. * @description 服务端几何对象中各个子对象所包含的节点个数。
  13479. */
  13480. _this.parts = null;
  13481. /**
  13482. * @member {Array.<Object>} Route.prototype.points
  13483. * @description 路由对象的所有路由点。
  13484. * @example
  13485. * (start code)
  13486. * [
  13487. * {
  13488. * "measure": 0,
  13489. * "y": -4377.027184298267,
  13490. * "x": 4020.0045221720466
  13491. * },
  13492. * {
  13493. * "measure": 37.33288381391519,
  13494. * "y": -4381.569363260499,
  13495. * "x": 4057.0600591960642
  13496. * }
  13497. * ]
  13498. * (end)
  13499. */
  13500. _this.points = null;
  13501. /**
  13502. * @member {string} Route.prototype.type
  13503. * @description 服务端几何对象类型。
  13504. */
  13505. _this.type = null;
  13506. /**
  13507. * @member {Array.<string>} [Route.prototype.componentTypes=LineString]
  13508. * @description components 存储的几何对象所支持的几何类型数组。
  13509. */
  13510. _this.componentTypes = ["SuperMap.Geometry.LinearRing", "SuperMap.Geometry.LineString"];
  13511. if (options) {
  13512. Util_Util.extend(Route_assertThisInitialized(_this), options);
  13513. }
  13514. _this.CLASS_NAME = "SuperMap.Route";
  13515. _this.geometryType = "LINEM";
  13516. return _this;
  13517. }
  13518. /**
  13519. *
  13520. * @function Route.prototype.toJson
  13521. * @description 转换为 JSON 对象。
  13522. * @returns {Object} JSON 对象。
  13523. */
  13524. Route_createClass(Route, [{
  13525. key: "toJson",
  13526. value: function toJson() {
  13527. var result = "{";
  13528. if (this.id != null && this.id != undefined) {
  13529. result += "\"id\":" + this.id + ",";
  13530. }
  13531. if (this.center != null && this.center != undefined) {
  13532. result += "\"center\":" + this.center + ",";
  13533. }
  13534. if (this.style != null && this.style != undefined) {
  13535. result += "\"style\":" + this.style + ",";
  13536. }
  13537. if (this.length != null && this.length != undefined) {
  13538. result += "\"length\":" + this.length + ",";
  13539. }
  13540. if (this.maxM != null && this.maxM != undefined) {
  13541. result += "\"maxM\":" + this.maxM + ",";
  13542. }
  13543. if (this.minM != null && this.minM != undefined) {
  13544. result += "\"minM\":" + this.minM + ",";
  13545. }
  13546. if (this.type != null && this.type != undefined) {
  13547. result += "\"type\":\"" + this.type + "\",";
  13548. }
  13549. if (this.parts != null && this.parts != undefined) {
  13550. result += "\"parts\":[" + this.parts[0];
  13551. for (var i = 1; i < this.parts.length; i++) {
  13552. result += "," + this.parts[i];
  13553. }
  13554. result += "],";
  13555. }
  13556. if (this.components != null && this.components.length > 0) {
  13557. result += "\"points\":[";
  13558. for (var j = 0, len = this.components.length; j < len; j++) {
  13559. for (var k = 0, len2 = this.components[j].components.length; k < len2; k++) {
  13560. result += this.components[j].components[k].toJson() + ",";
  13561. }
  13562. }
  13563. result = result.replace(/,$/g, '');
  13564. result += "]";
  13565. }
  13566. result = result.replace(/,$/g, '');
  13567. result += "}";
  13568. return result;
  13569. }
  13570. /**
  13571. * @function Route.prototype.destroy
  13572. * @override
  13573. */
  13574. }, {
  13575. key: "destroy",
  13576. value: function destroy() {
  13577. var me = this;
  13578. me.id = null;
  13579. me.center = null;
  13580. me.style = null;
  13581. me.length = null;
  13582. me.maxM = null;
  13583. me.minM = null;
  13584. me.type = null;
  13585. me.parts = null;
  13586. me.components.length = 0;
  13587. me.components = null;
  13588. me.componentTypes = null;
  13589. }
  13590. /**
  13591. * @function Route.fromJson
  13592. * @description 将 JSON 对象转换为 Route 对象。
  13593. * @param {Object} [jsonObject] - JSON 对象表示的路由对象。
  13594. * @returns {Route} 转化后的 Route 对象。
  13595. */
  13596. }], [{
  13597. key: "fromJson",
  13598. value: function fromJson(jsonObject) {
  13599. if (!jsonObject) {
  13600. return;
  13601. }
  13602. var geoParts = jsonObject.parts || [],
  13603. geoPoints = jsonObject.points || [],
  13604. len = geoParts.length,
  13605. lineList = [];
  13606. if (len > 0) {
  13607. for (var i = 0, pointIndex = 0, pointList = []; i < len; i++) {
  13608. for (var j = 0; j < geoParts[i]; j++) {
  13609. pointList.push(PointWithMeasure.fromJson(geoPoints[pointIndex + j]));
  13610. }
  13611. pointIndex += geoParts[i];
  13612. //判断线是否闭合,如果闭合,则返回LinearRing,否则返回LineString
  13613. if (pointList[0].equals(pointList[geoParts[i] - 1])) {
  13614. lineList.push(new LinearRing_LinearRing(pointList));
  13615. } else {
  13616. lineList.push(new LineString(pointList));
  13617. }
  13618. pointList = [];
  13619. }
  13620. } else {
  13621. return null;
  13622. }
  13623. return new Route(lineList, {
  13624. id: jsonObject.id,
  13625. center: jsonObject.center,
  13626. style: jsonObject.style,
  13627. length: jsonObject.length,
  13628. maxM: jsonObject.maxM,
  13629. minM: jsonObject.minM,
  13630. type: jsonObject.type,
  13631. parts: jsonObject.parts
  13632. });
  13633. }
  13634. }]);
  13635. return Route;
  13636. }(Collection);
  13637. ;// CONCATENATED MODULE: ./src/common/REST.js
  13638. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  13639. * This program are made available under the terms of the Apache License, Version 2.0
  13640. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  13641. /**
  13642. * @enum DataFormat
  13643. * @description 服务请求返回结果数据类型
  13644. * @category BaseTypes Constant
  13645. * @type {string}
  13646. * @usage
  13647. * ```
  13648. * // 浏览器
  13649. * <script type="text/javascript" src="{cdn}"></script>
  13650. * <script>
  13651. * const result = {namespace}.DataFormat.GEOJSON;
  13652. *
  13653. * </script>
  13654. * // ES6 Import
  13655. * import { DataFormat } from '{npm}';
  13656. *
  13657. * const result = DataFormat.GEOJSON;
  13658. * ```
  13659. */
  13660. var DataFormat = {
  13661. /** GEOJSON */
  13662. GEOJSON: "GEOJSON",
  13663. /** ISERVER */
  13664. ISERVER: "ISERVER",
  13665. /** FGB */
  13666. FGB: "FGB"
  13667. };
  13668. /**
  13669. * @enum ServerType
  13670. * @description 服务器类型
  13671. * @category BaseTypes Constant
  13672. * @type {string}
  13673. * @usage
  13674. * ```
  13675. * // 浏览器
  13676. * <script type="text/javascript" src="{cdn}"></script>
  13677. * <script>
  13678. * const result = {namespace}.ServerType.ISERVER;
  13679. *
  13680. * </script>
  13681. * // ES6 Import
  13682. * import { ServerType } from '{npm}';
  13683. *
  13684. * const result = ServerType.ISERVER;
  13685. * ```
  13686. */
  13687. var ServerType = {
  13688. /** ISERVER */
  13689. ISERVER: "ISERVER",
  13690. /** IPORTAL */
  13691. IPORTAL: "IPORTAL",
  13692. /** ONLINE */
  13693. ONLINE: "ONLINE"
  13694. };
  13695. /**
  13696. * @enum GeometryType
  13697. * @description 几何对象枚举,定义了一系列几何对象类型。
  13698. * @category BaseTypes Constant
  13699. * @type {string}
  13700. * @usage
  13701. * ```
  13702. * // 浏览器
  13703. * <script type="text/javascript" src="{cdn}"></script>
  13704. * <script>
  13705. * const result = {namespace}.GeometryType.LINE;
  13706. *
  13707. * </script>
  13708. * // ES6 Import
  13709. * import { GeometryType } from '{npm}';
  13710. *
  13711. * const result = GeometryType.LINE;
  13712. * ```
  13713. */
  13714. var REST_GeometryType = {
  13715. /** 线几何对象类型。 */
  13716. LINE: "LINE",
  13717. /** 路由对象。 */
  13718. LINEM: "LINEM",
  13719. /** 点几何对象类型。 */
  13720. POINT: "POINT",
  13721. /** 面几何对象类型。 */
  13722. REGION: "REGION",
  13723. /** EPS点几何对象。 */
  13724. POINTEPS: "POINTEPS",
  13725. /** EPS线几何对象。 */
  13726. LINEEPS: "LINEEPS",
  13727. /** EPS面几何对象。 */
  13728. REGIONEPS: "REGIONEPS",
  13729. /** 椭圆。 */
  13730. ELLIPSE: "ELLIPSE",
  13731. /** 圆。 */
  13732. CIRCLE: "CIRCLE",
  13733. /** 文本几何对象类型。 */
  13734. TEXT: "TEXT",
  13735. /** 矩形。 */
  13736. RECTANGLE: "RECTANGLE",
  13737. /** 未定义。 */
  13738. UNKNOWN: "UNKNOWN",
  13739. /** 复合几何对象类型。 */
  13740. GEOCOMPOUND: "GEOCOMPOUND"
  13741. };
  13742. /**
  13743. * @enum QueryOption
  13744. * @description 查询结果类型枚举,描述查询结果返回类型,包括只返回属性、只返回几何实体以及返回属性和几何实体。
  13745. * @category BaseTypes Constant
  13746. * @type {string}
  13747. * @usage
  13748. * ```
  13749. * // 浏览器
  13750. * <script type="text/javascript" src="{cdn}"></script>
  13751. * <script>
  13752. * const result = {namespace}.QueryOption.ATTRIBUTE;
  13753. *
  13754. * </script>
  13755. * // ES6 Import
  13756. * import { QueryOption } from '{npm}';
  13757. *
  13758. * const result = QueryOption.ATTRIBUTE;
  13759. * ```
  13760. */
  13761. var QueryOption = {
  13762. /** 属性。 */
  13763. ATTRIBUTE: "ATTRIBUTE",
  13764. /** 属性和几何对象。 */
  13765. ATTRIBUTEANDGEOMETRY: "ATTRIBUTEANDGEOMETRY",
  13766. /** 几何对象。 */
  13767. GEOMETRY: "GEOMETRY"
  13768. };
  13769. /**
  13770. * @enum JoinType
  13771. * @description 关联查询时的关联类型常量。
  13772. * 该类定义了两个表之间的连接类型常量,决定了对两个表之间进行连接查询时,查询结果中得到的记录的情况。
  13773. * @category BaseTypes Constant
  13774. * @type {string}
  13775. * @usage
  13776. * ```
  13777. * // 浏览器
  13778. * <script type="text/javascript" src="{cdn}"></script>
  13779. * <script>
  13780. * const result = {namespace}.JoinType.INNERJOIN;
  13781. *
  13782. * </script>
  13783. * // ES6 Import
  13784. * import { JoinType } from '{npm}';
  13785. *
  13786. * const result = JoinType.INNERJOIN;
  13787. * ```
  13788. */
  13789. var JoinType = {
  13790. /** 内连接。 */
  13791. INNERJOIN: "INNERJOIN",
  13792. /** 左连接。 */
  13793. LEFTJOIN: "LEFTJOIN"
  13794. };
  13795. /**
  13796. * @enum SpatialQueryMode
  13797. * @description 空间查询模式枚举。该类定义了空间查询操作模式常量。
  13798. * @category BaseTypes Constant
  13799. * @type {string}
  13800. * @usage
  13801. * ```
  13802. * // 浏览器
  13803. * <script type="text/javascript" src="{cdn}"></script>
  13804. * <script>
  13805. * const result = {namespace}.SpatialQueryMode.CONTAIN;
  13806. *
  13807. * </script>
  13808. * // ES6 Import
  13809. * import { SpatialQueryMode } from '{npm}';
  13810. *
  13811. * const result = SpatialQueryMode.CONTAIN;
  13812. * ```
  13813. */
  13814. var SpatialQueryMode = {
  13815. /** 包含空间查询模式。 */
  13816. CONTAIN: "CONTAIN",
  13817. /** 交叉空间查询模式。 */
  13818. CROSS: "CROSS",
  13819. /** 分离空间查询模式。 */
  13820. DISJOINT: "DISJOINT",
  13821. /** 重合空间查询模式。 */
  13822. IDENTITY: "IDENTITY",
  13823. /** 相交空间查询模式。 */
  13824. INTERSECT: "INTERSECT",
  13825. /** 无空间查询。 */
  13826. NONE: "NONE",
  13827. /** 叠加空间查询模式。 */
  13828. OVERLAP: "OVERLAP",
  13829. /** 邻接空间查询模式。 */
  13830. TOUCH: "TOUCH",
  13831. /** 被包含空间查询模式。 */
  13832. WITHIN: "WITHIN"
  13833. };
  13834. /**
  13835. * @enum SpatialRelationType
  13836. * @description 数据集对象间的空间关系枚举。
  13837. * 该类定义了数据集对象间的空间关系类型常量。
  13838. * @category BaseTypes Constant
  13839. * @type {string}
  13840. * @usage
  13841. * ```
  13842. * // 浏览器
  13843. * <script type="text/javascript" src="{cdn}"></script>
  13844. * <script>
  13845. * const result = {namespace}.SpatialRelationType.CONTAIN;
  13846. *
  13847. * </script>
  13848. * // ES6 Import
  13849. * import { SpatialRelationType } from '{npm}';
  13850. *
  13851. * const result = {namespace}.SpatialRelationType.CONTAIN;
  13852. * ```
  13853. */
  13854. var SpatialRelationType = {
  13855. /** 包含关系。 */
  13856. CONTAIN: "CONTAIN",
  13857. /** 相交关系。 */
  13858. INTERSECT: "INTERSECT",
  13859. /** 被包含关系。 */
  13860. WITHIN: "WITHIN"
  13861. };
  13862. /**
  13863. * @enum MeasureMode
  13864. * @type {string}
  13865. * @description 量算模式枚举。
  13866. * @category BaseTypes Constant
  13867. * 该类定义了两种测量模式:距离测量和面积测量。
  13868. * @usage
  13869. * ```
  13870. * // 浏览器
  13871. * <script type="text/javascript" src="{cdn}"></script>
  13872. * <script>
  13873. * const result = {namespace}.MeasureMode.DISTANCE;
  13874. *
  13875. * </script>
  13876. * // ES6 Import
  13877. * import { MeasureMode } from '{npm}';
  13878. *
  13879. * const result = MeasureMode.DISTANCE;
  13880. * ```
  13881. */
  13882. var MeasureMode = {
  13883. /** 距离测量。 */
  13884. DISTANCE: "DISTANCE",
  13885. /** 面积测量。 */
  13886. AREA: "AREA"
  13887. };
  13888. /**
  13889. * @enum Unit
  13890. * @description 距离单位枚举。
  13891. * 该类定义了一系列距离单位类型。
  13892. * @category BaseTypes Constant
  13893. * @type {string}
  13894. * @usage
  13895. * ```
  13896. * // 浏览器
  13897. * <script type="text/javascript" src="{cdn}"></script>
  13898. * <script>
  13899. * const result = {namespace}.Unit.METER;
  13900. *
  13901. * </script>
  13902. * // ES6 Import
  13903. * import { Unit } from '{npm}';
  13904. *
  13905. * const result = Unit.METER;
  13906. * ```
  13907. */
  13908. var Unit = {
  13909. /** 米。 */
  13910. METER: "METER",
  13911. /** 千米。 */
  13912. KILOMETER: "KILOMETER",
  13913. /** 英里。 */
  13914. MILE: "MILE",
  13915. /** 码。 */
  13916. YARD: "YARD",
  13917. /** 度。 */
  13918. DEGREE: "DEGREE",
  13919. /** 毫米。 */
  13920. MILLIMETER: "MILLIMETER",
  13921. /** 厘米。 */
  13922. CENTIMETER: "CENTIMETER",
  13923. /** 英寸。 */
  13924. INCH: "INCH",
  13925. /** 分米。 */
  13926. DECIMETER: "DECIMETER",
  13927. /** 英尺。 */
  13928. FOOT: "FOOT",
  13929. /** 秒。 */
  13930. SECOND: "SECOND",
  13931. /** 分。 */
  13932. MINUTE: "MINUTE",
  13933. /** 弧度。 */
  13934. RADIAN: "RADIAN"
  13935. };
  13936. /**
  13937. * @enum BufferRadiusUnit
  13938. * @description 缓冲区距离单位枚举。该类定义了一系列缓冲距离单位类型。
  13939. * @category BaseTypes Constant
  13940. * @type {string}
  13941. * @usage
  13942. * ```
  13943. * // 浏览器
  13944. * <script type="text/javascript" src="{cdn}"></script>
  13945. * <script>
  13946. * const result = {namespace}.BufferRadiusUnit.CENTIMETER;
  13947. *
  13948. * </script>
  13949. * // ES6 Import
  13950. * import { BufferRadiusUnit } from '{npm}';
  13951. *
  13952. * const result = BufferRadiusUnit.CENTIMETER;
  13953. * ```
  13954. */
  13955. var BufferRadiusUnit = {
  13956. /** 厘米。 */
  13957. CENTIMETER: "CENTIMETER",
  13958. /** 分米。 */
  13959. DECIMETER: "DECIMETER",
  13960. /** 英尺。 */
  13961. FOOT: "FOOT",
  13962. /** 英寸。 */
  13963. INCH: "INCH",
  13964. /** 千米。 */
  13965. KILOMETER: "KILOMETER",
  13966. /** 米。 */
  13967. METER: "METER",
  13968. /** 英里。 */
  13969. MILE: "MILE",
  13970. /** 毫米。 */
  13971. MILLIMETER: "MILLIMETER",
  13972. /** 码。 */
  13973. YARD: "YARD"
  13974. };
  13975. /**
  13976. * @enum EngineType
  13977. * @description 数据源引擎类型枚举。
  13978. * @category BaseTypes Constant
  13979. * @type {string}
  13980. * @usage
  13981. * ```
  13982. * // 浏览器
  13983. * <script type="text/javascript" src="{cdn}"></script>
  13984. * <script>
  13985. * const result = {namespace}.EngineType.IMAGEPLUGINS;
  13986. *
  13987. * </script>
  13988. * // ES6 Import
  13989. * import { EngineType } from '{npm}';
  13990. *
  13991. * const result = EngineType.IMAGEPLUGINS;
  13992. * ```
  13993. */
  13994. var EngineType = {
  13995. /** 影像只读引擎类型,文件引擎,针对通用影像格式如 BMP,JPG,TIFF 以及超图自定义影像格式 SIT 等。 */
  13996. IMAGEPLUGINS: "IMAGEPLUGINS",
  13997. /** OGC 引擎类型,针对于 Web 数据源,Web 引擎,目前支持的类型有 WMS,WFS,WCS。 */
  13998. OGC: "OGC",
  13999. /** Oracle 引擎类型,针对 Oracle 数据源,数据库引擎。 */
  14000. ORACLEPLUS: "ORACLEPLUS",
  14001. /** SDB 引擎类型,文件引擎,即 SDB 数据源。 */
  14002. SDBPLUS: "SDBPLUS",
  14003. /** SQL Server 引擎类型,针对 SQL Server 数据源,数据库引擎。 */
  14004. SQLPLUS: "SQLPLUS",
  14005. /** UDB 引擎类型,文件引擎。 */
  14006. UDB: "UDB"
  14007. };
  14008. /**
  14009. * @enum ThemeGraphTextFormat
  14010. * @description 统计专题图文本显示格式枚举。
  14011. * @category BaseTypes Constant
  14012. * @type {string}
  14013. * @usage
  14014. * ```
  14015. * // 浏览器
  14016. * <script type="text/javascript" src="{cdn}"></script>
  14017. * <script>
  14018. * const result = {namespace}.ThemeGraphTextFormat.CAPTION;
  14019. *
  14020. * </script>
  14021. * // ES6 Import
  14022. * import { ThemeGraphTextFormat } from '{npm}';
  14023. *
  14024. * const result = ThemeGraphTextFormat.CAPTION;
  14025. * ```
  14026. */
  14027. var ThemeGraphTextFormat = {
  14028. /** 标题。以各子项的标题来进行标注。 */
  14029. CAPTION: "CAPTION",
  14030. /** 标题 + 百分数。以各子项的标题和所占的百分比来进行标注。 */
  14031. CAPTION_PERCENT: "CAPTION_PERCENT",
  14032. /** 标题 + 实际数值。以各子项的标题和真实数值来进行标注。 */
  14033. CAPTION_VALUE: "CAPTION_VALUE",
  14034. /** 百分数。以各子项所占的百分比来进行标注。 */
  14035. PERCENT: "PERCENT",
  14036. /** 实际数值。以各子项的真实数值来进行标注。 */
  14037. VALUE: "VALUE"
  14038. };
  14039. /**
  14040. * @enum ThemeGraphType
  14041. * @description 统计专题图类型枚举。
  14042. * @category BaseTypes Constant
  14043. * @type {string}
  14044. * @usage
  14045. * ```
  14046. * // 浏览器
  14047. * <script type="text/javascript" src="{cdn}"></script>
  14048. * <script>
  14049. * const result = {namespace}.ThemeGraphType.AREA;
  14050. *
  14051. * </script>
  14052. * // ES6 Import
  14053. * import { ThemeGraphType } from '{npm}';
  14054. *
  14055. * const result = ThemeGraphType.AREA;
  14056. * ```
  14057. */
  14058. var ThemeGraphType = {
  14059. /** 面积图。 */
  14060. AREA: "AREA",
  14061. /** 柱状图。 */
  14062. BAR: "BAR",
  14063. /** 三维柱状图。 */
  14064. BAR3D: "BAR3D",
  14065. /** 折线图。 */
  14066. LINE: "LINE",
  14067. /** 饼图。 */
  14068. PIE: "PIE",
  14069. /** 三维饼图。 */
  14070. PIE3D: "PIE3D",
  14071. /** 点状图。 */
  14072. POINT: "POINT",
  14073. /** 环状图。 */
  14074. RING: "RING",
  14075. /** 玫瑰图。 */
  14076. ROSE: "ROSE",
  14077. /** 三维玫瑰图。 */
  14078. ROSE3D: "ROSE3D",
  14079. /** 堆叠柱状图。 */
  14080. STACK_BAR: "STACK_BAR",
  14081. /** 三维堆叠柱状图。 */
  14082. STACK_BAR3D: "STACK_BAR3D",
  14083. /** 阶梯图。 */
  14084. STEP: "STEP"
  14085. };
  14086. /**
  14087. * @enum GraphAxesTextDisplayMode
  14088. * @description 统计专题图坐标轴文本显示模式。
  14089. * @category BaseTypes Constant
  14090. * @type {string}
  14091. * @usage
  14092. * ```
  14093. * // 浏览器
  14094. * <script type="text/javascript" src="{cdn}"></script>
  14095. * <script>
  14096. * const result = {namespace}.GraphAxesTextDisplayMode.ALL;
  14097. *
  14098. * </script>
  14099. * // ES6 Import
  14100. * import { GraphAxesTextDisplayMode } from '{npm}';
  14101. *
  14102. * const result = GraphAxesTextDisplayMode.ALL;
  14103. * ```
  14104. */
  14105. var GraphAxesTextDisplayMode = {
  14106. /** 显示全部文本。 */
  14107. ALL: "ALL",
  14108. /** 不显示。 */
  14109. NONE: "NONE",
  14110. /** 显示Y轴的文本。 */
  14111. YAXES: "YAXES"
  14112. };
  14113. /**
  14114. * @enum GraduatedMode
  14115. * @description 专题图分级模式枚举。
  14116. * @category BaseTypes Constant
  14117. * @type {string}
  14118. * @usage
  14119. * ```
  14120. * // 浏览器
  14121. * <script type="text/javascript" src="{cdn}"></script>
  14122. * <script>
  14123. * const result = {namespace}.GraduatedMode.CONSTANT;
  14124. *
  14125. * </script>
  14126. * // ES6 Import
  14127. * import { GraduatedMode } from '{npm}';
  14128. *
  14129. * const result = GraduatedMode.CONSTANT;
  14130. * ```
  14131. */
  14132. var GraduatedMode = {
  14133. /** 常量分级模式。 */
  14134. CONSTANT: "CONSTANT",
  14135. /** 对数分级模式。 */
  14136. LOGARITHM: "LOGARITHM",
  14137. /** 平方根分级模式。 */
  14138. SQUAREROOT: "SQUAREROOT"
  14139. };
  14140. /**
  14141. * @enum RangeMode
  14142. * @description 范围分段专题图分段方式枚举。
  14143. * @category BaseTypes Constant
  14144. * @type {string}
  14145. * @usage
  14146. * ```
  14147. * // 浏览器
  14148. * <script type="text/javascript" src="{cdn}"></script>
  14149. * <script>
  14150. * const result = {namespace}.RangeMode.CUSTOMINTERVAL;
  14151. *
  14152. * </script>
  14153. * // ES6 Import
  14154. * import { RangeMode } from '{npm}';
  14155. *
  14156. * const result = RangeMode.CUSTOMINTERVAL;
  14157. * ```
  14158. */
  14159. var RangeMode = {
  14160. /** 自定义分段法。 */
  14161. CUSTOMINTERVAL: "CUSTOMINTERVAL",
  14162. /** 等距离分段法。 */
  14163. EQUALINTERVAL: "EQUALINTERVAL",
  14164. /** 对数分段法。 */
  14165. LOGARITHM: "LOGARITHM",
  14166. /** 等计数分段法。 */
  14167. QUANTILE: "QUANTILE",
  14168. /** 平方根分段法。 */
  14169. SQUAREROOT: "SQUAREROOT",
  14170. /** 标准差分段法。 */
  14171. STDDEVIATION: "STDDEVIATION"
  14172. };
  14173. /**
  14174. * @enum ThemeType
  14175. * @description 专题图类型枚举。
  14176. * @category BaseTypes Constant
  14177. * @type {string}
  14178. * @usage
  14179. * ```
  14180. * // 浏览器
  14181. * <script type="text/javascript" src="{cdn}"></script>
  14182. * <script>
  14183. * const result = {namespace}.ThemeType.DOTDENSITY;
  14184. *
  14185. * </script>
  14186. * // ES6 Import
  14187. * import { ThemeType } from '{npm}';
  14188. *
  14189. * const result = ThemeType.DOTDENSITY;
  14190. * ```
  14191. */
  14192. var ThemeType = {
  14193. /** 点密度专题图。 */
  14194. DOTDENSITY: "DOTDENSITY",
  14195. /** 等级符号专题图。 */
  14196. GRADUATEDSYMBOL: "GRADUATEDSYMBOL",
  14197. /** 统计专题图。 */
  14198. GRAPH: "GRAPH",
  14199. /** 标签专题图。 */
  14200. LABEL: "LABEL",
  14201. /** 分段专题图。 */
  14202. RANGE: "RANGE",
  14203. /** 単值专题图。 */
  14204. UNIQUE: "UNIQUE"
  14205. };
  14206. /**
  14207. * @enum ColorGradientType
  14208. * @description 渐变颜色枚举。
  14209. * @category BaseTypes Constant
  14210. * @type {string}
  14211. * @usage
  14212. * ```
  14213. * // 浏览器
  14214. * <script type="text/javascript" src="{cdn}"></script>
  14215. * <script>
  14216. * const result = {namespace}.ColorGradientType.BLACK_WHITE;
  14217. *
  14218. * </script>
  14219. * // ES6 Import
  14220. * import { ColorGradientType } from '{npm}';
  14221. *
  14222. * const result = ColorGradientType.BLACK_WHITE;
  14223. * ```
  14224. */
  14225. var ColorGradientType = {
  14226. /** 黑白渐变色。 */
  14227. BLACK_WHITE: "BLACKWHITE",
  14228. /** 蓝黑渐变色。 */
  14229. BLUE_BLACK: "BLUEBLACK",
  14230. /** 蓝红渐变色。 */
  14231. BLUE_RED: "BLUERED",
  14232. /** 蓝白渐变色。 */
  14233. BLUE_WHITE: "BLUEWHITE",
  14234. /** 青黑渐变色。 */
  14235. CYAN_BLACK: "CYANBLACK",
  14236. /** 青蓝渐变色。 */
  14237. CYAN_BLUE: "CYANBLUE",
  14238. /** 青绿渐变色。 */
  14239. CYAN_GREEN: "CYANGREEN",
  14240. /** 青白渐变色。 */
  14241. CYAN_WHITE: "CYANWHITE",
  14242. /** 绿黑渐变色。 */
  14243. GREEN_BLACK: "GREENBLACK",
  14244. /** 绿蓝渐变色。 */
  14245. GREEN_BLUE: "GREENBLUE",
  14246. /** 绿橙紫渐变色。 */
  14247. GREEN_ORANGE_VIOLET: "GREENORANGEVIOLET",
  14248. /** 绿红渐变色。 */
  14249. GREEN_RED: "GREENRED",
  14250. /** 蓝红渐变色。 */
  14251. GREEN_WHITE: "GREENWHITE",
  14252. /** 粉黑渐变色。 */
  14253. PINK_BLACK: "PINKBLACK",
  14254. /** 粉蓝渐变色。 */
  14255. PINK_BLUE: "PINKBLUE",
  14256. /** 粉红渐变色。 */
  14257. PINK_RED: "PINKRED",
  14258. /** 粉白渐变色。 */
  14259. PINK_WHITE: "PINKWHITE",
  14260. /** 彩虹色。 */
  14261. RAIN_BOW: "RAINBOW",
  14262. /** 红黑渐变色。 */
  14263. RED_BLACK: "REDBLACK",
  14264. /** 红白渐变色。 */
  14265. RED_WHITE: "REDWHITE",
  14266. /** 光谱渐变。 */
  14267. SPECTRUM: "SPECTRUM",
  14268. /** 地形渐变,用于三维显示效果较好。 */
  14269. TERRAIN: "TERRAIN",
  14270. /** 黄黑渐变色。 */
  14271. YELLOW_BLACK: "YELLOWBLACK",
  14272. /** 黄蓝渐变色。 */
  14273. YELLOW_BLUE: "YELLOWBLUE",
  14274. /** 黄绿渐变色。 */
  14275. YELLOW_GREEN: "YELLOWGREEN",
  14276. /** 黄红渐变色。 */
  14277. YELLOW_RED: "YELLOWRED",
  14278. /** 黄白渐变色。 */
  14279. YELLOW_WHITE: "YELLOWWHITE"
  14280. };
  14281. /**
  14282. * @enum TextAlignment
  14283. * @description 文本对齐枚举。
  14284. * @category BaseTypes Constant
  14285. * @type {string}
  14286. * @usage
  14287. * ```
  14288. * // 浏览器
  14289. * <script type="text/javascript" src="{cdn}"></script>
  14290. * <script>
  14291. * const result = {namespace}.TextAlignment.TOPLEFT;
  14292. *
  14293. * </script>
  14294. * // ES6 Import
  14295. * import { TextAlignment } from '{npm}';
  14296. *
  14297. * const result = TextAlignment.TOPLEFT;
  14298. * ```
  14299. */
  14300. var TextAlignment = {
  14301. /** 左上角对齐。 */
  14302. TOPLEFT: "TOPLEFT",
  14303. /** 顶部居中对齐。 */
  14304. TOPCENTER: "TOPCENTER",
  14305. /** 右上角对齐。 */
  14306. TOPRIGHT: "TOPRIGHT",
  14307. /** 基准线左对齐。 */
  14308. BASELINELEFT: "BASELINELEFT",
  14309. /** 基准线居中对齐。 */
  14310. BASELINECENTER: "BASELINECENTER",
  14311. /** 基准线右对齐。 */
  14312. BASELINERIGHT: "BASELINERIGHT",
  14313. /** 左下角对齐。 */
  14314. BOTTOMLEFT: "BOTTOMLEFT",
  14315. /** 底部居中对齐。 */
  14316. BOTTOMCENTER: "BOTTOMCENTER",
  14317. /** 右下角对齐。 */
  14318. BOTTOMRIGHT: "BOTTOMRIGHT",
  14319. /** 左中对齐。 */
  14320. MIDDLELEFT: "MIDDLELEFT",
  14321. /** 中心对齐。 */
  14322. MIDDLECENTER: "MIDDLECENTER",
  14323. /** 右中对齐。 */
  14324. MIDDLERIGHT: "MIDDLERIGHT"
  14325. };
  14326. /**
  14327. * @enum FillGradientMode
  14328. * @description 渐变填充风格的渐变类型枚举。
  14329. * @category BaseTypes Constant
  14330. * @type {string}
  14331. * @usage
  14332. * ```
  14333. * // 浏览器
  14334. * <script type="text/javascript" src="{cdn}"></script>
  14335. * <script>
  14336. * const result = {namespace}.FillGradientMode.NONE;
  14337. *
  14338. * </script>
  14339. * // ES6 Import
  14340. * import { FillGradientMode } from '{npm}';
  14341. *
  14342. * const result = FillGradientMode.NONE;
  14343. * ```
  14344. */
  14345. var FillGradientMode = {
  14346. /** 无渐变。 */
  14347. NONE: "NONE",
  14348. /** 线性渐变填充。 */
  14349. LINEAR: "LINEAR",
  14350. /** 辐射渐变填充。 */
  14351. RADIAL: "RADIAL",
  14352. /** 圆锥渐变填充。 */
  14353. CONICAL: "CONICAL",
  14354. /** 四角渐变填充。 */
  14355. SQUARE: "SQUARE"
  14356. };
  14357. /**
  14358. * @enum AlongLineDirection
  14359. * @description 标签沿线标注方向枚举。
  14360. * @category BaseTypes Constant
  14361. * @type {string}
  14362. * @usage
  14363. * ```
  14364. * // 浏览器
  14365. * <script type="text/javascript" src="{cdn}"></script>
  14366. * <script>
  14367. * const result = {namespace}.AlongLineDirection.NORMAL;
  14368. *
  14369. * </script>
  14370. * // ES6 Import
  14371. * import { AlongLineDirection } from '{npm}';
  14372. *
  14373. * const result = AlongLineDirection.NORMAL;
  14374. * ```
  14375. */
  14376. var AlongLineDirection = {
  14377. /** 沿线的法线方向放置标签。 */
  14378. NORMAL: "ALONG_LINE_NORMAL",
  14379. /** 从下到上,从左到右放置。 */
  14380. LB_TO_RT: "LEFT_BOTTOM_TO_RIGHT_TOP",
  14381. /** 从上到下,从左到右放置。 */
  14382. LT_TO_RB: "LEFT_TOP_TO_RIGHT_BOTTOM",
  14383. /** 从下到上,从右到左放置。 */
  14384. RB_TO_LT: "RIGHT_BOTTOM_TO_LEFT_TOP",
  14385. /** 从上到下,从右到左放置。 */
  14386. RT_TO_LB: "RIGHT_TOP_TO_LEFT_BOTTOM"
  14387. };
  14388. /**
  14389. * @enum LabelBackShape
  14390. * @description 标签专题图中标签背景的形状枚举。
  14391. * @category BaseTypes Constant
  14392. * @type {string}
  14393. * @usage
  14394. * ```
  14395. * // 浏览器
  14396. * <script type="text/javascript" src="{cdn}"></script>
  14397. * <script>
  14398. * const result = {namespace}.LabelBackShape.DIAMOND;
  14399. *
  14400. * </script>
  14401. * // ES6 Import
  14402. * import { LabelBackShape } from '{npm}';
  14403. *
  14404. * const result = LabelBackShape.DIAMOND;
  14405. * ```
  14406. */
  14407. var LabelBackShape = {
  14408. /** 菱形背景,即标签背景的形状为菱形。 */
  14409. DIAMOND: "DIAMOND",
  14410. /** 椭圆形背景,即标签背景的行状为椭圆形。 */
  14411. ELLIPSE: "ELLIPSE",
  14412. /** 符号背景,即标签背景的形状为设定的符号。 */
  14413. MARKER: "MARKER",
  14414. /** 空背景,即不使用任何形状作为标签的背景。 */
  14415. NONE: "NONE",
  14416. /** 矩形背景,即标签背景的形状为矩形。 */
  14417. RECT: "RECT",
  14418. /** 圆角矩形背景,即标签背景的形状为圆角矩形。 */
  14419. ROUNDRECT: "ROUNDRECT",
  14420. /** 三角形背景,即标签背景的形状为三角形。 */
  14421. TRIANGLE: "TRIANGLE"
  14422. };
  14423. /**
  14424. * @enum LabelOverLengthMode
  14425. * @description 标签专题图中超长标签的处理模式枚举。
  14426. * @category BaseTypes Constant
  14427. * @type {string}
  14428. * @usage
  14429. * ```
  14430. * // 浏览器
  14431. * <script type="text/javascript" src="{cdn}"></script>
  14432. * <script>
  14433. * const result = {namespace}.LabelOverLengthMode.NEWLINE;
  14434. *
  14435. * </script>
  14436. * // ES6 Import
  14437. * import { LabelOverLengthMode } from '{npm}';
  14438. *
  14439. * const result = LabelOverLengthMode.NEWLINE;
  14440. * ```
  14441. */
  14442. var LabelOverLengthMode = {
  14443. /** 换行显示。 */
  14444. NEWLINE: "NEWLINE",
  14445. /** 对超长标签不进行处理。 */
  14446. NONE: "NONE",
  14447. /** 省略超出部分。 */
  14448. OMIT: "OMIT"
  14449. };
  14450. /**
  14451. * @enum DirectionType
  14452. * @description 网络分析中方向枚举。
  14453. * 在行驶引导子项中使用。
  14454. * @category BaseTypes Constant
  14455. * @type {string}
  14456. * @usage
  14457. * ```
  14458. * // 浏览器
  14459. * <script type="text/javascript" src="{cdn}"></script>
  14460. * <script>
  14461. * const result = {namespace}.DirectionType.EAST;
  14462. *
  14463. * </script>
  14464. * // ES6 Import
  14465. * import { DirectionType } from '{npm}';
  14466. *
  14467. * const result = DirectionType.EAST;
  14468. * ```
  14469. */
  14470. var DirectionType = {
  14471. /** 东。 */
  14472. EAST: "EAST",
  14473. /** 无方向。 */
  14474. NONE: "NONE",
  14475. /** 北。 */
  14476. NORTH: "NORTH",
  14477. /** 南。 */
  14478. SOURTH: "SOURTH",
  14479. /** 西。 */
  14480. WEST: "WEST"
  14481. };
  14482. /**
  14483. * @enum SideType
  14484. * @description 行驶位置枚举。
  14485. * 表示在行驶在路的左边、右边或者路上的枚举,该类用在行驶导引子项类中。
  14486. * @category BaseTypes Constant
  14487. * @type {string}
  14488. * @usage
  14489. * ```
  14490. * // 浏览器
  14491. * <script type="text/javascript" src="{cdn}"></script>
  14492. * <script>
  14493. * const result = {namespace}.SideType.LEFT;
  14494. *
  14495. * </script>
  14496. * // ES6 Import
  14497. * import { SideType } from '{npm}';
  14498. *
  14499. * const result = SideType.LEFT;
  14500. * ```
  14501. */
  14502. var SideType = {
  14503. /** 路的左侧。 */
  14504. LEFT: "LEFT",
  14505. /** 在路上(即路的中间)。 */
  14506. MIDDLE: "MIDDLE",
  14507. /** 无效值。 */
  14508. NONE: "NONE",
  14509. /** 路的右侧。 */
  14510. RIGHT: "RIGHT"
  14511. };
  14512. /**
  14513. * @enum SupplyCenterType
  14514. * @description 资源供给中心类型枚举。
  14515. * 该枚举定义了网络分析中资源中心点的类型,主要用于资源分配和选址分区。
  14516. * 资源供给中心点的类型包括非中心,固定中心和可选中心。固定中心用于资源分配分析;固定中心和可选中心用于选址分析;非中心在两种网络分析时都不予考虑。
  14517. * @category BaseTypes Constant
  14518. * @type {string}
  14519. * @usage
  14520. * ```
  14521. * // 浏览器
  14522. * <script type="text/javascript" src="{cdn}"></script>
  14523. * <script>
  14524. * const result = {namespace}.SupplyCenterType.FIXEDCENTER;
  14525. *
  14526. * </script>
  14527. * // ES6 Import
  14528. * import { SupplyCenterType } from '{npm}';
  14529. *
  14530. * const result = SupplyCenterType.FIXEDCENTER;
  14531. * ```
  14532. */
  14533. var SupplyCenterType = {
  14534. /** 固定中心点。 */
  14535. FIXEDCENTER: "FIXEDCENTER",
  14536. /** 非中心点。 */
  14537. NULL: "NULL",
  14538. /** 可选中心点。 */
  14539. OPTIONALCENTER: "OPTIONALCENTER"
  14540. };
  14541. /**
  14542. * @enum TurnType
  14543. * @description 转弯方向枚举。
  14544. * 用在行驶引导子项类中,表示转弯的方向。
  14545. * @category BaseTypes Constant
  14546. * @type {string}
  14547. * @usage
  14548. * ```
  14549. * // 浏览器
  14550. * <script type="text/javascript" src="{cdn}"></script>
  14551. * <script>
  14552. * const result = {namespace}.TurnType.AHEAD;
  14553. *
  14554. * </script>
  14555. * // ES6 Import
  14556. * import { TurnType } from '{npm}';
  14557. *
  14558. * const result = TurnType.AHEAD;
  14559. * ```
  14560. */
  14561. var TurnType = {
  14562. /** 向前直行。 */
  14563. AHEAD: "AHEAD",
  14564. /** 掉头。 */
  14565. BACK: "BACK",
  14566. /** 终点,不拐弯。 */
  14567. END: "END",
  14568. /** 左转弯。 */
  14569. LEFT: "LEFT",
  14570. /** 无效值。 */
  14571. NONE: "NONE",
  14572. /** 右转弯。 */
  14573. RIGHT: "RIGHT"
  14574. };
  14575. /**
  14576. * @enum BufferEndType
  14577. * @description 缓冲区分析BufferEnd类型。
  14578. * @category BaseTypes Constant
  14579. * @type {string}
  14580. * @usage
  14581. * ```
  14582. * // 浏览器
  14583. * <script type="text/javascript" src="{cdn}"></script>
  14584. * <script>
  14585. * const result = {namespace}.BufferEndType.FLAT;
  14586. *
  14587. * </script>
  14588. * // ES6 Import
  14589. * import { BufferEndType } from '{npm}';
  14590. *
  14591. * const result = BufferEndType.FLAT;
  14592. * ```
  14593. */
  14594. var BufferEndType = {
  14595. /** 平头缓冲。 */
  14596. FLAT: "FLAT",
  14597. /** 圆头缓冲。 */
  14598. ROUND: "ROUND"
  14599. };
  14600. /**
  14601. * @enum OverlayOperationType
  14602. * @description 叠加分析类型枚举。
  14603. * @category BaseTypes Constant
  14604. * @type {string}
  14605. * @usage
  14606. * ```
  14607. * // 浏览器
  14608. * <script type="text/javascript" src="{cdn}"></script>
  14609. * <script>
  14610. * const result = {namespace}.OverlayOperationType.CLIP;
  14611. *
  14612. * </script>
  14613. * // ES6 Import
  14614. * import { OverlayOperationType } from '{npm}';
  14615. *
  14616. * const result = OverlayOperationType.CLIP;
  14617. * ```
  14618. */
  14619. var OverlayOperationType = {
  14620. /** 操作数据集(几何对象)裁剪被操作数据集(几何对象)。 */
  14621. CLIP: "CLIP",
  14622. /** 在被操作数据集(几何对象)上擦除掉与操作数据集(几何对象)相重合的部分。 */
  14623. ERASE: "ERASE",
  14624. /**对被操作数据集(几何对象)进行同一操作,即操作执行后,被操作数据集(几何对象)包含来自操作数据集(几何对象)的几何形状。 */
  14625. IDENTITY: "IDENTITY",
  14626. /** 对两个数据集(几何对象)求交,返回两个数据集(几何对象)的交集。 */
  14627. INTERSECT: "INTERSECT",
  14628. /** 对两个面数据集(几何对象)进行合并操作。 */
  14629. UNION: "UNION",
  14630. /** 对两个面数据集(几何对象)进行更新操作。 */
  14631. UPDATE: "UPDATE",
  14632. /** 对两个面数据集(几何对象)进行对称差操作。 */
  14633. XOR: "XOR"
  14634. };
  14635. /**
  14636. * @enum OutputType
  14637. * @description 分布式分析输出类型枚举。
  14638. * @category BaseTypes Constant
  14639. * @type {string}
  14640. * @usage
  14641. * ```
  14642. * // 浏览器
  14643. * <script type="text/javascript" src="{cdn}"></script>
  14644. * <script>
  14645. * const result = {namespace}.OutputType.INDEXEDHDFS;
  14646. *
  14647. * </script>
  14648. * // ES6 Import
  14649. * import { OutputType } from '{npm}';
  14650. *
  14651. * const result = OutputType.INDEXEDHDFS;
  14652. * ```
  14653. */
  14654. var OutputType = {
  14655. /** INDEXEDHDFS */
  14656. INDEXEDHDFS: "INDEXEDHDFS",
  14657. /** UDB */
  14658. UDB: "UDB",
  14659. /** MONGODB */
  14660. MONGODB: "MONGODB",
  14661. /** PG */
  14662. PG: "PG"
  14663. };
  14664. /**
  14665. * @enum SmoothMethod
  14666. * @description 光滑方法枚举。
  14667. * 用于从Grid 或DEM数据生成等值线或等值面时对等值线或者等值面的边界线进行平滑处理的方法。
  14668. * @category BaseTypes Constant
  14669. * @type {string}
  14670. * @usage
  14671. * ```
  14672. * // 浏览器
  14673. * <script type="text/javascript" src="{cdn}"></script>
  14674. * <script>
  14675. * const result = {namespace}.SmoothMethod.BSPLINE;
  14676. *
  14677. * </script>
  14678. * // ES6 Import
  14679. * import { SmoothMethod } from '{npm}';
  14680. *
  14681. * const result = SmoothMethod.BSPLINE;
  14682. * ```
  14683. */
  14684. var SmoothMethod = {
  14685. /** B 样条法。 */
  14686. BSPLINE: "BSPLINE",
  14687. /** 磨角法。 */
  14688. POLISH: "POLISH"
  14689. };
  14690. /**
  14691. * @enum SurfaceAnalystMethod
  14692. * @description 表面分析方法枚举。
  14693. * 通过对数据进行表面分析,能够挖掘原始数据所包含的信息,使某些细节明显化,易于分析。
  14694. * @category BaseTypes Constant
  14695. * @type {string}
  14696. * @usage
  14697. * ```
  14698. * // 浏览器
  14699. * <script type="text/javascript" src="{cdn}"></script>
  14700. * <script>
  14701. * const result = {namespace}.SurfaceAnalystMethod.ISOLINE;
  14702. *
  14703. * </script>
  14704. * // ES6 Import
  14705. * import { SurfaceAnalystMethod } from '{npm}';
  14706. *
  14707. * const result = SurfaceAnalystMethod.ISOLINE;
  14708. * ```
  14709. */
  14710. var SurfaceAnalystMethod = {
  14711. /** 等值线提取。 */
  14712. ISOLINE: "ISOLINE",
  14713. /** 等值面提取。 */
  14714. ISOREGION: "ISOREGION"
  14715. };
  14716. /**
  14717. * @enum DataReturnMode
  14718. * @description 数据返回模式枚举。
  14719. * 该枚举用于指定空间分析返回结果模式,包含返回数据集标识和记录集、只返回数据集标识(数据集名称@数据源名称)及只返回记录集三种模式。
  14720. * @category BaseTypes Constant
  14721. * @type {string}
  14722. * @usage
  14723. * ```
  14724. * // 浏览器
  14725. * <script type="text/javascript" src="{cdn}"></script>
  14726. * <script>
  14727. * const result = {namespace}.DataReturnMode.DATASET_AND_RECORDSET;
  14728. *
  14729. * </script>
  14730. * // ES6 Import
  14731. * import { DataReturnMode } from '{npm}';
  14732. *
  14733. * const result = DataReturnMode.DATASET_AND_RECORDSET;
  14734. * ```
  14735. */
  14736. var DataReturnMode = {
  14737. /** 返回结果数据集标识(数据集名称@数据源名称)和记录集(RecordSet)。 */
  14738. DATASET_AND_RECORDSET: "DATASET_AND_RECORDSET",
  14739. /** 只返回数据集标识(数据集名称@数据源名称)。 */
  14740. DATASET_ONLY: "DATASET_ONLY",
  14741. /** 只返回记录集(RecordSet)。 */
  14742. RECORDSET_ONLY: "RECORDSET_ONLY"
  14743. };
  14744. /**
  14745. * @enum EditType
  14746. * @description 要素集更新模式枚举。
  14747. * 该枚举用于指定数据服务中要素集更新模式,包含添加要素集、更新要素集和删除要素集。
  14748. * @category BaseTypes Constant
  14749. * @type {string}
  14750. * @usage
  14751. * ```
  14752. * // 浏览器
  14753. * <script type="text/javascript" src="{cdn}"></script>
  14754. * <script>
  14755. * const result = {namespace}.EditType.ADD;
  14756. *
  14757. * </script>
  14758. * // ES6 Import
  14759. * import { EditType } from '{npm}';
  14760. *
  14761. * const result = {namespace}.EditType.ADD;
  14762. * ```
  14763. */
  14764. var EditType = {
  14765. /** 增加操作。 */
  14766. ADD: "add",
  14767. /** 修改操作。 */
  14768. UPDATE: "update",
  14769. /** 删除操作。 */
  14770. DELETE: "delete"
  14771. };
  14772. /**
  14773. * @enum TransferTactic
  14774. * @description 公交换乘策略枚举。
  14775. * 该枚举用于指定公交服务中要素集更新模式,包含添加要素集、更新要素集和删除要素集。
  14776. * @category BaseTypes Constant
  14777. * @type {string}
  14778. * @usage
  14779. * ```
  14780. * // 浏览器
  14781. * <script type="text/javascript" src="{cdn}"></script>
  14782. * <script>
  14783. * const result = {namespace}.TransferTactic.LESS_TIME;
  14784. *
  14785. * </script>
  14786. * // ES6 Import
  14787. * import { TransferTactic } from '{npm}';
  14788. *
  14789. * const result = TransferTactic.LESS_TIME;
  14790. * ```
  14791. */
  14792. var TransferTactic = {
  14793. /** 时间短。 */
  14794. LESS_TIME: "LESS_TIME",
  14795. /** 少换乘。 */
  14796. LESS_TRANSFER: "LESS_TRANSFER",
  14797. /** 少步行。 */
  14798. LESS_WALK: "LESS_WALK",
  14799. /** 距离最短。 */
  14800. MIN_DISTANCE: "MIN_DISTANCE"
  14801. };
  14802. /**
  14803. * @enum TransferPreference
  14804. * @description 公交换乘策略枚举。
  14805. * 该枚举用于指定交通换乘服务中设置地铁优先、公交优先、不乘地铁、无偏好等偏好设置。
  14806. * @category BaseTypes Constant
  14807. * @type {string}
  14808. * @usage
  14809. * ```
  14810. * // 浏览器
  14811. * <script type="text/javascript" src="{cdn}"></script>
  14812. * <script>
  14813. * const result = {namespace}.TransferPreference.BUS;
  14814. *
  14815. * </script>
  14816. * // ES6 Import
  14817. * import { TransferPreference } from '{npm}';
  14818. *
  14819. * const result = TransferPreference.BUS;
  14820. * ```
  14821. */
  14822. var TransferPreference = {
  14823. /** 公交汽车优先。 */
  14824. BUS: "BUS",
  14825. /** 地铁优先。 */
  14826. SUBWAY: "SUBWAY",
  14827. /** 不乘坐地铁。 */
  14828. NO_SUBWAY: "NO_SUBWAY",
  14829. /** 无乘车偏好。 */
  14830. NONE: "NONE"
  14831. };
  14832. /**
  14833. * @enum GridType
  14834. * @description 地图背景格网类型枚举。
  14835. * @category BaseTypes Constant
  14836. * @type {string}
  14837. * @usage
  14838. * ```
  14839. * // 浏览器
  14840. * <script type="text/javascript" src="{cdn}"></script>
  14841. * <script>
  14842. * const result = {namespace}.GridType.CROSS;
  14843. *
  14844. * </script>
  14845. * // ES6 Import
  14846. * import { GridType } from '{npm}';
  14847. *
  14848. * const result = GridType.CROSS;
  14849. * ```
  14850. */
  14851. var GridType = {
  14852. /** 十字叉丝。 */
  14853. CROSS: "CROSS",
  14854. /** 网格线。 */
  14855. GRID: "GRID",
  14856. /** 点。 */
  14857. POINT: "POINT"
  14858. };
  14859. /**
  14860. * @enum ColorSpaceType
  14861. * @description 色彩空间枚举。
  14862. * 由于成色原理的不同,决定了显示器、投影仪这类靠色光直接合成颜色的颜色设备和打印机、
  14863. * 印刷机这类靠使用颜料的印刷设备在生成颜色方式上的区别。
  14864. * 针对上述不同成色方式,SuperMap 提供两种色彩空间,
  14865. * 分别为 RGB 和 CMYK。RGB 主要用于显示系统中,CMYK 主要用于印刷系统中。
  14866. * @category BaseTypes Constant
  14867. * @type {string}
  14868. * @usage
  14869. * ```
  14870. * // 浏览器
  14871. * <script type="text/javascript" src="{cdn}"></script>
  14872. * <script>
  14873. * const result = {namespace}.ColorSpaceType.CMYK;
  14874. *
  14875. * </script>
  14876. * // ES6 Import
  14877. * import { ColorSpaceType } from '{npm}';
  14878. *
  14879. * const result = ColorSpaceType.CMYK;
  14880. * ```
  14881. */
  14882. var ColorSpaceType = {
  14883. /** 该类型主要在印刷系统使用。 */
  14884. CMYK: "CMYK",
  14885. /** 该类型主要在显示系统中使用。 */
  14886. RGB: "RGB"
  14887. };
  14888. /**
  14889. * @enum LayerType
  14890. * @description 图层类型。
  14891. * @category BaseTypes Constant
  14892. * @type {string}
  14893. * @usage
  14894. * ```
  14895. * // 浏览器
  14896. * <script type="text/javascript" src="{cdn}"></script>
  14897. * <script>
  14898. * const result = {namespace}.LayerType.UGC;
  14899. *
  14900. * </script>
  14901. * // ES6 Import
  14902. * import { LayerType } from '{npm}';
  14903. *
  14904. * const result = LayerType.UGC;
  14905. * ```
  14906. */
  14907. var LayerType = {
  14908. /** SuperMap UGC 类型图层。如矢量图层、栅格(Grid)图层、影像图层。 */
  14909. UGC: "UGC",
  14910. /** WMS 图层。 */
  14911. WMS: "WMS",
  14912. /** WFS 图层。 */
  14913. WFS: "WFS",
  14914. /** 自定义图层。 */
  14915. CUSTOM: "CUSTOM"
  14916. };
  14917. /**
  14918. * @enum UGCLayerType
  14919. * @description SuperMap 图层类型。
  14920. * @category BaseTypes Constant
  14921. * @type {string}
  14922. * @usage
  14923. * ```
  14924. * // 浏览器
  14925. * <script type="text/javascript" src="{cdn}"></script>
  14926. * <script>
  14927. * const result = {namespace}.UGCLayerType.THEME;
  14928. *
  14929. * </script>
  14930. * // ES6 Import
  14931. * import { UGCLayerType } from '{npm}';
  14932. *
  14933. * const result = UGCLayerType.THEME;
  14934. * ```
  14935. */
  14936. var UGCLayerType = {
  14937. /** 专题图层。 */
  14938. THEME: "THEME",
  14939. /** 矢量图层。 */
  14940. VECTOR: "VECTOR",
  14941. /** 栅格图层。 */
  14942. GRID: "GRID",
  14943. /** 影像图层。 */
  14944. IMAGE: "IMAGE"
  14945. };
  14946. /**
  14947. * @enum StatisticMode
  14948. * @description 字段统计方法类型。
  14949. * @category BaseTypes Constant
  14950. * @type {string}
  14951. * @usage
  14952. * ```
  14953. * // 浏览器
  14954. * <script type="text/javascript" src="{cdn}"></script>
  14955. * <script>
  14956. * const result = {namespace}.StatisticMode.AVERAGE;
  14957. *
  14958. * </script>
  14959. * // ES6 Import
  14960. * import { StatisticMode } from '{npm}';
  14961. *
  14962. * const result = StatisticMode.AVERAGE;
  14963. * ```
  14964. */
  14965. var StatisticMode = {
  14966. /** 统计所选字段的平均值。 */
  14967. AVERAGE: "AVERAGE",
  14968. /** 统计所选字段的最大值。 */
  14969. MAX: "MAX",
  14970. /** 统计所选字段的最小值。 */
  14971. MIN: "MIN",
  14972. /** 统计所选字段的标准差 */
  14973. STDDEVIATION: "STDDEVIATION",
  14974. /** 统计所选字段的总和。 */
  14975. SUM: "SUM",
  14976. /** 统计所选字段的方差。 */
  14977. VARIANCE: "VARIANCE"
  14978. };
  14979. /**
  14980. * @enum PixelFormat
  14981. * @description 栅格与影像数据存储的像素格式枚举。
  14982. * @category BaseTypes Constant
  14983. * @type {string}
  14984. * @usage
  14985. * ```
  14986. * // 浏览器
  14987. * <script type="text/javascript" src="{cdn}"></script>
  14988. * <script>
  14989. * const result = {namespace}.PixelFormat.BIT16;
  14990. *
  14991. * </script>
  14992. * // ES6 Import
  14993. * import { PixelFormat } from '{npm}';
  14994. *
  14995. * const result = PixelFormat.BIT16;
  14996. * ```
  14997. */
  14998. var PixelFormat = {
  14999. /** 每个像元用16个比特(即2个字节)表示。 */
  15000. BIT16: "BIT16",
  15001. /** 每个像元用32个比特(即4个字节)表示。 */
  15002. BIT32: "BIT32",
  15003. /** 每个像元用64个比特(即8个字节)表示,只提供给栅格数据集使用。 */
  15004. BIT64: "BIT64",
  15005. /** 每个像元用4个字节来表示,只提供给栅格数据集使用。 */
  15006. SINGLE: "SINGLE",
  15007. /** 每个像元用8个字节来表示,只提供给栅格数据集使用。 */
  15008. DOUBLE: "DOUBLE",
  15009. /** 每个像元用1个比特表示。 */
  15010. UBIT1: "UBIT1",
  15011. /** 每个像元用4个比特来表示。 */
  15012. UBIT4: "UBIT4",
  15013. /** 每个像元用8个比特(即1个字节)来表示。 */
  15014. UBIT8: "UBIT8",
  15015. /** 每个像元用24个比特(即3个字节)来表示。 */
  15016. UBIT24: "UBIT24",
  15017. /** 每个像元用32个比特(即4个字节)来表示。 */
  15018. UBIT32: "UBIT32"
  15019. };
  15020. /**
  15021. * @enum SearchMode
  15022. * @description 内插时使用的样本点的查找方式枚举。
  15023. * @category BaseTypes Constant
  15024. * @type {string}
  15025. * @usage
  15026. * ```
  15027. * // 浏览器
  15028. * <script type="text/javascript" src="{cdn}"></script>
  15029. * <script>
  15030. * const result = {namespace}.SearchMode.KDTREE_FIXED_COUNT;
  15031. *
  15032. * </script>
  15033. * // ES6 Import
  15034. * import { SearchMode } from '{npm}';
  15035. *
  15036. * const result = SearchMode.KDTREE_FIXED_COUNT;
  15037. * ```
  15038. */
  15039. var SearchMode = {
  15040. /** 使用 KDTREE 的固定点数方式查找参与内插分析的点。 */
  15041. KDTREE_FIXED_COUNT: "KDTREE_FIXED_COUNT",
  15042. /** 使用 KDTREE 的定长方式查找参与内插分析的点。 */
  15043. KDTREE_FIXED_RADIUS: "KDTREE_FIXED_RADIUS",
  15044. /** 不进行查找,使用所有的输入点进行内插分析。 */
  15045. NONE: "NONE",
  15046. /** 使用 QUADTREE 方式查找参与内插分析的点,仅对样条(RBF)插值和普通克吕金(Kriging)有用。 */
  15047. QUADTREE: "QUADTREE"
  15048. };
  15049. /**
  15050. * @enum InterpolationAlgorithmType
  15051. * @description 插值分析的算法的类型。
  15052. * @category BaseTypes Constant
  15053. * @type {string}
  15054. * @usage
  15055. * ```
  15056. * // 浏览器
  15057. * <script type="text/javascript" src="{cdn}"></script>
  15058. * <script>
  15059. * const result = {namespace}.InterpolationAlgorithmType.KRIGING;
  15060. *
  15061. * </script>
  15062. * // ES6 Import
  15063. * import { InterpolationAlgorithmType } from '{npm}';
  15064. *
  15065. * const result = InterpolationAlgorithmType.KRIGING;
  15066. * ```
  15067. */
  15068. var InterpolationAlgorithmType = {
  15069. /** 普通克吕金插值法。 */
  15070. KRIGING: "KRIGING",
  15071. /** 简单克吕金插值法。 */
  15072. SimpleKriging: "SimpleKriging",
  15073. /** 泛克吕金插值法。 */
  15074. UniversalKriging: "UniversalKriging"
  15075. };
  15076. /**
  15077. * @enum VariogramMode
  15078. * @description 克吕金(Kriging)插值时的半变函数类型枚举。
  15079. * @category BaseTypes Constant
  15080. * @type {string}
  15081. * @usage
  15082. * ```
  15083. * // 浏览器
  15084. * <script type="text/javascript" src="{cdn}"></script>
  15085. * <script>
  15086. * const result = {namespace}.VariogramMode.EXPONENTIAL;
  15087. *
  15088. * </script>
  15089. * // ES6 Import
  15090. * import { VariogramMode } from '{npm}';
  15091. *
  15092. * const result = VariogramMode.EXPONENTIAL;
  15093. * ```
  15094. */
  15095. var VariogramMode = {
  15096. /** 指数函数。 */
  15097. EXPONENTIAL: "EXPONENTIAL",
  15098. /** 高斯函数。 */
  15099. GAUSSIAN: "GAUSSIAN",
  15100. /** 球型函数。 */
  15101. SPHERICAL: "SPHERICAL"
  15102. };
  15103. /**
  15104. * @enum Exponent
  15105. * @description 定义了泛克吕金(UniversalKriging)插值时样点数据中趋势面方程的阶数。
  15106. * @category BaseTypes Constant
  15107. * @type {string}
  15108. * @usage
  15109. * ```
  15110. * // 浏览器
  15111. * <script type="text/javascript" src="{cdn}"></script>
  15112. * <script>
  15113. * const result = {namespace}.Exponent.EXP1;
  15114. *
  15115. * </script>
  15116. * // ES6 Import
  15117. * import { Exponent } from '{npm}';
  15118. *
  15119. * const result = Exponent.EXP1;
  15120. * ```
  15121. */
  15122. var Exponent = {
  15123. /** 阶数为1。 */
  15124. EXP1: "EXP1",
  15125. /** 阶数为2。 */
  15126. EXP2: "EXP2"
  15127. };
  15128. /**
  15129. * @enum ClientType
  15130. * @description token申请的客户端标识类型。
  15131. * @category BaseTypes Constant
  15132. * @type {string}
  15133. * @usage
  15134. * ```
  15135. * // 浏览器
  15136. * <script type="text/javascript" src="{cdn}"></script>
  15137. * <script>
  15138. * const result = {namespace}.ClientType.IP;
  15139. *
  15140. * </script>
  15141. * // ES6 Import
  15142. * import { ClientType } from '{npm}';
  15143. *
  15144. * const result = ClientType.IP;
  15145. * ```
  15146. */
  15147. var ClientType = {
  15148. /** 指定的 IP 地址。 */
  15149. IP: "IP",
  15150. /** 指定的 URL。 */
  15151. REFERER: "Referer",
  15152. /** 发送申请令牌请求的客户端 IP。 */
  15153. REQUESTIP: "RequestIP",
  15154. /** 不做任何验证。 */
  15155. NONE: "NONE",
  15156. /** SERVER。 */
  15157. SERVER: "SERVER",
  15158. /** WEB。 */
  15159. WEB: "WEB"
  15160. };
  15161. /**
  15162. * @enum ChartType
  15163. * @description 客户端专题图图表类型。
  15164. * @category BaseTypes Constant
  15165. * @type {string}
  15166. * @usage
  15167. * ```
  15168. * // 浏览器
  15169. * <script type="text/javascript" src="{cdn}"></script>
  15170. * <script>
  15171. * const result = {namespace}.ChartType.BAR;
  15172. *
  15173. * </script>
  15174. * // ES6 Import
  15175. * import { ChartType } from '{npm}';
  15176. *
  15177. * const result = ChartType.BAR;
  15178. * ```
  15179. */
  15180. var ChartType = {
  15181. /** 柱状图。 */
  15182. BAR: "Bar",
  15183. /** 三维柱状图。 */
  15184. BAR3D: "Bar3D",
  15185. /** 圆形图。 */
  15186. CIRCLE: "Circle",
  15187. /** 饼图。 */
  15188. PIE: "Pie",
  15189. /** 散点图。 */
  15190. POINT: "Point",
  15191. /** 折线图。 */
  15192. LINE: "Line",
  15193. /** 环状图。 */
  15194. RING: "Ring"
  15195. };
  15196. /**
  15197. * @enum ClipAnalystMode
  15198. * @description 裁剪分析模式
  15199. * @category BaseTypes Constant
  15200. * @type {string}
  15201. * @usage
  15202. * ```
  15203. * // 浏览器
  15204. * <script type="text/javascript" src="{cdn}"></script>
  15205. * <script>
  15206. * const result = {namespace}.ClipAnalystMode.CLIP;
  15207. *
  15208. * </script>
  15209. * // ES6 Import
  15210. * import { ClipAnalystMode } from '{npm}';
  15211. *
  15212. * const result = ClipAnalystMode.CLIP;
  15213. * ```
  15214. */
  15215. var ClipAnalystMode = {
  15216. /** CLIP。 */
  15217. CLIP: "clip",
  15218. /** INTERSECT。 */
  15219. INTERSECT: "intersect"
  15220. };
  15221. /**
  15222. * @enum AnalystAreaUnit
  15223. * @description 分布式分析面积单位。
  15224. * @category BaseTypes Constant
  15225. * @type {string}
  15226. * @usage
  15227. * ```
  15228. * // 浏览器
  15229. * <script type="text/javascript" src="{cdn}"></script>
  15230. * <script>
  15231. * const result = {namespace}.AnalystAreaUnit.SQUAREMETER;
  15232. *
  15233. * </script>
  15234. * // ES6 Import
  15235. * import { AnalystAreaUnit } from '{npm}';
  15236. *
  15237. * const result = AnalystAreaUnit.SQUAREMETER;
  15238. * ```
  15239. */
  15240. var AnalystAreaUnit = {
  15241. /** 平方米。 */
  15242. "SQUAREMETER": "SquareMeter",
  15243. /** 平方千米。 */
  15244. "SQUAREKILOMETER": "SquareKiloMeter",
  15245. /** 公顷。 */
  15246. "HECTARE": "Hectare",
  15247. /** 公亩。 */
  15248. "ARE": "Are",
  15249. /** 英亩。 */
  15250. "ACRE": "Acre",
  15251. /** 平方英尺。 */
  15252. "SQUAREFOOT": "SquareFoot",
  15253. /** 平方码。 */
  15254. "SQUAREYARD": "SquareYard",
  15255. /** 平方英里。 */
  15256. "SQUAREMILE": "SquareMile"
  15257. };
  15258. /**
  15259. * @enum AnalystSizeUnit
  15260. * @description 分布式分析单位。
  15261. * @category BaseTypes Constant
  15262. * @type {string}
  15263. * @usage
  15264. * ```
  15265. * // 浏览器
  15266. * <script type="text/javascript" src="{cdn}"></script>
  15267. * <script>
  15268. * const result = {namespace}.AnalystSizeUnit.METER;
  15269. *
  15270. * </script>
  15271. * // ES6 Import
  15272. * import { AnalystSizeUnit } from '{npm}';
  15273. *
  15274. * const result = AnalystSizeUnit.METER;
  15275. * ```
  15276. */
  15277. var AnalystSizeUnit = {
  15278. /** 米。 */
  15279. "METER": "Meter",
  15280. /** 千米。 */
  15281. "KILOMETER": "Kilometer",
  15282. /** 码。 */
  15283. "YARD": "Yard",
  15284. /** 英尺。 */
  15285. "FOOT": "Foot",
  15286. /** 英里。 */
  15287. "MILE": "Mile"
  15288. };
  15289. /**
  15290. * @enum StatisticAnalystMode
  15291. * @description 分布式分析统计模式。
  15292. * @category BaseTypes Constant
  15293. * @type {string}
  15294. * @usage
  15295. * ```
  15296. * // 浏览器
  15297. * <script type="text/javascript" src="{cdn}"></script>
  15298. * <script>
  15299. * const result = {namespace}.StatisticAnalystMode.MAX;
  15300. *
  15301. * </script>
  15302. * // ES6 Import
  15303. * import { StatisticAnalystMode } from '{npm}';
  15304. *
  15305. * const result = StatisticAnalystMode.MAX;
  15306. * ```
  15307. */
  15308. var StatisticAnalystMode = {
  15309. /** 统计所选字段的最大值。 */
  15310. "MAX": "max",
  15311. /** 统计所选字段的最小值。 */
  15312. "MIN": "min",
  15313. /** 统计所选字段的平均值。 */
  15314. "AVERAGE": "average",
  15315. /** 统计所选字段的总和。 */
  15316. "SUM": "sum",
  15317. /** 统计所选字段的方差。 */
  15318. "VARIANCE": "variance",
  15319. /** 统计所选字段的标准差。 */
  15320. "STDDEVIATION": "stdDeviation"
  15321. };
  15322. /**
  15323. * @enum SummaryType
  15324. * @description 分布式分析聚合类型。
  15325. * @category BaseTypes Constant
  15326. * @type {string}
  15327. * @usage
  15328. * ```
  15329. * // 浏览器
  15330. * <script type="text/javascript" src="{cdn}"></script>
  15331. * <script>
  15332. * const result = {namespace}.SummaryType.SUMMARYMESH;
  15333. *
  15334. * </script>
  15335. * // ES6 Import
  15336. * import { SummaryType } from '{npm}';
  15337. *
  15338. * const result = SummaryType.SUMMARYMESH;
  15339. * ```
  15340. */
  15341. var SummaryType = {
  15342. /** 格网聚合。 */
  15343. "SUMMARYMESH": "SUMMARYMESH",
  15344. /** 多边形聚合。 */
  15345. "SUMMARYREGION": "SUMMARYREGION"
  15346. };
  15347. /**
  15348. * @enum TopologyValidatorRule
  15349. * @description 拓扑检查模式枚举。该类定义了拓扑检查操作模式常量。
  15350. * @category BaseTypes Constant
  15351. * @type {string}
  15352. * @usage
  15353. * ```
  15354. * // 浏览器
  15355. * <script type="text/javascript" src="{cdn}"></script>
  15356. * <script>
  15357. * const result = {namespace}.TopologyValidatorRule.REGIONNOOVERLAP;
  15358. *
  15359. * </script>
  15360. * // ES6 Import
  15361. * import { TopologyValidatorRule } from '{npm}';
  15362. *
  15363. * const result = TopologyValidatorRule.REGIONNOOVERLAP;
  15364. * ```
  15365. */
  15366. var TopologyValidatorRule = {
  15367. /** 面内无重叠,用于对面数据进行拓扑检查。 */
  15368. REGIONNOOVERLAP: "REGIONNOOVERLAP",
  15369. /** 面与面无重叠,用于对面数据进行拓扑检查。 */
  15370. REGIONNOOVERLAPWITH: "REGIONNOOVERLAPWITH",
  15371. /** 面被面包含,用于对面数据进行拓扑检查。 */
  15372. REGIONCONTAINEDBYREGION: "REGIONCONTAINEDBYREGION",
  15373. /** 面被面覆盖,用于对面数据进行拓扑检查。 */
  15374. REGIONCOVEREDBYREGION: "REGIONCOVEREDBYREGION",
  15375. /** 线与线无重叠,用于对线数据进行拓扑检查。 */
  15376. LINENOOVERLAP: "LINENOOVERLAP",
  15377. /** 线内无重叠,用于对线数据进行拓扑检查。 */
  15378. LINENOOVERLAPWITH: "LINENOOVERLAPWITH",
  15379. /** 点不相同,用于对点数据进行拓扑检查。 */
  15380. POINTNOIDENTICAL: "POINTNOIDENTICAL"
  15381. };
  15382. /**
  15383. * @enum BucketAggType
  15384. * @description 格网聚合查询枚举类,该类定义了Elasticsearch数据服务中聚合查询模式常量
  15385. * @category BaseTypes Constant
  15386. * @type {string}
  15387. * @usage
  15388. * ```
  15389. * // 浏览器
  15390. * <script type="text/javascript" src="{cdn}"></script>
  15391. * <script>
  15392. * const result = {namespace}.BucketAggType.GEOHASH_GRID;
  15393. *
  15394. * </script>
  15395. * // ES6 Import
  15396. * import { BucketAggType } from '{npm}';
  15397. *
  15398. * const result = BucketAggType.GEOHASH_GRID;
  15399. * ```
  15400. */
  15401. var BucketAggType = {
  15402. /** 格网聚合类型。 */
  15403. GEOHASH_GRID: "geohash_grid"
  15404. };
  15405. /**
  15406. * @enum MetricsAggType
  15407. * @description 指标聚合类型枚举类,该类定义了Elasticsearch数据服务中聚合查询模式常量。
  15408. * @category BaseTypes Constant
  15409. * @type {string}
  15410. * @usage
  15411. * ```
  15412. * // 浏览器
  15413. * <script type="text/javascript" src="{cdn}"></script>
  15414. * <script>
  15415. * const result = {namespace}.MetricsAggType.AVG;
  15416. *
  15417. * </script>
  15418. * // ES6 Import
  15419. * import { MetricsAggType } from '{npm}';
  15420. *
  15421. * const result = MetricsAggType.AVG;
  15422. * ```
  15423. */
  15424. var MetricsAggType = {
  15425. /** 平均值聚合类型。 */
  15426. AVG: 'avg',
  15427. /** 最大值聚合类型。 */
  15428. MAX: 'max',
  15429. /** 最小值聚合类型。 */
  15430. MIN: 'min',
  15431. /** 求和聚合类型。 */
  15432. SUM: 'sum'
  15433. };
  15434. /**
  15435. * @enum GetFeatureMode
  15436. * @description feature 查询方式。
  15437. * @category BaseTypes Constant
  15438. * @type {string}
  15439. * @usage
  15440. * ```
  15441. * // 浏览器
  15442. * <script type="text/javascript" src="{cdn}"></script>
  15443. * <script>
  15444. * const result = {namespace}.GetFeatureMode.BOUNDS;
  15445. *
  15446. * </script>
  15447. * // ES6 Import
  15448. * import { GetFeatureMode } from '{npm}';
  15449. *
  15450. * const result = GetFeatureMode.BOUNDS;
  15451. * ```
  15452. */
  15453. var GetFeatureMode = {
  15454. /** 通过范围查询来获取要素。 */
  15455. BOUNDS: "BOUNDS",
  15456. /** 通过几何对象的缓冲区来获取要素。 */
  15457. BUFFER: "BUFFER",
  15458. /** 通过 ID 来获取要素。 */
  15459. ID: "ID",
  15460. /** 通过空间查询模式来获取要素。 */
  15461. SPATIAL: "SPATIAL",
  15462. /** 通过 SQL 查询来获取要素。 */
  15463. SQL: 'SQL'
  15464. };
  15465. /**
  15466. * @enum RasterFunctionType
  15467. * @description 栅格分析方法。
  15468. * @category BaseTypes Constant
  15469. * @type {string}
  15470. * @usage
  15471. * ```
  15472. * // 浏览器
  15473. * <script type="text/javascript" src="{cdn}"></script>
  15474. * <script>
  15475. * const result = {namespace}.GetFeatureMode.NDVI;
  15476. *
  15477. * </script>
  15478. * // ES6 Import
  15479. * import { GetFeatureMode } from '{npm}';
  15480. *
  15481. * const result = GetFeatureMode.NDVI;
  15482. * ```
  15483. */
  15484. var RasterFunctionType = {
  15485. /** 归一化植被指数。 */
  15486. NDVI: "NDVI",
  15487. /** 阴影面分析。 */
  15488. HILLSHADE: "HILLSHADE"
  15489. };
  15490. /**
  15491. * @enum ResourceType
  15492. * @description iportal资源类型。
  15493. * @category BaseTypes Constant
  15494. * @version 10.0.1
  15495. * @type {string}
  15496. * @usage
  15497. * ```
  15498. * // 浏览器
  15499. * <script type="text/javascript" src="{cdn}"></script>
  15500. * <script>
  15501. * const result = {namespace}.GetFeatureMode.MAP;
  15502. *
  15503. * </script>
  15504. * // ES6 Import
  15505. * import { GetFeatureMode } from '{npm}';
  15506. *
  15507. * const result = GetFeatureMode.MAP;
  15508. * ```
  15509. */
  15510. var ResourceType = {
  15511. /** 地图。 */
  15512. MAP: "MAP",
  15513. /** 服务。 */
  15514. SERVICE: "SERVICE",
  15515. /** 场景。 */
  15516. SCENE: "SCENE",
  15517. /** 数据。 */
  15518. DATA: "DATA",
  15519. /** 洞察。 */
  15520. INSIGHTS_WORKSPACE: "INSIGHTS_WORKSPACE",
  15521. /** 大屏。 */
  15522. MAP_DASHBOARD: "MAP_DASHBOARD"
  15523. };
  15524. /**
  15525. * @enum OrderBy
  15526. * @description iportal资源排序字段。
  15527. * @category BaseTypes Constant
  15528. * @version 10.0.1
  15529. * @type {string}
  15530. * @usage
  15531. * ```
  15532. * // 浏览器
  15533. * <script type="text/javascript" src="{cdn}"></script>
  15534. * <script>
  15535. * const result = {namespace}.OrderBy.UPDATETIME;
  15536. *
  15537. * </script>
  15538. * // ES6 Import
  15539. * import { OrderBy } from '{npm}';
  15540. *
  15541. * const result = OrderBy.UPDATETIME;
  15542. * ```
  15543. */
  15544. var OrderBy = {
  15545. /** 按更新时间排序。 */
  15546. UPDATETIME: "UPDATETIME",
  15547. /** 按热度(可能是访问量、下载量)排序。 */
  15548. HEATLEVEL: "HEATLEVEL",
  15549. /** 按相关性排序。 */
  15550. RELEVANCE: "RELEVANCE"
  15551. };
  15552. /**
  15553. * @enum OrderType
  15554. * @description iportal资源升序还是降序过滤。
  15555. * @category BaseTypes Constant
  15556. * @version 10.0.1
  15557. * @type {string}
  15558. * @usage
  15559. * ```
  15560. * // 浏览器
  15561. * <script type="text/javascript" src="{cdn}"></script>
  15562. * <script>
  15563. * const result = {namespace}.OrderType.ASC;
  15564. *
  15565. * </script>
  15566. * // ES6 Import
  15567. * import { OrderType } from '{npm}';
  15568. *
  15569. * const result = OrderType.ASC;
  15570. * ```
  15571. */
  15572. var OrderType = {
  15573. /** 升序。 */
  15574. ASC: "ASC",
  15575. /** 降序。 */
  15576. DESC: "DESC"
  15577. };
  15578. /**
  15579. * @enum SearchType
  15580. * @description iportal资源查询的范围进行过滤。
  15581. * @category BaseTypes Constant
  15582. * @version 10.0.1
  15583. * @type {string}
  15584. * @usage
  15585. * ```
  15586. * // 浏览器
  15587. * <script type="text/javascript" src="{cdn}"></script>
  15588. * <script>
  15589. * const result = {namespace}.SearchType.PUBLIC;
  15590. *
  15591. * </script>
  15592. * // ES6 Import
  15593. * import { SearchType } from '{npm}';
  15594. *
  15595. * const result = SearchType.PUBLIC;
  15596. * ```
  15597. */
  15598. var SearchType = {
  15599. /** 公开资源。 */
  15600. PUBLIC: "PUBLIC",
  15601. /** 我的资源。 */
  15602. MY_RES: "MY_RES",
  15603. /** 我的群组资源。 */
  15604. MYGROUP_RES: "MYGROUP_RES",
  15605. /** 我的部门资源。 */
  15606. MYDEPARTMENT_RES: "MYDEPARTMENT_RES",
  15607. /** 分享给我的资源。 */
  15608. SHARETOME_RES: "SHARETOME_RES"
  15609. };
  15610. /**
  15611. * @enum AggregationTypes
  15612. * @description iportal资源聚合查询的类型。
  15613. * @category BaseTypes Constant
  15614. * @version 10.0.1
  15615. * @type {string}
  15616. * @usage
  15617. * ```
  15618. * // 浏览器
  15619. * <script type="text/javascript" src="{cdn}"></script>
  15620. * <script>
  15621. * const result = {namespace}.AggregationTypes.TAG;
  15622. *
  15623. * </script>
  15624. * // ES6 Import
  15625. * import { AggregationTypes } from '{npm}';
  15626. *
  15627. * const result = AggregationTypes.TAG;
  15628. * ```
  15629. */
  15630. var AggregationTypes = {
  15631. /** 标签。 */
  15632. TAG: "TAG",
  15633. /** 资源类型。 */
  15634. TYPE: "TYPE"
  15635. };
  15636. /**
  15637. * @enum PermissionType
  15638. * @description iportal资源权限类型。
  15639. * @category BaseTypes Constant
  15640. * @version 10.0.1
  15641. * @type {string}
  15642. * @usage
  15643. * ```
  15644. * // 浏览器
  15645. * <script type="text/javascript" src="{cdn}"></script>
  15646. * <script>
  15647. * const result = {namespace}.PermissionType.SEARCH;
  15648. *
  15649. * </script>
  15650. * // ES6 Import
  15651. * import { PermissionType } from '{npm}';
  15652. *
  15653. * const result = PermissionType.SEARCH;
  15654. * ```
  15655. */
  15656. var PermissionType = {
  15657. /** 可检索。 */
  15658. SEARCH: "SEARCH",
  15659. /** 可查看。 */
  15660. READ: "READ",
  15661. /** 可编辑。 */
  15662. READWRITE: "READWRITE",
  15663. /** 可删除。 */
  15664. DELETE: "DELETE",
  15665. /** 可下载,包括可读、可检索。 */
  15666. DOWNLOAD: "DOWNLOAD"
  15667. };
  15668. /**
  15669. * @enum EntityType
  15670. * @description iportal资源实体类型。
  15671. * @category BaseTypes Constant
  15672. * @version 10.0.1
  15673. * @type {string}
  15674. * @usage
  15675. * ```
  15676. * // 浏览器
  15677. * <script type="text/javascript" src="{cdn}"></script>
  15678. * <script>
  15679. * const result = {namespace}.EntityType.DEPARTMENT;
  15680. *
  15681. * </script>
  15682. * // ES6 Import
  15683. * import { EntityType } from '{npm}';
  15684. *
  15685. * const result = EntityType.DEPARTMENT;
  15686. * ```
  15687. */
  15688. var EntityType = {
  15689. /** 部门。 */
  15690. DEPARTMENT: "DEPARTMENT",
  15691. /** 用户组。 */
  15692. GROUP: "GROUP",
  15693. /** 群组。 */
  15694. IPORTALGROUP: "IPORTALGROUP",
  15695. /** 角色。 */
  15696. ROLE: "ROLE",
  15697. /** 用户。 */
  15698. USER: "USER"
  15699. };
  15700. /**
  15701. * @enum DataItemType
  15702. * @description iportal数据类型。
  15703. * @category BaseTypes Constant
  15704. * @version 10.0.1
  15705. * @type {string}
  15706. * @usage
  15707. * ```
  15708. * // 浏览器
  15709. * <script type="text/javascript" src="{cdn}"></script>
  15710. * <script>
  15711. * const result = {namespace}.DataItemType.GEOJSON;
  15712. *
  15713. * </script>
  15714. * // ES6 Import
  15715. * import { DataItemType } from '{npm}';
  15716. *
  15717. * const result = DataItemType.GEOJSON;
  15718. * ```
  15719. */
  15720. var DataItemType = {
  15721. /** geojson 数据。 */
  15722. GEOJSON: "GEOJSON",
  15723. /** UGCV5_MVT。 */
  15724. UGCV5_MVT: "UGCV5_MVT",
  15725. /** json数据。 */
  15726. JSON: "JSON",
  15727. /** 音频文件。 */
  15728. AUDIO: "AUDIO",
  15729. /** Color 颜色。 */
  15730. COLOR: "COLOR",
  15731. /** ColorScheme 颜色方案。 */
  15732. COLORSCHEME: "COLORSCHEME",
  15733. /** CSV 数据。 */
  15734. CSV: "CSV",
  15735. /** EXCEL 数据。 */
  15736. EXCEL: "EXCEL",
  15737. /** FillSymbol 填充符号库。 */
  15738. FILLSYMBOL: "FILLSYMBOL",
  15739. /** 图片类型。 */
  15740. IMAGE: "IMAGE",
  15741. /** LayerTemplate 图层模板。 */
  15742. LAYERTEMPLATE: "LAYERTEMPLATE",
  15743. /** LayoutTemplate 布局模板。 */
  15744. LAYOUTTEMPLATE: "LAYOUTTEMPLATE",
  15745. /** LineSymbol 线符号库。 */
  15746. LINESYMBOL: "LINESYMBOL",
  15747. /** MapTemplate 地图模板。 */
  15748. MAPTEMPLATE: "MAPTEMPLATE",
  15749. /** MarkerSymbol 点符号库。 */
  15750. MARKERSYMBOL: "MARKERSYMBOL",
  15751. /** MBTILES。 */
  15752. MBTILES: "MBTILES",
  15753. /** 照片。 */
  15754. PHOTOS: "PHOTOS",
  15755. /** SHP 空间数据。 */
  15756. SHP: "SHP",
  15757. /** SMTILES。 */
  15758. SMTILES: "SMTILES",
  15759. /** SVTILES。 */
  15760. SVTILES: "SVTILES",
  15761. /** ThemeTemplate 专题图模板。 */
  15762. THEMETEMPLATE: "THEMETEMPLATE",
  15763. /** TPK。 */
  15764. TPK: "TPK",
  15765. /** UDB 数据源。 */
  15766. UDB: "UDB",
  15767. /** UGCV5。 */
  15768. UGCV5: "UGCV5",
  15769. /** 其他类型(普通文件)。 */
  15770. UNKNOWN: "UNKNOWN",
  15771. /** 视频文件。 */
  15772. VIDEO: "VIDEO",
  15773. /** WorkEnviroment 工作环境。 */
  15774. WORKENVIRONMENT: "WORKENVIRONMENT",
  15775. /** 工作空间。 */
  15776. WORKSPACE: "WORKSPACE"
  15777. };
  15778. /**
  15779. * @enum WebExportFormatType
  15780. * @description Web 打印输出的格式。
  15781. * @category BaseTypes Constant
  15782. * @version 10.0.1
  15783. * @type {string}
  15784. * @usage
  15785. * ```
  15786. * // 浏览器
  15787. * <script type="text/javascript" src="{cdn}"></script>
  15788. * <script>
  15789. * const result = {namespace}.WebExportFormatType.PNG;
  15790. *
  15791. * </script>
  15792. * // ES6 Import
  15793. * import { WebExportFormatType } from '{npm}';
  15794. *
  15795. * const result = WebExportFormatType.PNG;
  15796. * ```
  15797. */
  15798. var WebExportFormatType = {
  15799. /** PNG */
  15800. PNG: "PNG",
  15801. /** PDF */
  15802. PDF: "PDF"
  15803. };
  15804. /**
  15805. * @enum WebScaleOrientationType
  15806. * @description Web 比例尺的方位样式。
  15807. * @category BaseTypes Constant
  15808. * @version 10.0.1
  15809. * @type {string}
  15810. * @usage
  15811. * ```
  15812. * // 浏览器
  15813. * <script type="text/javascript" src="{cdn}"></script>
  15814. * <script>
  15815. * const result = {namespace}.WebScaleOrientationType.HORIZONTALLABELSBELOW;
  15816. *
  15817. * </script>
  15818. * // ES6 Import
  15819. * import { WebScaleOrientationType } from '{npm}';
  15820. *
  15821. * const result = WebScaleOrientationType.HORIZONTALLABELSBELOW;
  15822. * ```
  15823. */
  15824. var WebScaleOrientationType = {
  15825. /** horizontal labels below. */
  15826. HORIZONTALLABELSBELOW: "HORIZONTALLABELSBELOW",
  15827. /** horizontal labels above. */
  15828. HORIZONTALLABELSABOVE: "HORIZONTALLABELSABOVE",
  15829. /** vertical labels left. */
  15830. VERTICALLABELSLEFT: "VERTICALLABELSLEFT",
  15831. /** vertical labels right. */
  15832. VERTICALLABELSRIGHT: "VERTICALLABELSRIGHT"
  15833. };
  15834. /**
  15835. * @enum WebScaleType
  15836. * @description Web 比例尺的样式。
  15837. * @category BaseTypes Constant
  15838. * @version 10.0.1
  15839. * @type {string}
  15840. * @usage
  15841. * ```
  15842. * // 浏览器
  15843. * <script type="text/javascript" src="{cdn}"></script>
  15844. * <script>
  15845. * const result = {namespace}.WebScaleType.LINE;
  15846. *
  15847. * </script>
  15848. * // ES6 Import
  15849. * import { WebScaleType } from '{npm}';
  15850. *
  15851. * const result = WebScaleType.LINE;
  15852. * ```
  15853. */
  15854. var WebScaleType = {
  15855. /** line. */
  15856. LINE: "LINE",
  15857. /** bar. */
  15858. BAR: "BAR",
  15859. /** bar sub. */
  15860. BAR_SUB: "BAR_SUB"
  15861. };
  15862. /**
  15863. * @enum WebScaleUnit
  15864. * @description Web 比例尺的单位制。
  15865. * @category BaseTypes Constant
  15866. * @version 10.0.1
  15867. * @type {string}
  15868. * @usage
  15869. * ```
  15870. * // 浏览器
  15871. * <script type="text/javascript" src="{cdn}"></script>
  15872. * <script>
  15873. * const result = {namespace}.WebScaleUnit.METER;
  15874. *
  15875. * </script>
  15876. * // ES6 Import
  15877. * import { WebScaleUnit } from '{npm}';
  15878. *
  15879. * const result = WebScaleUnit.METER;
  15880. * ```
  15881. */
  15882. var WebScaleUnit = {
  15883. /** 米。 */
  15884. METER: "METER",
  15885. /** 英尺。 */
  15886. FOOT: "FOOT",
  15887. /** 度。 */
  15888. DEGREES: "DEGREES"
  15889. };
  15890. ;// CONCATENATED MODULE: ./src/common/iServer/ServerGeometry.js
  15891. function ServerGeometry_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  15892. function ServerGeometry_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  15893. function ServerGeometry_createClass(Constructor, protoProps, staticProps) { if (protoProps) ServerGeometry_defineProperties(Constructor.prototype, protoProps); if (staticProps) ServerGeometry_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  15894. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  15895. * This program are made available under the terms of the Apache License, Version 2.0
  15896. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  15897. /**
  15898. * @class ServerGeometry
  15899. * @deprecatedclass SuperMap.ServerGeometry
  15900. * @category iServer Data Feature
  15901. * @classdesc 服务端几何对象类。该类描述几何对象(矢量)的特征数据(坐标点对、几何对象的类型等)。基于服务端的空间分析、空间关系运算、查询等 GIS 服务功能使用服务端几何对象。
  15902. * @param {Object} options - 参数。
  15903. * @param {string} options.id - 服务端几何对象唯一标识符。
  15904. * @param {Array.<number>} options.parts - 服务端几何对象中各个子对象所包含的节点个数。
  15905. * @param {Array.<GeometryPoint>} options.points - 组成几何对象的节点的坐标对数组。
  15906. * @param {GeometryType} options.type - 几何对象的类型。
  15907. * @param {ServerStyle} [options.style] - 服务端几何对象的风格。
  15908. * @usage
  15909. */
  15910. var ServerGeometry = /*#__PURE__*/function () {
  15911. function ServerGeometry(options) {
  15912. ServerGeometry_classCallCheck(this, ServerGeometry);
  15913. /**
  15914. * @member {string} ServerGeometry.prototype.id
  15915. * @description 服务端几何对象唯一标识符。
  15916. */
  15917. this.id = 0;
  15918. /**
  15919. * @member {ServerStyle} [ServerGeometry.prototype.style]
  15920. * @description 服务端几何对象的风格(ServerStyle)。
  15921. */
  15922. this.style = null;
  15923. /**
  15924. * @member {Array.<number>} ServerGeometry.prototype.parts
  15925. * @description 服务端几何对象中各个子对象所包含的节点个数。<br>
  15926. * 1.几何对象从结构上可以分为简单几何对象和复杂几何对象。
  15927. * 简单几何对象与复杂几何对象的区别:简单的几何对象一般为单一对象,
  15928. * 而复杂的几何对象由多个简单对象组成或经过一定的空间运算之后产生,
  15929. * 如:矩形为简单的区域对象,而中空的矩形为复杂的区域对象。<br>
  15930. * 2.通常情况,一个简单几何对象的子对象就是它本身,
  15931. * 因此对于简单对象来说的该字段为长度为1的整型数组,
  15932. * 该字段的值就是这个简单对象节点的个数。
  15933. * 如果一个几何对象是由几个简单对象组合而成的,
  15934. * 例如,一个岛状几何对象由 3 个简单的多边形组成而成,
  15935. * 那么这个岛状的几何对象的 Parts 字段值就是一个长度为 3 的整型数组,
  15936. * 数组中每个成员的值分别代表这三个多边形所包含的节点个数。
  15937. */
  15938. this.parts = null;
  15939. /**
  15940. * @member {Array.<GeometryPoint>} ServerGeometry.prototype.points
  15941. * @description 组成几何对象的节点的坐标对数组。<br>
  15942. * 1.所有几何对象(点、线、面)都是由一些简单的点坐标组成的,
  15943. * 该字段存放了组成几何对象的点坐标的数组。
  15944. * 对于简单的面对象,他的起点和终点的坐标点相同。<br>
  15945. * 2.对于复杂的几何对象,根据 Parts 属性来确定每一个组成复杂几何对象的简单对象所对应的节点的个数,
  15946. * 从而确定 Points 字段中坐标对的分配归属问题。
  15947. */
  15948. this.points = null;
  15949. /**
  15950. * @member {GeometryType} ServerGeometry.prototype.type
  15951. * @description 几何对象的类型(GeometryType)。
  15952. */
  15953. this.type = null;
  15954. /**
  15955. * @member {Object} ServerGeometry.prototype.prjCoordSys
  15956. * @description 投影坐标参数,现仅在缓冲区分析中有效。
  15957. */
  15958. this.prjCoordSys = null;
  15959. if (options) {
  15960. Util_Util.extend(this, options);
  15961. }
  15962. this.CLASS_NAME = 'SuperMap.ServerGeometry';
  15963. }
  15964. /**
  15965. * @function ServerGeometry.prototype.destroy
  15966. * @description 释放资源,将引用资源的属性置空。
  15967. */
  15968. ServerGeometry_createClass(ServerGeometry, [{
  15969. key: "destroy",
  15970. value: function destroy() {
  15971. var me = this;
  15972. me.id = null;
  15973. me.style = null;
  15974. me.parts = null;
  15975. me.partTopo = null;
  15976. me.points = null;
  15977. me.type = null;
  15978. me.prjCoordSys = null;
  15979. }
  15980. /**
  15981. * @function ServerGeometry.prototype.toGeometry
  15982. * @description 将服务端几何对象 ServerGeometry 转换为客户端几何对象 Geometry。
  15983. * @returns {Geometry} 转换后的客户端几何对象。
  15984. */
  15985. }, {
  15986. key: "toGeometry",
  15987. value: function toGeometry() {
  15988. var me = this,
  15989. geoType = me.type;
  15990. switch (geoType.toUpperCase()) {
  15991. case REST_GeometryType.POINT:
  15992. return me.toGeoPoint();
  15993. case REST_GeometryType.LINE:
  15994. return me.toGeoLine();
  15995. case REST_GeometryType.LINEM:
  15996. return me.toGeoLinem();
  15997. case REST_GeometryType.REGION:
  15998. return me.toGeoRegion();
  15999. case REST_GeometryType.POINTEPS:
  16000. return me.toGeoPoint();
  16001. case REST_GeometryType.LINEEPS:
  16002. return me.toGeoLineEPS();
  16003. case REST_GeometryType.REGIONEPS:
  16004. return me.toGeoRegionEPS();
  16005. case REST_GeometryType.GEOCOMPOUND:
  16006. return me.transformGeoCompound();
  16007. }
  16008. }
  16009. /**
  16010. * @function ServerGeometry.prototype.toGeoPoint
  16011. * @description 将服务端的点几何对象转换为客户端几何对象。包括 Point、MultiPoint。
  16012. * @returns {Geometry} 转换后的客户端几何对象。
  16013. */
  16014. }, {
  16015. key: "toGeoPoint",
  16016. value: function toGeoPoint() {
  16017. var me = this,
  16018. geoParts = me.parts || [],
  16019. geoPoints = me.points || [],
  16020. len = geoParts.length;
  16021. if (len > 0) {
  16022. if (len === 1) {
  16023. return new Point(geoPoints[0].x, geoPoints[0].y);
  16024. } else {
  16025. var pointList = [];
  16026. for (var i = 0; i < len; i++) {
  16027. pointList.push(new Point(geoPoints[i].x, geoPoints[i].y));
  16028. }
  16029. return new MultiPoint(pointList);
  16030. }
  16031. } else {
  16032. return null;
  16033. }
  16034. }
  16035. /**
  16036. * @function ServerGeometry.prototype.toGeoLine
  16037. * @description 将服务端的线几何对象转换为客户端几何对象。包括 GeometryLinearRing、GeometryLineString、GeometryMultiLineString。
  16038. * @returns {Geometry} 转换后的客户端几何对象。
  16039. */
  16040. }, {
  16041. key: "toGeoLine",
  16042. value: function toGeoLine() {
  16043. var me = this,
  16044. geoParts = me.parts || [],
  16045. geoPoints = me.points || [],
  16046. len = geoParts.length;
  16047. if (len > 0) {
  16048. if (len === 1) {
  16049. var pointList = [];
  16050. for (var i = 0; i < geoParts[0]; i++) {
  16051. pointList.push(new Point(geoPoints[i].x, geoPoints[i].y));
  16052. }
  16053. //判断线是否闭合,如果闭合,则返回LinearRing,否则返回LineString
  16054. if (pointList[0].equals(pointList[geoParts[0] - 1])) {
  16055. return new LinearRing_LinearRing(pointList);
  16056. } else {
  16057. return new LineString(pointList);
  16058. }
  16059. } else {
  16060. var lineList = [];
  16061. for (var _i2 = 0; _i2 < len; _i2++) {
  16062. var _pointList = [];
  16063. for (var j = 0; j < geoParts[_i2]; j++) {
  16064. _pointList.push(new Point(geoPoints[j].x, geoPoints[j].y));
  16065. }
  16066. lineList.push(new LineString(_pointList));
  16067. geoPoints.splice(0, geoParts[_i2]);
  16068. }
  16069. return new MultiLineString(lineList);
  16070. }
  16071. } else {
  16072. return null;
  16073. }
  16074. }
  16075. /**
  16076. * @function ServerGeometry.prototype.toGeoLineEPS
  16077. * @description 将服务端的线几何对象转换为客户端几何对象。包括 GeometryLinearRing、GeometryLineString、GeometryMultiLineString。
  16078. * @returns {Geometry} 转换后的客户端几何对象。
  16079. */
  16080. }, {
  16081. key: "toGeoLineEPS",
  16082. value: function toGeoLineEPS() {
  16083. var me = this,
  16084. geoParts = me.parts || [],
  16085. geoPoints = me.points || [],
  16086. i,
  16087. j,
  16088. pointList,
  16089. lineList,
  16090. lineEPS,
  16091. len = geoParts.length;
  16092. if (len > 0) {
  16093. if (len === 1) {
  16094. for (i = 0, pointList = []; i < geoParts[0]; i++) {
  16095. pointList.push(new Point(geoPoints[i].x, geoPoints[i].y, geoPoints[i].type));
  16096. }
  16097. //判断线是否闭合,如果闭合,则返回LinearRing,否则返回LineString
  16098. if (pointList[0].equals(pointList[geoParts[0] - 1])) {
  16099. lineEPS = LineString.createLineEPS(pointList);
  16100. return new LinearRing_LinearRing(lineEPS);
  16101. } else {
  16102. lineEPS = LineString.createLineEPS(pointList);
  16103. return new LineString(lineEPS);
  16104. }
  16105. } else {
  16106. for (i = 0, lineList = []; i < len; i++) {
  16107. for (j = 0, pointList = []; j < geoParts[i]; j++) {
  16108. pointList.push(new Point(geoPoints[j].x, geoPoints[j].y));
  16109. }
  16110. lineEPS = LineString.createLineEPS(pointList);
  16111. lineList.push(new LineString(lineEPS));
  16112. geoPoints.splice(0, geoParts[i]);
  16113. }
  16114. return new MultiLineString(lineList);
  16115. }
  16116. } else {
  16117. return null;
  16118. }
  16119. }
  16120. /**
  16121. * @function ServerGeometry.prototype.toGeoLinem
  16122. * @description 将服务端的路由线几何对象转换为客户端几何对象。包括 LinearRing、LineString、MultiLineString。
  16123. * @returns {Geometry} 转换后的客户端几何对象。
  16124. */
  16125. }, {
  16126. key: "toGeoLinem",
  16127. value: function toGeoLinem() {
  16128. var me = this;
  16129. return Route.fromJson(me);
  16130. }
  16131. /**
  16132. * @function ServerGeometry.prototype.toGeoRegion
  16133. * @description 将服务端的面几何对象转换为客户端几何对象。类型为 GeometryPolygon。
  16134. * @returns {Geometry} 转换后的客户端几何对象。
  16135. */
  16136. }, {
  16137. key: "toGeoRegion",
  16138. value: function toGeoRegion() {
  16139. var me = this,
  16140. geoParts = me.parts || [],
  16141. geoTopo = me.partTopo || [],
  16142. geoPoints = me.points || [],
  16143. len = geoParts.length;
  16144. if (len <= 0) {
  16145. return null;
  16146. }
  16147. var polygonArray = [];
  16148. var pointList = [];
  16149. if (len == 1) {
  16150. for (var i = 0; i < geoPoints.length; i++) {
  16151. pointList.push(new Point(geoPoints[i].x, geoPoints[i].y));
  16152. }
  16153. polygonArray.push(new Polygon_Polygon([new LinearRing_LinearRing(pointList)]));
  16154. return new MultiPolygon(polygonArray);
  16155. }
  16156. //处理复杂面
  16157. var CCWArray = [];
  16158. var areaArray = [];
  16159. var polygonArrayTemp = [];
  16160. var polygonBounds = [];
  16161. //polyon岛洞标识数组,初始都是岛。
  16162. var CCWIdent = [];
  16163. for (var _i4 = 0, pointIndex = 0; _i4 < len; _i4++) {
  16164. for (var j = 0; j < geoParts[_i4]; j++) {
  16165. pointList.push(new Point(geoPoints[pointIndex + j].x, geoPoints[pointIndex + j].y));
  16166. }
  16167. pointIndex += geoParts[_i4];
  16168. var polygon = new Polygon_Polygon([new LinearRing_LinearRing(pointList)]);
  16169. pointList = [];
  16170. polygonArrayTemp.push(polygon);
  16171. if (geoTopo.length === 0) {
  16172. polygonBounds.push(polygon.getBounds());
  16173. }
  16174. CCWIdent.push(1);
  16175. areaArray.push(polygon.getArea());
  16176. }
  16177. //iServer 9D新增字段
  16178. if (geoTopo.length === 0) {
  16179. //根据面积排序
  16180. ServerGeometry.bubbleSort(areaArray, polygonArrayTemp, geoTopo, polygonBounds);
  16181. //岛洞底层判断原则:将所有的子对象按照面积排序,面积最大的直接判定为岛(1),从面积次大的开始处理,
  16182. // 如果发现该对象在某个面积大于它的对象之中(即被包含),则根据包含它的对象的标识(1 or -1),指定其标识(-1 or 1),
  16183. // 依次处理完所有对象,就得到了一个标识数组,1表示岛,-1表示洞
  16184. //目标polygon索引列表 -1标示没有被任何polygon包含,
  16185. var targetArray = [];
  16186. for (var _i6 = 1; _i6 < polygonArrayTemp.length; _i6++) {
  16187. for (var _j2 = _i6 - 1; _j2 >= 0; _j2--) {
  16188. targetArray[_i6] = -1;
  16189. if (polygonBounds[_j2].containsBounds(polygonBounds[_i6])) {
  16190. CCWIdent[_i6] = CCWIdent[_j2] * -1;
  16191. if (CCWIdent[_i6] < 0) {
  16192. targetArray[_i6] = _j2;
  16193. }
  16194. break;
  16195. }
  16196. }
  16197. }
  16198. for (var _i8 = 0; _i8 < polygonArrayTemp.length; _i8++) {
  16199. if (CCWIdent[_i8] > 0) {
  16200. polygonArray.push(polygonArrayTemp[_i8]);
  16201. } else {
  16202. polygonArray[targetArray[_i8]].components = polygonArray[targetArray[_i8]].components.concat(polygonArrayTemp[_i8].components);
  16203. //占位
  16204. polygonArray.push('');
  16205. }
  16206. }
  16207. } else {
  16208. polygonArray = new Array();
  16209. for (var _i10 = 0; _i10 < polygonArrayTemp.length; _i10++) {
  16210. if (geoTopo[_i10] && geoTopo[_i10] == -1) {
  16211. CCWArray = CCWArray.concat(polygonArrayTemp[_i10].components);
  16212. } else {
  16213. if (CCWArray.length > 0 && polygonArray.length > 0) {
  16214. polygonArray[polygonArray.length - 1].components = polygonArray[polygonArray.length - 1].components.concat(CCWArray);
  16215. CCWArray = [];
  16216. }
  16217. polygonArray.push(polygonArrayTemp[_i10]);
  16218. }
  16219. if (_i10 == len - 1) {
  16220. var polyLength = polygonArray.length;
  16221. if (polyLength) {
  16222. polygonArray[polyLength - 1].components = polygonArray[polyLength - 1].components.concat(CCWArray);
  16223. } else {
  16224. for (var k = 0, length = CCWArray.length; k < length; k++) {
  16225. polygonArray.push(new Polygon_Polygon(CCWArray));
  16226. }
  16227. }
  16228. }
  16229. }
  16230. }
  16231. return new MultiPolygon(polygonArray);
  16232. }
  16233. /**
  16234. * @function ServerGeometry.prototype.toGeoRegionEPS
  16235. * @description 将服务端的面几何对象转换为客户端几何对象。类型为 Polygon。
  16236. * @returns {Geometry} 转换后的客户端几何对象。
  16237. */
  16238. }, {
  16239. key: "toGeoRegionEPS",
  16240. value: function toGeoRegionEPS() {
  16241. var me = this,
  16242. geoParts = me.parts || [],
  16243. geoTopo = me.partTopo || [],
  16244. geoPoints = me.points || [],
  16245. len = geoParts.length;
  16246. if (len <= 0) {
  16247. return null;
  16248. }
  16249. var polygonArray = [];
  16250. var pointList = [];
  16251. var lineEPS;
  16252. if (len == 1) {
  16253. for (var i = 0; i < geoPoints.length; i++) {
  16254. pointList.push(new Point(geoPoints[i].x, geoPoints[i].y));
  16255. }
  16256. lineEPS = LineString.createLineEPS(pointList);
  16257. polygonArray.push(new Polygon_Polygon([new LinearRing_LinearRing(lineEPS)]));
  16258. return new MultiPolygon(polygonArray);
  16259. }
  16260. //处理复杂面
  16261. var CCWArray = [];
  16262. var areaArray = [];
  16263. var polygonArrayTemp = [];
  16264. var polygonBounds = [];
  16265. //polyon岛洞标识数组,初始都是岛。
  16266. var CCWIdent = [];
  16267. for (var _i12 = 0, pointIndex = 0; _i12 < len; _i12++) {
  16268. for (var j = 0; j < geoParts[_i12]; j++) {
  16269. pointList.push(new Point(geoPoints[pointIndex + j].x, geoPoints[pointIndex + j].y));
  16270. }
  16271. pointIndex += geoParts[_i12];
  16272. lineEPS = LineString.createLineEPS(pointList);
  16273. var polygon = new Polygon_Polygon([new LinearRing_LinearRing(lineEPS)]);
  16274. pointList = [];
  16275. polygonArrayTemp.push(polygon);
  16276. if (geoTopo.length === 0) {
  16277. polygonBounds.push(polygon.getBounds());
  16278. }
  16279. CCWIdent.push(1);
  16280. areaArray.push(polygon.getArea());
  16281. }
  16282. //iServer 9D新增字段
  16283. if (geoTopo.length === 0) {
  16284. //根据面积排序
  16285. ServerGeometry.bubbleSort(areaArray, polygonArrayTemp, geoTopo, polygonBounds);
  16286. //岛洞底层判断原则:将所有的子对象按照面积排序,面积最大的直接判定为岛(1),从面积次大的开始处理,
  16287. // 如果发现该对象在某个面积大于它的对象之中(即被包含),则根据包含它的对象的标识(1 or -1),指定其标识(-1 or 1),
  16288. // 依次处理完所有对象,就得到了一个标识数组,1表示岛,-1表示洞
  16289. //目标polygon索引列表 -1标示没有被任何polygon包含,
  16290. var targetArray = [];
  16291. for (var _i14 = 1; _i14 < polygonArrayTemp.length; _i14++) {
  16292. for (var _j4 = _i14 - 1; _j4 >= 0; _j4--) {
  16293. targetArray[_i14] = -1;
  16294. if (polygonBounds[_j4].containsBounds(polygonBounds[_i14])) {
  16295. CCWIdent[_i14] = CCWIdent[_j4] * -1;
  16296. if (CCWIdent[_i14] < 0) {
  16297. targetArray[_i14] = _j4;
  16298. }
  16299. break;
  16300. }
  16301. }
  16302. }
  16303. for (var _i16 = 0; _i16 < polygonArrayTemp.length; _i16++) {
  16304. if (CCWIdent[_i16] > 0) {
  16305. polygonArray.push(polygonArrayTemp[_i16]);
  16306. } else {
  16307. polygonArray[targetArray[_i16]].components = polygonArray[targetArray[_i16]].components.concat(polygonArrayTemp[_i16].components);
  16308. //占位
  16309. polygonArray.push('');
  16310. }
  16311. }
  16312. } else {
  16313. polygonArray = new Array();
  16314. for (var _i18 = 0; _i18 < polygonArrayTemp.length; _i18++) {
  16315. if (geoTopo[_i18] && geoTopo[_i18] == -1) {
  16316. CCWArray = CCWArray.concat(polygonArrayTemp[_i18].components);
  16317. } else {
  16318. if (CCWArray.length > 0 && polygonArray.length > 0) {
  16319. polygonArray[polygonArray.length - 1].components = polygonArray[polygonArray.length - 1].components.concat(CCWArray);
  16320. CCWArray = [];
  16321. }
  16322. polygonArray.push(polygonArrayTemp[_i18]);
  16323. }
  16324. if (_i18 == len - 1) {
  16325. var polyLength = polygonArray.length;
  16326. if (polyLength) {
  16327. polygonArray[polyLength - 1].components = polygonArray[polyLength - 1].components.concat(CCWArray);
  16328. } else {
  16329. for (var k = 0, length = CCWArray.length; k < length; k++) {
  16330. polygonArray.push(new Polygon_Polygon(CCWArray));
  16331. }
  16332. }
  16333. }
  16334. }
  16335. }
  16336. return new MultiPolygon(polygonArray);
  16337. }
  16338. }, {
  16339. key: "transformGeoCompound",
  16340. value: function transformGeoCompound() {
  16341. var me = this,
  16342. geoParts = me.geoParts || [],
  16343. len = geoParts.length;
  16344. if (len <= 0) {
  16345. return null;
  16346. }
  16347. var geometryList = [];
  16348. for (var index = 0; index < len; index++) {
  16349. var geometry = geoParts[index];
  16350. geometryList.push(new ServerGeometry(geometry).toGeometry());
  16351. }
  16352. return new Collection(geometryList);
  16353. }
  16354. /**
  16355. * @function ServerGeometry.prototype.fromJson
  16356. * @description 将 JSON 对象表示服务端几何对象转换为 ServerGeometry。
  16357. * @param {Object} jsonObject - 要转换的 JSON 对象。
  16358. * @returns {ServerGeometry} 转换后的 ServerGeometry 对象。
  16359. */
  16360. }], [{
  16361. key: "fromJson",
  16362. value: function fromJson(jsonObject) {
  16363. if (!jsonObject) {
  16364. return;
  16365. }
  16366. return new ServerGeometry({
  16367. id: jsonObject.id,
  16368. style: ServerStyle.fromJson(jsonObject.style),
  16369. parts: jsonObject.parts,
  16370. partTopo: jsonObject.partTopo,
  16371. points: jsonObject.points,
  16372. center: jsonObject.center,
  16373. length: jsonObject.length,
  16374. maxM: jsonObject.maxM,
  16375. minM: jsonObject.minM,
  16376. type: jsonObject.type
  16377. });
  16378. }
  16379. /**
  16380. * @function ServerGeometry.prototype.fromGeometry
  16381. * @description 将客户端 Geometry 转换成服务端 ServerGeometry。
  16382. * @param {Geometry} geometry - 要转换的客户端 Geometry 对象。
  16383. * @returns {ServerGeometry} 转换后的 ServerGeometry 对象。
  16384. */
  16385. }, {
  16386. key: "fromGeometry",
  16387. value: function fromGeometry(geometry) {
  16388. if (!geometry) {
  16389. return;
  16390. }
  16391. var id = 0,
  16392. parts = [],
  16393. points = [],
  16394. type = null,
  16395. icomponents = geometry.components,
  16396. className = geometry.CLASS_NAME,
  16397. prjCoordSys = {
  16398. epsgCode: geometry.SRID
  16399. };
  16400. if (!isNaN(geometry.id)) {
  16401. id = geometry.id;
  16402. }
  16403. //坑爹的改法,没法,为了支持态势标绘,有时间就得全改
  16404. if (className != 'SuperMap.Geometry.LinearRing' && className != 'SuperMap.Geometry.LineString' && (geometry instanceof MultiPoint || geometry instanceof MultiLineString)) {
  16405. var ilen = icomponents.length;
  16406. for (var i = 0; i < ilen; i++) {
  16407. var vertices = icomponents[i].getVertices();
  16408. var partPointsCount = vertices.length;
  16409. parts.push(partPointsCount);
  16410. for (var j = 0; j < partPointsCount; j++) {
  16411. points.push(new Point(vertices[j].x, vertices[j].y));
  16412. }
  16413. }
  16414. //这里className不是多点就全部是算线
  16415. type = className == 'SuperMap.Geometry.MultiPoint' ? REST_GeometryType.POINT : REST_GeometryType.LINE;
  16416. } else if (geometry instanceof MultiPolygon) {
  16417. var _ilen = icomponents.length;
  16418. for (var _i20 = 0; _i20 < _ilen; _i20++) {
  16419. var polygon = icomponents[_i20],
  16420. linearRingOfPolygon = polygon.components,
  16421. linearRingOfPolygonLen = linearRingOfPolygon.length;
  16422. for (var _j6 = 0; _j6 < linearRingOfPolygonLen; _j6++) {
  16423. var _vertices = linearRingOfPolygon[_j6].getVertices();
  16424. var _partPointsCount = _vertices.length + 1;
  16425. parts.push(_partPointsCount);
  16426. for (var k = 0; k < _partPointsCount - 1; k++) {
  16427. points.push(new Point(_vertices[k].x, _vertices[k].y));
  16428. }
  16429. points.push(new Point(_vertices[0].x, _vertices[0].y));
  16430. }
  16431. }
  16432. type = REST_GeometryType.REGION;
  16433. } else if (geometry instanceof Polygon_Polygon) {
  16434. var _ilen2 = icomponents.length;
  16435. for (var _i22 = 0; _i22 < _ilen2; _i22++) {
  16436. var _vertices2 = icomponents[_i22].getVertices();
  16437. var _partPointsCount2 = _vertices2.length + 1;
  16438. parts.push(_partPointsCount2);
  16439. for (var _j8 = 0; _j8 < _partPointsCount2 - 1; _j8++) {
  16440. points.push(new Point(_vertices2[_j8].x, _vertices2[_j8].y));
  16441. }
  16442. points.push(new Point(_vertices2[0].x, _vertices2[0].y));
  16443. }
  16444. type = REST_GeometryType.REGION;
  16445. } else {
  16446. var _vertices3 = geometry.getVertices();
  16447. var geometryVerticesCount = _vertices3.length;
  16448. for (var _j10 = 0; _j10 < geometryVerticesCount; _j10++) {
  16449. points.push(new Point(_vertices3[_j10].x, _vertices3[_j10].y));
  16450. }
  16451. if (geometry instanceof LinearRing_LinearRing) {
  16452. points.push(new Point(_vertices3[0].x, _vertices3[0].y));
  16453. geometryVerticesCount++;
  16454. }
  16455. parts.push(geometryVerticesCount);
  16456. type = geometry instanceof Point ? REST_GeometryType.POINT : REST_GeometryType.LINE;
  16457. }
  16458. return new ServerGeometry({
  16459. id: id,
  16460. style: null,
  16461. parts: parts,
  16462. points: points,
  16463. type: type,
  16464. prjCoordSys: prjCoordSys
  16465. });
  16466. }
  16467. /**
  16468. * @function ServerGeometry.prototype.IsClockWise
  16469. * @description 判断 linearRing 中的点的顺序。返回值大于 0,逆时针;小于 0,顺时针。
  16470. * @param {Geometry} geometry - 要转换的客户端 Geometry 对象。
  16471. * @returns {number} 返回值大于 0,逆时针;小于 0,顺时针。
  16472. */
  16473. }, {
  16474. key: "IsClockWise",
  16475. value: function IsClockWise(points) {
  16476. var length = points.length;
  16477. if (length < 3) {
  16478. return 0.0;
  16479. }
  16480. var s = points[0].y * (points[length - 1].x - points[1].x);
  16481. points.push(points[0]);
  16482. for (var i = 1; i < length; i++) {
  16483. s += points[i].y * (points[i - 1].x - points[i + 1].x);
  16484. }
  16485. return s * 0.5;
  16486. }
  16487. }, {
  16488. key: "bubbleSort",
  16489. value: function bubbleSort(areaArray, pointList, geoTopo, polygonBounds) {
  16490. for (var i = 0; i < areaArray.length; i++) {
  16491. for (var j = 0; j < areaArray.length; j++) {
  16492. if (areaArray[i] > areaArray[j]) {
  16493. var d = areaArray[j];
  16494. areaArray[j] = areaArray[i];
  16495. areaArray[i] = d;
  16496. var b = pointList[j];
  16497. pointList[j] = pointList[i];
  16498. pointList[i] = b;
  16499. if (geoTopo && geoTopo.length > 0) {
  16500. var c = geoTopo[j];
  16501. geoTopo[j] = geoTopo[i];
  16502. geoTopo[i] = c;
  16503. }
  16504. if (polygonBounds && polygonBounds.length > 0) {
  16505. var f = polygonBounds[j];
  16506. polygonBounds[j] = polygonBounds[i];
  16507. polygonBounds[i] = f;
  16508. }
  16509. }
  16510. }
  16511. }
  16512. }
  16513. }]);
  16514. return ServerGeometry;
  16515. }();
  16516. ;// CONCATENATED MODULE: ./src/common/format/GeoJSON.js
  16517. function GeoJSON_typeof(obj) { "@babel/helpers - typeof"; return GeoJSON_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, GeoJSON_typeof(obj); }
  16518. function GeoJSON_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  16519. function GeoJSON_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  16520. function GeoJSON_createClass(Constructor, protoProps, staticProps) { if (protoProps) GeoJSON_defineProperties(Constructor.prototype, protoProps); if (staticProps) GeoJSON_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  16521. function GeoJSON_get() { if (typeof Reflect !== "undefined" && Reflect.get) { GeoJSON_get = Reflect.get.bind(); } else { GeoJSON_get = function _get(target, property, receiver) { var base = GeoJSON_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return GeoJSON_get.apply(this, arguments); }
  16522. function GeoJSON_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GeoJSON_getPrototypeOf(object); if (object === null) break; } return object; }
  16523. function GeoJSON_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) GeoJSON_setPrototypeOf(subClass, superClass); }
  16524. function GeoJSON_setPrototypeOf(o, p) { GeoJSON_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GeoJSON_setPrototypeOf(o, p); }
  16525. function GeoJSON_createSuper(Derived) { var hasNativeReflectConstruct = GeoJSON_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = GeoJSON_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = GeoJSON_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return GeoJSON_possibleConstructorReturn(this, result); }; }
  16526. function GeoJSON_possibleConstructorReturn(self, call) { if (call && (GeoJSON_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return GeoJSON_assertThisInitialized(self); }
  16527. function GeoJSON_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  16528. function GeoJSON_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  16529. function GeoJSON_getPrototypeOf(o) { GeoJSON_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GeoJSON_getPrototypeOf(o); }
  16530. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  16531. * This program are made available under the terms of the Apache License, Version 2.0
  16532. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  16533. /**
  16534. * @class GeoJSONFormat
  16535. * @aliasclass Format.GeoJSON
  16536. * @deprecatedclass SuperMap.Format.GeoJSON
  16537. * @classdesc GeoJSON 的读和写。使用 {@link GeoJSONObject} 构造器创建一个 GeoJSON 解析器。
  16538. * @category BaseTypes Format
  16539. * @param {Object} [options] - 可选参数。
  16540. * @param {string} [options.indent=" "] - 用于格式化输出,indent 字符串会在每次缩进的时候使用一次。
  16541. * @param {string} [options.space=" "] - 用于格式化输出,space 字符串会在名值对的 ":" 后边添加。
  16542. * @param {string} [options.newline="\n"] - 用于格式化输出, newline 字符串会用在每一个名值对或数组项末尾。
  16543. * @param {number} [options.level=0] - 用于格式化输出, 表示的是缩进级别。
  16544. * @param {boolean} [options.pretty=false] - 是否在序列化的时候使用额外的空格控制结构。在 write 方法中使用。
  16545. * @param {boolean} [options.nativeJSON] - 需要被注册的监听器对象。
  16546. * @param {boolean} [options.ignoreExtraDims=true] - 忽略维度超过 2 的几何要素。
  16547. * @extends {JSONFormat}
  16548. * @usage
  16549. */
  16550. var GeoJSON = /*#__PURE__*/function (_JSONFormat) {
  16551. GeoJSON_inherits(GeoJSON, _JSONFormat);
  16552. var _super = GeoJSON_createSuper(GeoJSON);
  16553. function GeoJSON(options) {
  16554. var _this;
  16555. GeoJSON_classCallCheck(this, GeoJSON);
  16556. _this = _super.call(this, options);
  16557. /**
  16558. * @member {boolean} [GeoJSONFormat.prototype.ignoreExtraDims=true]
  16559. * @description 忽略维度超过 2 的几何要素。
  16560. */
  16561. _this.ignoreExtraDims = true;
  16562. _this.CLASS_NAME = "SuperMap.Format.GeoJSON";
  16563. /**
  16564. * @member {Object} GeoJSONFormat.prototype.parseCoords
  16565. * @private
  16566. * @description 一个属性名对应着 GeoJSON 对象的几何类型的对象。每个属性其实都是一个实际上做解析用的方法。
  16567. */
  16568. _this.parseCoords = {
  16569. /**
  16570. * @function GeoJSONFormat.parseCoords.point
  16571. * @description 将一组坐标转成一个 {@link Geometry} 对象。
  16572. * @param {Object} array - GeoJSON 片段中的一组坐标。
  16573. * @returns {Geometry} 一个几何对象。
  16574. */
  16575. "point": function point(array) {
  16576. if (this.ignoreExtraDims === false && array.length != 2) {
  16577. throw "Only 2D points are supported: " + array;
  16578. }
  16579. return new Point(array[0], array[1]);
  16580. },
  16581. /**
  16582. * @function GeoJSONFormat.parseCoords.multipoint
  16583. * @description 将坐标组数组转化成为一个 {@link Geometry} 对象。
  16584. * @param {Object} array - GeoJSON 片段中的坐标组数组。
  16585. * @returns {Geometry} 一个几何对象。
  16586. */
  16587. "multipoint": function multipoint(array) {
  16588. var points = [];
  16589. var p = null;
  16590. for (var i = 0, len = array.length; i < len; ++i) {
  16591. try {
  16592. p = this.parseCoords["point"].apply(this, [array[i]]);
  16593. } catch (err) {
  16594. throw err;
  16595. }
  16596. points.push(p);
  16597. }
  16598. return new MultiPoint(points);
  16599. },
  16600. /**
  16601. * @function GeoJSONFormat.parseCoords.linestring
  16602. * @description 将坐标组数组转化成为一个 {@link Geometry} 对象。
  16603. * @param {Object} array - GeoJSON 片段中的坐标组数组。
  16604. * @returns {Geometry} 一个几何对象。
  16605. */
  16606. "linestring": function linestring(array) {
  16607. var points = [];
  16608. var p = null;
  16609. for (var i = 0, len = array.length; i < len; ++i) {
  16610. try {
  16611. p = this.parseCoords["point"].apply(this, [array[i]]);
  16612. } catch (err) {
  16613. throw err;
  16614. }
  16615. points.push(p);
  16616. }
  16617. return new LineString(points);
  16618. },
  16619. /**
  16620. * @function GeoJSONFormat.parseCoords.multilinestring
  16621. * @description 将坐标组数组转化成为一个 {@link Geometry} 对象。
  16622. * @param {Object} array - GeoJSON 片段中的坐标组数组。
  16623. * @returns {Geometry} 一个几何对象。
  16624. */
  16625. "multilinestring": function multilinestring(array) {
  16626. var lines = [];
  16627. var l = null;
  16628. for (var i = 0, len = array.length; i < len; ++i) {
  16629. try {
  16630. l = this.parseCoords["linestring"].apply(this, [array[i]]);
  16631. } catch (err) {
  16632. throw err;
  16633. }
  16634. lines.push(l);
  16635. }
  16636. return new MultiLineString(lines);
  16637. },
  16638. /**
  16639. * @function GeoJSONFormat.parseCoords.polygon
  16640. * @description 将坐标组数组转化成为一个 {@link Geometry} 对象。
  16641. * @returns {Geometry} 一个几何对象。
  16642. */
  16643. "polygon": function polygon(array) {
  16644. var rings = [];
  16645. var r, l;
  16646. for (var i = 0, len = array.length; i < len; ++i) {
  16647. try {
  16648. l = this.parseCoords["linestring"].apply(this, [array[i]]);
  16649. } catch (err) {
  16650. throw err;
  16651. }
  16652. r = new LinearRing_LinearRing(l.components);
  16653. rings.push(r);
  16654. }
  16655. return new Polygon_Polygon(rings);
  16656. },
  16657. /**
  16658. * @function GeoJSONFormat.parseCoords.multipolygon
  16659. * @description 将坐标组数组转化成为一个 {@link Geometry} 对象。
  16660. * @param {Object} array - GeoJSON 片段中的坐标组数组。
  16661. * @returns {Geometry} 一个几何对象。
  16662. */
  16663. "multipolygon": function multipolygon(array) {
  16664. var polys = [];
  16665. var p = null;
  16666. for (var i = 0, len = array.length; i < len; ++i) {
  16667. try {
  16668. p = this.parseCoords["polygon"].apply(this, [array[i]]);
  16669. } catch (err) {
  16670. throw err;
  16671. }
  16672. polys.push(p);
  16673. }
  16674. return new MultiPolygon(polys);
  16675. },
  16676. /**
  16677. * @function GeoJSONFormat.parseCoords.box
  16678. * @description 将坐标组数组转化成为一个 {@link Geometry} 对象。
  16679. * @param {Array} array - GeoJSON 片段中的坐标组数组。
  16680. * @returns {Geometry} 一个几何对象。
  16681. */
  16682. "box": function box(array) {
  16683. if (array.length != 2) {
  16684. throw "GeoJSON box coordinates must have 2 elements";
  16685. }
  16686. return new Polygon_Polygon([new LinearRing_LinearRing([new Point(array[0][0], array[0][1]), new Point(array[1][0], array[0][1]), new Point(array[1][0], array[1][1]), new Point(array[0][0], array[1][1]), new Point(array[0][0], array[0][1])])]);
  16687. }
  16688. };
  16689. /**
  16690. * @member {Object} GeoJSONFormat.prototype.extract
  16691. * @private
  16692. * @description 一个属性名对应着GeoJSON类型的对象。其值为相应的实际的解析方法。
  16693. */
  16694. _this.extract = {
  16695. /**
  16696. * @function GeoJSONFormat.extract.feature
  16697. * @description 返回一个表示单个要素对象的 GeoJSON 的一部分。
  16698. * @param {SuperMap.ServerFeature} feature - iServer 要素对象。
  16699. * @returns {Object} 一个表示点的对象。
  16700. */
  16701. 'feature': function feature(_feature) {
  16702. var geom = this.extract.geometry.apply(this, [_feature.geometry]);
  16703. var json = {
  16704. "type": "Feature",
  16705. "properties": this.createAttributes(_feature),
  16706. "geometry": geom
  16707. };
  16708. if (_feature.geometry && _feature.geometry.type === 'TEXT') {
  16709. json.properties.texts = _feature.geometry.texts;
  16710. json.properties.textStyle = _feature.geometry.textStyle;
  16711. }
  16712. if (_feature.fid) {
  16713. json.id = _feature.fid;
  16714. }
  16715. if (_feature.ID) {
  16716. json.id = _feature.ID;
  16717. }
  16718. return json;
  16719. },
  16720. /**
  16721. * @function GeoJSONFormat.extract.geometry
  16722. * @description 返回一个表示单个几何对象的 GeoJSON 的一部分。
  16723. * @param {Object} geometry - iServer 几何对象。
  16724. * @returns {Object} 一个表示几何体的对象。
  16725. */
  16726. 'geometry': function geometry(_geometry) {
  16727. if (_geometry == null) {
  16728. return null;
  16729. }
  16730. if (!_geometry.parts && _geometry.points) {
  16731. _geometry.parts = [_geometry.points.length];
  16732. }
  16733. var geo = _geometry.hasOwnProperty('geometryType') ? _geometry : new ServerGeometry(_geometry).toGeometry() || _geometry;
  16734. var geometryType = geo.geometryType || geo.type;
  16735. var data;
  16736. if (geometryType === "LinearRing") {
  16737. geometryType = "LineString";
  16738. }
  16739. if (geometryType === "LINEM") {
  16740. geometryType = "MultiLineString";
  16741. }
  16742. data = this.extract[geometryType.toLowerCase()].apply(this, [geo]);
  16743. geometryType = geometryType === 'TEXT' ? 'Point' : geometryType;
  16744. var json;
  16745. if (geometryType === "Collection") {
  16746. json = {
  16747. "type": "GeometryCollection",
  16748. "geometries": data
  16749. };
  16750. } else {
  16751. json = {
  16752. "type": geometryType,
  16753. "coordinates": data
  16754. };
  16755. }
  16756. return json;
  16757. },
  16758. /**
  16759. * @function GeoJSONFormat.extract.point
  16760. * @description 从一个点对象中返回一个坐标组。
  16761. * @param {GeometryPoint} point - 一个点对象。
  16762. * @returns {Array} 一个表示一个点的坐标组。
  16763. */
  16764. 'point': function point(_point) {
  16765. var p = [_point.x, _point.y];
  16766. for (var name in _point) {
  16767. if (name !== "x" && name !== "y" && _point[name] !== null && !isNaN(_point[name])) {
  16768. p.push(_point[name]);
  16769. }
  16770. }
  16771. return p;
  16772. },
  16773. /**
  16774. * @function GeoJSONFormat.extract.point
  16775. * @description 从一个文本对象中返回一个坐标组。
  16776. * @param {Object} geo - 一个文本对象。
  16777. * @returns {Array} 一个表示一个点的坐标组。
  16778. */
  16779. 'text': function text(geo) {
  16780. return [geo.points[0].x, geo.points[0].y];
  16781. },
  16782. /**
  16783. * @function GeoJSONFormat.extract.multipoint
  16784. * @description 从一个多点对象中返一个坐标组数组。
  16785. * @param {GeometryMultiPoint} multipoint - 多点对象。
  16786. * @returns {Array} 一个表示多点的坐标组数组。
  16787. */
  16788. 'multipoint': function multipoint(_multipoint) {
  16789. var array = [];
  16790. for (var i = 0, len = _multipoint.components.length; i < len; ++i) {
  16791. array.push(this.extract.point.apply(this, [_multipoint.components[i]]));
  16792. }
  16793. return array;
  16794. },
  16795. /**
  16796. * @function GeoJSONFormat.extract.linestring
  16797. * @description 从一个线对象中返回一个坐标组数组。
  16798. * @param {Linestring} linestring - 线对象。
  16799. * @returns {Array} 一个表示线对象的坐标组数组。
  16800. */
  16801. 'linestring': function linestring(_linestring) {
  16802. var array = [];
  16803. for (var i = 0, len = _linestring.components.length; i < len; ++i) {
  16804. array.push(this.extract.point.apply(this, [_linestring.components[i]]));
  16805. }
  16806. return array;
  16807. },
  16808. /**
  16809. * @function GeoJSONFormat.extract.multilinestring
  16810. * @description 从一个多线对象中返回一个线数组。
  16811. * @param {GeometryMultiLineString} multilinestring - 多线对象。
  16812. *
  16813. * @returns {Array} 一个表示多线的线数组。
  16814. */
  16815. 'multilinestring': function multilinestring(_multilinestring) {
  16816. var array = [];
  16817. for (var i = 0, len = _multilinestring.components.length; i < len; ++i) {
  16818. array.push(this.extract.linestring.apply(this, [_multilinestring.components[i]]));
  16819. }
  16820. return array;
  16821. },
  16822. /**
  16823. * @function GeoJSONFormat.extract.polygon
  16824. * @description 从一个面对象中返回一组线环。
  16825. * @param {GeometryPolygon} polygon - 面对象。
  16826. * @returns {Array} 一组表示面的线环。
  16827. */
  16828. 'polygon': function polygon(_polygon) {
  16829. var array = [];
  16830. for (var i = 0, len = _polygon.components.length; i < len; ++i) {
  16831. array.push(this.extract.linestring.apply(this, [_polygon.components[i]]));
  16832. }
  16833. return array;
  16834. },
  16835. /**
  16836. * @function GeoJSONFormat.extract.multipolygon
  16837. * @description 从一个多面对象中返回一组面。
  16838. * @param {GeometryMultiPolygon} multipolygon - 多面对象。
  16839. * @returns {Array} 一组表示多面的面。
  16840. */
  16841. 'multipolygon': function multipolygon(_multipolygon) {
  16842. var array = [];
  16843. for (var i = 0, len = _multipolygon.components.length; i < len; ++i) {
  16844. array.push(this.extract.polygon.apply(this, [_multipolygon.components[i]]));
  16845. }
  16846. return array;
  16847. },
  16848. /**
  16849. * @function GeoJSONFormat.extract.collection
  16850. * @description 从一个几何要素集合中一组几何要素数组。
  16851. * @param {GeometryCollection} collection - 几何要素集合。
  16852. * @returns {Array} 一组表示几何要素集合的几何要素数组。
  16853. */
  16854. 'collection': function collection(_collection) {
  16855. var len = _collection.components.length;
  16856. var array = new Array(len);
  16857. for (var i = 0; i < len; ++i) {
  16858. array[i] = this.extract.geometry.apply(this, [_collection.components[i]]);
  16859. }
  16860. return array;
  16861. }
  16862. };
  16863. return _this;
  16864. }
  16865. /**
  16866. * @function GeoJSONFormat.prototype.read
  16867. * @description 将 GeoJSON 对象或者GeoJSON 对象字符串转换为 SuperMap Feature 对象。
  16868. * @param {GeoJSONObject} json - GeoJSON 对象。
  16869. * @param {string} [type='FeaureCollection'] - 可选的字符串,它决定了输出的格式。支持的值有:"Geometry","Feature",和 "FeatureCollection",如果此值为null。
  16870. * @param {function} filter - 对象中每个层次每个键值对都会调用此函数得出一个结果。每个值都会被 filter 函数的结果所替换掉。这个函数可被用来将某些对象转化成某个类相应的对象,或者将日期字符串转化成Date对象。
  16871. * @returns {Object} 返回值依赖于 type 参数的值。
  16872. * -如果 type 等于 "FeatureCollection",返回值将会是 {@link FeatureVector} 数组。
  16873. * -如果 type 为 "Geometry",输入的 JSON 对象必须表示一个唯一的几何体,然后返回值就会是 {@link Geometry}。
  16874. * -如果 type 为 "Feature",输入的 JSON 对象也必须表示的一个要素,这样返回值才会是 {@link FeatureVector}。
  16875. */
  16876. GeoJSON_createClass(GeoJSON, [{
  16877. key: "read",
  16878. value: function read(json, type, filter) {
  16879. type = type ? type : "FeatureCollection";
  16880. var results = null;
  16881. var obj = null;
  16882. if (typeof json == "string") {
  16883. obj = GeoJSON_get(GeoJSON_getPrototypeOf(GeoJSON.prototype), "read", this).call(this, json, filter);
  16884. } else {
  16885. obj = json;
  16886. }
  16887. if (!obj) {
  16888. //console.error("Bad JSON: " + json);
  16889. } else if (typeof obj.type != "string") {
  16890. //console.error("Bad GeoJSON - no type: " + json);
  16891. } else if (this.isValidType(obj, type)) {
  16892. switch (type) {
  16893. case "Geometry":
  16894. try {
  16895. results = this.parseGeometry(obj);
  16896. } catch (err) {
  16897. //console.error(err);
  16898. }
  16899. break;
  16900. case "Feature":
  16901. try {
  16902. results = this.parseFeature(obj);
  16903. results.type = "Feature";
  16904. } catch (err) {
  16905. //console.error(err);
  16906. }
  16907. break;
  16908. case "FeatureCollection":
  16909. // for type FeatureCollection, we allow input to be any type
  16910. results = [];
  16911. switch (obj.type) {
  16912. case "Feature":
  16913. try {
  16914. results.push(this.parseFeature(obj));
  16915. } catch (err) {
  16916. results = null;
  16917. //console.error(err);
  16918. }
  16919. break;
  16920. case "FeatureCollection":
  16921. for (var i = 0, len = obj.features.length; i < len; ++i) {
  16922. try {
  16923. results.push(this.parseFeature(obj.features[i]));
  16924. } catch (err) {
  16925. results = null;
  16926. // console.error(err);
  16927. }
  16928. }
  16929. break;
  16930. default:
  16931. try {
  16932. var geom = this.parseGeometry(obj);
  16933. results.push(new Vector(geom));
  16934. } catch (err) {
  16935. results = null;
  16936. //console.error(err);
  16937. }
  16938. }
  16939. break;
  16940. default:
  16941. break;
  16942. }
  16943. }
  16944. return results;
  16945. }
  16946. /**
  16947. * @function GeoJSONFormat.prototype.write
  16948. * @description iServer Geometry JSON 对象 转 GeoJSON对象字符串。
  16949. * @param {Object} obj - iServer Geometry JSON 对象。
  16950. * @param {boolean} [pretty=false] - 是否使用换行和缩进来控制输出。
  16951. * @returns {GeoJSONObject} 一个 GeoJSON 字符串,它表示了输入的几何对象,要素对象,或者要素对象数组。
  16952. */
  16953. }, {
  16954. key: "write",
  16955. value: function write(obj, pretty) {
  16956. return GeoJSON_get(GeoJSON_getPrototypeOf(GeoJSON.prototype), "write", this).call(this, this.toGeoJSON(obj), pretty);
  16957. }
  16958. /**
  16959. * @function GeoJSONFormat.prototype.fromGeoJSON
  16960. * @version 9.1.1
  16961. * @description 将 GeoJSON 对象或者GeoJSON 对象字符串转换为iServer Feature JSON。
  16962. * @param {GeoJSONObject} json - GeoJSON 对象。
  16963. * @param {string} [type='FeaureCollection'] - 可选的字符串,它决定了输出的格式。支持的值有:"Geometry","Feature",和 "FeatureCollection",如果此值为null。
  16964. * @param {function} filter - 对象中每个层次每个键值对都会调用此函数得出一个结果。每个值都会被 filter 函数的结果所替换掉。这个函数可被用来将某些对象转化成某个类相应的对象,或者将日期字符串转化成Date对象。
  16965. * @returns {Object} iServer Feature JSON。
  16966. */
  16967. }, {
  16968. key: "fromGeoJSON",
  16969. value: function fromGeoJSON(json, type, filter) {
  16970. var _this2 = this;
  16971. var feature = this.read(json, type, filter);
  16972. if (!Util_Util.isArray(feature)) {
  16973. return this._toiSevrerFeature(feature);
  16974. }
  16975. return feature.map(function (element) {
  16976. return _this2._toiSevrerFeature(element);
  16977. });
  16978. }
  16979. /**
  16980. * @function GeoJSONFormat.prototype.toGeoJSON
  16981. * @version 9.1.1
  16982. * @description 将 iServer Feature JSON 对象转换为 GeoJSON 对象。
  16983. * @param {Object} obj - iServer Feature JSON。
  16984. * @returns {GeoJSONObject} GeoJSON 对象。
  16985. */
  16986. }, {
  16987. key: "toGeoJSON",
  16988. value: function toGeoJSON(obj) {
  16989. var geojson = {
  16990. "type": null
  16991. };
  16992. if (Util_Util.isArray(obj)) {
  16993. geojson.type = "FeatureCollection";
  16994. var numFeatures = obj.length;
  16995. geojson.features = new Array(numFeatures);
  16996. for (var i = 0; i < numFeatures; ++i) {
  16997. var element = obj[i];
  16998. if (isGeometry(element)) {
  16999. var feature = {};
  17000. feature.geometry = element;
  17001. geojson.features[i] = this.extract.feature.apply(this, [feature]);
  17002. } else {
  17003. geojson.features[i] = this.extract.feature.apply(this, [element]);
  17004. }
  17005. }
  17006. } else if (isGeometry(obj)) {
  17007. var _feature2 = {};
  17008. _feature2.geometry = obj;
  17009. geojson = this.extract.feature.apply(this, [_feature2]);
  17010. } else {
  17011. geojson = this.extract.feature.apply(this, [obj]);
  17012. }
  17013. function isGeometry(input) {
  17014. return input.hasOwnProperty("parts") && input.hasOwnProperty("points") || input.hasOwnProperty("geoParts");
  17015. }
  17016. return geojson;
  17017. }
  17018. /**
  17019. * @function GeoJSONFormat.prototype.isValidType
  17020. * @description 检查一个 GeoJSON 对象是否和给定的类型相符的合法的对象。
  17021. * @returns {boolean} GeoJSON 是否是给定类型的合法对象。
  17022. * @private
  17023. */
  17024. }, {
  17025. key: "isValidType",
  17026. value: function isValidType(obj, type) {
  17027. var valid = false;
  17028. switch (type) {
  17029. case "Geometry":
  17030. if (Util_Util.indexOf(["Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", "Box", "GeometryCollection"], obj.type) == -1) {
  17031. // unsupported geometry type
  17032. //console.error("Unsupported geometry type: " +
  17033. // obj.type);
  17034. } else {
  17035. valid = true;
  17036. }
  17037. break;
  17038. case "FeatureCollection":
  17039. // allow for any type to be converted to a feature collection
  17040. valid = true;
  17041. break;
  17042. default:
  17043. // for Feature types must match
  17044. if (obj.type == type) {
  17045. valid = true;
  17046. } else {
  17047. //console.error("Cannot convert types from " +
  17048. //obj.type + " to " + type);
  17049. }
  17050. }
  17051. return valid;
  17052. }
  17053. /**
  17054. * @function GeoJSONFormat.prototype.parseFeature
  17055. * @description 将一个 GeoJSON 中的 feature 转化成 {@link FeatureVector}> 对象。
  17056. * @private
  17057. * @param {GeoJSONObject} obj - 从 GeoJSON 对象中创建一个对象。
  17058. * @returns {FeatureVector} 一个要素。
  17059. */
  17060. }, {
  17061. key: "parseFeature",
  17062. value: function parseFeature(obj) {
  17063. var feature, geometry, attributes, bbox;
  17064. attributes = obj.properties ? obj.properties : {};
  17065. bbox = obj.geometry && obj.geometry.bbox || obj.bbox;
  17066. try {
  17067. geometry = this.parseGeometry(obj.geometry);
  17068. } catch (err) {
  17069. // deal with bad geometries
  17070. throw err;
  17071. }
  17072. feature = new Vector(geometry, attributes);
  17073. if (bbox) {
  17074. feature.bounds = Bounds.fromArray(bbox);
  17075. }
  17076. if (obj.id) {
  17077. feature.geometry.id = obj.id;
  17078. feature.fid = obj.id;
  17079. }
  17080. return feature;
  17081. }
  17082. /**
  17083. * @function GeoJSONFormat.prototype.parseGeometry
  17084. * @description 将一个 GeoJSON 中的几何要素转化成 {@link Geometry} 对象。
  17085. * @param {GeoJSONObject} obj - 从 GeoJSON 对象中创建一个对象。
  17086. * @returns {Geometry} 一个几何要素。
  17087. * @private
  17088. */
  17089. }, {
  17090. key: "parseGeometry",
  17091. value: function parseGeometry(obj) {
  17092. if (obj == null) {
  17093. return null;
  17094. }
  17095. var geometry;
  17096. if (obj.type == "GeometryCollection") {
  17097. if (!Util_Util.isArray(obj.geometries)) {
  17098. throw "GeometryCollection must have geometries array: " + obj;
  17099. }
  17100. var numGeom = obj.geometries.length;
  17101. var components = new Array(numGeom);
  17102. for (var i = 0; i < numGeom; ++i) {
  17103. components[i] = this.parseGeometry.apply(this, [obj.geometries[i]]);
  17104. }
  17105. geometry = new Collection(components);
  17106. } else {
  17107. if (!Util_Util.isArray(obj.coordinates)) {
  17108. throw "Geometry must have coordinates array: " + obj;
  17109. }
  17110. if (!this.parseCoords[obj.type.toLowerCase()]) {
  17111. throw "Unsupported geometry type: " + obj.type;
  17112. }
  17113. try {
  17114. geometry = this.parseCoords[obj.type.toLowerCase()].apply(this, [obj.coordinates]);
  17115. } catch (err) {
  17116. // deal with bad coordinates
  17117. throw err;
  17118. }
  17119. }
  17120. return geometry;
  17121. }
  17122. /**
  17123. * @function GeoJSONFormat.prototype.createCRSObject
  17124. * @description 从一个要素对象中创建一个坐标参考系对象。
  17125. * @param {FeatureVector} object - 要素对象。
  17126. * @private
  17127. * @returns {GeoJSONObject} 一个可作为 GeoJSON 对象的 CRS 属性使用的对象。
  17128. */
  17129. }, {
  17130. key: "createCRSObject",
  17131. value: function createCRSObject(object) {
  17132. var proj = object.layer.projection.toString();
  17133. var crs = {};
  17134. if (proj.match(/epsg:/i)) {
  17135. var code = parseInt(proj.substring(proj.indexOf(":") + 1));
  17136. if (code == 4326) {
  17137. crs = {
  17138. "type": "name",
  17139. "properties": {
  17140. "name": "urn:ogc:def:crs:OGC:1.3:CRS84"
  17141. }
  17142. };
  17143. } else {
  17144. crs = {
  17145. "type": "name",
  17146. "properties": {
  17147. "name": "EPSG:" + code
  17148. }
  17149. };
  17150. }
  17151. }
  17152. return crs;
  17153. }
  17154. }, {
  17155. key: "_toiSevrerFeature",
  17156. value: function _toiSevrerFeature(feature) {
  17157. var attributes = feature.attributes;
  17158. var attrNames = [];
  17159. var attrValues = [];
  17160. for (var attr in attributes) {
  17161. attrNames.push(attr);
  17162. attrValues.push(attributes[attr]);
  17163. }
  17164. var newFeature = {
  17165. fieldNames: attrNames,
  17166. fieldValues: attrValues,
  17167. geometry: ServerGeometry.fromGeometry(feature.geometry)
  17168. };
  17169. newFeature.geometry.id = feature.fid;
  17170. return newFeature;
  17171. }
  17172. }, {
  17173. key: "createAttributes",
  17174. value: function createAttributes(feature) {
  17175. if (!feature) {
  17176. return null;
  17177. }
  17178. var attr = {};
  17179. processFieldsAttributes(feature, attr);
  17180. var exceptKeys = ["fieldNames", "fieldValues", "geometry", "stringID", "ID"];
  17181. for (var key in feature) {
  17182. if (exceptKeys.indexOf(key) > -1) {
  17183. continue;
  17184. }
  17185. attr[key] = feature[key];
  17186. }
  17187. function processFieldsAttributes(feature, attributes) {
  17188. if (!(feature.hasOwnProperty("fieldNames") && feature.hasOwnProperty("fieldValues"))) {
  17189. return;
  17190. }
  17191. var names = feature.fieldNames,
  17192. values = feature.fieldValues;
  17193. for (var i in names) {
  17194. attributes[names[i]] = values[i];
  17195. }
  17196. }
  17197. return attr;
  17198. }
  17199. }]);
  17200. return GeoJSON;
  17201. }(JSONFormat);
  17202. ;// CONCATENATED MODULE: ./src/maplibregl/core/Util.js
  17203. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  17204. * This program are made available under the terms of the Apache License, Version 2.0
  17205. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  17206. // import "../core/Base";
  17207. var isArray = function isArray(obj) {
  17208. return Object.prototype.toString.call(obj) == "[object Array]";
  17209. };
  17210. var isString = function isString(str) {
  17211. return typeof str === 'string' && str.constructor === String;
  17212. };
  17213. /**
  17214. * @name Util
  17215. * @namespace
  17216. * @category BaseTypes Util
  17217. * @description 工具类。
  17218. * @usage
  17219. * ```
  17220. * // 浏览器
  17221. * <script type="text/javascript" src="{cdn}"></script>
  17222. * <script>
  17223. * const result = {namespace}.Util.toSuperMapGeometry(geoJSON);
  17224. *
  17225. * </script>
  17226. * // ES6 Import
  17227. * import { Util } from '{npm}';
  17228. *
  17229. * const result = Util.toSuperMapGeometry(geoJSON);
  17230. * ```
  17231. */
  17232. var core_Util_Util = {
  17233. /**
  17234. * @function Util.toSuperMapGeometry
  17235. * @description 将 GeoJSON 对象转为 SuperMap 几何图形。
  17236. * @param {GeoJSONObject} geoJSON - GeoJSON 对象。
  17237. * @returns {Geometry}
  17238. */
  17239. toSuperMapGeometry: function toSuperMapGeometry(geoJSON) {
  17240. if (geoJSON && geoJSON.type) {
  17241. var format = new GeoJSON();
  17242. var result = format.read(geoJSON, "FeatureCollection");
  17243. return result[0].geometry;
  17244. }
  17245. },
  17246. toSuperMapBounds: function toSuperMapBounds(bounds) {
  17247. if (isArray(bounds)) {
  17248. //左下右上
  17249. return new Bounds(bounds[0], bounds[1], bounds[2], bounds[3]);
  17250. }
  17251. return new Bounds(bounds.getWest(), bounds.getSouth(), bounds.getEast(), bounds.getNorth());
  17252. },
  17253. toSuperMapPoint: function toSuperMapPoint(lnglat) {
  17254. //客户端可传入 geojson 对象 或者 maplibregl lnglat 点对象,或者是点数组
  17255. if (isArray(lnglat)) {
  17256. return new Point(lnglat[0], lnglat[1]);
  17257. } else if (lnglat.lng && lnglat.lat) {
  17258. return new Point(lnglat.lng, lnglat.lat);
  17259. }
  17260. return new Point(lnglat.geometry.coordinates[0], lnglat.geometry.coordinates[1]);
  17261. },
  17262. /**
  17263. * @function Util.toSuperMapPolygon
  17264. * @description 将 Maplibre GL LngLatbounds 对象转为 SuperMap 几何图形。
  17265. * @param {maplibregl.LngLatBounds} lnglatBounds - Maplibre GL LngLatbounds对象。
  17266. * @returns {GeometryPolygon}
  17267. */
  17268. toSuperMapPolygon: function toSuperMapPolygon(lnglatBounds) {
  17269. var west = lnglatBounds.getWest();
  17270. var east = lnglatBounds.getEast();
  17271. var sourth = lnglatBounds.getSouth();
  17272. var north = lnglatBounds.getNorth();
  17273. return new Polygon_Polygon([new LinearRing_LinearRing([new Point(west, sourth), new Point(east, sourth), new Point(east, north), new Point(west, north)])]);
  17274. },
  17275. /**
  17276. * @function Util.isArray
  17277. * @description 判断是否为数组格式。
  17278. * @param {Object} obj - 待判断对象。
  17279. * @returns {boolean} 是否是数组。
  17280. */
  17281. isArray: isArray,
  17282. /**
  17283. * @function Util.toGeoJSON
  17284. * @description 将传入对象转为 GeoJSON 格式。
  17285. * @param {Object} smObj - 待转对象。
  17286. */
  17287. toGeoJSON: function toGeoJSON(smObj) {
  17288. if (smObj) {
  17289. var format = new GeoJSON();
  17290. return format.toGeoJSON(smObj);
  17291. }
  17292. },
  17293. /**
  17294. * @function Util.toProcessingParam
  17295. * @description 将 Region 节点数组转为 Processing 服务需要的分析参数。
  17296. * @param {Array} points - Region 各个节点数组。
  17297. * @returns {Object} processing 服务裁剪、查询分析的分析参数。
  17298. */
  17299. toProcessingParam: function toProcessingParam(points) {
  17300. var geometryParam = {};
  17301. if (points.length < 1) {
  17302. geometryParam = "";
  17303. } else {
  17304. var results = [];
  17305. for (var i = 0; i < points.length; i++) {
  17306. var point = {};
  17307. point.x = points[i][0];
  17308. point.y = points[i][1];
  17309. results.push(point);
  17310. }
  17311. geometryParam.type = "REGION";
  17312. geometryParam.points = results;
  17313. }
  17314. return geometryParam;
  17315. },
  17316. /**
  17317. * @function Util.extend
  17318. * @description 对象拷贝赋值。
  17319. * @param {Object} dest - 目标对象。
  17320. * @param {Object} arguments - 待拷贝的对象。
  17321. * @returns {Object} 赋值后的目标对象。
  17322. */
  17323. extend: function extend(dest) {
  17324. for (var index = 0; index < Object.getOwnPropertyNames(arguments).length; index++) {
  17325. var arg = Object.getOwnPropertyNames(arguments)[index];
  17326. if (arg == "caller" || arg == "callee" || arg == "length" || arg == "arguments") {
  17327. continue;
  17328. }
  17329. var obj = arguments[arg];
  17330. if (obj) {
  17331. for (var j = 0; j < Object.getOwnPropertyNames(obj).length; j++) {
  17332. var key = Object.getOwnPropertyNames(obj)[j];
  17333. if (arg == "caller" || arg == "callee" || arg == "length" || arg == "arguments") {
  17334. continue;
  17335. }
  17336. dest[key] = obj[key];
  17337. }
  17338. }
  17339. }
  17340. return dest;
  17341. },
  17342. /**
  17343. * 检测数据是否为number
  17344. * @param value 值,未知数据类型
  17345. * @returns {boolean}
  17346. */
  17347. isNumber: function isNumber(value) {
  17348. if (value === "") {
  17349. return false;
  17350. }
  17351. var mdata = Number(value);
  17352. if (mdata === 0) {
  17353. return true;
  17354. }
  17355. return !isNaN(mdata);
  17356. },
  17357. isString: isString,
  17358. /**
  17359. * 随机生成id
  17360. * @param attr
  17361. * @returns {string}
  17362. */
  17363. newGuid: function newGuid(attr) {
  17364. var len = attr || 32;
  17365. var guid = "";
  17366. for (var i = 1; i < len; i++) {
  17367. var n = Math.floor(Math.random() * 16.0).toString(16);
  17368. guid += n;
  17369. }
  17370. return guid;
  17371. },
  17372. /**
  17373. * @description 十六进制转 RGBA 格式。
  17374. * @param {Object} hex - 十六进制格式。
  17375. * @param {number} opacity - 不透明度Alpha。
  17376. * @returns {string} 生成的 RGBA 格式。
  17377. */
  17378. hexToRgba: function hexToRgba(hex, opacity) {
  17379. var color = [],
  17380. rgba = [];
  17381. hex = hex.replace(/#/, "");
  17382. if (hex.length == 3) {
  17383. var tmp = [];
  17384. for (var i = 0; i < 3; i++) {
  17385. tmp.push(hex.charAt(i) + hex.charAt(i));
  17386. }
  17387. hex = tmp.join("");
  17388. }
  17389. for (var _i2 = 0; _i2 < 6; _i2 += 2) {
  17390. color[_i2] = "0x" + hex.substr(_i2, 2);
  17391. rgba.push(parseInt(Number(color[_i2])));
  17392. }
  17393. rgba.push(opacity);
  17394. return "rgba(" + rgba.join(",") + ")";
  17395. },
  17396. /**
  17397. * @param {string} featureName 原始数据中的地名
  17398. * @param {string} fieldName 待匹配的地名
  17399. * @returns {boolean} 是否匹配
  17400. */
  17401. isMatchAdministrativeName: function isMatchAdministrativeName(featureName, fieldName) {
  17402. if (isString(fieldName)) {
  17403. var shortName = featureName.substr(0, 2);
  17404. // 张家口市和张家界市 特殊处理
  17405. if (shortName === '张家') {
  17406. shortName = featureName.substr(0, 3);
  17407. }
  17408. return !!fieldName.match(new RegExp(shortName));
  17409. }
  17410. return false;
  17411. }
  17412. };
  17413. ;// CONCATENATED MODULE: ./src/maplibregl/core/MapExtend.js
  17414. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  17415. * This program are made available under the terms of the Apache License, Version 2.0
  17416. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  17417. /**
  17418. * @function MapExtend
  17419. * @description 扩展了 maplibregl.Map 对图层相关的操作。
  17420. * @private
  17421. */
  17422. var MapExtend = function () {
  17423. (external_maplibregl_default()).Map.prototype.overlayLayersManager = {};
  17424. if ((external_maplibregl_default()).Map.prototype.addLayerBak === undefined) {
  17425. (external_maplibregl_default()).Map.prototype.addLayerBak = (external_maplibregl_default()).Map.prototype.addLayer;
  17426. (external_maplibregl_default()).Map.prototype.addLayer = function (layer, before) {
  17427. if (layer.source || layer.type === 'custom' || layer.type === 'background') {
  17428. this.addLayerBak(layer, before);
  17429. if (layer.overlay && !this.overlayLayersManager[layer.id]) {
  17430. this.overlayLayersManager[layer.id] = layer;
  17431. }
  17432. return this;
  17433. }
  17434. if (this.overlayLayersManager[layer.id] || this.style._layers[layer.id]) {
  17435. this.fire('error', {
  17436. error: new Error('A layer with this id already exists.')
  17437. });
  17438. return;
  17439. }
  17440. addLayer(layer, this);
  17441. this.overlayLayersManager[layer.id] = layer;
  17442. return this;
  17443. };
  17444. }
  17445. (external_maplibregl_default()).Map.prototype.getLayer = function (id) {
  17446. if (this.overlayLayersManager[id]) {
  17447. return this.overlayLayersManager[id];
  17448. }
  17449. return this.style.getLayer(id);
  17450. };
  17451. (external_maplibregl_default()).Map.prototype.moveLayer = function (id, beforeId) {
  17452. if (this.overlayLayersManager[id]) {
  17453. this.overlayLayersManager[id].moveLayer ? this.overlayLayersManager[id].moveLayer(id, beforeId) : moveLayer(id, beforeId);
  17454. return this;
  17455. }
  17456. if (this.style._layers[id]) {
  17457. this.style.moveLayer(id, beforeId);
  17458. this._update(true);
  17459. return this;
  17460. }
  17461. };
  17462. (external_maplibregl_default()).Map.prototype.removeLayer = function (id) {
  17463. if (this.overlayLayersManager[id]) {
  17464. delete this.overlayLayersManager[id];
  17465. }
  17466. this.style.removeLayer(id);
  17467. this._update(true);
  17468. return this;
  17469. };
  17470. //目前扩展的overlayer,只支持显示或隐藏图层操作
  17471. (external_maplibregl_default()).Map.prototype.setLayoutProperty = function (layerID, name, value) {
  17472. if (this.overlayLayersManager[layerID]) {
  17473. if (name === 'visibility') {
  17474. if (value === 'visible') {
  17475. value = true;
  17476. } else {
  17477. value = false;
  17478. }
  17479. setVisibility(this.overlayLayersManager[layerID], value);
  17480. this.style.fire('data', {
  17481. dataType: 'style'
  17482. });
  17483. }
  17484. return this;
  17485. }
  17486. this.style.setLayoutProperty(layerID, name, value);
  17487. this._update(true);
  17488. return this;
  17489. };
  17490. (external_maplibregl_default()).Map.prototype.updateTransform = function (units, originX, originY, centerX, centerY, width, height) {
  17491. this.transform.units = units;
  17492. var mercatorZfromAltitude = this.mercatorZfromAltitude;
  17493. (external_maplibregl_default()).MercatorCoordinate.fromLngLat = function (lngLatLike, altitude) {
  17494. altitude = altitude || 0;
  17495. var lngLat = external_maplibregl_default().LngLat.convert(lngLatLike);
  17496. return new (external_maplibregl_default()).MercatorCoordinate((lngLat.lng - originX) / width, (originY - lngLat.lat) / height, mercatorZfromAltitude(altitude, lngLat.lat));
  17497. };
  17498. (external_maplibregl_default()).MercatorCoordinate.prototype.toLngLat = function () {
  17499. return new (external_maplibregl_default()).LngLat(this.x * width + originX, originY - this.y * height);
  17500. };
  17501. this.customConvertPoint = window.URL.createObjectURL(new Blob(['customConvertPoint = {projectX:function(x){return (x - ' + centerX + ') / ' + width + ' + 0.5},projectY:function(y){y = 0.5 - ((y - ' + centerY + ') / ' + height + ');return y < 0 ? 0 : y > 1 ? 1 : y;},toY:function(y){return (0.5-y)*' + height + '+' + centerY + ';}}'], {
  17502. type: 'text/javascript'
  17503. }));
  17504. };
  17505. function addLayer(layer, map) {
  17506. layer.onAdd && layer.onAdd(map);
  17507. }
  17508. /**
  17509. * @function MapExtend.prototype.setVisibility
  17510. * @description 设置图层可见性,设置图层的隐藏,显示,重绘的相应的可见标记。
  17511. * @param {boolean} [visibility] - 是否显示图层(当前地图的 resolution 在最大最小 resolution 之间)。
  17512. */
  17513. function setVisibility(layer, visibility) {
  17514. layer.setVisibility && layer.setVisibility(visibility);
  17515. }
  17516. /**
  17517. * @function MapExtend.prototype.moveTo
  17518. * @description 将图层移动到某个图层之前。
  17519. * @param {string} layerID -待插入的图层 ID。
  17520. * @param {boolean} [beforeLayerID] - 是否将本图层插入到图层 id 为 layerID 的图层之前(如果为 false 则将本图层插入到图层 id 为 layerID 的图层之后)。
  17521. */
  17522. function moveLayer(layerID, beforeLayerID) {
  17523. var layer = document.getElementById(layerID);
  17524. // var beforeLayer;
  17525. if (beforeLayerID) {
  17526. var beforeLayer = document.getElementById(beforeLayerID);
  17527. if (!beforeLayer) {
  17528. external_maplibregl_default().Evented.prototype.fire('error', {
  17529. error: new Error("Layer with id \"".concat(beforeLayerID, "\" does not exist on this document."))
  17530. });
  17531. }
  17532. }
  17533. if (layer && beforeLayer) {
  17534. beforeLayer.parentNode.insertBefore(layer, beforeLayer);
  17535. } else {
  17536. //当没有传入beforeLayerID ,则默认将图层移动到最上面
  17537. layer.parentNode.appendChild(layer);
  17538. }
  17539. }
  17540. }();
  17541. ;// CONCATENATED MODULE: ./src/maplibregl/core/index.js
  17542. ;// CONCATENATED MODULE: ./src/maplibregl/services/ServiceBase.js
  17543. function ServiceBase_typeof(obj) { "@babel/helpers - typeof"; return ServiceBase_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, ServiceBase_typeof(obj); }
  17544. function ServiceBase_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  17545. function ServiceBase_createClass(Constructor, protoProps, staticProps) { if (protoProps) ServiceBase_defineProperties(Constructor.prototype, protoProps); if (staticProps) ServiceBase_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  17546. function ServiceBase_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  17547. function ServiceBase_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) ServiceBase_setPrototypeOf(subClass, superClass); }
  17548. function ServiceBase_setPrototypeOf(o, p) { ServiceBase_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ServiceBase_setPrototypeOf(o, p); }
  17549. function ServiceBase_createSuper(Derived) { var hasNativeReflectConstruct = ServiceBase_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = ServiceBase_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = ServiceBase_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return ServiceBase_possibleConstructorReturn(this, result); }; }
  17550. function ServiceBase_possibleConstructorReturn(self, call) { if (call && (ServiceBase_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return ServiceBase_assertThisInitialized(self); }
  17551. function ServiceBase_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  17552. function ServiceBase_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  17553. function ServiceBase_getPrototypeOf(o) { ServiceBase_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ServiceBase_getPrototypeOf(o); }
  17554. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  17555. * This program are made available under the terms of the Apache License, Version 2.0
  17556. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  17557. /**
  17558. * @class ServiceBase
  17559. * @category iServer Core
  17560. * @classdesc maplibregl.supermap 服务基类。
  17561. * @version 11.1.0
  17562. * @param {string} url - 服务地址。
  17563. * @param {Object} options - 参数。
  17564. * @param {string} [options.proxy] - 服务代理地址。
  17565. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  17566. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  17567. * @param {Object} [options.headers] - 请求头。
  17568. * @fires ServiceBase#initialized
  17569. * @usage
  17570. */
  17571. var ServiceBase = /*#__PURE__*/function (_maplibregl$Evented) {
  17572. ServiceBase_inherits(ServiceBase, _maplibregl$Evented);
  17573. var _super = ServiceBase_createSuper(ServiceBase);
  17574. function ServiceBase(url, options) {
  17575. var _this;
  17576. ServiceBase_classCallCheck(this, ServiceBase);
  17577. _this = _super.call(this);
  17578. _this.options = options || {};
  17579. _this.url = url;
  17580. /**
  17581. * @event ServiceBase#initialized
  17582. * @description 构造函数构造成功之后触发。
  17583. * @property {Object} this - this 对象。
  17584. */
  17585. _this.fire('initialized', ServiceBase_assertThisInitialized(_this));
  17586. return _this;
  17587. }
  17588. return ServiceBase_createClass(ServiceBase);
  17589. }((external_maplibregl_default()).Evented);
  17590. // EXTERNAL MODULE: ./node_modules/promise-polyfill/dist/polyfill.js
  17591. var polyfill = __webpack_require__(9957);
  17592. // EXTERNAL MODULE: ./node_modules/fetch-ie8/fetch.js
  17593. var fetch_ie8_fetch = __webpack_require__(5937);
  17594. // EXTERNAL MODULE: ./node_modules/fetch-jsonp/build/fetch-jsonp.js
  17595. var fetch_jsonp = __webpack_require__(4238);
  17596. var fetch_jsonp_default = /*#__PURE__*/__webpack_require__.n(fetch_jsonp);
  17597. ;// CONCATENATED MODULE: ./src/common/util/FetchRequest.js
  17598. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  17599. * This program are made available under the terms of the Apache License, Version 2.0
  17600. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  17601. var FetchRequest_fetch = window.fetch;
  17602. var setFetch = function setFetch(newFetch) {
  17603. FetchRequest_fetch = newFetch;
  17604. };
  17605. var RequestJSONPPromise = {
  17606. limitLength: 1500,
  17607. queryKeys: [],
  17608. queryValues: [],
  17609. supermap_callbacks: {},
  17610. addQueryStrings: function addQueryStrings(values) {
  17611. var me = this;
  17612. for (var key in values) {
  17613. me.queryKeys.push(key);
  17614. if (typeof values[key] !== 'string') {
  17615. values[key] = Util_Util.toJSON(values[key]);
  17616. }
  17617. var tempValue = encodeURIComponent(values[key]);
  17618. me.queryValues.push(tempValue);
  17619. }
  17620. },
  17621. issue: function issue(config) {
  17622. var me = this,
  17623. uid = me.getUid(),
  17624. url = config.url,
  17625. splitQuestUrl = [];
  17626. // me.addQueryStrings({
  17627. // callback: "RequestJSONPPromise.supermap_callbacks[" + uid + "]"
  17628. // });
  17629. var sectionURL = url,
  17630. keysCount = 0; //此次sectionURL中有多少个key
  17631. var length = me.queryKeys ? me.queryKeys.length : 0;
  17632. for (var i = 0; i < length; i++) {
  17633. if (sectionURL.length + me.queryKeys[i].length + 2 >= me.limitLength) {
  17634. //+2 for ("&"or"?")and"="
  17635. if (keysCount == 0) {
  17636. return false;
  17637. }
  17638. splitQuestUrl.push(sectionURL);
  17639. sectionURL = url;
  17640. keysCount = 0;
  17641. i--;
  17642. } else {
  17643. if (sectionURL.length + me.queryKeys[i].length + 2 + me.queryValues[i].length > me.limitLength) {
  17644. var leftValue = me.queryValues[i];
  17645. while (leftValue.length > 0) {
  17646. var leftLength = me.limitLength - sectionURL.length - me.queryKeys[i].length - 2; //+2 for ("&"or"?")and"="
  17647. if (sectionURL.indexOf('?') > -1) {
  17648. sectionURL += '&';
  17649. } else {
  17650. sectionURL += '?';
  17651. }
  17652. var tempLeftValue = leftValue.substring(0, leftLength);
  17653. //避免 截断sectionURL时,将类似于%22这样的符号截成两半,从而导致服务端组装sectionURL时发生错误
  17654. if (tempLeftValue.substring(leftLength - 1, leftLength) === '%') {
  17655. leftLength -= 1;
  17656. tempLeftValue = leftValue.substring(0, leftLength);
  17657. } else if (tempLeftValue.substring(leftLength - 2, leftLength - 1) === '%') {
  17658. leftLength -= 2;
  17659. tempLeftValue = leftValue.substring(0, leftLength);
  17660. }
  17661. sectionURL += me.queryKeys[i] + '=' + tempLeftValue;
  17662. leftValue = leftValue.substring(leftLength);
  17663. if (tempLeftValue.length > 0) {
  17664. splitQuestUrl.push(sectionURL);
  17665. sectionURL = url;
  17666. keysCount = 0;
  17667. }
  17668. }
  17669. } else {
  17670. keysCount++;
  17671. if (sectionURL.indexOf('?') > -1) {
  17672. sectionURL += '&';
  17673. } else {
  17674. sectionURL += '?';
  17675. }
  17676. sectionURL += me.queryKeys[i] + '=' + me.queryValues[i];
  17677. }
  17678. }
  17679. }
  17680. splitQuestUrl.push(sectionURL);
  17681. return me.send(splitQuestUrl, 'SuperMapJSONPCallbacks_' + uid, config && config.proxy);
  17682. },
  17683. getUid: function getUid() {
  17684. var uid = new Date().getTime(),
  17685. random = Math.floor(Math.random() * 1e17);
  17686. return uid * 1000 + random;
  17687. },
  17688. send: function send(splitQuestUrl, callback, proxy) {
  17689. var len = splitQuestUrl.length;
  17690. if (len > 0) {
  17691. return new Promise(function (resolve) {
  17692. var jsonpUserID = new Date().getTime();
  17693. for (var i = 0; i < len; i++) {
  17694. var url = splitQuestUrl[i];
  17695. if (url.indexOf('?') > -1) {
  17696. url += '&';
  17697. } else {
  17698. url += '?';
  17699. }
  17700. url += 'sectionCount=' + len;
  17701. url += '&sectionIndex=' + i;
  17702. url += '&jsonpUserID=' + jsonpUserID;
  17703. if (proxy) {
  17704. url = decodeURIComponent(url);
  17705. url = proxy + encodeURIComponent(url);
  17706. }
  17707. fetch_jsonp_default()(url, {
  17708. jsonpCallbackFunction: callback,
  17709. timeout: 30000
  17710. }).then(function (result) {
  17711. resolve(result.json());
  17712. });
  17713. }
  17714. });
  17715. }
  17716. },
  17717. GET: function GET(config) {
  17718. var me = this;
  17719. me.queryKeys.length = 0;
  17720. me.queryValues.length = 0;
  17721. me.addQueryStrings(config.params);
  17722. return me.issue(config);
  17723. },
  17724. POST: function POST(config) {
  17725. var me = this;
  17726. me.queryKeys.length = 0;
  17727. me.queryValues.length = 0;
  17728. me.addQueryStrings({
  17729. requestEntity: config.data
  17730. });
  17731. return me.issue(config);
  17732. },
  17733. PUT: function PUT(config) {
  17734. var me = this;
  17735. me.queryKeys.length = 0;
  17736. me.queryValues.length = 0;
  17737. me.addQueryStrings({
  17738. requestEntity: config.data
  17739. });
  17740. return me.issue(config);
  17741. },
  17742. DELETE: function DELETE(config) {
  17743. var me = this;
  17744. me.queryKeys.length = 0;
  17745. me.queryValues.length = 0;
  17746. me.addQueryStrings({
  17747. requestEntity: config.data
  17748. });
  17749. return me.issue(config);
  17750. }
  17751. };
  17752. var CORS;
  17753. var RequestTimeout;
  17754. /**
  17755. * @function setCORS
  17756. * @description 设置是否允许跨域请求,全局配置,优先级低于 service 下的 crossOring 参数。
  17757. * @category BaseTypes Util
  17758. * @param {boolean} cors - 是否允许跨域请求。
  17759. * @usage
  17760. * ```
  17761. * // 浏览器
  17762. * <script type="text/javascript" src="{cdn}"></script>
  17763. * <script>
  17764. * {namespace}.setCORS(cors);
  17765. *
  17766. * // 弃用的写法
  17767. * SuperMap.setCORS(cors);
  17768. *
  17769. * </script>
  17770. *
  17771. * // ES6 Import
  17772. * import { setCORS } from '{npm}';
  17773. *
  17774. * setCORS(cors);
  17775. * ```
  17776. */
  17777. var setCORS = function setCORS(cors) {
  17778. CORS = cors;
  17779. };
  17780. /**
  17781. * @function isCORS
  17782. * @description 是是否允许跨域请求。
  17783. * @category BaseTypes Util
  17784. * @returns {boolean} 是否允许跨域请求。
  17785. * @usage
  17786. * ```
  17787. * // 浏览器
  17788. * <script type="text/javascript" src="{cdn}"></script>
  17789. * <script>
  17790. * const result = {namespace}.isCORS();
  17791. *
  17792. * // 弃用的写法
  17793. * const result = SuperMap.isCORS();
  17794. *
  17795. * </script>
  17796. *
  17797. * // ES6 Import
  17798. * import { isCORS } from '{npm}';
  17799. *
  17800. * const result = isCORS();
  17801. * ```
  17802. */
  17803. var isCORS = function isCORS() {
  17804. if (CORS != undefined) {
  17805. return CORS;
  17806. }
  17807. return window.XMLHttpRequest && 'withCredentials' in new window.XMLHttpRequest();
  17808. };
  17809. /**
  17810. * @function setRequestTimeout
  17811. * @category BaseTypes Util
  17812. * @description 设置请求超时时间。
  17813. * @param {number} [timeout=45] - 请求超时时间,单位秒。
  17814. * @usage
  17815. * ```
  17816. * // 浏览器
  17817. <script type="text/javascript" src="{cdn}"></script>
  17818. <script>
  17819. {namespace}.setRequestTimeout(timeout);
  17820. // 弃用的写法
  17821. SuperMap.setRequestTimeout(timeout);
  17822. </script>
  17823. // ES6 Import
  17824. import { setRequestTimeout } from '{npm}';
  17825. setRequestTimeout(timeout);
  17826. * ```
  17827. */
  17828. var setRequestTimeout = function setRequestTimeout(timeout) {
  17829. return RequestTimeout = timeout;
  17830. };
  17831. /**
  17832. * @function getRequestTimeout
  17833. * @category BaseTypes Util
  17834. * @description 获取请求超时时间。
  17835. * @returns {number} 请求超时时间。
  17836. * @usage
  17837. * ```
  17838. * // 浏览器
  17839. <script type="text/javascript" src="{cdn}"></script>
  17840. <script>
  17841. {namespace}.getRequestTimeout();
  17842. // 弃用的写法
  17843. SuperMap.getRequestTimeout();
  17844. </script>
  17845. // ES6 Import
  17846. import { getRequestTimeout } from '{npm}';
  17847. getRequestTimeout();
  17848. * ```
  17849. */
  17850. var getRequestTimeout = function getRequestTimeout() {
  17851. return RequestTimeout || 45000;
  17852. };
  17853. /**
  17854. * @name FetchRequest
  17855. * @namespace
  17856. * @category BaseTypes Util
  17857. * @description 获取请求。
  17858. * @usage
  17859. * ```
  17860. * // 浏览器
  17861. * <script type="text/javascript" src="{cdn}"></script>
  17862. * <script>
  17863. * const result = {namespace}.FetchRequest.commit(method, url, params, options);
  17864. *
  17865. * </script>
  17866. *
  17867. * // ES6 Import
  17868. * import { FetchRequest } from '{npm}';
  17869. *
  17870. * const result = FetchRequest.commit(method, url, params, options);
  17871. *
  17872. * ```
  17873. */
  17874. var FetchRequest = {
  17875. /**
  17876. * @function FetchRequest.commit
  17877. * @description commit 请求。
  17878. * @param {string} method - 请求方法。
  17879. * @param {string} url - 请求地址。
  17880. * @param {string} params - 请求参数。
  17881. * @param {Object} options - 请求的配置属性。
  17882. * @returns {Promise} Promise 对象。
  17883. */
  17884. commit: function commit(method, url, params, options) {
  17885. method = method ? method.toUpperCase() : method;
  17886. switch (method) {
  17887. case 'GET':
  17888. return this.get(url, params, options);
  17889. case 'POST':
  17890. return this.post(url, params, options);
  17891. case 'PUT':
  17892. return this.put(url, params, options);
  17893. case 'DELETE':
  17894. return this["delete"](url, params, options);
  17895. default:
  17896. return this.get(url, params, options);
  17897. }
  17898. },
  17899. /**
  17900. * @function FetchRequest.supportDirectRequest
  17901. * @description supportDirectRequest 请求。
  17902. * @param {string} url - 请求地址。
  17903. * @param {Object} options - 请求的配置属性。
  17904. * @returns {boolean} 是否允许跨域请求。
  17905. */
  17906. supportDirectRequest: function supportDirectRequest(url, options) {
  17907. if (Util_Util.isInTheSameDomain(url)) {
  17908. return true;
  17909. }
  17910. if (options.crossOrigin != undefined) {
  17911. return options.crossOrigin;
  17912. } else {
  17913. return isCORS() || options.proxy;
  17914. }
  17915. },
  17916. /**
  17917. * @function FetchRequest.get
  17918. * @description get 请求。
  17919. * @param {string} url - 请求地址。
  17920. * @param {string} params - 请求参数。
  17921. * @param {Object} options - 请求的配置属性。
  17922. * @returns {Promise} Promise 对象。
  17923. */
  17924. get: function get(url, params, options) {
  17925. options = options || {};
  17926. var type = 'GET';
  17927. url = Util_Util.urlAppend(url, this._getParameterString(params || {}));
  17928. url = this._processUrl(url, options);
  17929. if (!this.supportDirectRequest(url, options)) {
  17930. url = url.replace('.json', '.jsonp');
  17931. var config = {
  17932. url: url,
  17933. data: params
  17934. };
  17935. return RequestJSONPPromise.GET(config);
  17936. }
  17937. if (!this.urlIsLong(url)) {
  17938. return this._fetch(url, params, options, type);
  17939. } else {
  17940. return this._postSimulatie(type, url.substring(0, url.indexOf('?')), params, options);
  17941. }
  17942. },
  17943. /**
  17944. * @function FetchRequest.delete
  17945. * @description delete 请求。
  17946. * @param {string} url - 请求地址。
  17947. * @param {string} params - 请求参数。
  17948. * @param {Object} options -请求的配置属性。
  17949. * @returns {Promise} Promise 对象。
  17950. */
  17951. "delete": function _delete(url, params, options) {
  17952. options = options || {};
  17953. var type = 'DELETE';
  17954. url = Util_Util.urlAppend(url, this._getParameterString(params || {}));
  17955. url = this._processUrl(url, options);
  17956. if (!this.supportDirectRequest(url, options)) {
  17957. url = url.replace('.json', '.jsonp');
  17958. var config = {
  17959. url: url += "&_method=DELETE",
  17960. data: params
  17961. };
  17962. return RequestJSONPPromise.DELETE(config);
  17963. }
  17964. if (this.urlIsLong(url)) {
  17965. return this._postSimulatie(type, url.substring(0, url.indexOf('?')), params, options);
  17966. }
  17967. return this._fetch(url, params, options, type);
  17968. },
  17969. /**
  17970. * @function FetchRequest.post
  17971. * @description post 请求。
  17972. * @param {string} url - 请求地址。
  17973. * @param {string} params - 请求参数。
  17974. * @param {Object} options - 请求的配置属性。
  17975. * @returns {Promise} Promise 对象。
  17976. */
  17977. post: function post(url, params, options) {
  17978. options = options || {};
  17979. url = this._processUrl(url, options);
  17980. if (!this.supportDirectRequest(url, options)) {
  17981. url = url.replace('.json', '.jsonp');
  17982. var config = {
  17983. url: Util_Util.urlAppend(url, "_method=POST"),
  17984. data: params
  17985. };
  17986. return RequestJSONPPromise.POST(config);
  17987. }
  17988. return this._fetch(url, params, options, 'POST');
  17989. },
  17990. /**
  17991. * @function FetchRequest.put
  17992. * @description put 请求。
  17993. * @param {string} url - 请求地址。
  17994. * @param {string} params - 请求参数。
  17995. * @param {Object} options - 请求的配置属性。
  17996. * @returns {Promise} Promise 对象。
  17997. */
  17998. put: function put(url, params, options) {
  17999. options = options || {};
  18000. url = this._processUrl(url, options);
  18001. if (!this.supportDirectRequest(url, options)) {
  18002. url = url.replace('.json', '.jsonp');
  18003. var config = {
  18004. url: url += "&_method=PUT",
  18005. data: params
  18006. };
  18007. return RequestJSONPPromise.PUT(config);
  18008. }
  18009. return this._fetch(url, params, options, 'PUT');
  18010. },
  18011. /**
  18012. * @function FetchRequest.urlIsLong
  18013. * @description URL 的字节长度是否太长。
  18014. * @param {string} url - 请求地址。
  18015. * @returns {boolean} URL 的字节长度是否太长。
  18016. */
  18017. urlIsLong: function urlIsLong(url) {
  18018. //当前url的字节长度。
  18019. var totalLength = 0,
  18020. charCode = null;
  18021. for (var i = 0, len = url.length; i < len; i++) {
  18022. //转化为Unicode编码
  18023. charCode = url.charCodeAt(i);
  18024. if (charCode < 0x007f) {
  18025. totalLength++;
  18026. } else if (0x0080 <= charCode && charCode <= 0x07ff) {
  18027. totalLength += 2;
  18028. } else if (0x0800 <= charCode && charCode <= 0xffff) {
  18029. totalLength += 3;
  18030. }
  18031. }
  18032. return totalLength < 2000 ? false : true;
  18033. },
  18034. _postSimulatie: function _postSimulatie(type, url, params, options) {
  18035. var separator = url.indexOf('?') > -1 ? '&' : '?';
  18036. url += separator + '_method=' + type;
  18037. if (typeof params !== 'string') {
  18038. params = JSON.stringify(params);
  18039. }
  18040. return this.post(url, params, options);
  18041. },
  18042. _processUrl: function _processUrl(url, options) {
  18043. if (this._isMVTRequest(url)) {
  18044. return url;
  18045. }
  18046. if (url.indexOf('.json') === -1 && !options.withoutFormatSuffix) {
  18047. if (url.indexOf('?') < 0) {
  18048. url += '.json';
  18049. } else {
  18050. var urlArrays = url.split('?');
  18051. if (urlArrays.length === 2) {
  18052. url = urlArrays[0] + '.json?' + urlArrays[1];
  18053. }
  18054. }
  18055. }
  18056. if (options && options.proxy) {
  18057. if (typeof options.proxy === 'function') {
  18058. url = options.proxy(url);
  18059. } else {
  18060. url = decodeURIComponent(url);
  18061. url = options.proxy + encodeURIComponent(url);
  18062. }
  18063. }
  18064. return url;
  18065. },
  18066. _fetch: function _fetch(url, params, options, type) {
  18067. options = options || {};
  18068. options.headers = options.headers || {};
  18069. if (!options.headers['Content-Type'] && !FormData.prototype.isPrototypeOf(params)) {
  18070. options.headers['Content-Type'] = 'application/x-www-form-urlencoded;charset=UTF-8';
  18071. }
  18072. if (options.timeout) {
  18073. return this._timeout(options.timeout, FetchRequest_fetch(url, {
  18074. method: type,
  18075. headers: options.headers,
  18076. body: type === 'PUT' || type === 'POST' ? params : undefined,
  18077. credentials: this._getWithCredentials(options),
  18078. mode: 'cors',
  18079. timeout: getRequestTimeout()
  18080. }).then(function (response) {
  18081. return response;
  18082. }));
  18083. }
  18084. return FetchRequest_fetch(url, {
  18085. method: type,
  18086. body: type === 'PUT' || type === 'POST' ? params : undefined,
  18087. headers: options.headers,
  18088. credentials: this._getWithCredentials(options),
  18089. mode: 'cors',
  18090. timeout: getRequestTimeout()
  18091. }).then(function (response) {
  18092. return response;
  18093. });
  18094. },
  18095. _getWithCredentials: function _getWithCredentials(options) {
  18096. if (options.withCredentials === true) {
  18097. return 'include';
  18098. }
  18099. if (options.withCredentials === false) {
  18100. return 'omit';
  18101. }
  18102. return 'same-origin';
  18103. },
  18104. _fetchJsonp: function _fetchJsonp(url, options) {
  18105. options = options || {};
  18106. return fetch_jsonp_default()(url, {
  18107. method: 'GET',
  18108. timeout: options.timeout
  18109. }).then(function (response) {
  18110. return response;
  18111. });
  18112. },
  18113. _timeout: function _timeout(seconds, promise) {
  18114. return new Promise(function (resolve, reject) {
  18115. setTimeout(function () {
  18116. reject(new Error('timeout'));
  18117. }, seconds);
  18118. promise.then(resolve, reject);
  18119. });
  18120. },
  18121. _getParameterString: function _getParameterString(params) {
  18122. var paramsArray = [];
  18123. for (var key in params) {
  18124. var value = params[key];
  18125. if (value != null && typeof value !== 'function') {
  18126. var encodedValue;
  18127. if (Array.isArray(value) || value.toString() === '[object Object]') {
  18128. encodedValue = encodeURIComponent(JSON.stringify(value));
  18129. } else {
  18130. encodedValue = encodeURIComponent(value);
  18131. }
  18132. paramsArray.push(encodeURIComponent(key) + '=' + encodedValue);
  18133. }
  18134. }
  18135. return paramsArray.join('&');
  18136. },
  18137. _isMVTRequest: function _isMVTRequest(url) {
  18138. return url.indexOf('.mvt') > -1 || url.indexOf('.pbf') > -1;
  18139. }
  18140. };
  18141. ;// CONCATENATED MODULE: ./src/common/commontypes/Event.js
  18142. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  18143. * This program are made available under the terms of the Apache License, Version 2.0
  18144. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  18145. /**
  18146. * @name Event
  18147. * @namespace
  18148. * @category BaseTypes Events
  18149. * @description 事件处理函数.
  18150. * @usage
  18151. * ```
  18152. * // 浏览器
  18153. * <script type="text/javascript" src="{cdn}"></script>
  18154. * <script>
  18155. * const element = {namespace}.Event.element();
  18156. *
  18157. * // 弃用的写法
  18158. * const result = SuperMap.Event.element();
  18159. *
  18160. * </script>
  18161. *
  18162. * // ES6 Import
  18163. * import { Event } from '{npm}';
  18164. *
  18165. * const result = Event.element();
  18166. * ```
  18167. */
  18168. var Event = {
  18169. /**
  18170. * @description 事件观察者列表。
  18171. * @type {Object}
  18172. * @default false
  18173. */
  18174. observers: false,
  18175. /**
  18176. * @description KEY_SPACE
  18177. * @type {number}
  18178. * @default 32
  18179. */
  18180. KEY_SPACE: 32,
  18181. /**
  18182. * @description KEY_BACKSPACE
  18183. * @type {number}
  18184. * @default 8
  18185. */
  18186. KEY_BACKSPACE: 8,
  18187. /**
  18188. * @description KEY_TAB
  18189. * @type {number}
  18190. * @default 9
  18191. */
  18192. KEY_TAB: 9,
  18193. /**
  18194. * @description KEY_RETURN
  18195. * @type {number}
  18196. * @default 13
  18197. */
  18198. KEY_RETURN: 13,
  18199. /**
  18200. * @description KEY_ESC
  18201. * @type {number}
  18202. * @default 27
  18203. */
  18204. KEY_ESC: 27,
  18205. /**
  18206. * @description KEY_LEFT
  18207. * @type {number}
  18208. * @default 37
  18209. */
  18210. KEY_LEFT: 37,
  18211. /**
  18212. * @description KEY_UP
  18213. * @type {number}
  18214. * @default 38
  18215. */
  18216. KEY_UP: 38,
  18217. /**
  18218. * @description KEY_RIGHT
  18219. * @type {number}
  18220. * @default 39
  18221. */
  18222. KEY_RIGHT: 39,
  18223. /**
  18224. * @description KEY_DOWN
  18225. * @type {number}
  18226. * @default 40
  18227. */
  18228. KEY_DOWN: 40,
  18229. /**
  18230. * @description KEY_DELETE
  18231. * @type {number}
  18232. * @default 46
  18233. */
  18234. KEY_DELETE: 46,
  18235. /**
  18236. * @description 监听浏览器 DOM 事件。
  18237. * @param {Event} event - Event 对象。
  18238. * @returns {HTMLElement} 触发事件的 DOM 元素。
  18239. */
  18240. element: function element(event) {
  18241. return event.target || event.srcElement;
  18242. },
  18243. /**
  18244. * @description 判断事件是否由单次触摸引起。
  18245. * @param {Event} event - Event 对象。
  18246. * @returns {boolean} 是否有且只有一个当前在与触摸表面接触的 Touch 对象。
  18247. */
  18248. isSingleTouch: function isSingleTouch(event) {
  18249. return event.touches && event.touches.length === 1;
  18250. },
  18251. /**
  18252. * @description 判断事件是否由多点触控引起。
  18253. * @param {Event} event - Event 对象。
  18254. * @returns {boolean} 是否存在多个当前在与触摸表面接触的 Touch 对象。
  18255. */
  18256. isMultiTouch: function isMultiTouch(event) {
  18257. return event.touches && event.touches.length > 1;
  18258. },
  18259. /**
  18260. * @description 确定事件是否由左键单击引起。
  18261. * @param {Event} event - Event 对象。
  18262. * @returns {boolean} 是否点击鼠标左键。
  18263. */
  18264. isLeftClick: function isLeftClick(event) {
  18265. return event.which && event.which === 1 || event.button && event.button === 1;
  18266. },
  18267. /**
  18268. * @description 确定事件是否由鼠标右键单击引起。
  18269. * @param {Event} event - Event 对象。
  18270. * @returns {boolean} 是否点击鼠标右键。
  18271. */
  18272. isRightClick: function isRightClick(event) {
  18273. return event.which && event.which === 3 || event.button && event.button === 2;
  18274. },
  18275. /**
  18276. * @description 阻止事件冒泡。
  18277. * @param {Event} event - Event 对象。
  18278. * @param {boolean} allowDefault - 默认为 false,表示阻止事件的默认行为。
  18279. */
  18280. stop: function stop(event, allowDefault) {
  18281. if (!allowDefault) {
  18282. if (event.preventDefault) {
  18283. event.preventDefault();
  18284. } else {
  18285. event.returnValue = false;
  18286. }
  18287. }
  18288. if (event.stopPropagation) {
  18289. event.stopPropagation();
  18290. } else {
  18291. event.cancelBubble = true;
  18292. }
  18293. },
  18294. /**
  18295. * @description 查询触发指定事件的 DOM 元素。
  18296. * @param {Event} event - Event 对象。
  18297. * @param {string} tagName - html 标签名。
  18298. * @returns {HTMLElement} DOM 元素。
  18299. */
  18300. findElement: function findElement(event, tagName) {
  18301. var element = Event.element(event);
  18302. while (element.parentNode && (!element.tagName || element.tagName.toUpperCase() != tagName.toUpperCase())) {
  18303. element = element.parentNode;
  18304. }
  18305. return element;
  18306. },
  18307. /**
  18308. * @description 监听事件,注册事件处理方法。
  18309. * @param {(HTMLElement|string)} elementParam - 待监听的 DOM 对象或者其 ID 标识。
  18310. * @param {string} name - 监听事件的类别名称。
  18311. * @param {function} observer - 注册的事件处理方法。
  18312. * @param {boolean} [useCapture=false] - 是否捕获。
  18313. */
  18314. observe: function observe(elementParam, name, observer, useCapture) {
  18315. var element = Util_Util.getElement(elementParam);
  18316. useCapture = useCapture || false;
  18317. if (name === 'keypress' && (navigator.appVersion.match(/Konqueror|Safari|KHTML/) || element.attachEvent)) {
  18318. name = 'keydown';
  18319. }
  18320. //if observers cache has not yet been created, create it
  18321. if (!this.observers) {
  18322. this.observers = {};
  18323. }
  18324. //if not already assigned, make a new unique cache ID
  18325. if (!element._eventCacheID) {
  18326. var idPrefix = "eventCacheID_";
  18327. if (element.id) {
  18328. idPrefix = element.id + "_" + idPrefix;
  18329. }
  18330. element._eventCacheID = Util_Util.createUniqueID(idPrefix);
  18331. }
  18332. var cacheID = element._eventCacheID;
  18333. //if there is not yet a hash entry for this element, add one
  18334. if (!this.observers[cacheID]) {
  18335. this.observers[cacheID] = [];
  18336. }
  18337. //add a new observer to this element's list
  18338. this.observers[cacheID].push({
  18339. 'element': element,
  18340. 'name': name,
  18341. 'observer': observer,
  18342. 'useCapture': useCapture
  18343. });
  18344. //add the actual browser event listener
  18345. if (element.addEventListener) {
  18346. if (name === 'mousewheel') {
  18347. // https://www.chromestatus.com/features/6662647093133312
  18348. element.addEventListener(name, observer, {
  18349. useCapture: useCapture,
  18350. passive: false
  18351. });
  18352. } else {
  18353. element.addEventListener(name, observer, useCapture);
  18354. }
  18355. } else if (element.attachEvent) {
  18356. element.attachEvent('on' + name, observer);
  18357. }
  18358. },
  18359. /**
  18360. * @description 移除给定 DOM 元素的监听事件。
  18361. * @param {(HTMLElement|string)} elementParam - 待监听的 DOM 对象或者其 ID 标识。
  18362. */
  18363. stopObservingElement: function stopObservingElement(elementParam) {
  18364. var element = Util_Util.getElement(elementParam);
  18365. var cacheID = element._eventCacheID;
  18366. this._removeElementObservers(Event.observers[cacheID]);
  18367. },
  18368. _removeElementObservers: function _removeElementObservers(elementObservers) {
  18369. if (elementObservers) {
  18370. for (var i = elementObservers.length - 1; i >= 0; i--) {
  18371. var entry = elementObservers[i];
  18372. var args = new Array(entry.element, entry.name, entry.observer, entry.useCapture);
  18373. Event.stopObserving.apply(this, args);
  18374. }
  18375. }
  18376. },
  18377. /**
  18378. * @description 移除事件监听和注册的事件处理方法。注意:事件的移除和监听相对应,移除时的各属性信息必须监听时保持一致才能确保事件移除成功。
  18379. * @param {(HTMLElement|string)} elementParam - 被监听的 DOM 元素或者其 ID。
  18380. * @param {string} name - 需要移除的被监听事件名称。
  18381. * @param {function} observer - 需要移除的事件处理方法。
  18382. * @param {boolean} [useCapture=false] - 是否捕获。
  18383. * @returns {boolean} 监听事件是否被移除。
  18384. */
  18385. stopObserving: function stopObserving(elementParam, name, observer, useCapture) {
  18386. useCapture = useCapture || false;
  18387. var element = Util_Util.getElement(elementParam);
  18388. var cacheID = element._eventCacheID;
  18389. if (name === 'keypress') {
  18390. if (navigator.appVersion.match(/Konqueror|Safari|KHTML/) || element.detachEvent) {
  18391. name = 'keydown';
  18392. }
  18393. }
  18394. // find element's entry in this.observers cache and remove it
  18395. var foundEntry = false;
  18396. var elementObservers = Event.observers[cacheID];
  18397. if (elementObservers) {
  18398. // find the specific event type in the element's list
  18399. var i = 0;
  18400. while (!foundEntry && i < elementObservers.length) {
  18401. var cacheEntry = elementObservers[i];
  18402. if (cacheEntry.name === name && cacheEntry.observer === observer && cacheEntry.useCapture === useCapture) {
  18403. elementObservers.splice(i, 1);
  18404. if (elementObservers.length == 0) {
  18405. delete Event.observers[cacheID];
  18406. }
  18407. foundEntry = true;
  18408. break;
  18409. }
  18410. i++;
  18411. }
  18412. }
  18413. //actually remove the event listener from browser
  18414. if (foundEntry) {
  18415. if (element.removeEventListener) {
  18416. element.removeEventListener(name, observer, useCapture);
  18417. } else if (element && element.detachEvent) {
  18418. element.detachEvent('on' + name, observer);
  18419. }
  18420. }
  18421. return foundEntry;
  18422. },
  18423. /**
  18424. * @description 移除缓存中的监听事件。
  18425. */
  18426. unloadCache: function unloadCache() {
  18427. // check for Event before checking for observers, because
  18428. // Event may be undefined in IE if no map instance was
  18429. // created
  18430. if (Event && Event.observers) {
  18431. for (var cacheID in Event.observers) {
  18432. var elementObservers = Event.observers[cacheID];
  18433. Event._removeElementObservers.apply(this, [elementObservers]);
  18434. }
  18435. Event.observers = false;
  18436. }
  18437. },
  18438. CLASS_NAME: "SuperMap.Event"
  18439. };
  18440. /* prevent memory leaks in IE */
  18441. Event.observe(window, 'resize', Event.unloadCache, false);
  18442. ;// CONCATENATED MODULE: ./src/common/commontypes/Events.js
  18443. function Events_typeof(obj) { "@babel/helpers - typeof"; return Events_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, Events_typeof(obj); }
  18444. function Events_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  18445. 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); } }
  18446. function Events_createClass(Constructor, protoProps, staticProps) { if (protoProps) Events_defineProperties(Constructor.prototype, protoProps); if (staticProps) Events_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  18447. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  18448. * This program are made available under the terms of the Apache License, Version 2.0
  18449. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  18450. /**
  18451. * @class Events
  18452. * @deprecatedclass SuperMap.Events
  18453. * @classdesc 事件类。
  18454. * @category BaseTypes Events
  18455. * @param {Object} object - 当前事件对象被添加到的 JS 对象。
  18456. * @param {HTMLElement} element - 响应浏览器事件的 DOM 元素。
  18457. * @param {Array.<string>} eventTypes - 自定义应用事件的数组。
  18458. * @param {boolean} [fallThrough=false] - 是否允许事件处理之后向上传递(冒泡),为 false 的时候阻止事件冒泡。
  18459. * @param {Object} options - 事件对象选项。
  18460. * @usage
  18461. */
  18462. var Events = /*#__PURE__*/function () {
  18463. function Events(object, element, eventTypes, fallThrough, options) {
  18464. Events_classCallCheck(this, Events);
  18465. /**
  18466. * @member {Array.<string>} Events.prototype.BROWSER_EVENTS
  18467. * @description 支持的事件。
  18468. * @constant
  18469. * @default [
  18470. "mouseover", "mouseout","mousedown", "mouseup", "mousemove",
  18471. "click", "dblclick", "rightclick", "dblrightclick","resize",
  18472. "focus", "blur","touchstart", "touchmove", "touchend","keydown",
  18473. "MSPointerDown", "MSPointerUp", "pointerdown", "pointerup",
  18474. "MSGestureStart", "MSGestureChange", "MSGestureEnd","contextmenu"
  18475. ]
  18476. */
  18477. 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"];
  18478. /**
  18479. * @member {Object} Events.prototype.listeners
  18480. * @description 事件监听器函数。
  18481. */
  18482. this.listeners = {};
  18483. /**
  18484. * @member {Object} Events.prototype.object
  18485. * @description 发布应用程序事件的对象。
  18486. */
  18487. this.object = object;
  18488. /**
  18489. * @member {HTMLElement} Events.prototype.element
  18490. * @description 接受浏览器事件的 DOM 节点。
  18491. */
  18492. this.element = null;
  18493. /**
  18494. * @member {Array.<string>} Events.prototype.eventTypes
  18495. * @description 支持的事件类型列表。
  18496. */
  18497. this.eventTypes = [];
  18498. /**
  18499. * @member {function} Events.prototype.eventHandler
  18500. * @description 绑定在元素上的事件处理器对象。
  18501. */
  18502. this.eventHandler = null;
  18503. /**
  18504. * @member {boolean} [Events.prototype.fallThrough=false]
  18505. * @description 是否允许事件处理之后向上传递(冒泡),为 false 的时候阻止事件冒泡。
  18506. */
  18507. this.fallThrough = fallThrough;
  18508. /**
  18509. * @member {boolean} [Events.prototype.includeXY=false]
  18510. * @description 判断是否让 xy 属性自动创建到浏览器上的鼠标事件,一般设置为 false,如果设置为 true,鼠标事件将会在事件传递过程中自动产生 xy 属性。可根据事件对象的 'evt.object' 属性在相关的事件句柄上调用 getMousePosition 函数。这个选项习惯默认为 false 的原因在于,当创建一个事件对象,其主要目的是管理。在一个 div 的相对定位的鼠标事件,将其设为 true 也是有意义的。这个选项也可以用来控制是否抵消缓存。如果设为 false 不抵消,如果设为 true,用 this.clearMouseCache() 清除缓存偏移(边界元素偏移,元素在页面的位置偏移)。
  18511. * @example
  18512. * function named(evt) {
  18513. * this.xy = this.object.events.getMousePosition(evt);
  18514. * }
  18515. */
  18516. this.includeXY = false;
  18517. /**
  18518. * @member {Object} Events.prototype.extensions
  18519. * @description 事件扩展。Keys 代表事件类型,values 代表事件对象。
  18520. */
  18521. this.extensions = {};
  18522. /**
  18523. * @member {Object} Events.prototype.extensionCount
  18524. * @description 事件扩展数量。
  18525. */
  18526. this.extensionCount = {};
  18527. /**
  18528. * @member {Object} Events.prototype.clearMouseListener
  18529. * @description 待移除的鼠标监听事件。
  18530. */
  18531. this.clearMouseListener = null;
  18532. Util_Util.extend(this, options);
  18533. if (eventTypes != null) {
  18534. for (var i = 0, len = eventTypes.length; i < len; i++) {
  18535. this.addEventType(eventTypes[i]);
  18536. }
  18537. }
  18538. if (element != null) {
  18539. this.attachToElement(element);
  18540. }
  18541. this.CLASS_NAME = "SuperMap.Events";
  18542. }
  18543. /**
  18544. * @function Events.prototype.destroy
  18545. * @description 移除当前要素 element 上的所有事件监听和处理。
  18546. */
  18547. Events_createClass(Events, [{
  18548. key: "destroy",
  18549. value: function destroy() {
  18550. for (var e in this.extensions) {
  18551. if (typeof this.extensions[e] !== "boolean") {
  18552. this.extensions[e].destroy();
  18553. }
  18554. }
  18555. this.extensions = null;
  18556. if (this.element) {
  18557. Event.stopObservingElement(this.element);
  18558. if (this.element.hasScrollEvent) {
  18559. Event.stopObserving(window, "scroll", this.clearMouseListener);
  18560. }
  18561. }
  18562. this.element = null;
  18563. this.listeners = null;
  18564. this.object = null;
  18565. this.eventTypes = null;
  18566. this.fallThrough = null;
  18567. this.eventHandler = null;
  18568. }
  18569. /**
  18570. * @function Events.prototype.addEventType
  18571. * @description 在此事件对象中添加新的事件类型,如果这个事件类型已经添加过了,则不做任何事情。
  18572. * @param {string} eventName - 事件名。
  18573. */
  18574. }, {
  18575. key: "addEventType",
  18576. value: function addEventType(eventName) {
  18577. if (!this.listeners[eventName]) {
  18578. this.eventTypes.push(eventName);
  18579. this.listeners[eventName] = [];
  18580. }
  18581. }
  18582. /**
  18583. * @function Events.prototype.attachToElement
  18584. * @description 给 DOM 元素绑定浏览器事件。
  18585. * @param {HTMLElement} element - 绑定浏览器事件的 DOM 元素。
  18586. */
  18587. }, {
  18588. key: "attachToElement",
  18589. value: function attachToElement(element) {
  18590. if (this.element) {
  18591. Event.stopObservingElement(this.element);
  18592. } else {
  18593. // keep a bound copy of handleBrowserEvent() so that we can
  18594. // pass the same function to both Event.observe() and .stopObserving()
  18595. this.eventHandler = FunctionExt.bindAsEventListener(this.handleBrowserEvent, this);
  18596. // to be used with observe and stopObserving
  18597. this.clearMouseListener = FunctionExt.bind(this.clearMouseCache, this);
  18598. }
  18599. this.element = element;
  18600. for (var i = 0, len = this.BROWSER_EVENTS.length; i < len; i++) {
  18601. var eventType = this.BROWSER_EVENTS[i];
  18602. // every browser event has a corresponding application event
  18603. // (whether it's listened for or not).
  18604. this.addEventType(eventType);
  18605. // use Prototype to register the event cross-browser
  18606. Event.observe(element, eventType, this.eventHandler);
  18607. }
  18608. // disable dragstart in IE so that mousedown/move/up works normally
  18609. Event.observe(element, "dragstart", Event.stop);
  18610. }
  18611. /**
  18612. * @function Events.prototype.on
  18613. * @description 在一个相同的范围内注册监听器的方法,此方法调用 register 函数。
  18614. * @example
  18615. * // 注册一个 "loadstart" 监听事件
  18616. * events.on({"loadstart": loadStartListener});
  18617. *
  18618. * // 同样注册一个 "loadstart" 监听事件
  18619. * events.register("loadstart", undefined, loadStartListener);
  18620. *
  18621. * // 同时为对象注册多个监听事件
  18622. * events.on({
  18623. * "loadstart": loadStartListener,
  18624. * "loadend": loadEndListener,
  18625. * scope: object
  18626. * });
  18627. *
  18628. * // 同时为对象注册多个监听事件,多次调用 register 方法
  18629. * events.register("loadstart", object, loadStartListener);
  18630. * events.register("loadend", object, loadEndListener);
  18631. *
  18632. *
  18633. * @param {Object} object - 添加监听的对象。
  18634. */
  18635. }, {
  18636. key: "on",
  18637. value: function on(object) {
  18638. for (var type in object) {
  18639. if (type !== "scope" && object.hasOwnProperty(type)) {
  18640. this.register(type, object.scope, object[type]);
  18641. }
  18642. }
  18643. }
  18644. /**
  18645. * @function Events.prototype.register
  18646. * @description 在事件对象上注册一个事件。当事件被触发时,'func' 函数被调用,假设我们触发一个事件,
  18647. * 指定 Bounds 作为 "obj",当事件被触发时,回调函数的上下文作为 Bounds 对象。
  18648. * @param {string} type - 事件注册者的名字。
  18649. * @param {Object} [obj=this.object] - 对象绑定的回调。
  18650. * @param {function} [func] - 回调函数,如果没有特定的回调,则这个函数不做任何事情。
  18651. * @param {(boolean|Object)} [priority] - 当为 true 时将新的监听加在事件队列的前面。
  18652. */
  18653. }, {
  18654. key: "register",
  18655. value: function register(type, obj, func, priority) {
  18656. if (type in Events && !this.extensions[type]) {
  18657. this.extensions[type] = new Events[type](this);
  18658. }
  18659. if (func != null && Util_Util.indexOf(this.eventTypes, type) !== -1) {
  18660. if (obj == null) {
  18661. obj = this.object;
  18662. }
  18663. var listeners = this.listeners[type];
  18664. if (!listeners) {
  18665. listeners = [];
  18666. this.listeners[type] = listeners;
  18667. this.extensionCount[type] = 0;
  18668. }
  18669. var listener = {
  18670. obj: obj,
  18671. func: func
  18672. };
  18673. if (priority) {
  18674. listeners.splice(this.extensionCount[type], 0, listener);
  18675. if (Events_typeof(priority) === "object" && priority.extension) {
  18676. this.extensionCount[type]++;
  18677. }
  18678. } else {
  18679. listeners.push(listener);
  18680. }
  18681. }
  18682. }
  18683. /**
  18684. * @function Events.prototype.registerPriority
  18685. * @description 相同的注册方法,但是在前面增加新的监听者事件查询而代替到方法的结束。
  18686. * @param {string} type - 事件注册者的名字。
  18687. * @param {Object} [obj=this.object] - 对象绑定的回调。
  18688. * @param {function} [func] - 回调函数,如果没有特定的回调,则这个函数不做任何事情。
  18689. */
  18690. }, {
  18691. key: "registerPriority",
  18692. value: function registerPriority(type, obj, func) {
  18693. this.register(type, obj, func, true);
  18694. }
  18695. /**
  18696. * @function Events.prototype.un
  18697. * @description 在一个相同的范围内取消注册监听器的方法,此方法调用 unregister 函数。
  18698. * @example
  18699. * // 移除 "loadstart" 事件监听
  18700. * events.un({"loadstart": loadStartListener});
  18701. *
  18702. * // 使用 "unregister" 方法移除 "loadstart" 事件监听
  18703. * events.unregister("loadstart", undefined, loadStartListener);
  18704. *
  18705. * // 取消对象多个事件监听
  18706. * events.un({
  18707. * "loadstart": loadStartListener,
  18708. * "loadend": loadEndListener,
  18709. * scope: object
  18710. * });
  18711. *
  18712. * // 取消对象多个事件监听,多次调用unregister方法。
  18713. * events.unregister("loadstart", object, loadStartListener);
  18714. * events.unregister("loadend", object, loadEndListener);
  18715. *
  18716. * @param {Object} object - 移除监听的对象。
  18717. */
  18718. }, {
  18719. key: "un",
  18720. value: function un(object) {
  18721. for (var type in object) {
  18722. if (type !== "scope" && object.hasOwnProperty(type)) {
  18723. this.unregister(type, object.scope, object[type]);
  18724. }
  18725. }
  18726. }
  18727. /**
  18728. * @function Events.prototype.unregister
  18729. * @description 取消注册。
  18730. * @param {string} type - 事件类型。
  18731. * @param {Object} [obj=this.object] - 对象绑定的回调。
  18732. * @param {function} [func] - 回调函数,如果没有特定的回调,则这个函数不做任何事情。
  18733. */
  18734. }, {
  18735. key: "unregister",
  18736. value: function unregister(type, obj, func) {
  18737. if (obj == null) {
  18738. obj = this.object;
  18739. }
  18740. var listeners = this.listeners[type];
  18741. if (listeners != null) {
  18742. for (var i = 0, len = listeners.length; i < len; i++) {
  18743. if (listeners[i].obj === obj && listeners[i].func === func) {
  18744. listeners.splice(i, 1);
  18745. break;
  18746. }
  18747. }
  18748. }
  18749. }
  18750. /**
  18751. * @function Events.prototype.remove
  18752. * @description 删除某个事件类型的所有监听,如果该事件类型没有注册,则不做任何操作。
  18753. * @param {string} type - 事件类型。
  18754. */
  18755. }, {
  18756. key: "remove",
  18757. value: function remove(type) {
  18758. if (this.listeners[type] != null) {
  18759. this.listeners[type] = [];
  18760. }
  18761. }
  18762. /**
  18763. * @function Events.prototype.triggerEvent
  18764. * @description 触发一个特定的注册事件。
  18765. * @param {string} type - 触发事件类型。
  18766. * @param {Event} evt - 事件对象。
  18767. * @returns {Event|boolean} 监听对象,如果返回是 false,则停止监听。
  18768. */
  18769. }, {
  18770. key: "triggerEvent",
  18771. value: function triggerEvent(type, evt) {
  18772. var listeners = this.listeners[type];
  18773. // fast path
  18774. if (!listeners || listeners.length == 0) {
  18775. return undefined;
  18776. }
  18777. // prep evt object with object & div references
  18778. if (evt == null) {
  18779. evt = {};
  18780. }
  18781. evt.object = this.object;
  18782. evt.element = this.element;
  18783. if (!evt.type) {
  18784. evt.type = type;
  18785. }
  18786. // execute all callbacks registered for specified type
  18787. // get a clone of the listeners array to
  18788. // allow for splicing during callbacks
  18789. listeners = listeners.slice();
  18790. var continueChain;
  18791. for (var i = 0, len = listeners.length; i < len; i++) {
  18792. var callback = listeners[i];
  18793. // bind the context to callback.obj
  18794. continueChain = callback.func.apply(callback.obj, [evt]);
  18795. if (continueChain != undefined && continueChain === false) {
  18796. // if callback returns false, execute no more callbacks.
  18797. break;
  18798. }
  18799. }
  18800. // don't fall through to other DOM elements
  18801. if (!this.fallThrough) {
  18802. Event.stop(evt, true);
  18803. }
  18804. return continueChain;
  18805. }
  18806. /**
  18807. * @function Events.prototype.handleBrowserEvent
  18808. * @description 对 triggerEvent 函数的包装,给事件对象设置了 xy 属性(即当前鼠标点的 xy 坐标)。
  18809. * @param {Event} evt - 事件对象。
  18810. */
  18811. }, {
  18812. key: "handleBrowserEvent",
  18813. value: function handleBrowserEvent(evt) {
  18814. var type = evt.type,
  18815. listeners = this.listeners[type];
  18816. if (!listeners || listeners.length == 0) {
  18817. // noone's listening, bail out
  18818. return;
  18819. }
  18820. // add clientX & clientY to all events - corresponds to average x, y
  18821. var touches = evt.touches;
  18822. if (touches && touches[0]) {
  18823. var x = 0;
  18824. var y = 0;
  18825. var num = touches.length;
  18826. var touch;
  18827. for (var i = 0; i < num; ++i) {
  18828. touch = touches[i];
  18829. x += touch.clientX;
  18830. y += touch.clientY;
  18831. }
  18832. evt.clientX = x / num;
  18833. evt.clientY = y / num;
  18834. }
  18835. if (this.includeXY) {
  18836. evt.xy = this.getMousePosition(evt);
  18837. }
  18838. this.triggerEvent(type, evt);
  18839. }
  18840. /**
  18841. * @function Events.prototype.clearMouseCache
  18842. * @description 清除鼠标缓存。
  18843. */
  18844. }, {
  18845. key: "clearMouseCache",
  18846. value: function clearMouseCache() {
  18847. this.element.scrolls = null;
  18848. this.element.lefttop = null;
  18849. var body = document.body;
  18850. if (body && !((body.scrollTop != 0 || body.scrollLeft != 0) && navigator.userAgent.match(/iPhone/i))) {
  18851. this.element.offsets = null;
  18852. }
  18853. }
  18854. /**
  18855. * @function Events.prototype.getMousePosition
  18856. * @description 获取当前鼠标的位置。
  18857. * @param {Event} evt - 事件对象。
  18858. * @returns {Pixel} 当前的鼠标的 xy 坐标点。
  18859. */
  18860. }, {
  18861. key: "getMousePosition",
  18862. value: function getMousePosition(evt) {
  18863. if (!this.includeXY) {
  18864. this.clearMouseCache();
  18865. } else if (!this.element.hasScrollEvent) {
  18866. Event.observe(window, "scroll", this.clearMouseListener);
  18867. this.element.hasScrollEvent = true;
  18868. }
  18869. if (!this.element.scrolls) {
  18870. var viewportElement = Util_Util.getViewportElement();
  18871. this.element.scrolls = [viewportElement.scrollLeft, viewportElement.scrollTop];
  18872. }
  18873. if (!this.element.lefttop) {
  18874. this.element.lefttop = [document.documentElement.clientLeft || 0, document.documentElement.clientTop || 0];
  18875. }
  18876. if (!this.element.offsets) {
  18877. this.element.offsets = Util_Util.pagePosition(this.element);
  18878. }
  18879. 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]);
  18880. }
  18881. }]);
  18882. return Events;
  18883. }();
  18884. 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"];
  18885. ;// CONCATENATED MODULE: ./src/common/commontypes/Credential.js
  18886. function Credential_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  18887. 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); } }
  18888. function Credential_createClass(Constructor, protoProps, staticProps) { if (protoProps) Credential_defineProperties(Constructor.prototype, protoProps); if (staticProps) Credential_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  18889. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  18890. * This program are made available under the terms of the Apache License, Version 2.0
  18891. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  18892. /**
  18893. * @class Credential
  18894. * @deprecatedclass SuperMap.Credential
  18895. * @category Security
  18896. * @classdesc SuperMap 的安全证书类,其中包括 token 等安全验证信息。</br>
  18897. * 需要使用用户名和密码在:"http://localhost:8090/iserver/services/security/tokens" 下申请 value。</br>
  18898. * 获得形如:"2OMwGmcNlrP2ixqv1Mk4BuQMybOGfLOrljruX6VcYMDQKc58Sl9nMHsqQaqeBx44jRvKSjkmpZKK1L596y7skQ.." 的 value。</br>
  18899. * 目前支持的功能包括:地图服务、专题图、量算、查询、公交换乘、空间分析、网络分析,不支持轮询功能。</br>
  18900. * @param {string} value - 访问受安全限制的服务时用于通过安全认证的验证信息。
  18901. * @param {string} [name='token'] - 验证信息前缀,name=value 部分的 name 部分。
  18902. * @example
  18903. * var pixcel = new Credential("valueString","token");
  18904. * pixcel.destroy();
  18905. * @usage
  18906. */
  18907. var Credential = /*#__PURE__*/function () {
  18908. function Credential(value, name) {
  18909. Credential_classCallCheck(this, Credential);
  18910. /**
  18911. * @member {string} Credential.prototype.value
  18912. * @description 访问受安全限制的服务时用于通过安全认证的验证信息。
  18913. */
  18914. this.value = value ? value : "";
  18915. /**
  18916. * @member {string} [Credential.prototype.name='token']
  18917. * @description 验证信息前缀,name=value 部分的 name 部分。
  18918. */
  18919. this.name = name ? name : "token";
  18920. this.CLASS_NAME = "SuperMap.Credential";
  18921. }
  18922. /**
  18923. * @function Credential.prototype.getUrlParameters
  18924. * @description 获取 name=value 的表达式。
  18925. * @example
  18926. * var credential = new Credential("valueString","token");
  18927. * //这里 str = "token=valueString";
  18928. * var str = credential.getUrlParameters();
  18929. * @returns {string} 安全信息组成的 url 片段。
  18930. */
  18931. Credential_createClass(Credential, [{
  18932. key: "getUrlParameters",
  18933. value: function getUrlParameters() {
  18934. //当需要其他安全信息的时候,则需要return this.name + "=" + this.value + "&" + "...";的形式添加。
  18935. return this.name + "=" + this.value;
  18936. }
  18937. /**
  18938. * @function Credential.prototype.getValue
  18939. * @description 获取 value。
  18940. * @example
  18941. * var credential = new Credential("2OMwGmcNlrP2ixqv1Mk4BuQMybOGfLOrljruX6VcYMDQKc58Sl9nMHsqQaqeBx44jRvKSjkmpZKK1L596y7skQ..","token");
  18942. * //这里 str = "2OMwGmcNlrP2ixqv1Mk4BuQMybOGfLOrljruX6VcYMDQKc58Sl9nMHsqQaqeBx44jRvKSjkmpZKK1L596y7skQ..";
  18943. * var str = credential.getValue();
  18944. * @returns {string} value 字符串,在 iServer 服务下该 value 值即为 token 值。
  18945. */
  18946. }, {
  18947. key: "getValue",
  18948. value: function getValue() {
  18949. return this.value;
  18950. }
  18951. /**
  18952. *
  18953. * @function Credential.prototype.destroy
  18954. * @description 销毁此对象。销毁后此对象的所有属性为 null,而不是初始值。
  18955. * @example
  18956. * var credential = new Credential("valueString","token");
  18957. * credential.destroy();
  18958. */
  18959. }, {
  18960. key: "destroy",
  18961. value: function destroy() {
  18962. this.value = null;
  18963. this.name = null;
  18964. }
  18965. }]);
  18966. return Credential;
  18967. }();
  18968. /**
  18969. * @member {Credential} Credential.CREDENTIAL
  18970. * @description 这个对象保存一个安全类的实例,在服务端需要安全验证的时候必须进行设置。
  18971. * @example
  18972. * 代码实例:
  18973. * // 当iServer启用服务安全的时候,下边的代码是必须的。安全证书类能够接收一个value和一个name参数。
  18974. * var value = "(以iServer为例,这里是申请的token值)";
  18975. * var name = "token";
  18976. * // 默认name参数为token,所以当使用iServer服务的时候可以不进行设置。
  18977. * Credential.CREDENTIAL = new Credential(value, name);
  18978. *
  18979. */
  18980. Credential.CREDENTIAL = null;
  18981. ;// CONCATENATED MODULE: ./src/common/security/SecurityManager.js
  18982. function SecurityManager_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  18983. 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); } }
  18984. function SecurityManager_createClass(Constructor, protoProps, staticProps) { if (protoProps) SecurityManager_defineProperties(Constructor.prototype, protoProps); if (staticProps) SecurityManager_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  18985. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  18986. * This program are made available under the terms of the Apache License, Version 2.0
  18987. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  18988. /**
  18989. * @class SecurityManager
  18990. * @deprecatedclass SuperMap.SecurityManager
  18991. * @category Security
  18992. * @classdesc 安全管理中心,提供 iServer,iPortal,Online 统一权限认证管理。
  18993. * > 使用说明:
  18994. * > 创建任何一个服务之前调用 {@link SecurityManager.registerToken}或
  18995. * > {@link SecurityManager.registerKey}注册凭据。
  18996. * > 发送请求时根据 URL 或者服务 ID 获取相应的 key 或者 token 并自动添加到服务地址中。
  18997. * @usage
  18998. */
  18999. var SecurityManager = /*#__PURE__*/function () {
  19000. function SecurityManager() {
  19001. SecurityManager_classCallCheck(this, SecurityManager);
  19002. }
  19003. SecurityManager_createClass(SecurityManager, null, [{
  19004. key: "generateToken",
  19005. value:
  19006. /**
  19007. * @description 从服务器获取一个token,在此之前要注册服务器信息。
  19008. * @function SecurityManager.generateToken
  19009. * @param {string} url - 服务器域名+端口,如:http://localhost:8092。
  19010. * @param {TokenServiceParameter} tokenParam - token 申请参数。
  19011. * @returns {Promise} 包含 token 信息的 Promise 对象。
  19012. */
  19013. function generateToken(url, tokenParam) {
  19014. var serverInfo = this.servers[url];
  19015. if (!serverInfo) {
  19016. return;
  19017. }
  19018. return FetchRequest.post(serverInfo.tokenServiceUrl, JSON.stringify(tokenParam.toJSON())).then(function (response) {
  19019. return response.text();
  19020. });
  19021. }
  19022. /**
  19023. * @description 注册安全服务器相关信息。
  19024. * @function SecurityManager.registerServers
  19025. * @param {ServerInfo} serverInfos - 服务器信息。
  19026. */
  19027. }, {
  19028. key: "registerServers",
  19029. value: function registerServers(serverInfos) {
  19030. this.servers = this.servers || {};
  19031. if (!Util_Util.isArray(serverInfos)) {
  19032. serverInfos = [serverInfos];
  19033. }
  19034. for (var i = 0; i < serverInfos.length; i++) {
  19035. var serverInfo = serverInfos[i];
  19036. this.servers[serverInfo.server] = serverInfo;
  19037. }
  19038. }
  19039. /**
  19040. * @description 服务请求都会自动带上这个 token。
  19041. * @function SecurityManager.registerToken
  19042. * @param {string} url -服务器域名+端口:如http://localhost:8090。
  19043. * @param {string} token - token。
  19044. */
  19045. }, {
  19046. key: "registerToken",
  19047. value: function registerToken(url, token) {
  19048. this.tokens = this.tokens || {};
  19049. if (!url || !token) {
  19050. return;
  19051. }
  19052. var domain = this._getTokenStorageKey(url);
  19053. this.tokens[domain] = token;
  19054. }
  19055. /**
  19056. * @description 注册 key,ids 为数组(存在一个 key 对应多个服务)。
  19057. * @function SecurityManager.registerKey
  19058. * @param {Array} ids - 可以是服务 ID 数组或者 URL 地址数组或者 webAPI 类型数组。
  19059. * @param {string} key - key。
  19060. */
  19061. }, {
  19062. key: "registerKey",
  19063. value: function registerKey(ids, key) {
  19064. this.keys = this.keys || {};
  19065. if (!ids || ids.length < 1 || !key) {
  19066. return;
  19067. }
  19068. ids = Util_Util.isArray(ids) ? ids : [ids];
  19069. for (var i = 0; i < ids.length; i++) {
  19070. var id = this._getUrlRestString(ids[0]) || ids[0];
  19071. this.keys[id] = key;
  19072. }
  19073. }
  19074. /**
  19075. * @description 获取服务器信息。
  19076. * @function SecurityManager.getServerInfo
  19077. * @param {string} url - 服务器域名+端口,如:http://localhost:8092。
  19078. * @returns {ServerInfo} 服务器信息。
  19079. */
  19080. }, {
  19081. key: "getServerInfo",
  19082. value: function getServerInfo(url) {
  19083. this.servers = this.servers || {};
  19084. return this.servers[url];
  19085. }
  19086. /**
  19087. * @description 根据 URL 获取token。
  19088. * @function SecurityManager.getToken
  19089. * @param {string} url - 服务器域名+端口,如:http://localhost:8092。
  19090. * @returns {string} token。
  19091. */
  19092. }, {
  19093. key: "getToken",
  19094. value: function getToken(url) {
  19095. if (!url) {
  19096. return;
  19097. }
  19098. this.tokens = this.tokens || {};
  19099. var domain = this._getTokenStorageKey(url);
  19100. return this.tokens[domain];
  19101. }
  19102. /**
  19103. * @description 根据 URL 获取 key。
  19104. * @function SecurityManager.getKey
  19105. * @param {string} id - ID。
  19106. * @returns {string} key。
  19107. */
  19108. }, {
  19109. key: "getKey",
  19110. value: function getKey(id) {
  19111. this.keys = this.keys || {};
  19112. var key = this._getUrlRestString(id) || id;
  19113. return this.keys[key];
  19114. }
  19115. /**
  19116. * @description iServer 登录验证。
  19117. * @function SecurityManager.loginiServer
  19118. * @param {string} url - iServer 首页地址,如:http://localhost:8090/iserver。
  19119. * @param {string} username - 用户名。
  19120. * @param {string} password - 密码。
  19121. * @param {boolean} [rememberme=false] - 是否记住。
  19122. * @returns {Promise} 包含 iServer 登录请求结果的 Promise 对象。
  19123. */
  19124. }, {
  19125. key: "loginiServer",
  19126. value: function loginiServer(url, username, password, rememberme) {
  19127. url = Util_Util.urlPathAppend(url, 'services/security/login');
  19128. var loginInfo = {
  19129. username: username && username.toString(),
  19130. password: password && password.toString(),
  19131. rememberme: rememberme
  19132. };
  19133. loginInfo = JSON.stringify(loginInfo);
  19134. var requestOptions = {
  19135. headers: {
  19136. 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
  19137. }
  19138. };
  19139. return FetchRequest.post(url, loginInfo, requestOptions).then(function (response) {
  19140. return response.json();
  19141. });
  19142. }
  19143. /**
  19144. * @description iServer登出。
  19145. * @function SecurityManager.logoutiServer
  19146. * @param {string} url - iServer 首页地址,如:http://localhost:8090/iserver。
  19147. * @returns {Promise} 是否登出成功。
  19148. */
  19149. }, {
  19150. key: "logoutiServer",
  19151. value: function logoutiServer(url) {
  19152. url = Util_Util.urlPathAppend(url, 'services/security/logout');
  19153. var requestOptions = {
  19154. headers: {
  19155. 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
  19156. },
  19157. withoutFormatSuffix: true
  19158. };
  19159. return FetchRequest.get(url, '', requestOptions).then(function () {
  19160. return true;
  19161. })["catch"](function () {
  19162. return false;
  19163. });
  19164. }
  19165. /**
  19166. * @description Online 登录验证。
  19167. * @function SecurityManager.loginOnline
  19168. * @param {string} callbackLocation - 跳转位置。
  19169. * @param {boolean} [newTab=true] - 是否新窗口打开。
  19170. */
  19171. }, {
  19172. key: "loginOnline",
  19173. value: function loginOnline(callbackLocation, newTab) {
  19174. var loginUrl = SecurityManager.SSO + '/login?service=' + callbackLocation;
  19175. this._open(loginUrl, newTab);
  19176. }
  19177. /**
  19178. * @description iPortal登录验证。
  19179. * @function SecurityManager.loginiPortal
  19180. * @param {string} url - iportal 首页地址,如:http://localhost:8092/iportal。
  19181. * @param {string} username - 用户名。
  19182. * @param {string} password - 密码。
  19183. * @returns {Promise} 包含 iPortal 登录请求结果的 Promise 对象。
  19184. */
  19185. }, {
  19186. key: "loginiPortal",
  19187. value: function loginiPortal(url, username, password) {
  19188. url = Util_Util.urlPathAppend(url, 'web/login');
  19189. var loginInfo = {
  19190. username: username && username.toString(),
  19191. password: password && password.toString()
  19192. };
  19193. loginInfo = JSON.stringify(loginInfo);
  19194. var requestOptions = {
  19195. headers: {
  19196. 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
  19197. },
  19198. withCredentials: true
  19199. };
  19200. return FetchRequest.post(url, loginInfo, requestOptions).then(function (response) {
  19201. return response.json();
  19202. });
  19203. }
  19204. /**
  19205. * @description iPortal 登出。
  19206. * @function SecurityManager.logoutiPortal
  19207. * @param {string} url - iportal 首页地址,如:http://localhost:8092/iportal。
  19208. * @returns {Promise} 如果登出成功,返回 true;否则返回 false。
  19209. */
  19210. }, {
  19211. key: "logoutiPortal",
  19212. value: function logoutiPortal(url) {
  19213. url = Util_Util.urlPathAppend(url, 'services/security/logout');
  19214. var requestOptions = {
  19215. headers: {
  19216. 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
  19217. },
  19218. withCredentials: true,
  19219. withoutFormatSuffix: true
  19220. };
  19221. return FetchRequest.get(url, '', requestOptions).then(function () {
  19222. return true;
  19223. })["catch"](function () {
  19224. return false;
  19225. });
  19226. }
  19227. /**
  19228. * @description iManager 登录验证。
  19229. * @function SecurityManager.loginManager
  19230. * @param {string} url - iManager 地址。地址参数为 iManager 首页地址,如: http://localhost:8390/imanager。
  19231. * @param {Object} [loginInfoParams] - iManager 登录参数。
  19232. * @param {string} loginInfoParams.userName - 用户名。
  19233. * @param {string} loginInfoParams.password - 密码。
  19234. * @param {Object} options
  19235. * @param {boolean} [options.isNewTab=true] - 不同域时是否在新窗口打开登录页面。
  19236. * @returns {Promise} 包含 iManager 登录请求结果的 Promise 对象。
  19237. */
  19238. }, {
  19239. key: "loginManager",
  19240. value: function loginManager(url, loginInfoParams, options) {
  19241. if (!Util_Util.isInTheSameDomain(url)) {
  19242. var isNewTab = options ? options.isNewTab : true;
  19243. this._open(url, isNewTab);
  19244. return;
  19245. }
  19246. var requestUrl = Util_Util.urlPathAppend(url, 'icloud/security/tokens');
  19247. var params = loginInfoParams || {};
  19248. var loginInfo = {
  19249. username: params.userName && params.userName.toString(),
  19250. password: params.password && params.password.toString()
  19251. };
  19252. loginInfo = JSON.stringify(loginInfo);
  19253. var requestOptions = {
  19254. headers: {
  19255. Accept: '*/*',
  19256. 'Content-Type': 'application/json'
  19257. }
  19258. };
  19259. var me = this;
  19260. return FetchRequest.post(requestUrl, loginInfo, requestOptions).then(function (response) {
  19261. response.text().then(function (result) {
  19262. me.imanagerToken = result;
  19263. return result;
  19264. });
  19265. });
  19266. }
  19267. /**
  19268. * @description 清空全部验证信息。
  19269. * @function SecurityManager.destroyAllCredentials
  19270. */
  19271. }, {
  19272. key: "destroyAllCredentials",
  19273. value: function destroyAllCredentials() {
  19274. this.keys = null;
  19275. this.tokens = null;
  19276. this.servers = null;
  19277. }
  19278. /**
  19279. * @description 清空令牌信息。
  19280. * @function SecurityManager.destroyToken
  19281. * @param {string} url - iportal 首页地址,如:http://localhost:8092/iportal。
  19282. */
  19283. }, {
  19284. key: "destroyToken",
  19285. value: function destroyToken(url) {
  19286. if (!url) {
  19287. return;
  19288. }
  19289. var domain = this._getTokenStorageKey(url);
  19290. this.tokens = this.tokens || {};
  19291. if (this.tokens[domain]) {
  19292. delete this.tokens[domain];
  19293. }
  19294. }
  19295. /**
  19296. * @description 清空服务授权码。
  19297. * @function SecurityManager.destroyKey
  19298. * @param {string} url - iServer 首页地址,如:http://localhost:8090/iserver。
  19299. */
  19300. }, {
  19301. key: "destroyKey",
  19302. value: function destroyKey(url) {
  19303. if (!url) {
  19304. return;
  19305. }
  19306. this.keys = this.keys || {};
  19307. var key = this._getUrlRestString(url) || url;
  19308. if (this.keys[key]) {
  19309. delete this.keys[key];
  19310. }
  19311. }
  19312. /**
  19313. * @description 服务URL追加授权信息,授权信息需先通过SecurityManager.registerKey或SecurityManager.registerToken注册。
  19314. * @version 10.1.2
  19315. * @function SecurityManager.appendCredential
  19316. * @param {string} url - 服务URL。
  19317. * @returns {string} 绑定了token或者key的服务URL。
  19318. */
  19319. }, {
  19320. key: "appendCredential",
  19321. value: function appendCredential(url) {
  19322. var newUrl = url;
  19323. var value = this.getToken(url);
  19324. var credential = value ? new Credential(value, 'token') : null;
  19325. if (!credential) {
  19326. value = this.getKey(url);
  19327. credential = value ? new Credential(value, 'key') : null;
  19328. }
  19329. if (credential) {
  19330. newUrl = Util_Util.urlAppend(newUrl, credential.getUrlParameters());
  19331. }
  19332. return newUrl;
  19333. }
  19334. }, {
  19335. key: "_open",
  19336. value: function _open(url, newTab) {
  19337. newTab = newTab != null ? newTab : true;
  19338. var offsetX = window.screen.availWidth / 2 - this.INNER_WINDOW_WIDTH / 2;
  19339. var offsetY = window.screen.availHeight / 2 - this.INNER_WINDOW_HEIGHT / 2;
  19340. 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';
  19341. if (newTab) {
  19342. window.open(url, 'login');
  19343. } else {
  19344. window.open(url, 'login', options);
  19345. }
  19346. }
  19347. }, {
  19348. key: "_getTokenStorageKey",
  19349. value: function _getTokenStorageKey(url) {
  19350. var patten = /(.*?):\/\/([^\/]+)/i;
  19351. var result = url.match(patten);
  19352. if (!result) {
  19353. return url;
  19354. }
  19355. return result[0];
  19356. }
  19357. }, {
  19358. key: "_getUrlRestString",
  19359. value: function _getUrlRestString(url) {
  19360. if (!url) {
  19361. return url;
  19362. }
  19363. // var patten = /http:\/\/(.*\/rest)/i;
  19364. var patten = /(http|https):\/\/(.*\/rest)/i;
  19365. var result = url.match(patten);
  19366. if (!result) {
  19367. return url;
  19368. }
  19369. return result[0];
  19370. }
  19371. }]);
  19372. return SecurityManager;
  19373. }();
  19374. SecurityManager.INNER_WINDOW_WIDTH = 600;
  19375. SecurityManager.INNER_WINDOW_HEIGHT = 600;
  19376. SecurityManager.SSO = 'https://sso.supermap.com';
  19377. SecurityManager.ONLINE = 'https://www.supermapol.com';
  19378. ;// CONCATENATED MODULE: ./src/common/iServer/CommonServiceBase.js
  19379. function CommonServiceBase_typeof(obj) { "@babel/helpers - typeof"; return CommonServiceBase_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, CommonServiceBase_typeof(obj); }
  19380. function CommonServiceBase_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  19381. 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); } }
  19382. function CommonServiceBase_createClass(Constructor, protoProps, staticProps) { if (protoProps) CommonServiceBase_defineProperties(Constructor.prototype, protoProps); if (staticProps) CommonServiceBase_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  19383. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  19384. * This program are made available under the terms of the Apache License, Version 2.0
  19385. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  19386. /**
  19387. * @class CommonServiceBase
  19388. * @deprecatedclass SuperMap.CommonServiceBase
  19389. * @category iServer Core
  19390. * @classdesc 对接 iServer 各种服务的 Service 的基类。
  19391. * @param {string} url - 服务地址。
  19392. * @param {Object} options - 参数。
  19393. * @param {Object} options.eventListeners - 事件监听器对象。有 processCompleted 属性可传入处理完成后的回调函数。processFailed 属性传入处理失败后的回调函数。
  19394. * @param {string} [options.proxy] - 服务代理地址。
  19395. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  19396. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  19397. * @param {Object} [options.headers] - 请求头。
  19398. * @usage
  19399. */
  19400. var CommonServiceBase = /*#__PURE__*/function () {
  19401. function CommonServiceBase(url, options) {
  19402. CommonServiceBase_classCallCheck(this, CommonServiceBase);
  19403. var me = this;
  19404. this.EVENT_TYPES = ['processCompleted', 'processFailed'];
  19405. this.events = null;
  19406. this.eventListeners = null;
  19407. this.url = null;
  19408. this.urls = null;
  19409. this.proxy = null;
  19410. this.index = null;
  19411. this.length = null;
  19412. this.totalTimes = null;
  19413. this.POLLING_TIMES = 3;
  19414. this.isInTheSameDomain = null;
  19415. this.withCredentials = false;
  19416. if (Util_Util.isArray(url)) {
  19417. me.urls = url;
  19418. me.length = url.length;
  19419. me.totalTimes = me.length;
  19420. if (me.length === 1) {
  19421. me.url = url[0];
  19422. } else {
  19423. me.index = parseInt(Math.random() * me.length);
  19424. me.url = url[me.index];
  19425. }
  19426. } else {
  19427. me.totalTimes = 1;
  19428. me.url = url;
  19429. }
  19430. if (Util_Util.isArray(url) && !me.isServiceSupportPolling()) {
  19431. me.url = url[0];
  19432. me.totalTimes = 1;
  19433. }
  19434. options = options || {};
  19435. this.crossOrigin = options.crossOrigin;
  19436. this.headers = options.headers;
  19437. Util_Util.extend(this, options);
  19438. me.isInTheSameDomain = Util_Util.isInTheSameDomain(me.url);
  19439. me.events = new Events(me, null, me.EVENT_TYPES, true);
  19440. if (me.eventListeners instanceof Object) {
  19441. me.events.on(me.eventListeners);
  19442. }
  19443. this.CLASS_NAME = 'SuperMap.CommonServiceBase';
  19444. }
  19445. /**
  19446. * @function CommonServiceBase.prototype.destroy
  19447. * @description 释放资源,将引用的资源属性置空。
  19448. */
  19449. CommonServiceBase_createClass(CommonServiceBase, [{
  19450. key: "destroy",
  19451. value: function destroy() {
  19452. var me = this;
  19453. if (Util_Util.isArray(me.urls)) {
  19454. me.urls = null;
  19455. me.index = null;
  19456. me.length = null;
  19457. me.totalTimes = null;
  19458. }
  19459. me.url = null;
  19460. me._processSuccess = null;
  19461. me._processFailed = null;
  19462. me.isInTheSameDomain = null;
  19463. me.EVENT_TYPES = null;
  19464. if (me.events) {
  19465. me.events.destroy();
  19466. me.events = null;
  19467. }
  19468. if (me.eventListeners) {
  19469. me.eventListeners = null;
  19470. }
  19471. }
  19472. /**
  19473. * @function CommonServiceBase.prototype.request
  19474. * @description: 该方法用于向服务发送请求。
  19475. * @param {Object} options - 参数。
  19476. * @param {string} [options.method='GET'] - 请求方式,包括 "GET","POST","PUT","DELETE"。
  19477. * @param {string} [options.url] - 发送请求的地址。
  19478. * @param {Object} [options.params] - 作为查询字符串添加到 URL 中的一组键值对,此参数只适用于 GET 方式发送的请求。
  19479. * @param {string} [options.data] - 发送到服务器的数据。
  19480. * @param {function} options.success - 请求成功后的回调函数。
  19481. * @param {function} options.failure - 请求失败后的回调函数。
  19482. * @param {Object} [options.scope] - 如果回调函数是对象的一个公共方法,设定该对象的范围。
  19483. * @param {boolean} [options.isInTheSameDomain] - 请求是否在当前域中。
  19484. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  19485. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  19486. * @param {Object} [options.headers] - 请求头。
  19487. */
  19488. }, {
  19489. key: "request",
  19490. value: function request(options) {
  19491. var format = options.scope.format;
  19492. if (format && !this.supportDataFormat(format)) {
  19493. throw new Error("".concat(this.CLASS_NAME, " is not surport ").concat(format, " format!"));
  19494. }
  19495. var me = this;
  19496. options.url = options.url || me.url;
  19497. if (this._returnContent(options) && !options.url.includes('returnContent=true')) {
  19498. options.url = Util_Util.urlAppend(options.url, 'returnContent=true');
  19499. }
  19500. options.proxy = options.proxy || me.proxy;
  19501. options.withCredentials = options.withCredentials != undefined ? options.withCredentials : me.withCredentials;
  19502. options.crossOrigin = options.crossOrigin != undefined ? options.crossOrigin : me.crossOrigin;
  19503. options.headers = options.headers || me.headers;
  19504. options.isInTheSameDomain = me.isInTheSameDomain;
  19505. options.withoutFormatSuffix = options.scope.withoutFormatSuffix || false;
  19506. //为url添加安全认证信息片段
  19507. options.url = SecurityManager.appendCredential(options.url);
  19508. me.calculatePollingTimes();
  19509. options.scope = me;
  19510. var success = options.scope ? options.success.bind(options.scope) : options.success;
  19511. var failure = options.scope ? options.failure.bind(options.scope) : options.failure;
  19512. options.success = me.getUrlCompleted(success, options);
  19513. options.failure = me.getUrlFailed(failure, options);
  19514. me._commit(options);
  19515. }
  19516. /**
  19517. * @function CommonServiceBase.prototype.getUrlCompleted
  19518. * @description 请求成功后执行此方法。
  19519. * @param {Object} cb - 成功回调函数。
  19520. * @param {Object} options - 请求参数对象。
  19521. * @private
  19522. */
  19523. }, {
  19524. key: "getUrlCompleted",
  19525. value: function getUrlCompleted(cb, options) {
  19526. // @param {Object} result - 服务器返回的结果对象。
  19527. return function (result) {
  19528. cb && cb(result, options);
  19529. };
  19530. }
  19531. /**
  19532. * @function CommonServiceBase.prototype.getUrlFailed
  19533. * @description 请求失败后执行此方法。
  19534. * @param {Object} cb - 失败回调函数。
  19535. * @param {Object} options - 请求参数对象。
  19536. * @private
  19537. */
  19538. }, {
  19539. key: "getUrlFailed",
  19540. value: function getUrlFailed(cb, options) {
  19541. var me = this;
  19542. // @param {Object} result - 服务器返回的结果对象。
  19543. return function (result) {
  19544. if (me.totalTimes > 0) {
  19545. me.totalTimes--;
  19546. me.ajaxPolling(options);
  19547. } else {
  19548. cb && cb(result, options);
  19549. }
  19550. };
  19551. }
  19552. /**
  19553. *
  19554. * @function CommonServiceBase.prototype.ajaxPolling
  19555. * @description 请求失败后,如果剩余请求失败次数不为 0,重新获取 URL 发送请求。
  19556. * @param {Object} options - 请求参数对象。
  19557. * @private
  19558. */
  19559. }, {
  19560. key: "ajaxPolling",
  19561. value: function ajaxPolling(options) {
  19562. var me = this,
  19563. url = options.url,
  19564. re = /^http:\/\/([a-z]{9}|(\d+\.){3}\d+):\d{0,4}/;
  19565. me.index = parseInt(Math.random() * me.length);
  19566. me.url = me.urls[me.index];
  19567. url = url.replace(re, re.exec(me.url)[0]);
  19568. options.url = url;
  19569. options.isInTheSameDomain = Util_Util.isInTheSameDomain(url);
  19570. me._commit(options);
  19571. }
  19572. /**
  19573. * @function CommonServiceBase.prototype.calculatePollingTimes
  19574. * @description 计算剩余请求失败执行次数。
  19575. */
  19576. }, {
  19577. key: "calculatePollingTimes",
  19578. value: function calculatePollingTimes() {
  19579. var me = this;
  19580. if (me.times) {
  19581. if (me.totalTimes > me.POLLING_TIMES) {
  19582. if (me.times > me.POLLING_TIMES) {
  19583. me.totalTimes = me.POLLING_TIMES;
  19584. } else {
  19585. me.totalTimes = me.times;
  19586. }
  19587. } else {
  19588. if (me.times < me.totalTimes) {
  19589. me.totalTimes = me.times;
  19590. }
  19591. }
  19592. } else {
  19593. if (me.totalTimes > me.POLLING_TIMES) {
  19594. me.totalTimes = me.POLLING_TIMES;
  19595. }
  19596. }
  19597. me.totalTimes--;
  19598. }
  19599. /**
  19600. * @function CommonServiceBase.prototype.isServiceSupportPolling
  19601. * @description 判断服务是否支持轮询。
  19602. */
  19603. }, {
  19604. key: "isServiceSupportPolling",
  19605. value: function isServiceSupportPolling() {
  19606. var me = this;
  19607. return !(me.CLASS_NAME === 'SuperMap.REST.ThemeService' || me.CLASS_NAME === 'SuperMap.REST.EditFeaturesService');
  19608. }
  19609. /**
  19610. * @function CommonServiceBase.prototype.serviceProcessCompleted
  19611. * @description 状态完成,执行此方法。
  19612. * @param {Object} result - 服务器返回的结果对象。
  19613. * @param {Object} options - 请求参数对象。
  19614. * @private
  19615. */
  19616. }, {
  19617. key: "serviceProcessCompleted",
  19618. value: function serviceProcessCompleted(result, options) {
  19619. result = Util_Util.transformResult(result);
  19620. this.events.triggerEvent('processCompleted', {
  19621. result: result,
  19622. options: options
  19623. });
  19624. }
  19625. /**
  19626. * @function CommonServiceBase.prototype.serviceProcessFailed
  19627. * @description 状态失败,执行此方法。
  19628. * @param {Object} result - 服务器返回的结果对象。
  19629. * @param {Object} options - 请求参数对象。对象
  19630. * @private
  19631. */
  19632. }, {
  19633. key: "serviceProcessFailed",
  19634. value: function serviceProcessFailed(result, options) {
  19635. result = Util_Util.transformResult(result);
  19636. var error = result.error || result;
  19637. this.events.triggerEvent('processFailed', {
  19638. error: error,
  19639. options: options
  19640. });
  19641. }
  19642. }, {
  19643. key: "_returnContent",
  19644. value: function _returnContent(options) {
  19645. if (options.scope.format === DataFormat.FGB) {
  19646. return false;
  19647. }
  19648. if (options.scope.returnContent) {
  19649. return true;
  19650. }
  19651. return false;
  19652. }
  19653. }, {
  19654. key: "supportDataFormat",
  19655. value: function supportDataFormat(foramt) {
  19656. return this.dataFormat().includes(foramt);
  19657. }
  19658. }, {
  19659. key: "dataFormat",
  19660. value: function dataFormat() {
  19661. return [DataFormat.GEOJSON, DataFormat.ISERVER];
  19662. }
  19663. }, {
  19664. key: "_commit",
  19665. value: function _commit(options) {
  19666. if (options.method === 'POST' || options.method === 'PUT' || options.method === 'PATCH') {
  19667. if (options.params) {
  19668. options.url = Util_Util.urlAppend(options.url, Util_Util.getParameterString(options.params || {}));
  19669. }
  19670. if (CommonServiceBase_typeof(options.data) === 'object') {
  19671. try {
  19672. options.params = Util_Util.toJSON(options.data);
  19673. } catch (e) {
  19674. console.log('不是json对象');
  19675. }
  19676. } else {
  19677. options.params = options.data;
  19678. }
  19679. }
  19680. FetchRequest.commit(options.method, options.url, options.params, {
  19681. headers: options.headers,
  19682. withoutFormatSuffix: options.withoutFormatSuffix,
  19683. withCredentials: options.withCredentials,
  19684. crossOrigin: options.crossOrigin,
  19685. timeout: options.async ? 0 : null,
  19686. proxy: options.proxy
  19687. }).then(function (response) {
  19688. if (response.text) {
  19689. return response.text();
  19690. }
  19691. if (response.json) {
  19692. return response.json();
  19693. }
  19694. return response;
  19695. }).then(function (text) {
  19696. var requestResult = text;
  19697. if (typeof text === 'string') {
  19698. requestResult = new JSONFormat().read(text);
  19699. }
  19700. if (!requestResult || requestResult.error || requestResult.code >= 300 && requestResult.code !== 304) {
  19701. if (requestResult && requestResult.error) {
  19702. requestResult = {
  19703. error: requestResult.error
  19704. };
  19705. } else {
  19706. requestResult = {
  19707. error: requestResult
  19708. };
  19709. }
  19710. }
  19711. if (requestResult && options.scope.format === DataFormat.FGB) {
  19712. requestResult.newResourceLocation = requestResult.newResourceLocation.replace('.json', '') + '.fgb';
  19713. }
  19714. return requestResult;
  19715. })["catch"](function (e) {
  19716. return {
  19717. error: e
  19718. };
  19719. }).then(function (requestResult) {
  19720. if (requestResult.error) {
  19721. var failure = options.scope ? FunctionExt.bind(options.failure, options.scope) : options.failure;
  19722. failure(requestResult);
  19723. } else {
  19724. requestResult.succeed = requestResult.succeed == undefined ? true : requestResult.succeed;
  19725. var success = options.scope ? FunctionExt.bind(options.success, options.scope) : options.success;
  19726. success(requestResult);
  19727. }
  19728. });
  19729. }
  19730. }]);
  19731. return CommonServiceBase;
  19732. }();
  19733. /**
  19734. * 服务器请求回调函数。
  19735. * @callback RequestCallback
  19736. * @category BaseTypes Util
  19737. * @example
  19738. * var requestCallback = function (serviceResult){
  19739. * console.log(serviceResult.result);
  19740. * }
  19741. * new QueryService(url).queryByBounds(param, requestCallback);
  19742. * @param {Object} serviceResult
  19743. * @param {Object} serviceResult.result 服务器返回结果。
  19744. * @param {Object} serviceResult.object 发布应用程序事件的对象。
  19745. * @param {Object} serviceResult.type 事件类型。
  19746. * @param {Object} serviceResult.element 接受浏览器事件的 DOM 节点。
  19747. * @param {Object} serviceResult.options 请求参数。
  19748. */
  19749. ;// CONCATENATED MODULE: ./src/common/iServer/GeoCodingParameter.js
  19750. function GeoCodingParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  19751. 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); } }
  19752. function GeoCodingParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) GeoCodingParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) GeoCodingParameter_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  19753. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  19754. * This program are made available under the terms of the Apache License, Version 2.0
  19755. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  19756. /**
  19757. * @class GeoCodingParameter
  19758. * @deprecatedclass SuperMap.GeoCodingParameter
  19759. * @category iServer AddressMatch
  19760. * @classdesc 地理正向匹配参数类。
  19761. * @param {Object} options - 参数。
  19762. * @param {string} options.address - 地点关键词。
  19763. * @param {number} [options.fromIndex] - 设置返回对象的起始索引值。
  19764. * @param {number} [options.toIndex] - 设置返回对象的结束索引值。
  19765. * @param {Array.<string>} [options.filters] - 过滤字段,限定查询区域。
  19766. * @param {string} [options.prjCoordSys] - 查询结果的坐标系。
  19767. * @param {number} [options.maxReturn] - 最大返回结果数。
  19768. * @usage
  19769. */
  19770. var GeoCodingParameter = /*#__PURE__*/function () {
  19771. function GeoCodingParameter(options) {
  19772. GeoCodingParameter_classCallCheck(this, GeoCodingParameter);
  19773. if (options.filters && typeof options.filters === 'string') {
  19774. options.filters = options.filters.split(',');
  19775. }
  19776. /**
  19777. * @member {string} GeoCodingParameter.prototype.address
  19778. * @description 地点关键词。
  19779. */
  19780. this.address = null;
  19781. /**
  19782. * @member {number} [GeoCodingParameter.prototype.fromIndex]
  19783. * @description 设置返回对象的起始索引值。
  19784. */
  19785. this.fromIndex = null;
  19786. /**
  19787. * @member {number} [GeoCodingParameter.prototype.toIndex]
  19788. * @description 设置返回对象的结束索引值。
  19789. */
  19790. this.toIndex = null;
  19791. /**
  19792. * @member {Array.<string>} [GeoCodingParameter.prototype.filters]
  19793. * @description 过滤字段,限定查询区域。
  19794. */
  19795. this.filters = null;
  19796. /**
  19797. * @member {string} [GeoCodingParameter.prototype.prjCoordSys]
  19798. * @description 查询结果的坐标系。
  19799. */
  19800. this.prjCoordSys = null;
  19801. /**
  19802. * @member {number} [GeoCodingParameter.prototype.maxReturn]
  19803. * @description 最大返回结果数。
  19804. */
  19805. this.maxReturn = null;
  19806. Util_Util.extend(this, options);
  19807. }
  19808. /**
  19809. * @function GeoCodingParameter.prototype.destroy
  19810. * @description 释放资源,将引用资源的属性置空。
  19811. */
  19812. GeoCodingParameter_createClass(GeoCodingParameter, [{
  19813. key: "destroy",
  19814. value: function destroy() {
  19815. this.address = null;
  19816. this.fromIndex = null;
  19817. this.toIndex = null;
  19818. this.filters = null;
  19819. this.prjCoordSys = null;
  19820. this.maxReturn = null;
  19821. }
  19822. }]);
  19823. return GeoCodingParameter;
  19824. }();
  19825. ;// CONCATENATED MODULE: ./src/common/iServer/GeoDecodingParameter.js
  19826. function GeoDecodingParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  19827. 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); } }
  19828. function GeoDecodingParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) GeoDecodingParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) GeoDecodingParameter_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  19829. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  19830. * This program are made available under the terms of the Apache License, Version 2.0
  19831. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  19832. /**
  19833. * @class GeoDecodingParameter
  19834. * @deprecatedclass SuperMap.GeoDecodingParameter
  19835. * @category iServer AddressMatch
  19836. * @classdesc 地理反向匹配参数类。
  19837. * @param {Object} options - 参数。
  19838. * @param {number} options.x - 查询位置的横坐标。
  19839. * @param {number} options.y - 查询位置的纵坐标。
  19840. * @param {number} [options.fromIndex] - 设置返回对象的起始索引值。
  19841. * @param {number} [options.toIndex] - 设置返回对象的结束索引值。
  19842. * @param {Array.<string>} [options.filters] - 过滤字段,限定查询区域。
  19843. * @param {string} [options.prjCoordSys] - 查询结果的坐标系。
  19844. * @param {number} [options.maxReturn] - 最大返回结果数。
  19845. * @param {number} [options.geoDecodingRadius] - 查询半径。
  19846. * @usage
  19847. */
  19848. var GeoDecodingParameter = /*#__PURE__*/function () {
  19849. function GeoDecodingParameter(options) {
  19850. GeoDecodingParameter_classCallCheck(this, GeoDecodingParameter);
  19851. if (options.filters) {
  19852. options.filters = options.filters.split(',');
  19853. }
  19854. /**
  19855. * @member {number} GeoDecodingParameter.prototype.x
  19856. * @description 查询位置的横坐标。
  19857. */
  19858. this.x = null;
  19859. /**
  19860. * @member {number} GeoDecodingParameter.prototype.y
  19861. * @description 查询位置的纵坐标。
  19862. */
  19863. this.y = null;
  19864. /**
  19865. * @member {number} [GeoDecodingParameter.prototype.fromIndex]
  19866. * @description 设置返回对象的起始索引值。
  19867. */
  19868. this.fromIndex = null;
  19869. /**
  19870. * @member {number} [GeoDecodingParameter.prototype.toIndex]
  19871. * @description 设置返回对象的结束索引值。
  19872. */
  19873. this.toIndex = null;
  19874. /**
  19875. * @member {Array.<string>} [GeoDecodingParameter.prototype.filters]
  19876. * @description 过滤字段,限定查询区域。
  19877. */
  19878. this.filters = null;
  19879. /**
  19880. * @member {string} [GeoDecodingParameter.prototype.prjCoordSys]
  19881. * @description 查询结果的坐标系。
  19882. */
  19883. this.prjCoordSys = null;
  19884. /**
  19885. * @member {number} [GeoDecodingParameter.prototype.maxReturn]
  19886. * @description 最大返回结果数。
  19887. */
  19888. this.maxReturn = null;
  19889. /**
  19890. * @member {number} GeoDecodingParameter.prototype.geoDecodingRadius
  19891. * @description 查询半径。
  19892. */
  19893. this.geoDecodingRadius = null;
  19894. Util_Util.extend(this, options);
  19895. }
  19896. /**
  19897. * @function GeoDecodingParameter.prototype.destroy
  19898. * @description 释放资源,将引用资源的属性置空。
  19899. */
  19900. GeoDecodingParameter_createClass(GeoDecodingParameter, [{
  19901. key: "destroy",
  19902. value: function destroy() {
  19903. this.x = null;
  19904. this.y = null;
  19905. this.fromIndex = null;
  19906. this.toIndex = null;
  19907. this.filters = null;
  19908. this.prjCoordSys = null;
  19909. this.maxReturn = null;
  19910. this.geoDecodingRadius = null;
  19911. }
  19912. }]);
  19913. return GeoDecodingParameter;
  19914. }();
  19915. ;// CONCATENATED MODULE: ./src/common/iServer/AddressMatchService.js
  19916. function AddressMatchService_typeof(obj) { "@babel/helpers - typeof"; return AddressMatchService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, AddressMatchService_typeof(obj); }
  19917. function AddressMatchService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  19918. 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); } }
  19919. function AddressMatchService_createClass(Constructor, protoProps, staticProps) { if (protoProps) AddressMatchService_defineProperties(Constructor.prototype, protoProps); if (staticProps) AddressMatchService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  19920. function AddressMatchService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { AddressMatchService_get = Reflect.get.bind(); } else { AddressMatchService_get = function _get(target, property, receiver) { var base = AddressMatchService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return AddressMatchService_get.apply(this, arguments); }
  19921. function AddressMatchService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = AddressMatchService_getPrototypeOf(object); if (object === null) break; } return object; }
  19922. function AddressMatchService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) AddressMatchService_setPrototypeOf(subClass, superClass); }
  19923. function AddressMatchService_setPrototypeOf(o, p) { AddressMatchService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return AddressMatchService_setPrototypeOf(o, p); }
  19924. 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); }; }
  19925. function AddressMatchService_possibleConstructorReturn(self, call) { if (call && (AddressMatchService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return AddressMatchService_assertThisInitialized(self); }
  19926. function AddressMatchService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  19927. function AddressMatchService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  19928. function AddressMatchService_getPrototypeOf(o) { AddressMatchService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return AddressMatchService_getPrototypeOf(o); }
  19929. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  19930. * This program are made available under the terms of the Apache License, Version 2.0
  19931. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  19932. /**
  19933. * @class AddressMatchService
  19934. * @deprecatedclass SuperMap.AddressMatchService
  19935. * @category iServer AddressMatch
  19936. * @classdesc 地址匹配服务,包括正向匹配和反向匹配。
  19937. * @param {string} url - 服务地址。
  19938. * @param {Object} options - 可选参数。
  19939. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  19940. * @param {Object} [options.headers] - 请求头。
  19941. * @usage
  19942. */
  19943. var AddressMatchService_AddressMatchService = /*#__PURE__*/function (_CommonServiceBase) {
  19944. AddressMatchService_inherits(AddressMatchService, _CommonServiceBase);
  19945. var _super = AddressMatchService_createSuper(AddressMatchService);
  19946. function AddressMatchService(url, options) {
  19947. var _this;
  19948. AddressMatchService_classCallCheck(this, AddressMatchService);
  19949. _this = _super.call(this, url, options);
  19950. _this.options = options || {};
  19951. _this.eventCount = 0;
  19952. _this.CLASS_NAME = 'SuperMap.AddressMatchService';
  19953. return _this;
  19954. }
  19955. /**
  19956. * @function AddressMatchService.prototype.destroy
  19957. * @override
  19958. */
  19959. AddressMatchService_createClass(AddressMatchService, [{
  19960. key: "destroy",
  19961. value: function destroy() {
  19962. AddressMatchService_get(AddressMatchService_getPrototypeOf(AddressMatchService.prototype), "destroy", this).call(this);
  19963. }
  19964. /**
  19965. * @function AddressMatchService.prototype.code
  19966. * @param {string} url - 正向地址匹配服务地址。
  19967. * @param {GeoCodingParameter} params - 正向地址匹配服务参数。
  19968. */
  19969. }, {
  19970. key: "code",
  19971. value: function code(url, params, callback) {
  19972. if (!(params instanceof GeoCodingParameter)) {
  19973. return;
  19974. }
  19975. this.processAsync(url, params, callback);
  19976. }
  19977. /**
  19978. * @function AddressMatchService.prototype.decode
  19979. * @param {string} url - 反向地址匹配服务地址。
  19980. * @param {GeoDecodingParameter} params - 反向地址匹配服务参数。
  19981. */
  19982. }, {
  19983. key: "decode",
  19984. value: function decode(url, params, callback) {
  19985. if (!(params instanceof GeoDecodingParameter)) {
  19986. return;
  19987. }
  19988. this.processAsync(url, params, callback);
  19989. }
  19990. /**
  19991. * @function AddressMatchService.prototype.processAsync
  19992. * @description 负责将客户端的动态分段服务参数传递到服务端。
  19993. * @param {string} url - 服务地址。
  19994. * @param {Object} params - 参数。
  19995. */
  19996. }, {
  19997. key: "processAsync",
  19998. value: function processAsync(url, params, callback) {
  19999. var eventId = ++this.eventCount;
  20000. var eventListeners = {
  20001. scope: this,
  20002. processCompleted: function processCompleted(result) {
  20003. if (eventId === result.result.eventId && callback) {
  20004. delete result.result.eventId;
  20005. callback(result);
  20006. this.events && this.events.un(eventListeners);
  20007. return false;
  20008. }
  20009. },
  20010. processFailed: function processFailed(result) {
  20011. if ((eventId === result.error.eventId || eventId === result.eventId) && callback) {
  20012. callback(result);
  20013. this.events && this.events.un(eventListeners);
  20014. return false;
  20015. }
  20016. }
  20017. };
  20018. this.events.on(eventListeners);
  20019. this.request({
  20020. method: 'GET',
  20021. url: url,
  20022. params: params,
  20023. scope: this,
  20024. success: function success(result, options) {
  20025. result.eventId = eventId;
  20026. this.serviceProcessCompleted(result, options);
  20027. },
  20028. failure: function failure(result, options) {
  20029. if (result.error) {
  20030. result.error.eventId = eventId;
  20031. }
  20032. result.eventId = eventId;
  20033. this.serviceProcessFailed(result, options);
  20034. }
  20035. });
  20036. }
  20037. /**
  20038. * @function AddressMatchService.prototype.serviceProcessCompleted
  20039. * @param {Object} result - 服务器返回的结果对象。
  20040. * @description 服务流程是否完成
  20041. */
  20042. }, {
  20043. key: "serviceProcessCompleted",
  20044. value: function serviceProcessCompleted(result, options) {
  20045. if (result.succeed) {
  20046. delete result.succeed;
  20047. }
  20048. AddressMatchService_get(AddressMatchService_getPrototypeOf(AddressMatchService.prototype), "serviceProcessCompleted", this).call(this, result, options);
  20049. }
  20050. /**
  20051. * @function AddressMatchService.prototype.serviceProcessCompleted
  20052. * @param {Object} result - 服务器返回的结果对象。
  20053. * @description 服务流程是否失败
  20054. */
  20055. }, {
  20056. key: "serviceProcessFailed",
  20057. value: function serviceProcessFailed(result, options) {
  20058. AddressMatchService_get(AddressMatchService_getPrototypeOf(AddressMatchService.prototype), "serviceProcessFailed", this).call(this, result, options);
  20059. }
  20060. }]);
  20061. return AddressMatchService;
  20062. }(CommonServiceBase);
  20063. ;// CONCATENATED MODULE: ./src/maplibregl/services/AddressMatchService.js
  20064. function services_AddressMatchService_typeof(obj) { "@babel/helpers - typeof"; return services_AddressMatchService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, services_AddressMatchService_typeof(obj); }
  20065. function services_AddressMatchService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  20066. 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); } }
  20067. function services_AddressMatchService_createClass(Constructor, protoProps, staticProps) { if (protoProps) services_AddressMatchService_defineProperties(Constructor.prototype, protoProps); if (staticProps) services_AddressMatchService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  20068. function services_AddressMatchService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) services_AddressMatchService_setPrototypeOf(subClass, superClass); }
  20069. function services_AddressMatchService_setPrototypeOf(o, p) { services_AddressMatchService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return services_AddressMatchService_setPrototypeOf(o, p); }
  20070. 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); }; }
  20071. function services_AddressMatchService_possibleConstructorReturn(self, call) { if (call && (services_AddressMatchService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return services_AddressMatchService_assertThisInitialized(self); }
  20072. function services_AddressMatchService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  20073. function services_AddressMatchService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  20074. function services_AddressMatchService_getPrototypeOf(o) { services_AddressMatchService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return services_AddressMatchService_getPrototypeOf(o); }
  20075. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  20076. * This program are made available under the terms of the Apache License, Version 2.0
  20077. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  20078. /**
  20079. * @class AddressMatchService
  20080. * @category iServer AddressMatch
  20081. * @classdesc 地址匹配服务类。
  20082. * @version 11.1.0
  20083. * @modulecategory Services
  20084. * @example
  20085. * new AddressMatchService(url,options)
  20086. * .code(function(result){
  20087. * //doSomething
  20088. * })
  20089. * @param {string} url - 服务地址。
  20090. * @param {Object} options - 参数。
  20091. * @param {string} [options.proxy] - 服务代理地址。
  20092. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  20093. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  20094. * @param {Object} [options.headers] - 请求头。
  20095. * @extends {ServiceBase}
  20096. * @usage
  20097. */
  20098. var AddressMatchService = /*#__PURE__*/function (_ServiceBase) {
  20099. services_AddressMatchService_inherits(AddressMatchService, _ServiceBase);
  20100. var _super = services_AddressMatchService_createSuper(AddressMatchService);
  20101. function AddressMatchService(url, options) {
  20102. var _this;
  20103. services_AddressMatchService_classCallCheck(this, AddressMatchService);
  20104. _this = _super.call(this, url, options);
  20105. _this._addressMatchService = new AddressMatchService_AddressMatchService(url, options);
  20106. return _this;
  20107. }
  20108. /**
  20109. * @function AddressMatchService.prototype.code
  20110. * @description 获取正向地址匹配结果。
  20111. * @param {GeoCodingParameter} params - 正向匹配参数。
  20112. * @param {RequestCallback} callback - 回调函数。
  20113. */
  20114. services_AddressMatchService_createClass(AddressMatchService, [{
  20115. key: "code",
  20116. value: function code(params, callback) {
  20117. this._addressMatchService.code(Util_Util.urlPathAppend(this.url, 'geocoding'), params, callback);
  20118. }
  20119. /**
  20120. * @function AddressMatchService.prototype.decode
  20121. * @description 获取反向地址匹配结果。
  20122. * @param {GeoDecodingParameter} params -反向匹配参数。
  20123. * @param {RequestCallback} callback - 回调函数。
  20124. */
  20125. }, {
  20126. key: "decode",
  20127. value: function decode(params, callback) {
  20128. this._addressMatchService.decode(Util_Util.urlPathAppend(this.url, 'geodecoding'), params, callback);
  20129. }
  20130. }]);
  20131. return AddressMatchService;
  20132. }(ServiceBase);
  20133. ;// CONCATENATED MODULE: ./src/common/iServer/QueryParameters.js
  20134. function QueryParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  20135. function QueryParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  20136. function QueryParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) QueryParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) QueryParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  20137. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  20138. * This program are made available under the terms of the Apache License, Version 2.0
  20139. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  20140. /**
  20141. * @class QueryParameters
  20142. * @deprecatedclass SuperMap.QueryParameters
  20143. * @category iServer Map QueryResults
  20144. * @classdesc 查询参数基类。距离查询、SQL 查询、几何地物查询等各自的参数均继承此类。
  20145. * @param {Object} options - 参数。
  20146. * @param {Array.<FilterParameter>} options.queryParams - 查询过滤条件参数数组。
  20147. * @param {string} [options.customParams] - 自定义参数,供扩展使用。
  20148. * @param {Object} [options.prjCoordSys] - 自定义参数,供 SuperMap Online 提供的动态投影查询扩展使用。如 {"epsgCode":3857}。
  20149. * @param {number} [options.expectCount=100000] - 期望返回结果记录个数。
  20150. * @param {GeometryType} [options.networkType=GeometryType.LINE] - 网络数据集对应的查询类型。
  20151. * @param {QueryOption} [options.queryOption=QueryOption.ATTRIBUTEANDGEOMETRY] - 查询结果类型枚举类。
  20152. * @param {number} [options.startRecord=0] - 查询起始记录号。
  20153. * @param {number} [options.holdTime=10] - 资源在服务端保存的时间,单位为分钟。
  20154. * @param {boolean} [options.returnCustomResult=false] - 仅供三维使用。
  20155. * @param {boolean} [options.returnFeatureWithFieldCaption = false] - 返回的查询结果要素字段标识是否为字段别名。为 false 时,返回的是字段名;为 true 时,返回的是字段别名。
  20156. * @usage
  20157. */
  20158. var QueryParameters = /*#__PURE__*/function () {
  20159. function QueryParameters(options) {
  20160. QueryParameters_classCallCheck(this, QueryParameters);
  20161. if (!options) {
  20162. return;
  20163. }
  20164. /**
  20165. * @member {string} [QueryParameters.prototype.customParams]
  20166. * @description 自定义参数,供扩展使用。
  20167. */
  20168. this.customParams = null;
  20169. /**
  20170. * @member {Object} [QueryParameters.prototype.prjCoordSys]
  20171. * @description 自定义参数,供 SuperMap Online 提供的动态投影查询扩展使用。如 {"epsgCode":3857}
  20172. */
  20173. this.prjCoordSys = null;
  20174. /**
  20175. * @member {number} [QueryParameters.prototype.expectCount=100000]
  20176. * @description 期望返回结果记录个数,默认返回100000条查询记录,
  20177. * 如果实际不足100000条则返回实际记录条数。
  20178. */
  20179. this.expectCount = 100000;
  20180. /**
  20181. * @member {GeometryType} [QueryParameters.prototype.networkType=GeometryType.LINE]
  20182. * @description 网络数据集对应的查询类型,分为点和线两种类型。
  20183. */
  20184. this.networkType = REST_GeometryType.LINE;
  20185. /**
  20186. * @member {QueryOption} [QueryParameters.prototype.queryOption=QueryOption.ATTRIBUTEANDGEOMETRY]
  20187. * @description 查询结果类型枚举类。
  20188. * 该类描述查询结果返回类型,包括只返回属性、
  20189. * 只返回几何实体以及返回属性和几何实体。
  20190. */
  20191. this.queryOption = QueryOption.ATTRIBUTEANDGEOMETRY;
  20192. /**
  20193. * @member {Array.<FilterParameter>} QueryParameters.prototype.queryParams
  20194. * @description 查询过滤条件参数数组。
  20195. * 该类用于设置查询数据集的查询过滤参数。
  20196. */
  20197. this.queryParams = null;
  20198. /**
  20199. * @member {number} [QueryParameters.prototype.startRecord=0]
  20200. * @description 查询起始记录号。
  20201. */
  20202. this.startRecord = 0;
  20203. /**
  20204. * @member {number} [QueryParameters.prototype.holdTime=10]
  20205. * @description 资源在服务端保存的时间,单位为分钟。
  20206. */
  20207. this.holdTime = 10;
  20208. /**
  20209. * @member {boolean} [QueryParameters.prototype.returnCustomResult=false]
  20210. * @description 仅供三维使用。
  20211. */
  20212. this.returnCustomResult = false;
  20213. /**
  20214. * @member {boolean} [QueryParameters.prototype.returnFeatureWithFieldCaption=false]
  20215. * @description 返回的查询结果要素字段标识是否为字段别名。为 false 时,返回的是字段名;为 true 时,返回的是字段别名。
  20216. */
  20217. this.returnFeatureWithFieldCaption = false;
  20218. Util_Util.extend(this, options);
  20219. this.CLASS_NAME = "SuperMap.QueryParameters";
  20220. }
  20221. /**
  20222. * @function QueryParameters.prototype.destroy
  20223. * @description 释放资源,将引用资源的属性置空。
  20224. */
  20225. QueryParameters_createClass(QueryParameters, [{
  20226. key: "destroy",
  20227. value: function destroy() {
  20228. var me = this;
  20229. me.customParams = null;
  20230. me.expectCount = null;
  20231. me.networkType = null;
  20232. me.queryOption = null;
  20233. if (me.queryParams) {
  20234. for (var i = 0, qps = me.queryParams, len = qps.length; i < len; i++) {
  20235. qps[i].destroy();
  20236. }
  20237. me.queryParams = null;
  20238. }
  20239. me.startRecord = null;
  20240. me.holdTime = null;
  20241. me.returnCustomResult = null;
  20242. me.prjCoordSys = null;
  20243. }
  20244. }]);
  20245. return QueryParameters;
  20246. }();
  20247. ;// CONCATENATED MODULE: ./src/common/iServer/ChartQueryFilterParameter.js
  20248. function ChartQueryFilterParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  20249. function ChartQueryFilterParameter_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  20250. function ChartQueryFilterParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) ChartQueryFilterParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) ChartQueryFilterParameter_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  20251. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  20252. * This program are made available under the terms of the Apache License, Version 2.0
  20253. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  20254. /**
  20255. * @class ChartQueryFilterParameter
  20256. * @deprecatedclass SuperMap.ChartQueryFilterParameter
  20257. * @category iServer Map Chart
  20258. * @classdesc 海图查询过滤参数类,用于设置海图查询的过滤参数。包括:物标代码、物标可应用对象的选择(是否查询点、线或面)、属性字段过滤条件。
  20259. * @param {Object} options - 参数。
  20260. * @param {string} options.attributeFilter - 属性字段过滤条件。
  20261. * @param {number} options.chartFeatureInfoSpecCode - 查询的物标代号。
  20262. * @param {boolean} [options.isQueryPoint] - 是否查询点。
  20263. * @param {boolean} [options.isQueryLine] - 是否查询线。
  20264. * @param {boolean} [options.isQueryRegion] - 是否查询面。
  20265. * @usage
  20266. */
  20267. var ChartQueryFilterParameter = /*#__PURE__*/function () {
  20268. function ChartQueryFilterParameter(options) {
  20269. ChartQueryFilterParameter_classCallCheck(this, ChartQueryFilterParameter);
  20270. /**
  20271. * @member {boolean} [ChartQueryFilterParameter.prototype.isQueryPoint]
  20272. * @description 是否查询点。
  20273. */
  20274. this.isQueryPoint = null;
  20275. /**
  20276. * @member {boolean} [ChartQueryFilterParameter.prototype.isQueryLine]
  20277. * @description 是否查询线。
  20278. */
  20279. this.isQueryLine = null;
  20280. /**
  20281. * @member {boolean} [ChartQueryFilterParameter.prototype.isQueryRegion]
  20282. * @description 是否查询面。
  20283. */
  20284. this.isQueryRegion = null;
  20285. /**
  20286. * @member {string} ChartQueryFilterParameter.prototype.attributeFilter
  20287. * @description 属性字段过滤条件。
  20288. */
  20289. this.attributeFilter = null;
  20290. /**
  20291. * @member {number} ChartQueryFilterParameter.prototype.chartFeatureInfoSpecCode
  20292. * @description 查询的物标代号。
  20293. */
  20294. this.chartFeatureInfoSpecCode = null;
  20295. Util_Util.extend(this, options);
  20296. this.CLASS_NAME = "SuperMap.ChartQueryFilterParameter";
  20297. }
  20298. /**
  20299. * @function ChartQueryFilterParameter.prototype.destroy
  20300. * @description 释放资源,将引用资源的属性置空。
  20301. */
  20302. ChartQueryFilterParameter_createClass(ChartQueryFilterParameter, [{
  20303. key: "destroy",
  20304. value: function destroy() {
  20305. var me = this;
  20306. me.isQueryPoint = null;
  20307. me.isQueryLine = null;
  20308. me.isQueryRegion = null;
  20309. me.attributeFilter = null;
  20310. me.chartFeatureInfoSpecCode = null;
  20311. }
  20312. /**
  20313. * @function ChartQueryFilterParameter.prototype.toJson
  20314. * @description 将属性信息转化成 JSON 格式字符串。
  20315. */
  20316. }, {
  20317. key: "toJson",
  20318. value: function toJson() {
  20319. var json = "";
  20320. json += "\"isQueryPoint\":" + this.isQueryPoint + ",";
  20321. json += "\"isQueryLine\":" + this.isQueryLine + ",";
  20322. json += "\"isQueryRegion\":" + this.isQueryRegion + ",";
  20323. if (this.attributeFilter) {
  20324. json += "\"attributeFilter\": \"" + this.attributeFilter + "\",";
  20325. }
  20326. json += "\"chartFeatureInfoSpecCode\":" + this.chartFeatureInfoSpecCode;
  20327. json = "{" + json + "}";
  20328. return json;
  20329. }
  20330. }]);
  20331. return ChartQueryFilterParameter;
  20332. }();
  20333. ;// CONCATENATED MODULE: ./src/common/iServer/ChartQueryParameters.js
  20334. function ChartQueryParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  20335. function ChartQueryParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  20336. function ChartQueryParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) ChartQueryParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) ChartQueryParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  20337. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  20338. * This program are made available under the terms of the Apache License, Version 2.0
  20339. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  20340. /**
  20341. * @class ChartQueryParameters
  20342. * @deprecatedclass SuperMap.ChartQueryParameters
  20343. * @category iServer Map Chart
  20344. * @classdesc 海图查询参数类,该类用于设置海图查询时的相关参数,海图查询分为海图属性查询和海图范围查询两类,通过属性 queryMode 指定查询模式。
  20345. * 必设属性有:queryMode、chartLayerNames、chartQueryFilterParameters。当进行海图范围查询时,必设属性还包括 bounds。
  20346. * @param {Object} options - 参数。
  20347. * @param {string} options.queryMode - 海图查询模式类型,支持两种查询方式:海图属性查询("ChartAttributeQuery")和海图空间查询("ChartBoundsQuery")。
  20348. * @param {Array.<string>} options.chartLayerNames - 查询的海图图层的名称。
  20349. * @param {Array.<ChartQueryFilterParameter>} options.chartQueryFilterParameters - 海图查询过滤参数。包括:物标代码、物标可应用对象的选择(是否查询点、线或面)、属性字段过滤条件。
  20350. * @param {(SuperMap.Bounds|L.Bounds|L.LatLngBounds|ol.extent|mapboxgl.LngLatBounds|GeoJSONObject)} options.bounds - 海图查询范围。当进行海图范围查询时,此为必选参数。
  20351. * @param {boolean} [options.returnContent=true] - 获取或设置是返回查询结果记录集 recordsets,还是返回查询结果的资源 resourceInfo。
  20352. * @param {number} [options.startRecord=0] - 查询起始记录位置。
  20353. * @param {number} [options.expectCount] - 期望查询结果返回的记录数,该值大于0。
  20354. * @usage
  20355. */
  20356. var ChartQueryParameters = /*#__PURE__*/function () {
  20357. function ChartQueryParameters(options) {
  20358. ChartQueryParameters_classCallCheck(this, ChartQueryParameters);
  20359. /**
  20360. * @member {string} ChartQueryParameters.prototype.queryMode
  20361. * @description 海图查询模式类型,支持两种查询方式:海图属性查询("ChartAttributeQuery")和海图空间查询("ChartBoundsQuery")。
  20362. */
  20363. this.queryMode = null;
  20364. /**
  20365. * @member {(SuperMap.Bounds|L.Bounds|L.LatLngBounds|ol.extent|mapboxgl.LngLatBounds|GeoJSONObject)} ChartQueryParameters.prototype.bounds
  20366. * @description 海图查询范围。
  20367. */
  20368. this.bounds = null;
  20369. /**
  20370. * @member {Array.<string>} ChartQueryParameters.prototype.chartLayerNames
  20371. * @description 查询的海图图层的名称。
  20372. */
  20373. this.chartLayerNames = null;
  20374. /**
  20375. * @member {Array.<ChartQueryFilterParameter>} ChartQueryParameters.prototype.chartQueryFilterParameters
  20376. * @description 海图查询过滤参数。包括:物标代码、物标可应用对象的选择(是否查询点、线或面)、属性字段过滤条件。
  20377. */
  20378. this.chartQueryFilterParameters = null;
  20379. /**
  20380. * @member {boolean} [ChartQueryParameters.prototype.returnContent=true]
  20381. * @description 获取或设置是返回查询结果记录集 recordsets,还是返回查询结果的资源 resourceInfo。
  20382. */
  20383. this.returnContent = true;
  20384. /**
  20385. * @member {number} [ChartQueryParameters.prototype.startRecord=0]
  20386. * @description 查询起始记录位置。
  20387. */
  20388. this.startRecord = 0;
  20389. /**
  20390. * @member {number} [ChartQueryParameters.prototype.expectCount]
  20391. * @description 期望查询结果返回的记录数,该值大于0。
  20392. */
  20393. this.expectCount = null;
  20394. Util_Util.extend(this, options);
  20395. this.CLASS_NAME = "SuperMap.ChartQueryParameters";
  20396. }
  20397. /**
  20398. * @function ChartQueryParameters.prototype.destroy
  20399. * @description 释放资源,将引用资源的属性置空。
  20400. */
  20401. ChartQueryParameters_createClass(ChartQueryParameters, [{
  20402. key: "destroy",
  20403. value: function destroy() {
  20404. var me = this;
  20405. me.queryMode = null;
  20406. me.bounds = null;
  20407. me.chartLayerNames = null;
  20408. me.chartQueryFilterParameters = null;
  20409. me.returnContent = true;
  20410. me.startRecord = 0;
  20411. me.expectCount = null;
  20412. }
  20413. /**
  20414. * @function ChartQueryParameters.prototype.getVariablesJson
  20415. * @description 将属性信息转换成能够被服务识别的 JSON 格式字符串。
  20416. * @returns {string} JSON 字符串。
  20417. */
  20418. }, {
  20419. key: "getVariablesJson",
  20420. value: function getVariablesJson() {
  20421. var json = "";
  20422. json += "\"queryMode\":\"" + this.queryMode + "\",";
  20423. if (this.chartLayerNames && this.chartLayerNames.length) {
  20424. var chartLayersArray = [];
  20425. var layerLength = this.chartLayerNames.length;
  20426. for (var i = 0; i < layerLength; i++) {
  20427. chartLayersArray.push("\"" + this.chartLayerNames[i] + "\"");
  20428. }
  20429. var layerNames = "[" + chartLayersArray.join(",") + "]";
  20430. json += "\"chartLayerNames\":" + layerNames + ",";
  20431. }
  20432. if (this.queryMode === "ChartBoundsQuery" && this.bounds) {
  20433. json += "\"bounds\":" + "{" + "\"leftBottom\":" + "{" + "\"x\":" + this.bounds.left + "," + "\"y\":" + this.bounds.bottom + "}" + "," + "\"rightTop\":" + "{" + "\"x\":" + this.bounds.right + "," + "\"y\":" + this.bounds.top + "}" + "},";
  20434. }
  20435. if (this.chartQueryFilterParameters && this.chartQueryFilterParameters.length) {
  20436. var chartParamArray = [];
  20437. var chartLength = this.chartQueryFilterParameters.length;
  20438. for (var j = 0; j < chartLength; j++) {
  20439. var chartQueryFilterParameter = this.chartQueryFilterParameters[j];
  20440. if (!(chartQueryFilterParameter instanceof ChartQueryFilterParameter)) {
  20441. continue;
  20442. }
  20443. chartParamArray.push(chartQueryFilterParameter.toJson());
  20444. }
  20445. var chartParamsJson = "[" + chartParamArray.join(",") + "]";
  20446. chartParamsJson = "\"chartQueryParams\":" + chartParamsJson + ",";
  20447. chartParamsJson += "\"startRecord\":" + this.startRecord + ",";
  20448. chartParamsJson += "\"expectCount\":" + this.expectCount;
  20449. chartParamsJson = "{" + chartParamsJson + "}";
  20450. json += "\"chartQueryParameters\":" + chartParamsJson;
  20451. }
  20452. json = "{" + json + "}";
  20453. return json;
  20454. }
  20455. }]);
  20456. return ChartQueryParameters;
  20457. }();
  20458. ;// CONCATENATED MODULE: ./src/common/iServer/ChartQueryService.js
  20459. function ChartQueryService_typeof(obj) { "@babel/helpers - typeof"; return ChartQueryService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, ChartQueryService_typeof(obj); }
  20460. function ChartQueryService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  20461. function ChartQueryService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  20462. function ChartQueryService_createClass(Constructor, protoProps, staticProps) { if (protoProps) ChartQueryService_defineProperties(Constructor.prototype, protoProps); if (staticProps) ChartQueryService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  20463. function ChartQueryService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) ChartQueryService_setPrototypeOf(subClass, superClass); }
  20464. function ChartQueryService_setPrototypeOf(o, p) { ChartQueryService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ChartQueryService_setPrototypeOf(o, p); }
  20465. function ChartQueryService_createSuper(Derived) { var hasNativeReflectConstruct = ChartQueryService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = ChartQueryService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = ChartQueryService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return ChartQueryService_possibleConstructorReturn(this, result); }; }
  20466. function ChartQueryService_possibleConstructorReturn(self, call) { if (call && (ChartQueryService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return ChartQueryService_assertThisInitialized(self); }
  20467. function ChartQueryService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  20468. function ChartQueryService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  20469. function ChartQueryService_getPrototypeOf(o) { ChartQueryService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ChartQueryService_getPrototypeOf(o); }
  20470. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  20471. * This program are made available under the terms of the Apache License, Version 2.0
  20472. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  20473. /**
  20474. * @class ChartQueryService
  20475. * @deprecatedclass SuperMap.ChartQueryService
  20476. * @category iServer Map Chart
  20477. * @classdesc 海图查询服务类。该类负责将海图查询所需参数(ChartQueryParameters)传递至服务端,并获取服务端的返回结果。
  20478. * 用户可以通过两种方式获取查询结果:
  20479. * 1.通过 AsyncResponder 类获取(推荐使用);
  20480. * 2.通过监听 QueryEvent.PROCESS_COMPLETE 事件获取。
  20481. * @extends {CommonServiceBase}
  20482. * @param {string} url - 地图查询服务访问地址。如:"http://localhost:8090/iserver/services/map-ChartW/rest/maps/海图"。
  20483. * @param {Object} options - 参数。
  20484. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  20485. * @param {DataFormat} [options.format] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为"ISERVER","GEOJSON"。
  20486. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  20487. * @param {Object} [options.headers] - 请求头。
  20488. * @example
  20489. * 下面示例显示了如何进行海图属性查询:
  20490. * var nameArray = ["GB4X0000_52000"];
  20491. * var chartQueryFilterParameter = new ChartQueryFilterParameter({
  20492. * isQueryPoint:true,
  20493. * isQueryLine:true,
  20494. * isQueryRegion:true,
  20495. * attributeFilter:"SmID<10",
  20496. * chartFeatureInfoSpecCode:1
  20497. * });
  20498. *
  20499. * var chartQueryParameters = new ChartQueryParameters({
  20500. * queryMode:"ChartAttributeQuery",
  20501. * chartLayerNames:nameArray,
  20502. * returnContent:true,
  20503. * chartQueryFilterParameters:[chartQueryFilterParameter]
  20504. * });
  20505. *
  20506. * var chartQueryService = new ChartQueryService(url);
  20507. *
  20508. * chartQueryService.events.on({
  20509. * "processCompleted":processCompleted,
  20510. * "processFailed":processFailed
  20511. * });
  20512. * chartQueryService.processAsync(chartQueryParameters);
  20513. * @usage
  20514. */
  20515. var ChartQueryService = /*#__PURE__*/function (_CommonServiceBase) {
  20516. ChartQueryService_inherits(ChartQueryService, _CommonServiceBase);
  20517. var _super = ChartQueryService_createSuper(ChartQueryService);
  20518. function ChartQueryService(url, options) {
  20519. var _this;
  20520. ChartQueryService_classCallCheck(this, ChartQueryService);
  20521. _this = _super.call(this, url, options);
  20522. options = options || {};
  20523. /**
  20524. * @member {boolean} ChartQueryService.prototype.returnContent
  20525. * @description 是否立即返回新创建资源的表述还是返回新资源的URI。
  20526. */
  20527. _this.returnContent = null;
  20528. /**
  20529. * @member {DataFormat} ChartQueryService.prototype.format
  20530. * @description 查询结果返回格式,目前支持iServerJSON 和GeoJSON两种格式
  20531. * 参数格式为"ISERVER","GEOJSON",GEOJSON
  20532. */
  20533. _this.format = DataFormat.GEOJSON;
  20534. Util_Util.extend(ChartQueryService_assertThisInitialized(_this), options);
  20535. var me = ChartQueryService_assertThisInitialized(_this);
  20536. if (options.format) {
  20537. me.format = options.format.toUpperCase();
  20538. }
  20539. if (!me.url) {
  20540. return ChartQueryService_possibleConstructorReturn(_this);
  20541. }
  20542. me.url = Util_Util.urlPathAppend(me.url, 'queryResults');
  20543. _this.CLASS_NAME = "SuperMap.ChartQueryService";
  20544. return _this;
  20545. }
  20546. /**
  20547. * @function ChartQueryService.prototype.destroy
  20548. * @override
  20549. */
  20550. ChartQueryService_createClass(ChartQueryService, [{
  20551. key: "destroy",
  20552. value: function destroy() {
  20553. var me = this;
  20554. CommonServiceBase.prototype.destroy.apply(this, arguments);
  20555. me.returnContent = null;
  20556. me.format = null;
  20557. }
  20558. /**
  20559. * @function ChartQueryService.prototype.processAsync
  20560. * @description 使用服务地址 URL 实例化 ChartQueryService 对象。
  20561. * @param {ChartQueryParameters} params - 查询参数。
  20562. */
  20563. }, {
  20564. key: "processAsync",
  20565. value: function processAsync(params) {
  20566. //todo重点需要添加代码的地方
  20567. if (!(params instanceof ChartQueryParameters)) {
  20568. return;
  20569. }
  20570. var me = this,
  20571. jsonParameters;
  20572. me.returnContent = params.returnContent;
  20573. jsonParameters = params.getVariablesJson();
  20574. if (me.returnContent) {
  20575. me.url = Util_Util.urlAppend(me.url, 'returnContent=true');
  20576. }
  20577. me.request({
  20578. method: "POST",
  20579. data: jsonParameters,
  20580. scope: me,
  20581. success: me.serviceProcessCompleted,
  20582. failure: me.serviceProcessFailed
  20583. });
  20584. }
  20585. /**
  20586. * @function ChartQueryService.prototype.serviceProcessCompleted
  20587. * @description 查询完成,执行此方法。
  20588. * @param {Object} result - 服务器返回的结果对象。
  20589. */
  20590. }, {
  20591. key: "serviceProcessCompleted",
  20592. value: function serviceProcessCompleted(result, options) {
  20593. var me = this;
  20594. result = Util_Util.transformResult(result);
  20595. if (result && result.recordsets && me.format === DataFormat.GEOJSON) {
  20596. for (var i = 0, recordsets = result.recordsets, len = recordsets.length; i < len; i++) {
  20597. if (recordsets[i].features) {
  20598. var geoJSONFormat = new GeoJSON();
  20599. recordsets[i].features = geoJSONFormat.toGeoJSON(recordsets[i].features);
  20600. }
  20601. }
  20602. }
  20603. me.events.triggerEvent("processCompleted", {
  20604. result: result,
  20605. options: options
  20606. });
  20607. }
  20608. /**
  20609. * @function ChartQueryService.prototype.getQueryParameters
  20610. * @description 将 JSON 对象表示的查询参数转化为 QueryParameters 对象。
  20611. * @param {Object} params - JSON 字符串表示的查询参数。
  20612. * @returns {QueryParameters} 返回查询结果
  20613. */
  20614. }, {
  20615. key: "getQueryParameters",
  20616. value: function getQueryParameters(params) {
  20617. return new QueryParameters({
  20618. queryMode: params.queryMode,
  20619. bounds: params.bounds,
  20620. chartLayerNames: params.chartLayerNames,
  20621. chartQueryFilterParameters: params.chartQueryFilterParameters,
  20622. returnContent: params.returnContent
  20623. });
  20624. }
  20625. }]);
  20626. return ChartQueryService;
  20627. }(CommonServiceBase);
  20628. ;// CONCATENATED MODULE: ./src/common/iServer/ChartFeatureInfoSpecsService.js
  20629. function ChartFeatureInfoSpecsService_typeof(obj) { "@babel/helpers - typeof"; return ChartFeatureInfoSpecsService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, ChartFeatureInfoSpecsService_typeof(obj); }
  20630. function ChartFeatureInfoSpecsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  20631. function ChartFeatureInfoSpecsService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  20632. function ChartFeatureInfoSpecsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) ChartFeatureInfoSpecsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) ChartFeatureInfoSpecsService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  20633. function ChartFeatureInfoSpecsService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { ChartFeatureInfoSpecsService_get = Reflect.get.bind(); } else { ChartFeatureInfoSpecsService_get = function _get(target, property, receiver) { var base = ChartFeatureInfoSpecsService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return ChartFeatureInfoSpecsService_get.apply(this, arguments); }
  20634. function ChartFeatureInfoSpecsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ChartFeatureInfoSpecsService_getPrototypeOf(object); if (object === null) break; } return object; }
  20635. function ChartFeatureInfoSpecsService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) ChartFeatureInfoSpecsService_setPrototypeOf(subClass, superClass); }
  20636. function ChartFeatureInfoSpecsService_setPrototypeOf(o, p) { ChartFeatureInfoSpecsService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ChartFeatureInfoSpecsService_setPrototypeOf(o, p); }
  20637. function ChartFeatureInfoSpecsService_createSuper(Derived) { var hasNativeReflectConstruct = ChartFeatureInfoSpecsService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = ChartFeatureInfoSpecsService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = ChartFeatureInfoSpecsService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return ChartFeatureInfoSpecsService_possibleConstructorReturn(this, result); }; }
  20638. function ChartFeatureInfoSpecsService_possibleConstructorReturn(self, call) { if (call && (ChartFeatureInfoSpecsService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return ChartFeatureInfoSpecsService_assertThisInitialized(self); }
  20639. function ChartFeatureInfoSpecsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  20640. function ChartFeatureInfoSpecsService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  20641. function ChartFeatureInfoSpecsService_getPrototypeOf(o) { ChartFeatureInfoSpecsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ChartFeatureInfoSpecsService_getPrototypeOf(o); }
  20642. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  20643. * This program are made available under the terms of the Apache License, Version 2.0
  20644. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  20645. /**
  20646. * @class ChartFeatureInfoSpecsService
  20647. * @deprecatedclass SuperMap.ChartFeatureInfoSpecsService
  20648. * @category iServer Map Chart
  20649. * @classdesc 海图物标信息服务类,通过该服务类可以查询到服务端支持的所有海图物标信息。
  20650. * 用户可以通过两种方式获取查询结果:
  20651. * 一种是通过监听 ChartFeatureInfoSpecsEvent.PROCESS_COMPLETE 事件;
  20652. * 另一种是使用 AsyncResponder 类实现异步处理。
  20653. * @extends {CommonServiceBase}
  20654. * @param {string} url - 地图(特指海图)服务地址。
  20655. * 如:"http://localhost:8090/iserver/services/map-ChartW/rest/maps/海图"。
  20656. * 发送请求格式类似于:"http://localhost:8090/iserver/services/map-ChartW/rest/maps/海图/chartFeatureInfoSpecs.json"。
  20657. * @param {Object} options - 参数。
  20658. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  20659. * @param {DataFormat} [options.format] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式,参数格式为"ISERVER","GEOJSON"。
  20660. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  20661. * @param {Object} [options.headers] - 请求头。
  20662. * @usage
  20663. */
  20664. var ChartFeatureInfoSpecsService = /*#__PURE__*/function (_CommonServiceBase) {
  20665. ChartFeatureInfoSpecsService_inherits(ChartFeatureInfoSpecsService, _CommonServiceBase);
  20666. var _super = ChartFeatureInfoSpecsService_createSuper(ChartFeatureInfoSpecsService);
  20667. function ChartFeatureInfoSpecsService(url, options) {
  20668. var _this;
  20669. ChartFeatureInfoSpecsService_classCallCheck(this, ChartFeatureInfoSpecsService);
  20670. _this = _super.call(this, url, options);
  20671. _this.CLASS_NAME = "SuperMap.ChartFeatureInfoSpecsService";
  20672. return _this;
  20673. }
  20674. /**
  20675. * @function ChartFeatureInfoSpecsService.prototype.destroy
  20676. * @override
  20677. */
  20678. ChartFeatureInfoSpecsService_createClass(ChartFeatureInfoSpecsService, [{
  20679. key: "destroy",
  20680. value: function destroy() {
  20681. ChartFeatureInfoSpecsService_get(ChartFeatureInfoSpecsService_getPrototypeOf(ChartFeatureInfoSpecsService.prototype), "destroy", this).call(this);
  20682. Util_Util.reset(this);
  20683. }
  20684. /**
  20685. * @function ChartFeatureInfoSpecsService.prototype.processAsync
  20686. * @description 根据地图(特指海图)服务地址与服务端完成异步通讯,获取物标信息。
  20687. * 当查询物标信息成功时,将触发 ChartFeatureInfoSpecsEvent.PROCESS_COMPLETE
  20688. * 事件。用可以通过户两种方式获取图层信息:
  20689. * 1. 通过 AsyncResponder 类获取(推荐使用);
  20690. * 2. 通过监听 ChartFeatureInfoSpecsEvent.PROCESS_COMPLETE 事件获取。
  20691. */
  20692. }, {
  20693. key: "processAsync",
  20694. value: function processAsync() {
  20695. var me = this,
  20696. method = "GET";
  20697. if (!me.isTempLayers) {
  20698. Util_Util.urlPathAppend(me.url, 'chartFeatureInfoSpecs');
  20699. }
  20700. me.request({
  20701. method: method,
  20702. params: null,
  20703. scope: me,
  20704. success: me.serviceProcessCompleted,
  20705. failure: me.serviceProcessFailed
  20706. });
  20707. }
  20708. }]);
  20709. return ChartFeatureInfoSpecsService;
  20710. }(CommonServiceBase);
  20711. ;// CONCATENATED MODULE: ./src/common/iServer/ChartService.js
  20712. function ChartService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  20713. function ChartService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  20714. function ChartService_createClass(Constructor, protoProps, staticProps) { if (protoProps) ChartService_defineProperties(Constructor.prototype, protoProps); if (staticProps) ChartService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  20715. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  20716. * This program are made available under the terms of the Apache License, Version 2.0
  20717. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  20718. /**
  20719. * @class ChartService
  20720. * @category iServer Map Chart
  20721. * @classdesc 海图服务。
  20722. * @extends {ServiceBase}
  20723. * @example
  20724. * new ChartService(url).queryChart(param,function(result){
  20725. * //doSomething
  20726. * })
  20727. * @param {string} url - 服务地址。
  20728. * @param {Object} options - 参数。
  20729. * @param {string} [options.proxy] - 服务代理地址。
  20730. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  20731. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  20732. * @param {Object} [options.headers] - 请求头。
  20733. * @usage
  20734. */
  20735. var ChartService_ChartService = /*#__PURE__*/function () {
  20736. function ChartService(url, options) {
  20737. ChartService_classCallCheck(this, ChartService);
  20738. this.url = url;
  20739. this.options = options || {};
  20740. }
  20741. /**
  20742. * @function ChartService.prototype.queryChart
  20743. * @description 查询海图服务。
  20744. * @param {ChartQueryParameters} params - 海图查询所需参数类。
  20745. * @param {RequestCallback} callback - 回调函数。
  20746. * @param {DataFormat} resultFormat - 返回结果类型。
  20747. */
  20748. ChartService_createClass(ChartService, [{
  20749. key: "queryChart",
  20750. value: function queryChart(params, callback, resultFormat) {
  20751. var me = this,
  20752. param = params,
  20753. format = me._processFormat(resultFormat);
  20754. var chartQueryService = new ChartQueryService(me.url, {
  20755. proxy: me.options.proxy,
  20756. withCredentials: me.options.withCredentials,
  20757. crossOrigin: me.options.crossOrigin,
  20758. headers: me.options.headers,
  20759. eventListeners: {
  20760. scope: me,
  20761. processCompleted: callback,
  20762. processFailed: callback
  20763. },
  20764. format: format
  20765. });
  20766. chartQueryService.processAsync(param);
  20767. }
  20768. /**
  20769. * @function ChartService.prototype.getChartFeatureInfo
  20770. * @description 获取海图物标信息服务。
  20771. * @param {RequestCallback} callback 回调函数。
  20772. */
  20773. }, {
  20774. key: "getChartFeatureInfo",
  20775. value: function getChartFeatureInfo(callback) {
  20776. var me = this;
  20777. var url = Util_Util.urlPathAppend(me.url, 'chartFeatureInfoSpecs');
  20778. var chartFeatureInfoSpecsService = new ChartFeatureInfoSpecsService(url, {
  20779. proxy: me.options.proxy,
  20780. withCredentials: me.options.withCredentials,
  20781. crossOrigin: me.options.crossOrigin,
  20782. headers: me.options.headers,
  20783. eventListeners: {
  20784. scope: me,
  20785. processCompleted: callback,
  20786. processFailed: callback
  20787. }
  20788. });
  20789. chartFeatureInfoSpecsService.processAsync();
  20790. }
  20791. }, {
  20792. key: "_processFormat",
  20793. value: function _processFormat(resultFormat) {
  20794. return resultFormat ? resultFormat : DataFormat.GEOJSON;
  20795. }
  20796. }]);
  20797. return ChartService;
  20798. }();
  20799. ;// CONCATENATED MODULE: ./src/maplibregl/services/ChartService.js
  20800. function ChartService_typeof(obj) { "@babel/helpers - typeof"; return ChartService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, ChartService_typeof(obj); }
  20801. function services_ChartService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  20802. function services_ChartService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  20803. function services_ChartService_createClass(Constructor, protoProps, staticProps) { if (protoProps) services_ChartService_defineProperties(Constructor.prototype, protoProps); if (staticProps) services_ChartService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  20804. function ChartService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) ChartService_setPrototypeOf(subClass, superClass); }
  20805. function ChartService_setPrototypeOf(o, p) { ChartService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ChartService_setPrototypeOf(o, p); }
  20806. function ChartService_createSuper(Derived) { var hasNativeReflectConstruct = ChartService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = ChartService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = ChartService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return ChartService_possibleConstructorReturn(this, result); }; }
  20807. function ChartService_possibleConstructorReturn(self, call) { if (call && (ChartService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return ChartService_assertThisInitialized(self); }
  20808. function ChartService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  20809. function ChartService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  20810. function ChartService_getPrototypeOf(o) { ChartService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ChartService_getPrototypeOf(o); }
  20811. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  20812. * This program are made available under the terms of the Apache License, Version 2.0
  20813. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  20814. /**
  20815. * @class ChartService
  20816. * @category iServer Map Chart
  20817. * @classdesc 海图服务类。
  20818. * @version 11.1.0
  20819. * @modulecategory Services
  20820. * @extends {ServiceBase}
  20821. * @example
  20822. * new ChartService(url)
  20823. * .queryChart(param,function(result){
  20824. * //doSomething
  20825. * })
  20826. * @param {string} url - 服务地址。
  20827. * @param {Object} options - 参数。
  20828. * @param {string} [options.proxy] - 服务代理地址。
  20829. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  20830. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  20831. * @param {Object} [options.headers] - 请求头。
  20832. * @usage
  20833. */
  20834. var ChartService = /*#__PURE__*/function (_ServiceBase) {
  20835. ChartService_inherits(ChartService, _ServiceBase);
  20836. var _super = ChartService_createSuper(ChartService);
  20837. function ChartService(url, options) {
  20838. var _this;
  20839. services_ChartService_classCallCheck(this, ChartService);
  20840. _this = _super.call(this, url, options);
  20841. _this._chartService = new ChartService_ChartService(url, options);
  20842. return _this;
  20843. }
  20844. /**
  20845. * @function ChartService.prototype.queryChart
  20846. * @description 查询海图服务。
  20847. * @param {ChartQueryParameters} params - 海图查询参数类。
  20848. * @param {RequestCallback} callback 回调函数。
  20849. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  20850. */
  20851. services_ChartService_createClass(ChartService, [{
  20852. key: "queryChart",
  20853. value: function queryChart(params, callback, resultFormat) {
  20854. this._chartService.queryChart(params, callback, resultFormat);
  20855. }
  20856. /**
  20857. * @function ChartService.prototype.getChartFeatureInfo
  20858. * @description 获取海图物标信息服务。
  20859. * @param {RequestCallback} callback 回调函数。
  20860. */
  20861. }, {
  20862. key: "getChartFeatureInfo",
  20863. value: function getChartFeatureInfo(callback) {
  20864. this._chartService.getChartFeatureInfo(callback);
  20865. }
  20866. }, {
  20867. key: "_processFormat",
  20868. value: function _processFormat(resultFormat) {
  20869. return resultFormat ? resultFormat : DataFormat.GEOJSON;
  20870. }
  20871. }]);
  20872. return ChartService;
  20873. }(ServiceBase);
  20874. ;// CONCATENATED MODULE: ./src/common/iServer/DataFlowService.js
  20875. function DataFlowService_typeof(obj) { "@babel/helpers - typeof"; return DataFlowService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, DataFlowService_typeof(obj); }
  20876. function DataFlowService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  20877. function DataFlowService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  20878. function DataFlowService_createClass(Constructor, protoProps, staticProps) { if (protoProps) DataFlowService_defineProperties(Constructor.prototype, protoProps); if (staticProps) DataFlowService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  20879. function DataFlowService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) DataFlowService_setPrototypeOf(subClass, superClass); }
  20880. function DataFlowService_setPrototypeOf(o, p) { DataFlowService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return DataFlowService_setPrototypeOf(o, p); }
  20881. function DataFlowService_createSuper(Derived) { var hasNativeReflectConstruct = DataFlowService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = DataFlowService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = DataFlowService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return DataFlowService_possibleConstructorReturn(this, result); }; }
  20882. function DataFlowService_possibleConstructorReturn(self, call) { if (call && (DataFlowService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return DataFlowService_assertThisInitialized(self); }
  20883. function DataFlowService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  20884. function DataFlowService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  20885. function DataFlowService_getPrototypeOf(o) { DataFlowService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return DataFlowService_getPrototypeOf(o); }
  20886. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  20887. * This program are made available under the terms of the Apache License, Version 2.0
  20888. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  20889. /**
  20890. * @class DataFlowService
  20891. * @deprecatedclass SuperMap.DataFlowService
  20892. * @category iServer DataFlow
  20893. * @classdesc 数据流服务类。
  20894. * @extends {CommonServiceBase}
  20895. * @param {string} url - 数据流服务地址。
  20896. * @param {Object} options - 参数。
  20897. * @param {function} options.style - 设置数据加载样式。
  20898. * @param {function} [options.onEachFeature] - 设置每个数据加载popup等。
  20899. * @param {GeoJSONObject} [options.geometry] - 指定几何范围,该范围内的要素才能被订阅。
  20900. * @param {Object} [options.excludeField] - 排除字段。
  20901. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  20902. * @param {Object} [options.headers] - 请求头。
  20903. * @usage
  20904. */
  20905. var DataFlowService_DataFlowService = /*#__PURE__*/function (_CommonServiceBase) {
  20906. DataFlowService_inherits(DataFlowService, _CommonServiceBase);
  20907. var _super = DataFlowService_createSuper(DataFlowService);
  20908. function DataFlowService(url, options) {
  20909. var _this;
  20910. DataFlowService_classCallCheck(this, DataFlowService);
  20911. options = options || {};
  20912. /*
  20913. * @constant EVENT_TYPES
  20914. * {Array.<string>}
  20915. * 此类支持的事件类型
  20916. */
  20917. options.EVENT_TYPES = ["broadcastSocketConnected", "broadcastSocketClosed", "broadcastSocketError", "broadcastFailed", "broadcastSucceeded", "subscribeSocketConnected", "subscribeSocketClosed", "subscribeSocketError", "messageSucceeded", "setFilterParamSucceeded"];
  20918. _this = _super.call(this, url, options);
  20919. /**
  20920. * @member {GeoJSONObject} DataFlowService.prototype.geometry
  20921. * @description 指定几何范围,该范围内的要素才能被订阅。
  20922. */
  20923. _this.geometry = null;
  20924. /**
  20925. * @member {Object} DataFlowService.prototype.prjCoordSys
  20926. * @description 动态投影参数。
  20927. */
  20928. _this.prjCoordSys = null;
  20929. /**
  20930. * @member {Object} DataFlowService.prototype.excludeField
  20931. * @description 排除字段。
  20932. */
  20933. _this.excludeField = null;
  20934. Util_Util.extend(DataFlowService_assertThisInitialized(_this), options);
  20935. _this.CLASS_NAME = "SuperMap.DataFlowService";
  20936. return _this;
  20937. }
  20938. /**
  20939. * @function DataFlowService.prototype.initBroadcast
  20940. * @description 初始化广播。
  20941. * @returns {DataFlowService}
  20942. */
  20943. DataFlowService_createClass(DataFlowService, [{
  20944. key: "initBroadcast",
  20945. value: function initBroadcast() {
  20946. var me = this;
  20947. this.broadcastWebSocket = this._connect(Util_Util.urlPathAppend(me.url, 'broadcast'));
  20948. this.broadcastWebSocket.onopen = function (e) {
  20949. me.broadcastWebSocket.isOpen = true;
  20950. e.eventType = 'broadcastSocketConnected';
  20951. me.events.triggerEvent('broadcastSocketConnected', e);
  20952. };
  20953. this.broadcastWebSocket.onclose = function (e) {
  20954. if (me.broadcastWebSocket) {
  20955. me.broadcastWebSocket.isOpen = false;
  20956. }
  20957. e.eventType = 'broadcastSocketClosed';
  20958. me.events.triggerEvent('broadcastSocketClosed', e);
  20959. };
  20960. this.broadcastWebSocket.onerror = function (e) {
  20961. e.eventType = 'broadcastSocketError';
  20962. me.events.triggerEvent('broadcastSocketError', e);
  20963. };
  20964. return this;
  20965. }
  20966. /**
  20967. * @function DataFlowService.prototype.broadcast
  20968. * @description 加载广播数据。
  20969. * @param {GeoJSONObject} geoJSONFeature - JSON 格式的要素数据。
  20970. */
  20971. }, {
  20972. key: "broadcast",
  20973. value: function broadcast(geoJSONFeature) {
  20974. if (!this.broadcastWebSocket || !this.broadcastWebSocket.isOpen) {
  20975. this.events.triggerEvent('broadcastFailed');
  20976. return;
  20977. }
  20978. this.broadcastWebSocket.send(JSON.stringify(geoJSONFeature));
  20979. this.events.triggerEvent('broadcastSucceeded');
  20980. }
  20981. /**
  20982. * @function DataFlowService.prototype.initSubscribe
  20983. * @description 初始化订阅数据。
  20984. * @returns {DataFlowService} DataFlowService的实例对象。
  20985. */
  20986. }, {
  20987. key: "initSubscribe",
  20988. value: function initSubscribe() {
  20989. var me = this;
  20990. this.subscribeWebSocket = this._connect(Util_Util.urlPathAppend(me.url, 'subscribe'));
  20991. this.subscribeWebSocket.onopen = function (e) {
  20992. me.subscribeWebSocket.send(me._getFilterParams());
  20993. e.eventType = 'subscribeSocketConnected';
  20994. me.events.triggerEvent('subscribeSocketConnected', e);
  20995. };
  20996. this.subscribeWebSocket.onclose = function (e) {
  20997. e.eventType = 'subscribeWebSocketClosed';
  20998. me.events.triggerEvent('subscribeWebSocketClosed', e);
  20999. };
  21000. this.subscribeWebSocket.onerror = function (e) {
  21001. e.eventType = 'subscribeSocketError';
  21002. me.events.triggerEvent('subscribeSocketError', e);
  21003. };
  21004. this.subscribeWebSocket.onmessage = function (e) {
  21005. me._onMessage(e);
  21006. };
  21007. return this;
  21008. }
  21009. /**
  21010. * @function DataFlowService.prototype.setExcludeField
  21011. * @description 设置排除字段。
  21012. * @param {Object} excludeField - 排除字段。
  21013. * @returns {DataFlowService} DataFlowService的实例对象。
  21014. */
  21015. }, {
  21016. key: "setExcludeField",
  21017. value: function setExcludeField(excludeField) {
  21018. this.excludeField = excludeField;
  21019. this.subscribeWebSocket.send(this._getFilterParams());
  21020. return this;
  21021. }
  21022. /**
  21023. * @function DataFlowService.prototype.setGeometry
  21024. * @description 设置添加的几何要素数据。
  21025. * @param {GeoJSONObject} geometry - 指定几何范围,该范围内的要素才能被订阅。
  21026. * @returns {DataFlowService} DataFlowService的实例对象。
  21027. */
  21028. }, {
  21029. key: "setGeometry",
  21030. value: function setGeometry(geometry) {
  21031. this.geometry = geometry;
  21032. this.subscribeWebSocket.send(this._getFilterParams());
  21033. return this;
  21034. }
  21035. /**
  21036. * @function DataFlowService.prototype.unSubscribe
  21037. * @description 结束订阅数据。
  21038. */
  21039. }, {
  21040. key: "unSubscribe",
  21041. value: function unSubscribe() {
  21042. if (!this.subscribeWebSocket) {
  21043. return;
  21044. }
  21045. this.subscribeWebSocket.close();
  21046. this.subscribeWebSocket = null;
  21047. }
  21048. /**
  21049. * @function DataFlowService.prototype.unBroadcast
  21050. * @description 结束加载广播。
  21051. */
  21052. }, {
  21053. key: "unBroadcast",
  21054. value: function unBroadcast() {
  21055. if (!this.broadcastWebSocket) {
  21056. return;
  21057. }
  21058. this.broadcastWebSocket.close();
  21059. this.broadcastWebSocket = null;
  21060. }
  21061. /**
  21062. * @function DataFlowService.prototype.destroy
  21063. * @override
  21064. */
  21065. }, {
  21066. key: "destroy",
  21067. value: function destroy() {
  21068. CommonServiceBase.prototype.destroy.apply(this, arguments);
  21069. var me = this;
  21070. me.geometry = null;
  21071. me.prjCoordSys = null;
  21072. me.excludeField = null;
  21073. this.unBroadcast();
  21074. this.unSubscribe();
  21075. }
  21076. }, {
  21077. key: "_getFilterParams",
  21078. value: function _getFilterParams() {
  21079. var filter = {
  21080. filterParam: {
  21081. prjCoordSys: this.prjCoordSys,
  21082. excludeField: this.excludeField,
  21083. geometry: this.geometry
  21084. }
  21085. };
  21086. return Util_Util.toJSON(filter);
  21087. }
  21088. }, {
  21089. key: "_onMessage",
  21090. value: function _onMessage(e) {
  21091. if (e.data && e.data.indexOf("filterParam") >= 0) {
  21092. var filterParam = JSON.parse(e.data);
  21093. e.filterParam = filterParam;
  21094. e.eventType = 'setFilterParamSucceeded';
  21095. this.events.triggerEvent('setFilterParamSucceeded', e);
  21096. return;
  21097. }
  21098. var feature = JSON.parse(e.data);
  21099. e.featureResult = feature;
  21100. e.eventType = 'messageSucceeded';
  21101. this.events.triggerEvent('messageSucceeded', e);
  21102. }
  21103. }, {
  21104. key: "_connect",
  21105. value: function _connect(url) {
  21106. url = SecurityManager.appendCredential(url);
  21107. if ("WebSocket" in window) {
  21108. return new WebSocket(url);
  21109. } else if ("MozWebSocket" in window) {
  21110. var mozWebSocket = window.MozWebSocket;
  21111. return new mozWebSocket(url);
  21112. } else {
  21113. console.log("no WebSocket");
  21114. return null;
  21115. }
  21116. }
  21117. }]);
  21118. return DataFlowService;
  21119. }(CommonServiceBase);
  21120. ;// CONCATENATED MODULE: ./src/maplibregl/services/DataFlowService.js
  21121. function services_DataFlowService_typeof(obj) { "@babel/helpers - typeof"; return services_DataFlowService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, services_DataFlowService_typeof(obj); }
  21122. function services_DataFlowService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  21123. function services_DataFlowService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  21124. function services_DataFlowService_createClass(Constructor, protoProps, staticProps) { if (protoProps) services_DataFlowService_defineProperties(Constructor.prototype, protoProps); if (staticProps) services_DataFlowService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  21125. function services_DataFlowService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) services_DataFlowService_setPrototypeOf(subClass, superClass); }
  21126. function services_DataFlowService_setPrototypeOf(o, p) { services_DataFlowService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return services_DataFlowService_setPrototypeOf(o, p); }
  21127. function services_DataFlowService_createSuper(Derived) { var hasNativeReflectConstruct = services_DataFlowService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = services_DataFlowService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = services_DataFlowService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return services_DataFlowService_possibleConstructorReturn(this, result); }; }
  21128. function services_DataFlowService_possibleConstructorReturn(self, call) { if (call && (services_DataFlowService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return services_DataFlowService_assertThisInitialized(self); }
  21129. function services_DataFlowService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  21130. function services_DataFlowService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  21131. function services_DataFlowService_getPrototypeOf(o) { services_DataFlowService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return services_DataFlowService_getPrototypeOf(o); }
  21132. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  21133. * This program are made available under the terms of the Apache License, Version 2.0
  21134. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  21135. /**
  21136. * @class DataFlowService
  21137. * @category iServer DataFlow
  21138. * @classdesc 数据流服务类。
  21139. * @version 11.1.0
  21140. * @modulecategory Services
  21141. * @extends {ServiceBase}
  21142. * @example
  21143. * new DataFlowService(url)
  21144. * .queryChart(param,function(result){
  21145. * //doSomething
  21146. * })
  21147. * @param {string} url - 服务地址。
  21148. * @param {Object} options - 参数。
  21149. * @param {GeoJSONObject} [options.geometry] - 指定几何范围,该范围内的要素才能被订阅。
  21150. * @param {Object} [options.excludeField] - 排除字段。
  21151. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  21152. * @param {Object} [options.headers] - 请求头。
  21153. * @fires DataFlowService#broadcastSocketConnected
  21154. * @fires DataFlowService#broadcastSocketError
  21155. * @fires DataFlowService#broadcastFailed
  21156. * @fires DataFlowService#broadcastSucceeded
  21157. * @fires DataFlowService#subscribeSocketError
  21158. * @fires DataFlowService#messageSucceeded
  21159. * @fires DataFlowService#setFilterParamSucceeded
  21160. * @usage
  21161. */
  21162. var DataFlowService = /*#__PURE__*/function (_ServiceBase) {
  21163. services_DataFlowService_inherits(DataFlowService, _ServiceBase);
  21164. var _super = services_DataFlowService_createSuper(DataFlowService);
  21165. function DataFlowService(url, options) {
  21166. var _this;
  21167. services_DataFlowService_classCallCheck(this, DataFlowService);
  21168. options = options || {};
  21169. if (options.projection) {
  21170. options.prjCoordSys = options.projection;
  21171. }
  21172. _this = _super.call(this, url, options);
  21173. _this.dataFlow = new DataFlowService_DataFlowService(url, options);
  21174. /**
  21175. * @event DataFlowService#broadcastSocketConnected
  21176. * @description broadcast Socket 连接成功。
  21177. */
  21178. /**
  21179. * @event DataFlowService#broadcastSocketError
  21180. * @description broadcast Socket 连接失败。
  21181. */
  21182. /**
  21183. * @event DataFlowService#broadcastFailed
  21184. * @description 广播失败。
  21185. */
  21186. /**
  21187. * @event DataFlowService#broadcastSucceeded
  21188. * @description 广播成功。
  21189. */
  21190. /**
  21191. * @event DataFlowService#subscribeSocketConnected
  21192. * @description 订阅数据连接成功。
  21193. */
  21194. /**
  21195. * @event DataFlowService#subscribeSocketError
  21196. * @description 订阅数据连接失败。
  21197. */
  21198. /**
  21199. * @event DataFlowService#messageSucceeded
  21200. * @description 获取信息成功。
  21201. */
  21202. /**
  21203. * @event DataFlowService#setFilterParamSucceeded
  21204. * @description 设置过滤参数成功。
  21205. */
  21206. _this.dataFlow.events.on({
  21207. "broadcastSocketConnected": _this._defaultEvent,
  21208. "broadcastSocketError": _this._defaultEvent,
  21209. "broadcastFailed": _this._defaultEvent,
  21210. "broadcastSucceeded": _this._defaultEvent,
  21211. "subscribeSocketConnected": _this._defaultEvent,
  21212. "subscribeSocketError": _this._defaultEvent,
  21213. "messageSucceeded": _this._defaultEvent,
  21214. "setFilterParamSucceeded": _this._defaultEvent,
  21215. scope: services_DataFlowService_assertThisInitialized(_this)
  21216. });
  21217. var me = services_DataFlowService_assertThisInitialized(_this);
  21218. me.on('subscribeSocketConnected', function (e) {
  21219. /**
  21220. * @event DataFlowService#subscribesucceeded
  21221. * @description 数据流服务订阅成功后触发。
  21222. * @property {Object} e - 事件对象。
  21223. */
  21224. me.fire('subscribesucceeded', e);
  21225. });
  21226. return _this;
  21227. }
  21228. /**
  21229. * @function DataFlowService.prototype.initBroadcast
  21230. * @description 初始化广播。
  21231. * @returns {DataFlowService}
  21232. */
  21233. services_DataFlowService_createClass(DataFlowService, [{
  21234. key: "initBroadcast",
  21235. value: function initBroadcast() {
  21236. this.dataFlow.initBroadcast();
  21237. return this;
  21238. }
  21239. /**
  21240. * @function DataFlowService.prototype.broadcast
  21241. * @description 加载广播数据。
  21242. * @param {JSONObject} obj - 要素数据。
  21243. */
  21244. }, {
  21245. key: "broadcast",
  21246. value: function broadcast(obj) {
  21247. this.dataFlow.broadcast(obj);
  21248. }
  21249. /**
  21250. * @function DataFlowService.prototype.initSubscribe
  21251. * @description 初始化订阅数据。
  21252. */
  21253. }, {
  21254. key: "initSubscribe",
  21255. value: function initSubscribe() {
  21256. this.dataFlow.initSubscribe();
  21257. return this;
  21258. }
  21259. /**
  21260. * @function DataFlowService.prototype.setExcludeField
  21261. * @description 设置排除字段。
  21262. * @param {Object} excludeField - 排除字段。
  21263. */
  21264. }, {
  21265. key: "setExcludeField",
  21266. value: function setExcludeField(excludeField) {
  21267. this.dataFlow.setExcludeField(excludeField);
  21268. this.options.excludeField = excludeField;
  21269. return this;
  21270. }
  21271. /**
  21272. * @function DataFlowService.prototype.setGeometry
  21273. * @description 设置添加的几何要素数据。
  21274. * @param {GeoJSONObject} geometry - 指定几何范围,该范围内的要素才能被订阅。
  21275. */
  21276. }, {
  21277. key: "setGeometry",
  21278. value: function setGeometry(geometry) {
  21279. this.dataFlow.setGeometry(geometry);
  21280. this.options.geometry = geometry;
  21281. return this;
  21282. }
  21283. /**
  21284. * @function DataFlowService.prototype.unSubscribe
  21285. * @description 结束订阅数据。
  21286. */
  21287. }, {
  21288. key: "unSubscribe",
  21289. value: function unSubscribe() {
  21290. this.dataFlow.unSubscribe();
  21291. }
  21292. /**
  21293. * @function DataFlowService.prototype.unBroadcast
  21294. * @description 结束加载广播。
  21295. */
  21296. }, {
  21297. key: "unBroadcast",
  21298. value: function unBroadcast() {
  21299. this.dataFlow.unBroadcast();
  21300. }
  21301. }, {
  21302. key: "_defaultEvent",
  21303. value: function _defaultEvent(e) {
  21304. this.fire(e.eventType || e.type, e);
  21305. }
  21306. }]);
  21307. return DataFlowService;
  21308. }(ServiceBase);
  21309. ;// CONCATENATED MODULE: ./src/common/iServer/DatasetService.js
  21310. function DatasetService_typeof(obj) { "@babel/helpers - typeof"; return DatasetService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, DatasetService_typeof(obj); }
  21311. function DatasetService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  21312. function DatasetService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  21313. function DatasetService_createClass(Constructor, protoProps, staticProps) { if (protoProps) DatasetService_defineProperties(Constructor.prototype, protoProps); if (staticProps) DatasetService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  21314. function DatasetService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { DatasetService_get = Reflect.get.bind(); } else { DatasetService_get = function _get(target, property, receiver) { var base = DatasetService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return DatasetService_get.apply(this, arguments); }
  21315. function DatasetService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = DatasetService_getPrototypeOf(object); if (object === null) break; } return object; }
  21316. function DatasetService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) DatasetService_setPrototypeOf(subClass, superClass); }
  21317. function DatasetService_setPrototypeOf(o, p) { DatasetService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return DatasetService_setPrototypeOf(o, p); }
  21318. function DatasetService_createSuper(Derived) { var hasNativeReflectConstruct = DatasetService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = DatasetService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = DatasetService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return DatasetService_possibleConstructorReturn(this, result); }; }
  21319. function DatasetService_possibleConstructorReturn(self, call) { if (call && (DatasetService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return DatasetService_assertThisInitialized(self); }
  21320. function DatasetService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  21321. function DatasetService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  21322. function DatasetService_getPrototypeOf(o) { DatasetService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return DatasetService_getPrototypeOf(o); }
  21323. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  21324. * This program are made available under the terms of the Apache License, Version 2.0
  21325. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  21326. /**
  21327. * @class DatasetService
  21328. * @deprecatedclass SuperMap.DatasetService
  21329. * @category iServer Data Dataset
  21330. * @classdesc 数据集查询服务。
  21331. * @param {string} url - 服务的访问地址。如访问World Data服务,只需将url设为:http://localhost:8090/iserver/services/data-world/rest/data 即可。
  21332. * @param {Object} options - 参数。
  21333. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  21334. * @param {DataFormat} [options.format=DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
  21335. * @param {string}options.datasource - 数据源名称。
  21336. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  21337. * @param {Object} [options.headers] - 请求头。
  21338. * @usage
  21339. */
  21340. var DatasetService_DatasetService = /*#__PURE__*/function (_CommonServiceBase) {
  21341. DatasetService_inherits(DatasetService, _CommonServiceBase);
  21342. var _super = DatasetService_createSuper(DatasetService);
  21343. function DatasetService(url, options) {
  21344. var _this;
  21345. DatasetService_classCallCheck(this, DatasetService);
  21346. _this = _super.call(this, url, options);
  21347. if (!options) {
  21348. return DatasetService_possibleConstructorReturn(_this);
  21349. }
  21350. /**
  21351. * @member {string} DatasetService.prototype.datasource
  21352. * @description 要查询的数据集所在的数据源名称。
  21353. */
  21354. _this.datasource = null;
  21355. /**
  21356. * @member {string} DatasetService.prototype.dataset
  21357. * @description 要查询的数据集名称。
  21358. */
  21359. _this.dataset = null;
  21360. _this.eventCount = 0;
  21361. if (options) {
  21362. Util_Util.extend(DatasetService_assertThisInitialized(_this), options);
  21363. }
  21364. _this.CLASS_NAME = "SuperMap.DatasetService";
  21365. return _this;
  21366. }
  21367. /**
  21368. * @function DatasetService.prototype.destroy
  21369. * @override
  21370. */
  21371. DatasetService_createClass(DatasetService, [{
  21372. key: "destroy",
  21373. value: function destroy() {
  21374. DatasetService_get(DatasetService_getPrototypeOf(DatasetService.prototype), "destroy", this).call(this);
  21375. var me = this;
  21376. me.datasource = null;
  21377. me.dataset = null;
  21378. }
  21379. /**
  21380. * @function DatasetService.prototype.getDatasetsService
  21381. * @description 执行服务,查询数据集服务。
  21382. */
  21383. }, {
  21384. key: "getDatasetsService",
  21385. value: function getDatasetsService(params, callback) {
  21386. var url = Util_Util.urlPathAppend(this.url, "datasources/name/".concat(params, "/datasets"));
  21387. this.processAsync(url, 'GET', callback);
  21388. }
  21389. /**
  21390. * @function DatasetService.prototype.getDatasetService
  21391. * @description 执行服务,查询数据集信息服务。
  21392. */
  21393. }, {
  21394. key: "getDatasetService",
  21395. value: function getDatasetService(datasourceName, datasetName, callback) {
  21396. var url = Util_Util.urlPathAppend(this.url, "datasources/name/".concat(datasourceName, "/datasets/name/").concat(datasetName));
  21397. this.processAsync(url, 'GET', callback);
  21398. }
  21399. /**
  21400. * @function DatasetService.prototype.setDatasetService
  21401. * @description 执行服务,更改数据集信息服务。
  21402. */
  21403. }, {
  21404. key: "setDatasetService",
  21405. value: function setDatasetService(params, callback) {
  21406. if (!params) {
  21407. return;
  21408. }
  21409. var url = Util_Util.urlPathAppend(this.url, "datasources/name/".concat(params.datasourceName, "/datasets/name/").concat(params.datasetName));
  21410. delete params.datasourceName;
  21411. this.processAsync(url, 'PUT', callback, params);
  21412. }
  21413. /**
  21414. * @function DatasetService.prototype.deleteDatasetService
  21415. * @description 执行服务,删除数据集信息服务。
  21416. */
  21417. }, {
  21418. key: "deleteDatasetService",
  21419. value: function deleteDatasetService(datasourceName, datasetName, callback) {
  21420. var url = Util_Util.urlPathAppend(this.url, "datasources/name/".concat(datasourceName, "/datasets/name/").concat(datasetName));
  21421. this.processAsync(url, 'DELETE', callback);
  21422. }
  21423. }, {
  21424. key: "processAsync",
  21425. value: function processAsync(url, method, callback, params) {
  21426. var eventId = ++this.eventCount;
  21427. var eventListeners = {
  21428. scope: this,
  21429. processCompleted: function processCompleted(result) {
  21430. if (eventId === result.result.eventId && callback) {
  21431. delete result.result.eventId;
  21432. callback(result);
  21433. this.events && this.events.un(eventListeners);
  21434. return false;
  21435. }
  21436. },
  21437. processFailed: function processFailed(result) {
  21438. if ((eventId === result.error.eventId || eventId === result.eventId) && callback) {
  21439. callback(result);
  21440. this.events && this.events.un(eventListeners);
  21441. return false;
  21442. }
  21443. }
  21444. };
  21445. this.events.on(eventListeners);
  21446. var me = this;
  21447. var requestConfig = {
  21448. url: url,
  21449. method: method,
  21450. scope: me,
  21451. success: function success(result, options) {
  21452. result.eventId = eventId;
  21453. me.serviceProcessCompleted(result, options);
  21454. },
  21455. failure: function failure(result, options) {
  21456. if (result.error) {
  21457. result.error.eventId = eventId;
  21458. }
  21459. result.eventId = eventId;
  21460. me.serviceProcessFailed(result, options);
  21461. }
  21462. };
  21463. params && (requestConfig.data = Util_Util.toJSON(params));
  21464. me.request(requestConfig);
  21465. }
  21466. }]);
  21467. return DatasetService;
  21468. }(CommonServiceBase);
  21469. ;// CONCATENATED MODULE: ./src/common/iServer/CreateDatasetParameters.js
  21470. function CreateDatasetParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  21471. function CreateDatasetParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  21472. function CreateDatasetParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) CreateDatasetParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) CreateDatasetParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  21473. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  21474. * This program are made available under the terms of the Apache License, Version 2.0
  21475. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  21476. /**
  21477. * @class CreateDatasetParameters
  21478. * @deprecatedclass SuperMap.CreateDatasetParameters
  21479. * @category iServer Data Dataset
  21480. * @classdesc 数据集创建参数类。
  21481. * @param {Object} options - 参数。
  21482. * @param {string} options.datasourceName - 数据源名称,此为必选参数。
  21483. * @param {string} options.datasetName - 数据集名称,此为必选参数。
  21484. * @param {string} options.datasetType - 数据集类型。目前支持创建的数据集类型有:点、线、面、文本、复合(CAD)和属性数据集。
  21485. * @usage
  21486. */
  21487. var CreateDatasetParameters = /*#__PURE__*/function () {
  21488. function CreateDatasetParameters(options) {
  21489. CreateDatasetParameters_classCallCheck(this, CreateDatasetParameters);
  21490. if (!options) {
  21491. return;
  21492. }
  21493. /**
  21494. * @member {string} CreateDatasetParameters.prototype.datasourceName
  21495. * @description 数据源名称,此为必选参数。
  21496. */
  21497. this.datasourceName = null;
  21498. /**
  21499. * @member {string} CreateDatasetParameters.prototype.datasetName
  21500. * @description 数据集名称,此为必选参数。
  21501. */
  21502. this.datasetName = null;
  21503. /**
  21504. * @member {string} CreateDatasetParameters.prototype.datasetType
  21505. * @description 数据集类型。目前支持创建的数据集类型有:点、线、面、文本、复合(CAD)和属性数据集。
  21506. */
  21507. this.datasetType = null;
  21508. if (options) {
  21509. Util_Util.extend(this, options);
  21510. }
  21511. this.CLASS_NAME = "SuperMap.CreateDatasetParameters";
  21512. }
  21513. /**
  21514. * @function CreateDatasetParameters.prototype.destroy
  21515. * @description 释放资源,将引用资源的属性置空。
  21516. */
  21517. CreateDatasetParameters_createClass(CreateDatasetParameters, [{
  21518. key: "destroy",
  21519. value: function destroy() {
  21520. var me = this;
  21521. me.datasourceName = null;
  21522. me.datasetName = null;
  21523. me.datasetType = null;
  21524. }
  21525. }]);
  21526. return CreateDatasetParameters;
  21527. }();
  21528. ;// CONCATENATED MODULE: ./src/common/iServer/UpdateDatasetParameters.js
  21529. function UpdateDatasetParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  21530. function UpdateDatasetParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  21531. function UpdateDatasetParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) UpdateDatasetParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) UpdateDatasetParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  21532. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  21533. * This program are made available under the terms of the Apache License, Version 2.0
  21534. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  21535. /**
  21536. * @class UpdateDatasetParameters
  21537. * @deprecatedclass SuperMap.UpdateDatasetParameters
  21538. * @category iServer Data Dataset
  21539. * @classdesc 数据集信息更改参数类。
  21540. * @param {Object} options - 参数。
  21541. * @param {string} options.datasourceName - 数据源名称。
  21542. * @param {string} options.datasetName - 数据集名称。
  21543. * @param {boolean} options.isFileCache - 是否使用文件形式的缓存。仅对数据库型数据源中的矢量数据集有效。
  21544. * @param {string} options.description - 数据集描述信息。
  21545. * @param {string} options.prjCoordSys - 投影坐标系。
  21546. * @param {Object} options.charset - 矢量数据集的字符集。当数据集类型为矢量数据集时,可以传递此参数。如果用户传递空值,则编码方式保持不变。
  21547. * @param {Array.<string>} options.palette - 影像数据的颜色调色板。当数据集类型为影像数据集时,可以传递此参数。
  21548. * @param {number} options.noValue - 栅格数据集中没有数据的像元的栅格值。当数据集类型为栅格数据集时,可以传递此参数。
  21549. * @usage
  21550. */
  21551. var UpdateDatasetParameters = /*#__PURE__*/function () {
  21552. function UpdateDatasetParameters(options) {
  21553. UpdateDatasetParameters_classCallCheck(this, UpdateDatasetParameters);
  21554. if (!options) {
  21555. return;
  21556. }
  21557. /**
  21558. * @member {string} UpdateDatasetParameters.prototype.datasourceName
  21559. * @description 数据源名称。
  21560. */
  21561. this.datasourceName = null;
  21562. /**
  21563. * @member {string} UpdateDatasetParameters.prototype.datasetName
  21564. * @description 数据集名称。
  21565. */
  21566. this.datasetName = null;
  21567. /**
  21568. * @member {boolean} UpdateDatasetParameters.prototype.isFileCache
  21569. * @description 是否使用文件形式的缓存。仅对数据库型数据源中的矢量数据集有效。
  21570. */
  21571. this.isFileCache = null;
  21572. /**
  21573. * @member {string} UpdateDatasetParameters.prototype.description
  21574. * @description 数据集描述信息。
  21575. */
  21576. this.description = null;
  21577. /**
  21578. * @member {string} UpdateDatasetParameters.prototype.prjCoordSys
  21579. * @description 投影坐标系。
  21580. */
  21581. this.prjCoordSys = null;
  21582. /**
  21583. * @member {Object} UpdateDatasetParameters.prototype.charset
  21584. * @description 矢量数据集的字符集。
  21585. */
  21586. this.charset = null;
  21587. /**
  21588. * @member {Array.<string>} UpdateDatasetParameters.prototype.palette
  21589. * @description 影像数据的颜色调色板。
  21590. */
  21591. this.palette = null;
  21592. /**
  21593. * @member {number} UpdateDatasetParameters.prototype.noValue
  21594. * @description 栅格数据集中没有数据的像元的栅格值。
  21595. */
  21596. this.noValue = null;
  21597. if (options) {
  21598. Util_Util.extend(this, options);
  21599. }
  21600. this.CLASS_NAME = "SuperMap.UpdateDatasetParameters";
  21601. }
  21602. /**
  21603. * @function UpdateDatasetParameters.prototype.destroy
  21604. * @description 释放资源,将引用资源的属性置空。
  21605. */
  21606. UpdateDatasetParameters_createClass(UpdateDatasetParameters, [{
  21607. key: "destroy",
  21608. value: function destroy() {
  21609. var me = this;
  21610. me.datasourceName = null;
  21611. me.datasetName = null;
  21612. me.isFileCache = null;
  21613. me.prjCoordSys = null;
  21614. me.charset = null;
  21615. me.palette = null;
  21616. me.noValue = null;
  21617. }
  21618. }]);
  21619. return UpdateDatasetParameters;
  21620. }();
  21621. ;// CONCATENATED MODULE: ./src/maplibregl/services/DatasetService.js
  21622. function services_DatasetService_typeof(obj) { "@babel/helpers - typeof"; return services_DatasetService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, services_DatasetService_typeof(obj); }
  21623. function services_DatasetService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  21624. function services_DatasetService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  21625. function services_DatasetService_createClass(Constructor, protoProps, staticProps) { if (protoProps) services_DatasetService_defineProperties(Constructor.prototype, protoProps); if (staticProps) services_DatasetService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  21626. function services_DatasetService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) services_DatasetService_setPrototypeOf(subClass, superClass); }
  21627. function services_DatasetService_setPrototypeOf(o, p) { services_DatasetService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return services_DatasetService_setPrototypeOf(o, p); }
  21628. function services_DatasetService_createSuper(Derived) { var hasNativeReflectConstruct = services_DatasetService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = services_DatasetService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = services_DatasetService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return services_DatasetService_possibleConstructorReturn(this, result); }; }
  21629. function services_DatasetService_possibleConstructorReturn(self, call) { if (call && (services_DatasetService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return services_DatasetService_assertThisInitialized(self); }
  21630. function services_DatasetService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  21631. function services_DatasetService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  21632. function services_DatasetService_getPrototypeOf(o) { services_DatasetService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return services_DatasetService_getPrototypeOf(o); }
  21633. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  21634. * This program are made available under the terms of the Apache License, Version 2.0
  21635. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  21636. /**
  21637. * @class DatasetService
  21638. * @category iServer Data Dataset
  21639. * @classdesc 数据集信息服务类。
  21640. * @version 11.1.0
  21641. * @modulecategory Services
  21642. * @param {string} url - 服务地址。
  21643. * @param {Object} options - 参数。
  21644. * @param {string} [options.proxy] - 服务代理地址。
  21645. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  21646. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  21647. * @param {Object} [options.headers] - 请求头。
  21648. * @extends {ServiceBase}
  21649. * @usage
  21650. */
  21651. var DatasetService = /*#__PURE__*/function (_ServiceBase) {
  21652. services_DatasetService_inherits(DatasetService, _ServiceBase);
  21653. var _super = services_DatasetService_createSuper(DatasetService);
  21654. function DatasetService(url, options) {
  21655. var _this;
  21656. services_DatasetService_classCallCheck(this, DatasetService);
  21657. _this = _super.call(this, url, options);
  21658. _this._datasetService = new DatasetService_DatasetService(_this.url, {
  21659. proxy: _this.options.proxy,
  21660. withCredentials: _this.options.withCredentials,
  21661. crossOrigin: _this.options.crossOrigin,
  21662. headers: _this.options.headers
  21663. });
  21664. return _this;
  21665. }
  21666. /**
  21667. * @function DatasetService.prototype.getDatasets
  21668. * @description 数据集查询服务。
  21669. * @example
  21670. * new DatasetService(url).getDatasets(datasourceName,function(result){
  21671. * //doSomething
  21672. * });
  21673. * @param {string} datasourceName - 数据源名称。
  21674. * @param {RequestCallback} callback - 回调函数。
  21675. */
  21676. services_DatasetService_createClass(DatasetService, [{
  21677. key: "getDatasets",
  21678. value: function getDatasets(datasourceName, callback) {
  21679. if (!datasourceName) {
  21680. return;
  21681. }
  21682. this._datasetService.getDatasetsService(datasourceName, callback);
  21683. }
  21684. /**
  21685. * @function DatasetService.prototype.getDataset
  21686. * @description 数据集查询服务。
  21687. * @example
  21688. * new DatasetService(url).getDataset(datasourceName, datasetName, function(result){
  21689. * //doSomething
  21690. * });
  21691. * @param {string} datasourceName - 数据源名称。
  21692. * @param {string} datasetName - 数据集名称。
  21693. * @param {RequestCallback} callback - 回调函数。
  21694. */
  21695. }, {
  21696. key: "getDataset",
  21697. value: function getDataset(datasourceName, datasetName, callback) {
  21698. if (!datasourceName || !datasetName) {
  21699. return;
  21700. }
  21701. this._datasetService.getDatasetService(datasourceName, datasetName, callback);
  21702. }
  21703. /**
  21704. * @function DatasetService.prototype.setDataset
  21705. * @description 数据集信息设置服务。可实现修改已存在数据集,新增不存在数据集。
  21706. * @example
  21707. * new DatasetService(url).setDataset(params, function(result){
  21708. * //doSomething
  21709. * });
  21710. * @param {CreateDatasetParameters|UpdateDatasetParameters} params - 数据集创建参数类或数据集信息更改参数类。
  21711. * @param {RequestCallback} callback - 回调函数。
  21712. */
  21713. }, {
  21714. key: "setDataset",
  21715. value: function setDataset(params, callback) {
  21716. if (!(params instanceof CreateDatasetParameters) && !(params instanceof UpdateDatasetParameters)) {
  21717. return;
  21718. } else if (params instanceof CreateDatasetParameters) {
  21719. var datasetParams = {
  21720. "datasetType": params.datasetType,
  21721. "datasetName": params.datasetName,
  21722. "datasourceName": params.datasourceName
  21723. };
  21724. } else if (params instanceof UpdateDatasetParameters) {
  21725. datasetParams = {
  21726. "datasetName": params.datasetName,
  21727. "datasourceName": params.datasourceName,
  21728. "isFileCache": params.isFileCache,
  21729. "description": params.description,
  21730. "prjCoordSys": params.prjCoordSys,
  21731. "charset": params.charset
  21732. };
  21733. }
  21734. this._datasetService.setDatasetService(datasetParams, callback);
  21735. }
  21736. /**
  21737. * @function DatasetService.prototype.deleteDataset
  21738. * @description 指定数据源下的数据集删除服务。
  21739. * @example
  21740. * new DatasetService(url).deleteDataset(datasourceName, datasetName, function(result){
  21741. * //doSomething
  21742. * });
  21743. * @param {string} datasourceName - 数据源名称。
  21744. * @param {string} datasetName - 数据集名称。
  21745. * @param {RequestCallback} callback - 回调函数。
  21746. */
  21747. }, {
  21748. key: "deleteDataset",
  21749. value: function deleteDataset(datasourceName, datasetName, callback) {
  21750. this._datasetService.deleteDatasetService(datasourceName, datasetName, callback);
  21751. }
  21752. }]);
  21753. return DatasetService;
  21754. }(ServiceBase);
  21755. ;// CONCATENATED MODULE: ./src/common/iServer/SetDatasourceParameters.js
  21756. function SetDatasourceParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  21757. function SetDatasourceParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  21758. function SetDatasourceParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) SetDatasourceParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) SetDatasourceParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  21759. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  21760. * This program are made available under the terms of the Apache License, Version 2.0
  21761. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  21762. /**
  21763. * @class SetDatasourceParameters
  21764. * @deprecatedclass SuperMap.SetDatasourceParameters
  21765. * @category iServer Data Datasource
  21766. * @classdesc 设置数据源信息参数类。
  21767. * @param {Object} options - 参数。
  21768. * @param {string} options.datasourceName - 数据源名称。
  21769. * @param {string} options.description - 数据源描述信息。
  21770. * @param {string} options.coordUnit - 坐标单位。
  21771. * @param {string} options.distanceUnit - 距离单位。
  21772. * @usage
  21773. */
  21774. var SetDatasourceParameters = /*#__PURE__*/function () {
  21775. function SetDatasourceParameters(options) {
  21776. SetDatasourceParameters_classCallCheck(this, SetDatasourceParameters);
  21777. if (!options) {
  21778. return;
  21779. }
  21780. /**
  21781. * @member {string} SetDatasourceParameters.prototype.datasourceName
  21782. * @description 数据源名称。
  21783. */
  21784. this.datasourceName = null;
  21785. /**
  21786. * @member {string} SetDatasourceParameters.prototype.description
  21787. * @description 数据源描述信息。
  21788. */
  21789. this.description = null;
  21790. /**
  21791. * @member {string} SetDatasourceParameters.prototype.coordUnit
  21792. * @description 坐标单位。
  21793. */
  21794. this.coordUnit = null;
  21795. /**
  21796. * @member {string} SetDatasourceParameters.prototype.distanceUnit
  21797. * @description 距离单位。
  21798. */
  21799. this.distanceUnit = null;
  21800. if (options) {
  21801. Util_Util.extend(this, options);
  21802. }
  21803. this.CLASS_NAME = "SuperMap.SetDatasourceParameters";
  21804. }
  21805. /**
  21806. * @function SetDatasourceParameters.prototype.destroy
  21807. * @description 释放资源,将引用资源的属性置空。
  21808. */
  21809. SetDatasourceParameters_createClass(SetDatasourceParameters, [{
  21810. key: "destroy",
  21811. value: function destroy() {
  21812. var me = this;
  21813. me.datasourceName = null;
  21814. me.description = null;
  21815. me.coordUnit = null;
  21816. me.distanceUnit = null;
  21817. }
  21818. }]);
  21819. return SetDatasourceParameters;
  21820. }();
  21821. ;// CONCATENATED MODULE: ./src/common/iServer/DatasourceService.js
  21822. function DatasourceService_typeof(obj) { "@babel/helpers - typeof"; return DatasourceService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, DatasourceService_typeof(obj); }
  21823. function DatasourceService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  21824. function DatasourceService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  21825. function DatasourceService_createClass(Constructor, protoProps, staticProps) { if (protoProps) DatasourceService_defineProperties(Constructor.prototype, protoProps); if (staticProps) DatasourceService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  21826. function DatasourceService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { DatasourceService_get = Reflect.get.bind(); } else { DatasourceService_get = function _get(target, property, receiver) { var base = DatasourceService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return DatasourceService_get.apply(this, arguments); }
  21827. function DatasourceService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = DatasourceService_getPrototypeOf(object); if (object === null) break; } return object; }
  21828. function DatasourceService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) DatasourceService_setPrototypeOf(subClass, superClass); }
  21829. function DatasourceService_setPrototypeOf(o, p) { DatasourceService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return DatasourceService_setPrototypeOf(o, p); }
  21830. function DatasourceService_createSuper(Derived) { var hasNativeReflectConstruct = DatasourceService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = DatasourceService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = DatasourceService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return DatasourceService_possibleConstructorReturn(this, result); }; }
  21831. function DatasourceService_possibleConstructorReturn(self, call) { if (call && (DatasourceService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return DatasourceService_assertThisInitialized(self); }
  21832. function DatasourceService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  21833. function DatasourceService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  21834. function DatasourceService_getPrototypeOf(o) { DatasourceService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return DatasourceService_getPrototypeOf(o); }
  21835. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  21836. * This program are made available under the terms of the Apache License, Version 2.0
  21837. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  21838. /**
  21839. * @class DatasourceService
  21840. * @deprecatedclass SuperMap.DatasourceService
  21841. * @category iServer Data Datasource
  21842. * @classdesc 数据源查询服务类。
  21843. * @param {string} url - 服务地址。如访问World Data服务,只需将url设为:http://localhost:8090/iserver/services/data-world/rest/data 即可。
  21844. * @param {Object} options - 参数。
  21845. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  21846. * @param {DataFormat} [options.format=DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
  21847. * @param {string} options.datasource - 要查询的数据集所在的数据源名称。
  21848. * @param {string} options.dataset - 要查询的数据集名称。
  21849. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  21850. * @param {Object} [options.headers] - 请求头。
  21851. * @extends {CommonServiceBase}
  21852. * @usage
  21853. */
  21854. var DatasourceService_DatasourceService = /*#__PURE__*/function (_CommonServiceBase) {
  21855. DatasourceService_inherits(DatasourceService, _CommonServiceBase);
  21856. var _super = DatasourceService_createSuper(DatasourceService);
  21857. function DatasourceService(url, options) {
  21858. var _this;
  21859. DatasourceService_classCallCheck(this, DatasourceService);
  21860. _this = _super.call(this, url, options);
  21861. if (options) {
  21862. Util_Util.extend(DatasourceService_assertThisInitialized(_this), options);
  21863. }
  21864. _this.eventCount = 0;
  21865. _this.CLASS_NAME = "SuperMap.DatasourceService";
  21866. return _this;
  21867. }
  21868. /**
  21869. * @function DatasourceService.prototype.destroy
  21870. * @override
  21871. */
  21872. DatasourceService_createClass(DatasourceService, [{
  21873. key: "destroy",
  21874. value: function destroy() {
  21875. this.eventCount = 0;
  21876. DatasourceService_get(DatasourceService_getPrototypeOf(DatasourceService.prototype), "destroy", this).call(this);
  21877. }
  21878. /**
  21879. * @function DatasourceService.prototype.getDatasourceService
  21880. * @description 获取指定数据源信息。
  21881. */
  21882. }, {
  21883. key: "getDatasourceService",
  21884. value: function getDatasourceService(datasourceName, callback) {
  21885. var url = Util_Util.urlPathAppend(this.url, "datasources/name/".concat(datasourceName));
  21886. this.processAsync(url, "GET", callback);
  21887. }
  21888. /**
  21889. * @function DatasourceService.prototype.getDatasourcesService
  21890. * @description 获取所有数据源信息。
  21891. */
  21892. }, {
  21893. key: "getDatasourcesService",
  21894. value: function getDatasourcesService(callback) {
  21895. var url = Util_Util.urlPathAppend(this.url, "datasources");
  21896. this.processAsync(url, "GET", callback);
  21897. }
  21898. /**
  21899. * @function DatasourceService.prototype.setDatasourceService
  21900. * @description 更新数据源信息。
  21901. */
  21902. }, {
  21903. key: "setDatasourceService",
  21904. value: function setDatasourceService(params, callback) {
  21905. if (!params) {
  21906. return;
  21907. }
  21908. var url = Util_Util.urlPathAppend(this.url, "datasources/name/".concat(params.datasourceName));
  21909. this.processAsync(url, "PUT", callback, params);
  21910. }
  21911. }, {
  21912. key: "processAsync",
  21913. value: function processAsync(url, method, callback, params) {
  21914. var eventId = ++this.eventCount;
  21915. var eventListeners = {
  21916. scope: this,
  21917. processCompleted: function processCompleted(result) {
  21918. if (eventId === result.result.eventId && callback) {
  21919. delete result.result.eventId;
  21920. callback(result);
  21921. this.events && this.events.un(eventListeners);
  21922. return false;
  21923. }
  21924. },
  21925. processFailed: function processFailed(result) {
  21926. if ((eventId === result.error.eventId || eventId === result.eventId) && callback) {
  21927. callback(result);
  21928. this.events && this.events.un(eventListeners);
  21929. return false;
  21930. }
  21931. }
  21932. };
  21933. this.events.on(eventListeners);
  21934. var me = this;
  21935. var requestConfig = {
  21936. url: url,
  21937. method: method,
  21938. scope: me,
  21939. success: function success(result, options) {
  21940. result.eventId = eventId;
  21941. this.serviceProcessCompleted(result, options);
  21942. },
  21943. failure: function failure(result, options) {
  21944. if (result.error) {
  21945. result.error.eventId = eventId;
  21946. }
  21947. result.eventId = eventId;
  21948. this.serviceProcessFailed(result, options);
  21949. }
  21950. };
  21951. params && (requestConfig.data = Util_Util.toJSON(params));
  21952. me.request(requestConfig);
  21953. }
  21954. }]);
  21955. return DatasourceService;
  21956. }(CommonServiceBase);
  21957. ;// CONCATENATED MODULE: ./src/maplibregl/services/DatasourceService.js
  21958. function services_DatasourceService_typeof(obj) { "@babel/helpers - typeof"; return services_DatasourceService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, services_DatasourceService_typeof(obj); }
  21959. function services_DatasourceService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  21960. function services_DatasourceService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  21961. function services_DatasourceService_createClass(Constructor, protoProps, staticProps) { if (protoProps) services_DatasourceService_defineProperties(Constructor.prototype, protoProps); if (staticProps) services_DatasourceService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  21962. function services_DatasourceService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) services_DatasourceService_setPrototypeOf(subClass, superClass); }
  21963. function services_DatasourceService_setPrototypeOf(o, p) { services_DatasourceService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return services_DatasourceService_setPrototypeOf(o, p); }
  21964. function services_DatasourceService_createSuper(Derived) { var hasNativeReflectConstruct = services_DatasourceService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = services_DatasourceService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = services_DatasourceService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return services_DatasourceService_possibleConstructorReturn(this, result); }; }
  21965. function services_DatasourceService_possibleConstructorReturn(self, call) { if (call && (services_DatasourceService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return services_DatasourceService_assertThisInitialized(self); }
  21966. function services_DatasourceService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  21967. function services_DatasourceService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  21968. function services_DatasourceService_getPrototypeOf(o) { services_DatasourceService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return services_DatasourceService_getPrototypeOf(o); }
  21969. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  21970. * This program are made available under the terms of the Apache License, Version 2.0
  21971. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  21972. /**
  21973. * @class DatasourceService
  21974. * @category iServer Data Datasource
  21975. * @classdesc 数据源服务类。
  21976. * @modulecategory Services
  21977. * @version 11.1.0
  21978. * @modulecategory Services
  21979. * @param {string} url - 服务地址。
  21980. * @param {Object} options - 参数。
  21981. * @param {string} [options.proxy] - 服务代理地址。
  21982. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  21983. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  21984. * @param {Object} [options.headers] - 请求头。
  21985. * @extends {ServiceBase}
  21986. * @usage
  21987. */
  21988. var DatasourceService = /*#__PURE__*/function (_ServiceBase) {
  21989. services_DatasourceService_inherits(DatasourceService, _ServiceBase);
  21990. var _super = services_DatasourceService_createSuper(DatasourceService);
  21991. function DatasourceService(url, options) {
  21992. var _this;
  21993. services_DatasourceService_classCallCheck(this, DatasourceService);
  21994. _this = _super.call(this, url, options);
  21995. _this._datasourceService = new DatasourceService_DatasourceService(_this.url, {
  21996. proxy: _this.proxy,
  21997. withCredentials: _this.withCredentials,
  21998. crossOrigin: _this.crossOrigin,
  21999. headers: _this.headers
  22000. });
  22001. return _this;
  22002. }
  22003. /**
  22004. * @function DatasourceService.prototype.getDatasources
  22005. * @description 数据源集查询服务。
  22006. * @example
  22007. * new DatasourceService(url).getDatasources(function(result){
  22008. * //doSomething
  22009. * });
  22010. * @param {RequestCallback} callback - 回调函数。
  22011. */
  22012. services_DatasourceService_createClass(DatasourceService, [{
  22013. key: "getDatasources",
  22014. value: function getDatasources(callback) {
  22015. this._datasourceService.getDatasourcesService(callback);
  22016. }
  22017. /**
  22018. * @function DatasourceService.prototype.getDatasource
  22019. * @description 数据源信息查询服务。
  22020. * @example
  22021. * new DatasourceService(url).getDatasource(datasourceName,function(result){
  22022. * //doSomething
  22023. * });
  22024. * @param {string} datasourceName - 数据源名称。
  22025. * @param {RequestCallback} callback 回调函数。
  22026. */
  22027. }, {
  22028. key: "getDatasource",
  22029. value: function getDatasource(datasourceName, callback) {
  22030. if (!datasourceName) {
  22031. return;
  22032. }
  22033. this._datasourceService.getDatasourceService(datasourceName, callback);
  22034. }
  22035. /**
  22036. * @function DatasourceService.prototype.setDatasource
  22037. * @description 数据源信息设置服务。可实现更改当前数据源信息。
  22038. * @example
  22039. * new DatasourceService(url).setDatasource(params, function(result){
  22040. * //doSomething
  22041. * });
  22042. * @param {SetDatasourceParameters} params - 数据源信息查询参数类。
  22043. * @param {RequestCallback} callback - 回调函数。
  22044. */
  22045. }, {
  22046. key: "setDatasource",
  22047. value: function setDatasource(params, callback) {
  22048. if (!(params instanceof SetDatasourceParameters)) {
  22049. return;
  22050. }
  22051. var datasourceParams = {
  22052. description: params.description,
  22053. coordUnit: params.coordUnit,
  22054. distanceUnit: params.distanceUnit,
  22055. datasourceName: params.datasourceName
  22056. };
  22057. this._datasourceService.setDatasourceService(datasourceParams, callback);
  22058. }
  22059. }]);
  22060. return DatasourceService;
  22061. }(ServiceBase);
  22062. ;// CONCATENATED MODULE: ./src/common/iServer/EditFeaturesParameters.js
  22063. function EditFeaturesParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  22064. function EditFeaturesParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  22065. function EditFeaturesParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) EditFeaturesParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) EditFeaturesParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  22066. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  22067. * This program are made available under the terms of the Apache License, Version 2.0
  22068. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  22069. /**
  22070. * @class EditFeaturesParameters
  22071. * @deprecatedclass SuperMap.EditFeaturesParameters
  22072. * @category iServer Data Feature
  22073. * @classdesc 数据集添加、修改、删除参数类。
  22074. * @param {Object} options - 参数。
  22075. * @param {Array.<FeatureVector|GeoJSONObject|ol.Feature>} options.features - 当前需要创建或者是修改的要素集。
  22076. * @param {boolean} [options.returnContent=false] - 是否返回要素内容。如果为true则返回创建要素的 ID 数组,否则返回 featureResult 资源的 URI。
  22077. * @param {EditType} [options.editType=EditType.ADD] - POST 动作类型 (ADD、UPDATE、DELETE)。
  22078. * @param {Array.<string|number>} [options.IDs] - 删除要素时的要素的 ID 数组。
  22079. * @usage
  22080. */
  22081. var EditFeaturesParameters = /*#__PURE__*/function () {
  22082. function EditFeaturesParameters(options) {
  22083. EditFeaturesParameters_classCallCheck(this, EditFeaturesParameters);
  22084. /**
  22085. * @member {string} EditFeaturesParameters.prototype.dataSourceName
  22086. * @description 当前需要创建或者是修改的要素的数据源。
  22087. */
  22088. this.dataSourceName = null;
  22089. /**
  22090. * @member {string} EditFeaturesParameters.prototype.dataSetName
  22091. * @description 当前需要创建或者是修改的要素的数据集。
  22092. */
  22093. this.dataSetName = null;
  22094. /**
  22095. * @member {Array.<FeatureVector|GeoJSONObject|ol.Feature>} EditFeaturesParameters.prototype.features
  22096. * @description 当前需要创建或者是修改的要素集。
  22097. */
  22098. this.features = null;
  22099. /**
  22100. * @member {EditType} [EditFeaturesParameters.prototype.editType=EditType.ADD]
  22101. * @description 要素集更新类型 (add、update、delete)。
  22102. */
  22103. this.editType = EditType.ADD;
  22104. /**
  22105. * @member {Array.<string|number>} [EditFeaturesParameters.prototype.IDs]
  22106. * @description 执行删除时要素集 ID 集合。
  22107. */
  22108. this.IDs = null;
  22109. /**
  22110. * @member {boolean} [EditFeaturesParameters.prototype.returnContent=false]
  22111. * @description 要素添加时,isUseBatch 不传或传为 false 的情况下有效。
  22112. * true 表示直接返回新创建的要素的 ID 数组;false 表示返回创建的 featureResult 资源的 URI。
  22113. */
  22114. this.returnContent = false;
  22115. /**
  22116. * @member {boolean} [EditFeaturesParameters.prototype.isUseBatch=false]
  22117. * @description 是否使用批量添加要素功能,要素添加时有效。批量添加能够提高要素编辑效率。true 表示批量添加;false 表示不使用批量添加。
  22118. */
  22119. this.isUseBatch = false;
  22120. Util_Util.extend(this, options);
  22121. this.CLASS_NAME = "SuperMap.EditFeaturesParameters";
  22122. }
  22123. /**
  22124. * @function EditFeaturesParameters.prototype.destroy
  22125. * @description 释放资源,将引用资源的属性置空。
  22126. */
  22127. EditFeaturesParameters_createClass(EditFeaturesParameters, [{
  22128. key: "destroy",
  22129. value: function destroy() {
  22130. var me = this;
  22131. me.dataSourceName = null;
  22132. me.dataSetName = null;
  22133. me.features = null;
  22134. me.editType = null;
  22135. me.IDs = null;
  22136. me.returnContent = null;
  22137. }
  22138. /**
  22139. * @function EditFeaturesParameters.prototype.toJsonParameters
  22140. * @description 将 EditFeaturesParameters 对象参数转换为 JSON 字符串。
  22141. * @param {EditFeaturesParameters} params - 地物编辑参数。
  22142. * @returns {string} JSON 字符串。
  22143. */
  22144. }], [{
  22145. key: "toJsonParameters",
  22146. value: function toJsonParameters(params) {
  22147. var feature,
  22148. len,
  22149. features,
  22150. editType = params.editType;
  22151. if (editType === EditType.DELETE) {
  22152. if (params.IDs === null) {
  22153. return;
  22154. }
  22155. features = {
  22156. ids: params.IDs
  22157. };
  22158. } else {
  22159. features = [];
  22160. if (params.features) {
  22161. len = params.features.length;
  22162. for (var i = 0; i < len; i++) {
  22163. feature = params.features[i];
  22164. feature.geometry = ServerGeometry.fromGeometry(feature.geometry);
  22165. features.push(feature);
  22166. }
  22167. }
  22168. }
  22169. return Util_Util.toJSON(features);
  22170. }
  22171. }]);
  22172. return EditFeaturesParameters;
  22173. }();
  22174. ;// CONCATENATED MODULE: ./src/common/iServer/EditFeaturesService.js
  22175. function EditFeaturesService_typeof(obj) { "@babel/helpers - typeof"; return EditFeaturesService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, EditFeaturesService_typeof(obj); }
  22176. function EditFeaturesService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  22177. function EditFeaturesService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  22178. function EditFeaturesService_createClass(Constructor, protoProps, staticProps) { if (protoProps) EditFeaturesService_defineProperties(Constructor.prototype, protoProps); if (staticProps) EditFeaturesService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  22179. function EditFeaturesService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { EditFeaturesService_get = Reflect.get.bind(); } else { EditFeaturesService_get = function _get(target, property, receiver) { var base = EditFeaturesService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return EditFeaturesService_get.apply(this, arguments); }
  22180. function EditFeaturesService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = EditFeaturesService_getPrototypeOf(object); if (object === null) break; } return object; }
  22181. function EditFeaturesService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) EditFeaturesService_setPrototypeOf(subClass, superClass); }
  22182. function EditFeaturesService_setPrototypeOf(o, p) { EditFeaturesService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return EditFeaturesService_setPrototypeOf(o, p); }
  22183. function EditFeaturesService_createSuper(Derived) { var hasNativeReflectConstruct = EditFeaturesService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = EditFeaturesService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = EditFeaturesService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return EditFeaturesService_possibleConstructorReturn(this, result); }; }
  22184. function EditFeaturesService_possibleConstructorReturn(self, call) { if (call && (EditFeaturesService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return EditFeaturesService_assertThisInitialized(self); }
  22185. function EditFeaturesService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  22186. function EditFeaturesService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  22187. function EditFeaturesService_getPrototypeOf(o) { EditFeaturesService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return EditFeaturesService_getPrototypeOf(o); }
  22188. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  22189. * This program are made available under the terms of the Apache License, Version 2.0
  22190. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  22191. /**
  22192. * @class EditFeaturesService
  22193. * @deprecatedclass SuperMap.EditFeaturesService
  22194. * @category iServer Data Feature
  22195. * @classdesc 数据服务中数据集添加、更新、删除服务类。
  22196. * @extends {CommonServiceBase}
  22197. * @param {string} url - 服务端的数据服务资源地址。请求数据服务中数据集编辑服务,URL 应为:</br>
  22198. * http://{服务器地址}:{服务端口号}/iserver/services/{数据服务名}/rest/data/datasources/name/{数据源名}/datasets/name/{数据集名} 。</br>
  22199. * 例如:http://localhost:8090/iserver/services/data-jingjin/rest/data/datasources/name/Jingjin/datasets/name/Landuse_R
  22200. * @param {Object} options - 参数。
  22201. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  22202. * @param {DataFormat} [format] -查询结果返回格式,目前支持iServerJSON 和GeoJSON两种格式。参数格式为"ISERVER","GEOJSON"。
  22203. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  22204. * @param {Object} [options.headers] - 请求头。
  22205. * @example
  22206. * var myService = new EditFeaturesService(url, {eventListeners: {
  22207. * "processCompleted": editFeatureCompleted,
  22208. * "processFailed": editFeatureError
  22209. * }
  22210. * };
  22211. * @usage
  22212. */
  22213. var EditFeaturesService = /*#__PURE__*/function (_CommonServiceBase) {
  22214. EditFeaturesService_inherits(EditFeaturesService, _CommonServiceBase);
  22215. var _super = EditFeaturesService_createSuper(EditFeaturesService);
  22216. function EditFeaturesService(url, options) {
  22217. var _this;
  22218. EditFeaturesService_classCallCheck(this, EditFeaturesService);
  22219. _this = _super.call(this, url, options);
  22220. /**
  22221. * @member {boolean} [EditFeaturesService.prototype.returnContent=false]
  22222. * @description要素添加时,isUseBatch 不传或传为 false 的情况下有效。true 表示直接返回新创建的要素的 ID 数组;false 表示返回创建的 featureResult 资源的 URI。
  22223. */
  22224. _this.returnContent = false;
  22225. /**
  22226. * @member {boolean} [EditFeaturesService.prototype.isUseBatch=false]
  22227. * @description 是否使用批量添加要素功能,要素添加时有效。
  22228. * 批量添加能够提高要素编辑效率。
  22229. * true 表示批量添加;false 表示不使用批量添加。
  22230. */
  22231. _this.isUseBatch = false;
  22232. if (options) {
  22233. Util_Util.extend(EditFeaturesService_assertThisInitialized(_this), options);
  22234. }
  22235. _this.url = Util_Util.urlPathAppend(_this.url, 'features');
  22236. _this.CLASS_NAME = "SuperMap.EditFeaturesService";
  22237. return _this;
  22238. }
  22239. /**
  22240. * @function EditFeaturesService.prototype.destroy
  22241. * @override
  22242. */
  22243. EditFeaturesService_createClass(EditFeaturesService, [{
  22244. key: "destroy",
  22245. value: function destroy() {
  22246. EditFeaturesService_get(EditFeaturesService_getPrototypeOf(EditFeaturesService.prototype), "destroy", this).call(this);
  22247. var me = this;
  22248. me.returnContent = null;
  22249. me.isUseBatch = null;
  22250. me.fromIndex = null;
  22251. me.toIndex = null;
  22252. }
  22253. /**
  22254. * @function EditFeaturesService.prototype.processAsync
  22255. * @description 负责将客户端的更新参数传递到服务端。
  22256. * @param {EditFeaturesParameters} params - 编辑要素参数。
  22257. */
  22258. }, {
  22259. key: "processAsync",
  22260. value: function processAsync(params) {
  22261. if (!(params instanceof EditFeaturesParameters)) {
  22262. return;
  22263. }
  22264. var me = this,
  22265. method = "POST",
  22266. ids = "",
  22267. editType = params.editType,
  22268. jsonParameters = null;
  22269. me.returnContent = params.returnContent;
  22270. me.isUseBatch = params.isUseBatch;
  22271. jsonParameters = EditFeaturesParameters.toJsonParameters(params);
  22272. if (editType === EditType.DELETE) {
  22273. ids = Util_Util.toJSON(params.IDs);
  22274. jsonParameters = ids;
  22275. var urlWithIds = Util_Util.urlAppend(me.url, Util_Util.getParameterString({
  22276. ids: ids
  22277. }));
  22278. if (FetchRequest.urlIsLong(urlWithIds)) {
  22279. me.url = Util_Util.urlAppend(me.url, Util_Util.getParameterString({
  22280. _method: 'DELETE'
  22281. }));
  22282. method = "POST";
  22283. } else {
  22284. me.url = urlWithIds;
  22285. method = "DELETE";
  22286. }
  22287. } else if (editType === EditType.UPDATE) {
  22288. method = "PUT";
  22289. } else {
  22290. if (me.isUseBatch) {
  22291. me.url = Util_Util.urlAppend(me.url, "isUseBatch=".concat(me.isUseBatch));
  22292. me.returnContent = false;
  22293. }
  22294. if (me.returnContent) {
  22295. me.url = Util_Util.urlAppend(me.url, 'returnContent=true');
  22296. method = "POST";
  22297. }
  22298. }
  22299. me.request({
  22300. method: method,
  22301. data: jsonParameters,
  22302. scope: me,
  22303. success: me.serviceProcessCompleted,
  22304. failure: me.serviceProcessFailed
  22305. });
  22306. }
  22307. }]);
  22308. return EditFeaturesService;
  22309. }(CommonServiceBase);
  22310. ;// CONCATENATED MODULE: ./src/common/iServer/GetFeaturesServiceBase.js
  22311. function GetFeaturesServiceBase_typeof(obj) { "@babel/helpers - typeof"; return GetFeaturesServiceBase_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, GetFeaturesServiceBase_typeof(obj); }
  22312. function GetFeaturesServiceBase_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  22313. function GetFeaturesServiceBase_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  22314. function GetFeaturesServiceBase_createClass(Constructor, protoProps, staticProps) { if (protoProps) GetFeaturesServiceBase_defineProperties(Constructor.prototype, protoProps); if (staticProps) GetFeaturesServiceBase_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  22315. function GetFeaturesServiceBase_get() { if (typeof Reflect !== "undefined" && Reflect.get) { GetFeaturesServiceBase_get = Reflect.get.bind(); } else { GetFeaturesServiceBase_get = function _get(target, property, receiver) { var base = GetFeaturesServiceBase_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return GetFeaturesServiceBase_get.apply(this, arguments); }
  22316. function GetFeaturesServiceBase_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GetFeaturesServiceBase_getPrototypeOf(object); if (object === null) break; } return object; }
  22317. function GetFeaturesServiceBase_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) GetFeaturesServiceBase_setPrototypeOf(subClass, superClass); }
  22318. function GetFeaturesServiceBase_setPrototypeOf(o, p) { GetFeaturesServiceBase_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GetFeaturesServiceBase_setPrototypeOf(o, p); }
  22319. function GetFeaturesServiceBase_createSuper(Derived) { var hasNativeReflectConstruct = GetFeaturesServiceBase_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = GetFeaturesServiceBase_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = GetFeaturesServiceBase_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return GetFeaturesServiceBase_possibleConstructorReturn(this, result); }; }
  22320. function GetFeaturesServiceBase_possibleConstructorReturn(self, call) { if (call && (GetFeaturesServiceBase_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return GetFeaturesServiceBase_assertThisInitialized(self); }
  22321. function GetFeaturesServiceBase_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  22322. function GetFeaturesServiceBase_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  22323. function GetFeaturesServiceBase_getPrototypeOf(o) { GetFeaturesServiceBase_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GetFeaturesServiceBase_getPrototypeOf(o); }
  22324. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  22325. * This program are made available under the terms of the Apache License, Version 2.0
  22326. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  22327. /**
  22328. * @class GetFeaturesServiceBase
  22329. * @deprecatedclass SuperMap.GetFeaturesServiceBase
  22330. * @category iServer Data FeatureResults
  22331. * @classdesc 数据服务中数据集查询服务基类。获取结果数据类型为 Object。包含 result 属性,result 的数据格式根据 format 参数决定为 GeoJSON 或者 iServerJSON。
  22332. * @extends CommonServiceBase
  22333. * @param {string} url - 服务地址。请求数据服务中数据集查询服务,
  22334. * URL应为:http://{服务器地址}:{服务端口号}/iserver/services/{数据服务名}/rest/data/
  22335. * 例如:"http://localhost:8090/iserver/services/data-jingjin/rest/data/"
  22336. * @param {Object} options - 参数。
  22337. * @param {Object} options.eventListeners - 事件监听器对象。有 processCompleted 属性可传入处理完成后的回调函数。processFailed 属性传入处理失败后的回调函数。
  22338. * @param {DataFormat} [options.format=DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON、GeoJSON、FGB 三种格式。参数格式为 "ISERVER","GEOJSON","FGB"。
  22339. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  22340. * @param {Object} [options.headers] - 请求头。
  22341. * @example
  22342. * var myService = new GetFeaturesServiceBase(url, {
  22343. * eventListeners: {
  22344. * "processCompleted": getFeatureCompleted,
  22345. * "processFailed": getFeatureError
  22346. * }
  22347. * });
  22348. * @usage
  22349. */
  22350. var GetFeaturesServiceBase = /*#__PURE__*/function (_CommonServiceBase) {
  22351. GetFeaturesServiceBase_inherits(GetFeaturesServiceBase, _CommonServiceBase);
  22352. var _super = GetFeaturesServiceBase_createSuper(GetFeaturesServiceBase);
  22353. function GetFeaturesServiceBase(url, options) {
  22354. var _this;
  22355. GetFeaturesServiceBase_classCallCheck(this, GetFeaturesServiceBase);
  22356. _this = _super.call(this, url, options);
  22357. options = options || {};
  22358. /**
  22359. * @member {boolean} [GetFeaturesServiceBase.prototype.returnContent=true]
  22360. * @description 是否立即返回新创建资源的表述还是返回新资源的 URI。
  22361. * 如果为 true,则直接返回新创建资源,即查询结果的表述。
  22362. * 如果为 false,则返回的是查询结果资源的 URI。
  22363. */
  22364. _this.returnContent = true;
  22365. /**
  22366. * @member {number} [GetFeaturesServiceBase.prototype.fromIndex=0]
  22367. * @description 查询结果的最小索引号。如果该值大于查询结果的最大索引号,则查询结果为空。
  22368. */
  22369. _this.fromIndex = 0;
  22370. /**
  22371. * @member {number} [GetFeaturesServiceBase.prototype.toIndex=19]
  22372. * @description 查询结果的最大索引号。
  22373. * 如果该值大于查询结果的最大索引号,则以查询结果的最大索引号为终止索引号。
  22374. */
  22375. _this.toIndex = 19;
  22376. /**
  22377. * @member {number} [GetFeaturesServiceBase.prototype.hasGeometry=true]
  22378. * @description 返回结果是否包含Geometry。
  22379. */
  22380. _this.hasGeometry = true;
  22381. /**
  22382. * @member {number} [GetFeaturesServiceBase.prototype.maxFeatures=1000]
  22383. * @description 进行 SQL 查询时,用于设置服务端返回查询结果条目数量。
  22384. */
  22385. _this.maxFeatures = null;
  22386. /**
  22387. * @member {string} [GetFeaturesServiceBase.prototype.format=DataFormat.GEOJSON]
  22388. * @description 查询结果返回格式,目前支持 iServerJSON、GeoJSON、FGB 三种格式。
  22389. * 参数格式为 "ISERVER","GEOJSON","FGB"。
  22390. */
  22391. _this.format = DataFormat.GEOJSON;
  22392. Util_Util.extend(GetFeaturesServiceBase_assertThisInitialized(_this), options);
  22393. _this.url = Util_Util.urlPathAppend(_this.url, 'featureResults');
  22394. _this.CLASS_NAME = "SuperMap.GetFeaturesServiceBase";
  22395. return _this;
  22396. }
  22397. /**
  22398. * @function GetFeaturesServiceBase.prototype.destroy
  22399. * @description 释放资源,将引用资源的属性置空。
  22400. */
  22401. GetFeaturesServiceBase_createClass(GetFeaturesServiceBase, [{
  22402. key: "destroy",
  22403. value: function destroy() {
  22404. GetFeaturesServiceBase_get(GetFeaturesServiceBase_getPrototypeOf(GetFeaturesServiceBase.prototype), "destroy", this).call(this);
  22405. var me = this;
  22406. me.returnContent = null;
  22407. me.fromIndex = null;
  22408. me.toIndex = null;
  22409. me.maxFeatures = null;
  22410. me.format = null;
  22411. me.hasGeometry = null;
  22412. }
  22413. /**
  22414. * @function GetFeaturesServiceBase.prototype.processAsync
  22415. * @description 将客户端的查询参数传递到服务端。
  22416. * @param {Object} params - 查询参数。
  22417. */
  22418. }, {
  22419. key: "processAsync",
  22420. value: function processAsync(params) {
  22421. if (!params) {
  22422. return;
  22423. }
  22424. var me = this,
  22425. jsonParameters = null,
  22426. firstPara = true;
  22427. me.returnContent = params.returnContent;
  22428. me.fromIndex = params.fromIndex;
  22429. me.toIndex = params.toIndex;
  22430. me.maxFeatures = params.maxFeatures;
  22431. me.hasGeometry = params.hasGeometry;
  22432. if (me.returnContent) {
  22433. firstPara = false;
  22434. }
  22435. var isValidNumber = me.fromIndex != null && me.toIndex != null && !isNaN(me.fromIndex) && !isNaN(me.toIndex);
  22436. if (isValidNumber && me.fromIndex >= 0 && me.toIndex >= 0 && !firstPara) {
  22437. me.url = Util_Util.urlAppend(me.url, "fromIndex=".concat(me.fromIndex, "&toIndex=").concat(me.toIndex));
  22438. }
  22439. if (params.returnCountOnly) {
  22440. me.url = Util_Util.urlAppend(me.url, "&returnCountOnly=" + params.returnContent);
  22441. }
  22442. jsonParameters = me.getJsonParameters(params);
  22443. me.request({
  22444. method: "POST",
  22445. data: jsonParameters,
  22446. scope: me,
  22447. success: me.serviceProcessCompleted,
  22448. failure: me.serviceProcessFailed
  22449. });
  22450. }
  22451. /**
  22452. * @function GetFeaturesServiceBase.prototype.getFeatureComplete
  22453. * @description 查询完成,执行此方法。
  22454. * @param {Object} result - 服务器返回的结果对象。
  22455. */
  22456. }, {
  22457. key: "serviceProcessCompleted",
  22458. value: function serviceProcessCompleted(result, options) {
  22459. var me = this;
  22460. result = Util_Util.transformResult(result);
  22461. if (me.format === DataFormat.GEOJSON && result.features) {
  22462. var geoJSONFormat = new GeoJSON();
  22463. result.features = geoJSONFormat.toGeoJSON(result.features);
  22464. }
  22465. me.events.triggerEvent("processCompleted", {
  22466. result: result,
  22467. options: options
  22468. });
  22469. }
  22470. }, {
  22471. key: "dataFormat",
  22472. value: function dataFormat() {
  22473. return [DataFormat.GEOJSON, DataFormat.ISERVER, DataFormat.FGB];
  22474. }
  22475. }]);
  22476. return GetFeaturesServiceBase;
  22477. }(CommonServiceBase);
  22478. ;// CONCATENATED MODULE: ./src/common/iServer/FilterParameter.js
  22479. function FilterParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  22480. function FilterParameter_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  22481. function FilterParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) FilterParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) FilterParameter_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  22482. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  22483. * This program are made available under the terms of the Apache License, Version 2.0
  22484. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  22485. /**
  22486. * @class FilterParameter
  22487. * @deprecatedclass SuperMap.FilterParameter
  22488. * @category iServer Data FeatureResults
  22489. * @classdesc 查询过滤条件参数类。该类用于设置查询数据集的查询过滤参数。
  22490. * @param {Object} options - 参数。
  22491. * @param {string} options.attributeFilter - 属性过滤条件。
  22492. * @param {string} options.name - 查询数据集名称或者图层名称。
  22493. * @param {Array.<JoinItem>} [options.joinItems] - 与外部表的连接信息 JoinItem 数组。
  22494. * @param {Array.<LinkItem>} [options.linkItems] - 与外部表的关联信息 LinkItem 数组。
  22495. * @param {Array.<string>} [options.ids] - 查询 id 数组,即属性表中的 SmID 值。
  22496. * @param {string} [options.orderBy] - 查询排序的字段,orderBy 的字段须为数值型的。
  22497. * @param {string} [options.groupBy] - 查询分组条件的字段。
  22498. * @param {Array.<string>} [options.fields] - 查询字段数组。
  22499. * @usage
  22500. */
  22501. var FilterParameter = /*#__PURE__*/function () {
  22502. function FilterParameter(options) {
  22503. FilterParameter_classCallCheck(this, FilterParameter);
  22504. /**
  22505. * @member {string} FilterParameter.prototype.attributeFilter
  22506. * @description 属性过滤条件。
  22507. * 相当于 SQL 语句中的 WHERE 子句,其格式为:WHERE <条件表达式>,
  22508. * attributeFilter 就是其中的“条件表达式”。
  22509. * 该字段的用法为 attributeFilter = "过滤条件"。
  22510. * 例如,要查询字段 fieldValue 小于100的记录,设置 attributeFilter = "fieldValue < 100";
  22511. * 要查询字段 name 的值为“酒店”的记录,设置 attributeFilter = "name like '%酒店%'",等等。
  22512. */
  22513. this.attributeFilter = null;
  22514. /**
  22515. * @member {string} FilterParameter.prototype.name
  22516. * @description 查询数据集名称或者图层名称,根据实际的查询对象而定。
  22517. * 一般情况下该字段为数据集名称,但在进行与地图相关功能的操作时,
  22518. * 需要设置为图层名称(图层名称格式:数据集名称@数据源别名)。
  22519. * 因为一个地图的图层可能是来自于不同数据源的数据集,
  22520. * 而不同的数据源中可能存在同名的数据集,
  22521. * 使用数据集名称不能唯一的确定数据集,
  22522. * 所以在进行与地图相关功能的操作时,该值需要设置为图层名称。
  22523. */
  22524. this.name = null;
  22525. /**
  22526. * @member {Array.<JoinItem>} [FilterParameter.prototype.joinItems]
  22527. * @description 与外部表的连接信息 JoinItem 数组。
  22528. */
  22529. this.joinItems = null;
  22530. /**
  22531. * @member {Array.<LinkItem>} [FilterParameter.prototype.linkItems]
  22532. * @description 与外部表的关联信息 LinkItem 数组。
  22533. */
  22534. this.linkItems = null;
  22535. /**
  22536. * @member {Array.<string>} [FilterParameter.prototype.ids]
  22537. * @description 查询 id 数组,即属性表中的 SmID 值。
  22538. */
  22539. this.ids = null;
  22540. /**
  22541. * @member {string} [FilterParameter.prototype.orderBy]
  22542. * @description 查询排序的字段,orderBy的字段须为数值型的。
  22543. * 相当于 SQL 语句中的 ORDER BY 子句,其格式为:ORDER BY <列名>,
  22544. * 列名即属性表中每一列的名称,列又可称为属性,在 SuperMap 中又称为字段。
  22545. * 对单个字段排序时,该字段的用法为 orderBy = "字段名";
  22546. * 对多个字段排序时,字段之间以英文逗号进行分割,用法为 orderBy = "字段名1, 字段名2"。
  22547. * 例如,现有一个国家数据集,它有两个字段分别为“SmArea”和“pop_1994”,
  22548. * 分别表示国家的面积和1994年的各国人口数量。
  22549. * 如果要按照各国人口数量对记录进行排序,则 orderBy = "pop_1994";
  22550. * 如果要以面积和人口进行排序,则 orderBy = "SmArea, pop_1994"。
  22551. */
  22552. this.orderBy = null;
  22553. /**
  22554. * @member {string} [FilterParameter.prototype.groupBy]
  22555. * @description 查询分组条件的字段。
  22556. * 相当于 SQL 语句中的 GROUP BY 子句,其格式为:GROUP BY <列名>,
  22557. * 列名即属性表中每一列的名称,列又可称为属性,在 SuperMap 中又称为字段。
  22558. * 对单个字段分组时,该字段的用法为 groupBy = "字段名";
  22559. * 对多个字段分组时,字段之间以英文逗号进行分割,用法为 groupBy = "字段名1, 字段名2"。
  22560. * 例如,现有一个全球城市数据集,该数据集有两个字段分别为“Continent”和“Country”,
  22561. * 分别表示某个城市所属的洲和国家。
  22562. * 如果要按照国家对全球的城市进行分组,可以设置 groupBy = "Country";
  22563. * 如果以洲和国家对城市进行分组,设置 groupBy = "Continent, Country"。
  22564. */
  22565. this.groupBy = null;
  22566. /**
  22567. * @member {Array.<string>} [FilterParameter.prototype.fields]
  22568. * @description 查询字段数组,如果不设置则使用系统返回的所有字段。
  22569. */
  22570. this.fields = null;
  22571. if (options) {
  22572. Util_Util.extend(this, options);
  22573. }
  22574. this.CLASS_NAME = "SuperMap.FilterParameter";
  22575. }
  22576. /**
  22577. * @function FilterParameter.prototype.destroy
  22578. * @description 释放资源,将引用资源的属性置空。
  22579. */
  22580. FilterParameter_createClass(FilterParameter, [{
  22581. key: "destroy",
  22582. value: function destroy() {
  22583. var me = this;
  22584. me.attributeFilter = null;
  22585. me.name = null;
  22586. if (me.joinItems) {
  22587. for (var i = 0, joinItems = me.joinItems, len = joinItems.length; i < len; i++) {
  22588. joinItems[i].destroy();
  22589. }
  22590. me.joinItems = null;
  22591. }
  22592. if (me.linkItems) {
  22593. for (var _i2 = 0, linkItems = me.linkItems, _len2 = linkItems.length; _i2 < _len2; _i2++) {
  22594. linkItems[_i2].destroy();
  22595. }
  22596. me.linkItems = null;
  22597. }
  22598. me.ids = null;
  22599. me.orderBy = null;
  22600. me.groupBy = null;
  22601. me.fields = null;
  22602. }
  22603. }]);
  22604. return FilterParameter;
  22605. }();
  22606. ;// CONCATENATED MODULE: ./src/common/iServer/GetFeaturesParametersBase.js
  22607. function GetFeaturesParametersBase_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  22608. function GetFeaturesParametersBase_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  22609. function GetFeaturesParametersBase_createClass(Constructor, protoProps, staticProps) { if (protoProps) GetFeaturesParametersBase_defineProperties(Constructor.prototype, protoProps); if (staticProps) GetFeaturesParametersBase_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  22610. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  22611. * This program are made available under the terms of the Apache License, Version 2.0
  22612. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  22613. /**
  22614. * @class GetFeaturesParametersBase
  22615. * @deprecatedclass SuperMap.GetFeaturesParametersBase
  22616. * @category iServer Data FeatureResults
  22617. * @classdesc 要素查询参数基类。
  22618. * @param {Object} options - 参数。
  22619. * @param {Array.<string>} options.datasetNames - 数据集名称列表。
  22620. * @param {boolean} [options.returnContent=true] - 是否直接返回查询结果。
  22621. * @param {number} [options.fromIndex=0] - 查询结果的最小索引号。
  22622. * @param {number} [options.toIndex=19] - 查询结果的最大索引号。
  22623. * @param {string|number} [options.targetEpsgCode] - 动态投影的目标坐标系对应的 EPSG Code,使用此参数时,returnContent 参数需为 true。
  22624. * @param {Object} [options.targetPrj] - 动态投影的目标坐标系。使用此参数时,returnContent 参数需为 true。如:prjCoordSys={"epsgCode":3857}。当同时设置 targetEpsgCode 参数时,此参数不生效。
  22625. * @param {MetricsAggParameter|GeoHashGridAggParameter} [options.aggregations] - 聚合查询参数。该参数仅支持数据来源 Elasticsearch 服务的Supermap iServer的rest数据服务。
  22626. * @usage
  22627. */
  22628. var GetFeaturesParametersBase = /*#__PURE__*/function () {
  22629. function GetFeaturesParametersBase(options) {
  22630. GetFeaturesParametersBase_classCallCheck(this, GetFeaturesParametersBase);
  22631. /**
  22632. * @member {Array.<string>} GetFeaturesParametersBase.prototype.datasetName
  22633. * @description 数据集集合中的数据集名称列表。
  22634. */
  22635. this.datasetNames = null;
  22636. /**
  22637. * @member {string} GetFeaturesParametersBase.prototype.targetEpsgCode
  22638. * @description 动态投影的目标坐标系对应的 EPSG Code,使用时需设置 returnContent 参数为 true。
  22639. */
  22640. this.targetEpsgCode = null;
  22641. /**
  22642. * @member {Object} GetFeaturesParametersBase.prototype.targetPrj
  22643. * @description 动态投影的目标坐标系。使用时需设置 returnContent 参数为 true。如:prjCoordSys={"epsgCode":3857}。当同时设置 targetEpsgCode 参数时,此参数不生效。
  22644. */
  22645. this.targetPrj = null;
  22646. /**
  22647. * @member {boolean} [GetFeaturesParametersBase.prototype.returnContent=true]
  22648. * @description 是否立即返回新创建资源的表述还是返回新资源的 URI。
  22649. * 如果为 true,则直接返回新创建资源,即查询结果的表述。
  22650. * 如果为 false,则返回的是查询结果资源的 URI。
  22651. */
  22652. this.returnContent = true;
  22653. /**
  22654. * @member {number} [GetFeaturesParametersBase.prototype.fromIndex=0]
  22655. * @description 查询结果的最小索引号。如果该值大于查询结果的最大索引号,则查询结果为空。
  22656. */
  22657. this.fromIndex = 0;
  22658. /**
  22659. * @member {number} [GetFeaturesParametersBase.prototype.toIndex=19]
  22660. * @description 查询结果的最大索引号。如果该值大于查询结果的最大索引号,则以查询结果的最大索引号为终止索引号。
  22661. */
  22662. this.toIndex = 19;
  22663. /**
  22664. * @member {boolean} [GetFeaturesParametersBase.prototype.returnCountOnly=false]
  22665. * @description 只返回查询结果的总数。
  22666. */
  22667. this.returnCountOnly = false;
  22668. /**
  22669. * @member {number} [GetFeaturesParametersBase.prototype.maxFeatures=1000]
  22670. * @description 进行 SQL 查询时,用于设置服务端返回查询结果条目数量。
  22671. */
  22672. this.maxFeatures = null;
  22673. /**
  22674. * @member {number} [GetFeaturesParametersBase.prototype.hasGeometry=true]
  22675. * @description 返回结果是否包含Geometry。
  22676. */
  22677. this.hasGeometry = true;
  22678. /**
  22679. * @member {MetricsAggParameter|GeoHashGridAggParameter} GetFeaturesParametersBase.prototype.aggregations
  22680. * @description 聚合查询参数,该参数仅支持数据来源 Elasticsearch 服务的Supermap iServer的rest数据服务。
  22681. */
  22682. this.aggregations = null;
  22683. Util_Util.extend(this, options);
  22684. this.CLASS_NAME = 'SuperMap.GetFeaturesParametersBase';
  22685. }
  22686. /**
  22687. *
  22688. * @function GetFeaturesParametersBase.prototype.destroy
  22689. * @description 释放资源,将引用资源的属性置空。
  22690. */
  22691. GetFeaturesParametersBase_createClass(GetFeaturesParametersBase, [{
  22692. key: "destroy",
  22693. value: function destroy() {
  22694. var me = this;
  22695. me.datasetNames = null;
  22696. me.returnContent = null;
  22697. me.fromIndex = null;
  22698. me.toIndex = null;
  22699. me.hasGeometry = null;
  22700. me.maxFeatures = null;
  22701. me.targetEpsgCode = null;
  22702. me.targetPrj = null;
  22703. if (me.aggregation) {
  22704. me.aggregation = null;
  22705. }
  22706. }
  22707. }]);
  22708. return GetFeaturesParametersBase;
  22709. }();
  22710. ;// CONCATENATED MODULE: ./src/common/iServer/GetFeaturesByIDsParameters.js
  22711. function GetFeaturesByIDsParameters_typeof(obj) { "@babel/helpers - typeof"; return GetFeaturesByIDsParameters_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, GetFeaturesByIDsParameters_typeof(obj); }
  22712. function GetFeaturesByIDsParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  22713. function GetFeaturesByIDsParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  22714. function GetFeaturesByIDsParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) GetFeaturesByIDsParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) GetFeaturesByIDsParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  22715. function GetFeaturesByIDsParameters_get() { if (typeof Reflect !== "undefined" && Reflect.get) { GetFeaturesByIDsParameters_get = Reflect.get.bind(); } else { GetFeaturesByIDsParameters_get = function _get(target, property, receiver) { var base = GetFeaturesByIDsParameters_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return GetFeaturesByIDsParameters_get.apply(this, arguments); }
  22716. function GetFeaturesByIDsParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GetFeaturesByIDsParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  22717. function GetFeaturesByIDsParameters_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) GetFeaturesByIDsParameters_setPrototypeOf(subClass, superClass); }
  22718. function GetFeaturesByIDsParameters_setPrototypeOf(o, p) { GetFeaturesByIDsParameters_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GetFeaturesByIDsParameters_setPrototypeOf(o, p); }
  22719. function GetFeaturesByIDsParameters_createSuper(Derived) { var hasNativeReflectConstruct = GetFeaturesByIDsParameters_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = GetFeaturesByIDsParameters_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = GetFeaturesByIDsParameters_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return GetFeaturesByIDsParameters_possibleConstructorReturn(this, result); }; }
  22720. function GetFeaturesByIDsParameters_possibleConstructorReturn(self, call) { if (call && (GetFeaturesByIDsParameters_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return GetFeaturesByIDsParameters_assertThisInitialized(self); }
  22721. function GetFeaturesByIDsParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  22722. function GetFeaturesByIDsParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  22723. function GetFeaturesByIDsParameters_getPrototypeOf(o) { GetFeaturesByIDsParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GetFeaturesByIDsParameters_getPrototypeOf(o); }
  22724. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  22725. * This program are made available under the terms of the Apache License, Version 2.0
  22726. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  22727. /**
  22728. * @class GetFeaturesByIDsParameters
  22729. * @deprecatedclass SuperMap.GetFeaturesByIDsParameters
  22730. * @category iServer Data FeatureResults
  22731. * @classdesc ID 查询参数类。
  22732. * @param {Object} options - 参数。
  22733. * @param {Array.<number>} options.IDs - 指定查询的元素 ID 信息。
  22734. * @param {Array.<string>} [options.fields] - 设置查询结果返回字段。默认返回所有字段。
  22735. * @param {Array.<string>} options.dataSetNames - 数据集集合中的数据集名称列表。
  22736. * @param {boolean} [options.returnContent=true] - 是否直接返回查询结果。
  22737. * @param {number} [options.fromIndex=0] - 查询结果的最小索引号。
  22738. * @param {number} [options.toIndex=19] - 查询结果的最大索引号。
  22739. * @param {string|number} [options.targetEpsgCode] - 动态投影的目标坐标系对应的 EPSG Code,使用此参数时,returnContent 参数需为 true。
  22740. * @param {Object} [options.targetPrj] - 动态投影的目标坐标系。使用此参数时,returnContent 参数需为 true。如:prjCoordSys={"epsgCode":3857}。当同时设置 targetEpsgCode 参数时,此参数不生效。
  22741. * @param {MetricsAggParameter|GeoHashGridAggParameter} [options.aggregations] - 聚合查询参数。该参数仅支持数据来源 Elasticsearch 服务的Supermap iServer的rest数据服务。
  22742. * @extends {GetFeaturesParametersBase}
  22743. * @usage
  22744. */
  22745. var GetFeaturesByIDsParameters = /*#__PURE__*/function (_GetFeaturesParameter) {
  22746. GetFeaturesByIDsParameters_inherits(GetFeaturesByIDsParameters, _GetFeaturesParameter);
  22747. var _super = GetFeaturesByIDsParameters_createSuper(GetFeaturesByIDsParameters);
  22748. function GetFeaturesByIDsParameters(options) {
  22749. var _this;
  22750. GetFeaturesByIDsParameters_classCallCheck(this, GetFeaturesByIDsParameters);
  22751. _this = _super.call(this, options);
  22752. /**
  22753. * @member {string} GetFeaturesByIDsParameters.prototype.getFeatureMode
  22754. * @description 数据集查询模式。
  22755. */
  22756. _this.getFeatureMode = 'ID';
  22757. /**
  22758. * @member {Array.<number>} GetFeaturesByIDsParameters.prototype.IDs
  22759. * @description 所要查询指定的元素 ID 信息。
  22760. */
  22761. _this.IDs = null;
  22762. /**
  22763. * @member {Array.<string>} GetFeaturesByIDsParameters.prototype.fields
  22764. * @description 设置查询结果返回字段。当指定了返回结果字段后,则 GetFeaturesResult 中的 features 的属性字段只包含所指定的字段。不设置即返回全部字段。
  22765. */
  22766. _this.fields = null;
  22767. Util_Util.extend(GetFeaturesByIDsParameters_assertThisInitialized(_this), options);
  22768. _this.CLASS_NAME = 'SuperMap.GetFeaturesByIDsParameters';
  22769. return _this;
  22770. }
  22771. /**
  22772. * @function GetFeaturesByIDsParameters.prototype.destroy
  22773. * @override
  22774. */
  22775. GetFeaturesByIDsParameters_createClass(GetFeaturesByIDsParameters, [{
  22776. key: "destroy",
  22777. value: function destroy() {
  22778. GetFeaturesByIDsParameters_get(GetFeaturesByIDsParameters_getPrototypeOf(GetFeaturesByIDsParameters.prototype), "destroy", this).call(this);
  22779. var me = this;
  22780. me.IDs = null;
  22781. me.getFeatureMode = null;
  22782. if (me.fields) {
  22783. while (me.fields.length > 0) {
  22784. me.fields.pop();
  22785. }
  22786. me.fields = null;
  22787. }
  22788. }
  22789. /**
  22790. * @function GetFeaturesByIDsParameters.toJsonParameters
  22791. * @description 将 GetFeaturesByIDsParameters 对象转换为 JSON 字符串。
  22792. * @param {GetFeaturesByIDsParameters} params - ID 查询参数对象。
  22793. * @returns {string} 转化后的 JSON 字符串。
  22794. */
  22795. }], [{
  22796. key: "toJsonParameters",
  22797. value: function toJsonParameters(params) {
  22798. var parasByIDs, filterParameter;
  22799. parasByIDs = {
  22800. datasetNames: params.datasetNames,
  22801. getFeatureMode: 'ID',
  22802. ids: params.IDs
  22803. };
  22804. if (params.fields) {
  22805. filterParameter = new FilterParameter();
  22806. filterParameter.name = params.datasetNames;
  22807. filterParameter.fields = params.fields;
  22808. parasByIDs.queryParameter = filterParameter;
  22809. }
  22810. if (params.targetEpsgCode) {
  22811. parasByIDs.targetEpsgCode = params.targetEpsgCode;
  22812. }
  22813. if (typeof params.hasGeometry === 'boolean') {
  22814. parasByIDs.hasGeometry = params.hasGeometry;
  22815. }
  22816. if (!params.targetEpsgCode && params.targetPrj) {
  22817. parasByIDs.targetPrj = params.targetPrj;
  22818. }
  22819. if (params.aggregations) {
  22820. parasByIDs.aggregations = params.aggregations;
  22821. }
  22822. return Util_Util.toJSON(parasByIDs);
  22823. }
  22824. }]);
  22825. return GetFeaturesByIDsParameters;
  22826. }(GetFeaturesParametersBase);
  22827. ;// CONCATENATED MODULE: ./src/common/iServer/GetFeaturesByIDsService.js
  22828. function GetFeaturesByIDsService_typeof(obj) { "@babel/helpers - typeof"; return GetFeaturesByIDsService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, GetFeaturesByIDsService_typeof(obj); }
  22829. function GetFeaturesByIDsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  22830. function GetFeaturesByIDsService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  22831. function GetFeaturesByIDsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) GetFeaturesByIDsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) GetFeaturesByIDsService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  22832. function GetFeaturesByIDsService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { GetFeaturesByIDsService_get = Reflect.get.bind(); } else { GetFeaturesByIDsService_get = function _get(target, property, receiver) { var base = GetFeaturesByIDsService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return GetFeaturesByIDsService_get.apply(this, arguments); }
  22833. function GetFeaturesByIDsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GetFeaturesByIDsService_getPrototypeOf(object); if (object === null) break; } return object; }
  22834. function GetFeaturesByIDsService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) GetFeaturesByIDsService_setPrototypeOf(subClass, superClass); }
  22835. function GetFeaturesByIDsService_setPrototypeOf(o, p) { GetFeaturesByIDsService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GetFeaturesByIDsService_setPrototypeOf(o, p); }
  22836. function GetFeaturesByIDsService_createSuper(Derived) { var hasNativeReflectConstruct = GetFeaturesByIDsService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = GetFeaturesByIDsService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = GetFeaturesByIDsService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return GetFeaturesByIDsService_possibleConstructorReturn(this, result); }; }
  22837. function GetFeaturesByIDsService_possibleConstructorReturn(self, call) { if (call && (GetFeaturesByIDsService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return GetFeaturesByIDsService_assertThisInitialized(self); }
  22838. function GetFeaturesByIDsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  22839. function GetFeaturesByIDsService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  22840. function GetFeaturesByIDsService_getPrototypeOf(o) { GetFeaturesByIDsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GetFeaturesByIDsService_getPrototypeOf(o); }
  22841. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  22842. * This program are made available under the terms of the Apache License, Version 2.0
  22843. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  22844. /**
  22845. * @class GetFeaturesByIDsService
  22846. * @deprecatedclass SuperMap.GetFeaturesByIDsService
  22847. * @category iServer Data FeatureResults
  22848. * @classdesc 数据集ID查询服务类。在数据集集合中查找指定 ID 号对应的空间地物要素。
  22849. * @param {string} url - 服务地址。请求数据服务中数据集查询服务。
  22850. * URL 应为:http://{服务器地址}:{服务端口号}/iserver/services/{数据服务名}/rest/data/;</br>
  22851. * 例如:"http://localhost:8090/iserver/services/data-jingjin/rest/data/"
  22852. * @param {Object} options - 参数。
  22853. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  22854. * @param {DataFormat} [options.format=DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON、GeoJSON、FGB 三种格式。参数格式为 "ISERVER","GEOJSON","FGB"。
  22855. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  22856. * @param {Object} [options.headers] - 请求头。
  22857. * @extends {GetFeaturesServiceBase}
  22858. * @example
  22859. * var myGetFeaturesByIDsService = new GetFeaturesByIDsService(url, {
  22860. * eventListeners: {
  22861. * "processCompleted": getFeatureCompleted,
  22862. * "processFailed": getFeatureError
  22863. * }
  22864. * });
  22865. * function getFeatureCompleted(object){//todo};
  22866. * function getFeatureError(object){//todo}
  22867. * @usage
  22868. */
  22869. var GetFeaturesByIDsService = /*#__PURE__*/function (_GetFeaturesServiceBa) {
  22870. GetFeaturesByIDsService_inherits(GetFeaturesByIDsService, _GetFeaturesServiceBa);
  22871. var _super = GetFeaturesByIDsService_createSuper(GetFeaturesByIDsService);
  22872. function GetFeaturesByIDsService(url, options) {
  22873. var _this;
  22874. GetFeaturesByIDsService_classCallCheck(this, GetFeaturesByIDsService);
  22875. _this = _super.call(this, url, options);
  22876. _this.CLASS_NAME = "SuperMap.GetFeaturesByIDsService";
  22877. return _this;
  22878. }
  22879. /**
  22880. * @function GetFeaturesByIDsService.prototype.destroy
  22881. * @override
  22882. */
  22883. GetFeaturesByIDsService_createClass(GetFeaturesByIDsService, [{
  22884. key: "destroy",
  22885. value: function destroy() {
  22886. GetFeaturesByIDsService_get(GetFeaturesByIDsService_getPrototypeOf(GetFeaturesByIDsService.prototype), "destroy", this).call(this);
  22887. }
  22888. /**
  22889. * @function GetFeaturesByIDsService.prototype.getJsonParameters
  22890. * @description 将查询参数转化为 JSON 字符串。
  22891. * 在本类中重写此方法,可以实现不同种类的查询(ID, SQL, Buffer, Geometry等)。
  22892. * @param {GetFeaturesByIDsParameters} params - ID查询参数类。
  22893. * @returns {string} 转化后的 JSON 字符串。
  22894. */
  22895. }, {
  22896. key: "getJsonParameters",
  22897. value: function getJsonParameters(params) {
  22898. return GetFeaturesByIDsParameters.toJsonParameters(params);
  22899. }
  22900. }]);
  22901. return GetFeaturesByIDsService;
  22902. }(GetFeaturesServiceBase);
  22903. ;// CONCATENATED MODULE: ./src/common/iServer/GetFeaturesBySQLParameters.js
  22904. function GetFeaturesBySQLParameters_typeof(obj) { "@babel/helpers - typeof"; return GetFeaturesBySQLParameters_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, GetFeaturesBySQLParameters_typeof(obj); }
  22905. function GetFeaturesBySQLParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  22906. function GetFeaturesBySQLParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  22907. function GetFeaturesBySQLParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) GetFeaturesBySQLParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) GetFeaturesBySQLParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  22908. function GetFeaturesBySQLParameters_get() { if (typeof Reflect !== "undefined" && Reflect.get) { GetFeaturesBySQLParameters_get = Reflect.get.bind(); } else { GetFeaturesBySQLParameters_get = function _get(target, property, receiver) { var base = GetFeaturesBySQLParameters_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return GetFeaturesBySQLParameters_get.apply(this, arguments); }
  22909. function GetFeaturesBySQLParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GetFeaturesBySQLParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  22910. function GetFeaturesBySQLParameters_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) GetFeaturesBySQLParameters_setPrototypeOf(subClass, superClass); }
  22911. function GetFeaturesBySQLParameters_setPrototypeOf(o, p) { GetFeaturesBySQLParameters_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GetFeaturesBySQLParameters_setPrototypeOf(o, p); }
  22912. function GetFeaturesBySQLParameters_createSuper(Derived) { var hasNativeReflectConstruct = GetFeaturesBySQLParameters_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = GetFeaturesBySQLParameters_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = GetFeaturesBySQLParameters_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return GetFeaturesBySQLParameters_possibleConstructorReturn(this, result); }; }
  22913. function GetFeaturesBySQLParameters_possibleConstructorReturn(self, call) { if (call && (GetFeaturesBySQLParameters_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return GetFeaturesBySQLParameters_assertThisInitialized(self); }
  22914. function GetFeaturesBySQLParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  22915. function GetFeaturesBySQLParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  22916. function GetFeaturesBySQLParameters_getPrototypeOf(o) { GetFeaturesBySQLParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GetFeaturesBySQLParameters_getPrototypeOf(o); }
  22917. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  22918. * This program are made available under the terms of the Apache License, Version 2.0
  22919. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  22920. /**
  22921. * @class GetFeaturesBySQLParameters
  22922. * @deprecatedclass SuperMap.GetFeaturesBySQLParameters
  22923. * @category iServer Data FeatureResults
  22924. * @classdesc 数据集 SQL 查询参数类。
  22925. * @param {Object} options - 参数。
  22926. * @param {FilterParameter} options.queryParameter - 查询过滤条件参数。
  22927. * @param {Array.<string>} options.datasetNames - 数据集集合中的数据集名称列表。
  22928. * @param {boolean} [options.returnContent=true] - 是否直接返回查询结果。
  22929. * @param {number} [options.fromIndex=0] - 查询结果的最小索引号。
  22930. * @param {number} [options.toIndex=19] - 查询结果的最大索引号。
  22931. * @param {string|number} [options.targetEpsgCode] - 动态投影的目标坐标系对应的 EPSG Code,使用此参数时,returnContent 参数需为 true。
  22932. * @param {Object} [options.targetPrj] - 动态投影的目标坐标系。使用此参数时,returnContent 参数需为 true。如:prjCoordSys={"epsgCode":3857}。当同时设置 targetEpsgCode 参数时,此参数不生效。
  22933. * @param {MetricsAggParameter|GeoHashGridAggParameter} [options.aggregations] - 聚合查询参数。该参数仅支持数据来源 Elasticsearch 服务的Supermap iServer的rest数据服务。
  22934. * @extends {GetFeaturesParametersBase}
  22935. * @usage
  22936. */
  22937. var GetFeaturesBySQLParameters = /*#__PURE__*/function (_GetFeaturesParameter) {
  22938. GetFeaturesBySQLParameters_inherits(GetFeaturesBySQLParameters, _GetFeaturesParameter);
  22939. var _super = GetFeaturesBySQLParameters_createSuper(GetFeaturesBySQLParameters);
  22940. function GetFeaturesBySQLParameters(options) {
  22941. var _this;
  22942. GetFeaturesBySQLParameters_classCallCheck(this, GetFeaturesBySQLParameters);
  22943. _this = _super.call(this, options);
  22944. /**
  22945. * @member {string} GetFeaturesBySQLParameters.prototype.getFeatureMode
  22946. * @description 数据集查询模式。
  22947. */
  22948. _this.getFeatureMode = 'SQL';
  22949. /**
  22950. * @member {FilterParameter} GetFeaturesBySQLParameters.prototype.queryParameter
  22951. * @description 查询过滤条件参数类。
  22952. */
  22953. _this.queryParameter = null;
  22954. Util_Util.extend(GetFeaturesBySQLParameters_assertThisInitialized(_this), options);
  22955. _this.CLASS_NAME = 'SuperMap.GetFeaturesBySQLParameters';
  22956. return _this;
  22957. }
  22958. /**
  22959. * @function GetFeaturesBySQLParameters.prototype.destroy
  22960. * @override
  22961. */
  22962. GetFeaturesBySQLParameters_createClass(GetFeaturesBySQLParameters, [{
  22963. key: "destroy",
  22964. value: function destroy() {
  22965. GetFeaturesBySQLParameters_get(GetFeaturesBySQLParameters_getPrototypeOf(GetFeaturesBySQLParameters.prototype), "destroy", this).call(this);
  22966. var me = this;
  22967. me.getFeatureMode = null;
  22968. if (me.queryParameter) {
  22969. me.queryParameter.destroy();
  22970. me.queryParameter = null;
  22971. }
  22972. }
  22973. /**
  22974. * @function GetFeaturesBySQLParameters.prototype.toJsonParameters
  22975. * @description 将 GetFeaturesBySQLParameters 对象转换为 JSON 字符串。
  22976. * @param {GetFeaturesBySQLParameters} params - 数据集 SQL 查询参数对象。
  22977. * @returns {string} 转化后的 JSON 字符串。
  22978. */
  22979. }], [{
  22980. key: "toJsonParameters",
  22981. value: function toJsonParameters(params) {
  22982. var paramsBySql = {
  22983. datasetNames: params.datasetNames,
  22984. getFeatureMode: 'SQL',
  22985. queryParameter: params.queryParameter
  22986. };
  22987. if (params.maxFeatures && !isNaN(params.maxFeatures)) {
  22988. paramsBySql.maxFeatures = params.maxFeatures;
  22989. }
  22990. if (typeof params.hasGeometry === 'boolean') {
  22991. paramsBySql.hasGeometry = params.hasGeometry;
  22992. }
  22993. if (params.aggregations) {
  22994. paramsBySql.aggregations = params.aggregations;
  22995. }
  22996. if (params.targetEpsgCode) {
  22997. paramsBySql.targetEpsgCode = params.targetEpsgCode;
  22998. }
  22999. if (!params.targetEpsgCode && params.targetPrj) {
  23000. paramsBySql.targetPrj = params.targetPrj;
  23001. }
  23002. if (params.aggregations) {
  23003. paramsBySql.aggregations = params.aggregations;
  23004. }
  23005. return Util_Util.toJSON(paramsBySql);
  23006. }
  23007. }]);
  23008. return GetFeaturesBySQLParameters;
  23009. }(GetFeaturesParametersBase);
  23010. ;// CONCATENATED MODULE: ./src/common/iServer/GetFeaturesBySQLService.js
  23011. function GetFeaturesBySQLService_typeof(obj) { "@babel/helpers - typeof"; return GetFeaturesBySQLService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, GetFeaturesBySQLService_typeof(obj); }
  23012. function GetFeaturesBySQLService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  23013. function GetFeaturesBySQLService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  23014. function GetFeaturesBySQLService_createClass(Constructor, protoProps, staticProps) { if (protoProps) GetFeaturesBySQLService_defineProperties(Constructor.prototype, protoProps); if (staticProps) GetFeaturesBySQLService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  23015. function GetFeaturesBySQLService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { GetFeaturesBySQLService_get = Reflect.get.bind(); } else { GetFeaturesBySQLService_get = function _get(target, property, receiver) { var base = GetFeaturesBySQLService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return GetFeaturesBySQLService_get.apply(this, arguments); }
  23016. function GetFeaturesBySQLService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GetFeaturesBySQLService_getPrototypeOf(object); if (object === null) break; } return object; }
  23017. function GetFeaturesBySQLService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) GetFeaturesBySQLService_setPrototypeOf(subClass, superClass); }
  23018. function GetFeaturesBySQLService_setPrototypeOf(o, p) { GetFeaturesBySQLService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GetFeaturesBySQLService_setPrototypeOf(o, p); }
  23019. function GetFeaturesBySQLService_createSuper(Derived) { var hasNativeReflectConstruct = GetFeaturesBySQLService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = GetFeaturesBySQLService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = GetFeaturesBySQLService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return GetFeaturesBySQLService_possibleConstructorReturn(this, result); }; }
  23020. function GetFeaturesBySQLService_possibleConstructorReturn(self, call) { if (call && (GetFeaturesBySQLService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return GetFeaturesBySQLService_assertThisInitialized(self); }
  23021. function GetFeaturesBySQLService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  23022. function GetFeaturesBySQLService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  23023. function GetFeaturesBySQLService_getPrototypeOf(o) { GetFeaturesBySQLService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GetFeaturesBySQLService_getPrototypeOf(o); }
  23024. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  23025. * This program are made available under the terms of the Apache License, Version 2.0
  23026. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  23027. /**
  23028. * @class GetFeaturesBySQLService
  23029. * @deprecatedclass SuperMap.GetFeaturesBySQLService
  23030. * @constructs GetFeaturesBySQLService
  23031. * @category iServer Data FeatureResults
  23032. * @classdesc 数据服务中数据集 SQL 查询服务类。在一个或多个指定的图层上查询符合 SQL 条件的空间地物信息。
  23033. * @param {string} url - 服务地址。请求数据服务中数据集查询服务,
  23034. * URL 应为:http://{服务器地址}:{服务端口号}/iserver/services/{数据服务名}/rest/data/;</br>
  23035. * 例如:"http://localhost:8090/iserver/services/data-jingjin/rest/data/"
  23036. * @param {Object} options - 参数。
  23037. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  23038. * @param {DataFormat} [options.format=DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON、GeoJSON、FGB 三种格式。参数格式为 "ISERVER","GEOJSON","FGB"。
  23039. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  23040. * @param {Object} [options.headers] - 请求头。
  23041. * @extends {GetFeaturesServiceBase}
  23042. * @example
  23043. * var myGetFeaturesBySQLService = new GetFeaturesBySQLService(url, {
  23044. * eventListeners: {
  23045. * "processCompleted": GetFeaturesCompleted,
  23046. * "processFailed": GetFeaturesError
  23047. * }
  23048. * });
  23049. * function getFeaturesCompleted(object){//todo};
  23050. * function getFeaturesError(object){//todo};
  23051. * @usage
  23052. */
  23053. var GetFeaturesBySQLService = /*#__PURE__*/function (_GetFeaturesServiceBa) {
  23054. GetFeaturesBySQLService_inherits(GetFeaturesBySQLService, _GetFeaturesServiceBa);
  23055. var _super = GetFeaturesBySQLService_createSuper(GetFeaturesBySQLService);
  23056. function GetFeaturesBySQLService(url, options) {
  23057. var _this;
  23058. GetFeaturesBySQLService_classCallCheck(this, GetFeaturesBySQLService);
  23059. _this = _super.call(this, url, options);
  23060. _this.CLASS_NAME = "SuperMap.GetFeaturesBySQLService";
  23061. return _this;
  23062. }
  23063. /**
  23064. * @function GetFeaturesBySQLService.prototype.destroy
  23065. * @override
  23066. */
  23067. GetFeaturesBySQLService_createClass(GetFeaturesBySQLService, [{
  23068. key: "destroy",
  23069. value: function destroy() {
  23070. GetFeaturesBySQLService_get(GetFeaturesBySQLService_getPrototypeOf(GetFeaturesBySQLService.prototype), "destroy", this).call(this);
  23071. }
  23072. /*
  23073. * @function GetFeaturesBySQLService.prototype.getJsonParameters
  23074. * @description 将查询参数转化为 JSON 字符串。
  23075. * 在本类中重写此方法,可以实现不同种类的查询(ID, SQL, Buffer, Geometry等)。
  23076. * @param {GetFeaturesBySQLParameters} params - 数据集SQL查询参数类。
  23077. * @returns {string} 转化后的 JSON 字符串。
  23078. */
  23079. }, {
  23080. key: "getJsonParameters",
  23081. value: function getJsonParameters(params) {
  23082. return GetFeaturesBySQLParameters.toJsonParameters(params);
  23083. }
  23084. }]);
  23085. return GetFeaturesBySQLService;
  23086. }(GetFeaturesServiceBase);
  23087. ;// CONCATENATED MODULE: ./src/common/iServer/GetFeaturesByBoundsParameters.js
  23088. function GetFeaturesByBoundsParameters_typeof(obj) { "@babel/helpers - typeof"; return GetFeaturesByBoundsParameters_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, GetFeaturesByBoundsParameters_typeof(obj); }
  23089. function GetFeaturesByBoundsParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  23090. function GetFeaturesByBoundsParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  23091. function GetFeaturesByBoundsParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) GetFeaturesByBoundsParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) GetFeaturesByBoundsParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  23092. function GetFeaturesByBoundsParameters_get() { if (typeof Reflect !== "undefined" && Reflect.get) { GetFeaturesByBoundsParameters_get = Reflect.get.bind(); } else { GetFeaturesByBoundsParameters_get = function _get(target, property, receiver) { var base = GetFeaturesByBoundsParameters_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return GetFeaturesByBoundsParameters_get.apply(this, arguments); }
  23093. function GetFeaturesByBoundsParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GetFeaturesByBoundsParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  23094. function GetFeaturesByBoundsParameters_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) GetFeaturesByBoundsParameters_setPrototypeOf(subClass, superClass); }
  23095. function GetFeaturesByBoundsParameters_setPrototypeOf(o, p) { GetFeaturesByBoundsParameters_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GetFeaturesByBoundsParameters_setPrototypeOf(o, p); }
  23096. function GetFeaturesByBoundsParameters_createSuper(Derived) { var hasNativeReflectConstruct = GetFeaturesByBoundsParameters_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = GetFeaturesByBoundsParameters_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = GetFeaturesByBoundsParameters_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return GetFeaturesByBoundsParameters_possibleConstructorReturn(this, result); }; }
  23097. function GetFeaturesByBoundsParameters_possibleConstructorReturn(self, call) { if (call && (GetFeaturesByBoundsParameters_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return GetFeaturesByBoundsParameters_assertThisInitialized(self); }
  23098. function GetFeaturesByBoundsParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  23099. function GetFeaturesByBoundsParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  23100. function GetFeaturesByBoundsParameters_getPrototypeOf(o) { GetFeaturesByBoundsParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GetFeaturesByBoundsParameters_getPrototypeOf(o); }
  23101. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  23102. * This program are made available under the terms of the Apache License, Version 2.0
  23103. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  23104. /**
  23105. * @class GetFeaturesByBoundsParameters
  23106. * @deprecatedclass SuperMap.GetFeaturesByBoundsParameters
  23107. * @category iServer Data FeatureResults
  23108. * @classdesc 数据集范围查询参数类,该类用于设置数据集范围查询的相关参数。
  23109. * @param {Object} options - 参数。
  23110. * @param {(SuperMap.Bounds|L.Bounds|L.LatLngBounds|ol.extent|mapboxgl.LngLatBounds|GeoJSONObject)} options.bounds - 查询的范围对象。
  23111. * @param {Array.<string>} options.datasetNames - 数据集名称列表。
  23112. * @param {string} [options.attributeFilter] - 范围查询属性过滤条件。
  23113. * @param {Array.<string>} [options.fields] - 设置查询结果返回字段。默认返回所有字段。
  23114. * @param {SpatialQueryMode} [options.spatialQueryMode=SpatialQueryMode.CONTAIN] - 空间查询模式常量。
  23115. * @param {boolean} [options.returnContent=true] - 是否直接返回查询结果。
  23116. * @param {number} [options.fromIndex=0] - 查询结果的最小索引号。
  23117. * @param {number} [options.toIndex=19] - 查询结果的最大索引号。
  23118. * @param {string|number} [options.targetEpsgCode] - 动态投影的目标坐标系对应的 EPSG Code,使用此参数时,returnContent 参数需为 true。
  23119. * @param {Object} [options.targetPrj] - 动态投影的目标坐标系。使用此参数时,returnContent 参数需为 true。如:prjCoordSys={"epsgCode":3857}。当同时设置 targetEpsgCode 参数时,此参数不生效。
  23120. * @param {MetricsAggParameter|GeoHashGridAggParameter} [options.aggregations] - 聚合查询参数。该参数仅支持数据来源 Elasticsearch 服务的Supermap iServer的rest数据服务。
  23121. * @extends {GetFeaturesParametersBase}
  23122. * @usage
  23123. */
  23124. var GetFeaturesByBoundsParameters = /*#__PURE__*/function (_GetFeaturesParameter) {
  23125. GetFeaturesByBoundsParameters_inherits(GetFeaturesByBoundsParameters, _GetFeaturesParameter);
  23126. var _super = GetFeaturesByBoundsParameters_createSuper(GetFeaturesByBoundsParameters);
  23127. function GetFeaturesByBoundsParameters(options) {
  23128. var _this;
  23129. GetFeaturesByBoundsParameters_classCallCheck(this, GetFeaturesByBoundsParameters);
  23130. _this = _super.call(this, options);
  23131. /**
  23132. * @member {string} GetFeaturesByBoundsParameters.prototype.getFeatureMode
  23133. * @description 数据集查询模式。范围查询有 "BOUNDS","BOUNDS_ATTRIBUTEFILTER" 两种,当用户设置 attributeFilter 时会自动切换到 BOUNDS_ATTRIBUTEFILTER 访问服务。
  23134. */
  23135. _this.getFeatureMode = GetFeaturesByBoundsParameters.getFeatureMode.BOUNDS;
  23136. /**
  23137. * @member {(SuperMap.Bounds|L.Bounds|L.LatLngBounds|ol.extent|mapboxgl.LngLatBounds|GeoJSONObject)} GetFeaturesByBoundsParameters.prototype.bounds
  23138. * @description 用于查询的范围对象。
  23139. *
  23140. */
  23141. _this.bounds = null;
  23142. /**
  23143. * @member {Array.<string>} GetFeaturesByBoundsParameters.prototype.fields
  23144. * @description 设置查询结果返回字段。当指定了返回结果字段后,则 GetFeaturesResult 中的 features 的属性字段只包含所指定的字段。不设置即返回全部字段。
  23145. */
  23146. _this.fields = null;
  23147. /**
  23148. * @member {string} GetFeaturesByBoundsParameters.prototype.attributeFilter
  23149. * @description 范围查询属性过滤条件。
  23150. */
  23151. _this.attributeFilter = null;
  23152. /**
  23153. * @member {SpatialQueryMode} [GetFeaturesByBoundsParameters.prototype.spatialQueryMode=SpatialQueryMode.CONTAIN]
  23154. * @description 空间查询模式常量。
  23155. */
  23156. _this.spatialQueryMode = SpatialQueryMode.CONTAIN;
  23157. Util_Util.extend(GetFeaturesByBoundsParameters_assertThisInitialized(_this), options);
  23158. _this.CLASS_NAME = 'SuperMap.GetFeaturesByBoundsParameters';
  23159. return _this;
  23160. }
  23161. /**
  23162. * @function GetFeaturesByBoundsParameters.prototype.destroy
  23163. * @override
  23164. */
  23165. GetFeaturesByBoundsParameters_createClass(GetFeaturesByBoundsParameters, [{
  23166. key: "destroy",
  23167. value: function destroy() {
  23168. GetFeaturesByBoundsParameters_get(GetFeaturesByBoundsParameters_getPrototypeOf(GetFeaturesByBoundsParameters.prototype), "destroy", this).call(this);
  23169. var me = this;
  23170. if (me.bounds) {
  23171. me.bounds.destroy();
  23172. me.bounds = null;
  23173. }
  23174. if (me.fields) {
  23175. while (me.fields.length > 0) {
  23176. me.fields.pop();
  23177. }
  23178. me.fields = null;
  23179. }
  23180. me.attributeFilter = null;
  23181. me.spatialQueryMode = null;
  23182. me.getFeatureMode = null;
  23183. }
  23184. /**
  23185. * @function GetFeaturesByBoundsParameters.toJsonParameters
  23186. * @description 将 {@link GetFeaturesByBoundsParameters} 对象参数转换为 JSON 字符串。
  23187. * @param {GetFeaturesByBoundsParameters} params - 范围查询参数。
  23188. * @returns {string} 转化后的 JSON 字符串。
  23189. *
  23190. */
  23191. }], [{
  23192. key: "toJsonParameters",
  23193. value: function toJsonParameters(params) {
  23194. var filterParameter, bounds, parasByBounds;
  23195. bounds = {
  23196. leftBottom: {
  23197. x: params.bounds.left,
  23198. y: params.bounds.bottom
  23199. },
  23200. rightTop: {
  23201. x: params.bounds.right,
  23202. y: params.bounds.top
  23203. }
  23204. };
  23205. parasByBounds = {
  23206. datasetNames: params.datasetNames,
  23207. getFeatureMode: GetFeaturesByBoundsParameters.getFeatureMode.BOUNDS,
  23208. bounds: bounds,
  23209. spatialQueryMode: params.spatialQueryMode
  23210. };
  23211. if (params.fields) {
  23212. filterParameter = new FilterParameter();
  23213. filterParameter.name = params.datasetNames;
  23214. filterParameter.fields = params.fields;
  23215. parasByBounds.queryParameter = filterParameter;
  23216. }
  23217. if (params.attributeFilter) {
  23218. parasByBounds.attributeFilter = params.attributeFilter;
  23219. parasByBounds.getFeatureMode = GetFeaturesByBoundsParameters.getFeatureMode.BOUNDS_ATTRIBUTEFILTER;
  23220. }
  23221. if (params.maxFeatures && !isNaN(params.maxFeatures)) {
  23222. parasByBounds.maxFeatures = params.maxFeatures;
  23223. }
  23224. if (typeof params.hasGeometry === 'boolean') {
  23225. parasByBounds.hasGeometry = params.hasGeometry;
  23226. }
  23227. if (params.targetEpsgCode) {
  23228. parasByBounds.targetEpsgCode = params.targetEpsgCode;
  23229. }
  23230. if (!params.targetEpsgCode && params.targetPrj) {
  23231. parasByBounds.targetPrj = params.targetPrj;
  23232. }
  23233. if (params.aggregations) {
  23234. parasByBounds.aggregations = params.aggregations;
  23235. }
  23236. return Util_Util.toJSON(parasByBounds);
  23237. }
  23238. }]);
  23239. return GetFeaturesByBoundsParameters;
  23240. }(GetFeaturesParametersBase);
  23241. GetFeaturesByBoundsParameters.getFeatureMode = {
  23242. BOUNDS: 'BOUNDS',
  23243. BOUNDS_ATTRIBUTEFILTER: 'BOUNDS_ATTRIBUTEFILTER'
  23244. };
  23245. ;// CONCATENATED MODULE: ./src/common/iServer/GetFeaturesByBoundsService.js
  23246. function GetFeaturesByBoundsService_typeof(obj) { "@babel/helpers - typeof"; return GetFeaturesByBoundsService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, GetFeaturesByBoundsService_typeof(obj); }
  23247. function GetFeaturesByBoundsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  23248. function GetFeaturesByBoundsService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  23249. function GetFeaturesByBoundsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) GetFeaturesByBoundsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) GetFeaturesByBoundsService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  23250. function GetFeaturesByBoundsService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { GetFeaturesByBoundsService_get = Reflect.get.bind(); } else { GetFeaturesByBoundsService_get = function _get(target, property, receiver) { var base = GetFeaturesByBoundsService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return GetFeaturesByBoundsService_get.apply(this, arguments); }
  23251. function GetFeaturesByBoundsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GetFeaturesByBoundsService_getPrototypeOf(object); if (object === null) break; } return object; }
  23252. function GetFeaturesByBoundsService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) GetFeaturesByBoundsService_setPrototypeOf(subClass, superClass); }
  23253. function GetFeaturesByBoundsService_setPrototypeOf(o, p) { GetFeaturesByBoundsService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GetFeaturesByBoundsService_setPrototypeOf(o, p); }
  23254. function GetFeaturesByBoundsService_createSuper(Derived) { var hasNativeReflectConstruct = GetFeaturesByBoundsService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = GetFeaturesByBoundsService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = GetFeaturesByBoundsService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return GetFeaturesByBoundsService_possibleConstructorReturn(this, result); }; }
  23255. function GetFeaturesByBoundsService_possibleConstructorReturn(self, call) { if (call && (GetFeaturesByBoundsService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return GetFeaturesByBoundsService_assertThisInitialized(self); }
  23256. function GetFeaturesByBoundsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  23257. function GetFeaturesByBoundsService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  23258. function GetFeaturesByBoundsService_getPrototypeOf(o) { GetFeaturesByBoundsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GetFeaturesByBoundsService_getPrototypeOf(o); }
  23259. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  23260. * This program are made available under the terms of the Apache License, Version 2.0
  23261. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  23262. /**
  23263. * @class GetFeaturesByBoundsService
  23264. * @deprecatedclass SuperMap.GetFeaturesByBoundsService
  23265. * @category iServer Data FeatureResults
  23266. * @classdesc 数据集范围查询服务类,查询与指定范围对象符合一定空间关系的矢量要素。
  23267. * @description 数据集范围查询服务类构造函数。
  23268. * @extends {GetFeaturesServiceBase}
  23269. * @param {string} url - 服务地址。请求数据服务中数据集查询服务,URL 应为:http://{服务器地址}:{服务端口号}/iserver/services/{数据服务名}/rest/data/;
  23270. * 例如:"http://localhost:8090/iserver/services/data-jingjin/rest/data/"
  23271. * @param {Object} options - 参数。
  23272. * @param {Object} options.eventListeners - 事件监听器对象。有 processCompleted 属性可传入处理完成后的回调函数。processFailed 属性传入处理失败后的回调函数。
  23273. * @param {DataFormat} [options.format=DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON、GeoJSON、FGB 三种格式。参数格式为 "ISERVER","GEOJSON","FGB"。
  23274. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  23275. * @param {Object} [options.headers] - 请求头。
  23276. * @example
  23277. * var myGetFeaturesByBoundsService = new SuperMa.GetFeaturesByBoundsService(url, {
  23278. * eventListeners: {
  23279. * "processCompleted": getFeatureCompleted,
  23280. * "processFailed": getFeatureError
  23281. * }
  23282. * });
  23283. * function getFeatureCompleted(object){//todo};
  23284. * function getFeatureError(object){//todo}
  23285. * @usage
  23286. */
  23287. var GetFeaturesByBoundsService = /*#__PURE__*/function (_GetFeaturesServiceBa) {
  23288. GetFeaturesByBoundsService_inherits(GetFeaturesByBoundsService, _GetFeaturesServiceBa);
  23289. var _super = GetFeaturesByBoundsService_createSuper(GetFeaturesByBoundsService);
  23290. function GetFeaturesByBoundsService(url, options) {
  23291. var _this;
  23292. GetFeaturesByBoundsService_classCallCheck(this, GetFeaturesByBoundsService);
  23293. _this = _super.call(this, url, options);
  23294. _this.CLASS_NAME = "SuperMap.GetFeaturesByBoundsService";
  23295. return _this;
  23296. }
  23297. /**
  23298. * @function GetFeaturesByBoundsService.prototype.destroy
  23299. * @override
  23300. */
  23301. GetFeaturesByBoundsService_createClass(GetFeaturesByBoundsService, [{
  23302. key: "destroy",
  23303. value: function destroy() {
  23304. GetFeaturesByBoundsService_get(GetFeaturesByBoundsService_getPrototypeOf(GetFeaturesByBoundsService.prototype), "destroy", this).call(this);
  23305. }
  23306. /**
  23307. * @function GetFeaturesByBoundsService.prototype.getJsonParameters
  23308. * @description 将查询参数转化为 JSON 字符串。在本类中重写此方法,可以实现不同种类的查询(ID, SQL, Buffer, Geometry,Bounds等)。
  23309. * @param params {GetFeaturesByBoundsParameters}
  23310. * @returns {string} 转化后的 JSON 字符串。
  23311. *
  23312. */
  23313. }, {
  23314. key: "getJsonParameters",
  23315. value: function getJsonParameters(params) {
  23316. return GetFeaturesByBoundsParameters.toJsonParameters(params);
  23317. }
  23318. }]);
  23319. return GetFeaturesByBoundsService;
  23320. }(GetFeaturesServiceBase);
  23321. ;// CONCATENATED MODULE: ./src/common/iServer/GetFeaturesByBufferParameters.js
  23322. function GetFeaturesByBufferParameters_typeof(obj) { "@babel/helpers - typeof"; return GetFeaturesByBufferParameters_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, GetFeaturesByBufferParameters_typeof(obj); }
  23323. function GetFeaturesByBufferParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  23324. function GetFeaturesByBufferParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  23325. function GetFeaturesByBufferParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) GetFeaturesByBufferParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) GetFeaturesByBufferParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  23326. function GetFeaturesByBufferParameters_get() { if (typeof Reflect !== "undefined" && Reflect.get) { GetFeaturesByBufferParameters_get = Reflect.get.bind(); } else { GetFeaturesByBufferParameters_get = function _get(target, property, receiver) { var base = GetFeaturesByBufferParameters_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return GetFeaturesByBufferParameters_get.apply(this, arguments); }
  23327. function GetFeaturesByBufferParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GetFeaturesByBufferParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  23328. function GetFeaturesByBufferParameters_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) GetFeaturesByBufferParameters_setPrototypeOf(subClass, superClass); }
  23329. function GetFeaturesByBufferParameters_setPrototypeOf(o, p) { GetFeaturesByBufferParameters_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GetFeaturesByBufferParameters_setPrototypeOf(o, p); }
  23330. function GetFeaturesByBufferParameters_createSuper(Derived) { var hasNativeReflectConstruct = GetFeaturesByBufferParameters_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = GetFeaturesByBufferParameters_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = GetFeaturesByBufferParameters_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return GetFeaturesByBufferParameters_possibleConstructorReturn(this, result); }; }
  23331. function GetFeaturesByBufferParameters_possibleConstructorReturn(self, call) { if (call && (GetFeaturesByBufferParameters_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return GetFeaturesByBufferParameters_assertThisInitialized(self); }
  23332. function GetFeaturesByBufferParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  23333. function GetFeaturesByBufferParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  23334. function GetFeaturesByBufferParameters_getPrototypeOf(o) { GetFeaturesByBufferParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GetFeaturesByBufferParameters_getPrototypeOf(o); }
  23335. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  23336. * This program are made available under the terms of the Apache License, Version 2.0
  23337. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  23338. /**
  23339. * @class GetFeaturesByBufferParameters
  23340. * @deprecatedclass SuperMap.GetFeaturesByBufferParameters
  23341. * @category iServer Data FeatureResults
  23342. * @classdesc 数据集缓冲区查询参数类。
  23343. * @param {Object} options - 参数。
  23344. * @param {number} options.bufferDistance - buffer 距离,单位与所查询图层对应的数据集单位相同。
  23345. * @param {GeoJSONObject} options.geometry - 空间查询条件。
  23346. * @param {Array.<string>} options.dataSetNames - 数据集集合中的数据集名称列表。
  23347. * @param {Array.<string>} [options.fields] - 设置查询结果返回字段。默认返回所有字段。
  23348. * @param {string} [options.attributeFilter] - 属性查询条件。
  23349. * @param {boolean} [options.returnContent=true] - 是否直接返回查询结果。
  23350. * @param {number} [options.fromIndex=0] - 查询结果的最小索引号。
  23351. * @param {number} [options.toIndex=19] - 查询结果的最大索引号。
  23352. * @param {string|number} [options.targetEpsgCode] - 动态投影的目标坐标系对应的 EPSG Code,使用此参数时,returnContent 参数需为 true。
  23353. * @param {Object} [options.targetPrj] - 动态投影的目标坐标系。使用此参数时,returnContent 参数需为 true。如:prjCoordSys={"epsgCode":3857}。当同时设置 targetEpsgCode 参数时,此参数不生效。
  23354. * @extends {GetFeaturesParametersBase}
  23355. * @usage
  23356. */
  23357. var GetFeaturesByBufferParameters = /*#__PURE__*/function (_GetFeaturesParameter) {
  23358. GetFeaturesByBufferParameters_inherits(GetFeaturesByBufferParameters, _GetFeaturesParameter);
  23359. var _super = GetFeaturesByBufferParameters_createSuper(GetFeaturesByBufferParameters);
  23360. function GetFeaturesByBufferParameters(options) {
  23361. var _this;
  23362. GetFeaturesByBufferParameters_classCallCheck(this, GetFeaturesByBufferParameters);
  23363. _this = _super.call(this, options);
  23364. /**
  23365. * @member {number} GetFeaturesByBufferParameters.prototype.bufferDistance
  23366. * @description buffer 距离,单位与所查询图层对应的数据集单位相同。
  23367. */
  23368. _this.bufferDistance = null;
  23369. /**
  23370. * @member {string} GetFeaturesByBufferParameters.prototype.attributeFilter
  23371. * @description 属性查询条件。
  23372. */
  23373. _this.attributeFilter = null;
  23374. /**
  23375. * @member {GeoJSONObject} GetFeaturesByBufferParameters.prototype.geometry
  23376. * @description 空间查询条件。<br>
  23377. * 点类型可以是:{@link GeometryPoint}|{@link L.Marker}|{@link L.CircleMarker}|{@link L.Circle}|{@link L.GeoJSON}|{@link ol.geom.Point}|{@link ol.format.GeoJSON}|{@link mapboxgl.LngLat}|{@link mapboxgl.Point}|{@link GeoJSONObject}。</br>
  23378. * 线类型可以是:{@link GeometryLineString}|{@link GeometryLinearRing}|{@link L.Polyline}|{@link L.GeoJSON}|{@link ol.geom.LineString}|{@link ol.format.GeoJSON}|{@link GeoJSONObject}。</br>
  23379. * 面类型可以是:{@link GeometryPolygon}|{@link L.Polygon}|{@link L.GeoJSON}|{@link ol.geom.Polygon}|{@link ol.format.GeoJSON}|{@link mapboxgl.LngLatBounds}|{@link GeoJSONObject}。
  23380. */
  23381. _this.geometry = null;
  23382. /**
  23383. * @member {Array.<string>} GetFeaturesByBufferParameters.prototype.fields
  23384. * @description 设置查询结果返回字段。当指定了返回结果字段后,则 GetFeaturesResult 中的 features 的属性字段只包含所指定的字段。不设置即返回全部字段。
  23385. */
  23386. _this.fields = null;
  23387. Util_Util.extend(GetFeaturesByBufferParameters_assertThisInitialized(_this), options);
  23388. _this.CLASS_NAME = 'SuperMap.GetFeaturesByBufferParameters';
  23389. return _this;
  23390. }
  23391. /**
  23392. * @function GetFeaturesByBufferParameters.prototype.destroy
  23393. * @override
  23394. */
  23395. GetFeaturesByBufferParameters_createClass(GetFeaturesByBufferParameters, [{
  23396. key: "destroy",
  23397. value: function destroy() {
  23398. GetFeaturesByBufferParameters_get(GetFeaturesByBufferParameters_getPrototypeOf(GetFeaturesByBufferParameters.prototype), "destroy", this).call(this);
  23399. var me = this;
  23400. me.bufferDistance = null;
  23401. me.attributeFilter = null;
  23402. if (me.fields) {
  23403. while (me.fields.length > 0) {
  23404. me.fields.pop();
  23405. }
  23406. me.fields = null;
  23407. }
  23408. if (me.geometry) {
  23409. me.geometry.destroy();
  23410. me.geometry = null;
  23411. }
  23412. }
  23413. /**
  23414. * @function GetFeaturesByBufferParameters.toJsonParameters
  23415. * @description 将 GetFeaturesByBufferParameters 对象转换为 JSON 字符串。
  23416. * @param {GetFeaturesByBufferParameters} params - 数据集缓冲区查询参数对象。
  23417. * @returns {string} 转化后的 JSON 字符串。
  23418. */
  23419. }], [{
  23420. key: "toJsonParameters",
  23421. value: function toJsonParameters(params) {
  23422. var filterParameter, paramsByBuffer, geometry;
  23423. geometry = ServerGeometry.fromGeometry(params.geometry);
  23424. paramsByBuffer = {
  23425. datasetNames: params.datasetNames,
  23426. getFeatureMode: 'BUFFER',
  23427. bufferDistance: params.bufferDistance,
  23428. geometry: geometry
  23429. };
  23430. if (params.fields) {
  23431. filterParameter = new FilterParameter();
  23432. filterParameter.name = params.datasetNames;
  23433. filterParameter.fields = params.fields;
  23434. paramsByBuffer.queryParameter = filterParameter;
  23435. }
  23436. if (params.attributeFilter) {
  23437. paramsByBuffer.attributeFilter = params.attributeFilter;
  23438. paramsByBuffer.getFeatureMode = 'BUFFER_ATTRIBUTEFILTER';
  23439. }
  23440. if (params.maxFeatures && !isNaN(params.maxFeatures)) {
  23441. paramsByBuffer.maxFeatures = params.maxFeatures;
  23442. }
  23443. if (typeof params.hasGeometry === 'boolean') {
  23444. paramsByBuffer.hasGeometry = params.hasGeometry;
  23445. }
  23446. if (params.targetEpsgCode) {
  23447. paramsByBuffer.targetEpsgCode = params.targetEpsgCode;
  23448. }
  23449. if (!params.targetEpsgCode && params.targetPrj) {
  23450. paramsByBuffer.targetPrj = params.targetPrj;
  23451. }
  23452. return Util_Util.toJSON(paramsByBuffer);
  23453. }
  23454. }]);
  23455. return GetFeaturesByBufferParameters;
  23456. }(GetFeaturesParametersBase);
  23457. ;// CONCATENATED MODULE: ./src/common/iServer/GetFeaturesByBufferService.js
  23458. function GetFeaturesByBufferService_typeof(obj) { "@babel/helpers - typeof"; return GetFeaturesByBufferService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, GetFeaturesByBufferService_typeof(obj); }
  23459. function GetFeaturesByBufferService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  23460. function GetFeaturesByBufferService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  23461. function GetFeaturesByBufferService_createClass(Constructor, protoProps, staticProps) { if (protoProps) GetFeaturesByBufferService_defineProperties(Constructor.prototype, protoProps); if (staticProps) GetFeaturesByBufferService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  23462. function GetFeaturesByBufferService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { GetFeaturesByBufferService_get = Reflect.get.bind(); } else { GetFeaturesByBufferService_get = function _get(target, property, receiver) { var base = GetFeaturesByBufferService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return GetFeaturesByBufferService_get.apply(this, arguments); }
  23463. function GetFeaturesByBufferService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GetFeaturesByBufferService_getPrototypeOf(object); if (object === null) break; } return object; }
  23464. function GetFeaturesByBufferService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) GetFeaturesByBufferService_setPrototypeOf(subClass, superClass); }
  23465. function GetFeaturesByBufferService_setPrototypeOf(o, p) { GetFeaturesByBufferService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GetFeaturesByBufferService_setPrototypeOf(o, p); }
  23466. function GetFeaturesByBufferService_createSuper(Derived) { var hasNativeReflectConstruct = GetFeaturesByBufferService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = GetFeaturesByBufferService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = GetFeaturesByBufferService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return GetFeaturesByBufferService_possibleConstructorReturn(this, result); }; }
  23467. function GetFeaturesByBufferService_possibleConstructorReturn(self, call) { if (call && (GetFeaturesByBufferService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return GetFeaturesByBufferService_assertThisInitialized(self); }
  23468. function GetFeaturesByBufferService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  23469. function GetFeaturesByBufferService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  23470. function GetFeaturesByBufferService_getPrototypeOf(o) { GetFeaturesByBufferService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GetFeaturesByBufferService_getPrototypeOf(o); }
  23471. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  23472. * This program are made available under the terms of the Apache License, Version 2.0
  23473. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  23474. /**
  23475. * @class GetFeaturesByBufferService
  23476. * @deprecatedclass SuperMap.GetFeaturesByBufferService
  23477. * @category iServer Data FeatureResults
  23478. * @classdesc 数据服务中数据集缓冲区查询服务类。
  23479. * @param {string} url - 服务地址。请求数据服务中数据集查询服务,
  23480. * URL 应为:http://{服务器地址}:{服务端口号}/iserver/services/{数据服务名}/rest/data/;
  23481. * 例如:"http://localhost:8090/iserver/services/data-jingjin/rest/data/"
  23482. * @param {Object} options - 参数。
  23483. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  23484. * @param {DataFormat} [options.format=DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON、GeoJSON、FGB 三种格式。参数格式为 "ISERVER","GEOJSON","FGB"。
  23485. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  23486. * @param {Object} [options.headers] - 请求头。
  23487. * @extends {GetFeaturesServiceBase}
  23488. * @example
  23489. * var myGetFeaturesByBufferService = new GetFeaturesByBufferService(url, {
  23490. * eventListeners: {
  23491. * "processCompleted": GetFeaturesCompleted,
  23492. * "processFailed": GetFeaturesError
  23493. * }
  23494. * });
  23495. * function GetFeaturesCompleted(object){//todo};
  23496. * function GetFeaturesError(object){//todo};
  23497. * @usage
  23498. */
  23499. var GetFeaturesByBufferService = /*#__PURE__*/function (_GetFeaturesServiceBa) {
  23500. GetFeaturesByBufferService_inherits(GetFeaturesByBufferService, _GetFeaturesServiceBa);
  23501. var _super = GetFeaturesByBufferService_createSuper(GetFeaturesByBufferService);
  23502. function GetFeaturesByBufferService(url, options) {
  23503. var _this;
  23504. GetFeaturesByBufferService_classCallCheck(this, GetFeaturesByBufferService);
  23505. _this = _super.call(this, url, options);
  23506. _this.CLASS_NAME = "SuperMap.GetFeaturesByBufferService";
  23507. return _this;
  23508. }
  23509. /**
  23510. * @function GetFeaturesByBufferService.prototype.destroy
  23511. * @override
  23512. */
  23513. GetFeaturesByBufferService_createClass(GetFeaturesByBufferService, [{
  23514. key: "destroy",
  23515. value: function destroy() {
  23516. GetFeaturesByBufferService_get(GetFeaturesByBufferService_getPrototypeOf(GetFeaturesByBufferService.prototype), "destroy", this).call(this);
  23517. }
  23518. /**
  23519. * @function GetFeaturesByBufferService.prototype.getJsonParameters
  23520. * @description 将查询参数转化为 JSON 字符串。在本类中重写此方法,可以实现不同种类的查询(IDs, SQL, Buffer, Geometry等)。
  23521. * @param {GetFeaturesByBufferParameters} params - 数据集缓冲区查询参数类。
  23522. * @returns {Object} 转化后的 JSON 字符串。
  23523. */
  23524. }, {
  23525. key: "getJsonParameters",
  23526. value: function getJsonParameters(params) {
  23527. if (!(params instanceof GetFeaturesByBufferParameters)) {
  23528. return;
  23529. }
  23530. return GetFeaturesByBufferParameters.toJsonParameters(params);
  23531. }
  23532. }]);
  23533. return GetFeaturesByBufferService;
  23534. }(GetFeaturesServiceBase);
  23535. ;// CONCATENATED MODULE: ./src/common/iServer/GetFeaturesByGeometryParameters.js
  23536. function GetFeaturesByGeometryParameters_typeof(obj) { "@babel/helpers - typeof"; return GetFeaturesByGeometryParameters_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, GetFeaturesByGeometryParameters_typeof(obj); }
  23537. function GetFeaturesByGeometryParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  23538. function GetFeaturesByGeometryParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  23539. function GetFeaturesByGeometryParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) GetFeaturesByGeometryParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) GetFeaturesByGeometryParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  23540. function GetFeaturesByGeometryParameters_get() { if (typeof Reflect !== "undefined" && Reflect.get) { GetFeaturesByGeometryParameters_get = Reflect.get.bind(); } else { GetFeaturesByGeometryParameters_get = function _get(target, property, receiver) { var base = GetFeaturesByGeometryParameters_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return GetFeaturesByGeometryParameters_get.apply(this, arguments); }
  23541. function GetFeaturesByGeometryParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GetFeaturesByGeometryParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  23542. function GetFeaturesByGeometryParameters_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) GetFeaturesByGeometryParameters_setPrototypeOf(subClass, superClass); }
  23543. function GetFeaturesByGeometryParameters_setPrototypeOf(o, p) { GetFeaturesByGeometryParameters_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GetFeaturesByGeometryParameters_setPrototypeOf(o, p); }
  23544. function GetFeaturesByGeometryParameters_createSuper(Derived) { var hasNativeReflectConstruct = GetFeaturesByGeometryParameters_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = GetFeaturesByGeometryParameters_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = GetFeaturesByGeometryParameters_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return GetFeaturesByGeometryParameters_possibleConstructorReturn(this, result); }; }
  23545. function GetFeaturesByGeometryParameters_possibleConstructorReturn(self, call) { if (call && (GetFeaturesByGeometryParameters_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return GetFeaturesByGeometryParameters_assertThisInitialized(self); }
  23546. function GetFeaturesByGeometryParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  23547. function GetFeaturesByGeometryParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  23548. function GetFeaturesByGeometryParameters_getPrototypeOf(o) { GetFeaturesByGeometryParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GetFeaturesByGeometryParameters_getPrototypeOf(o); }
  23549. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  23550. * This program are made available under the terms of the Apache License, Version 2.0
  23551. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  23552. /**
  23553. * @class GetFeaturesByGeometryParameters
  23554. * @deprecatedclass SuperMap.GetFeaturesByGeometryParameters
  23555. * @category iServer Data FeatureResults
  23556. * @classdesc 数据集几何查询参数类。该类用于设置数据集几何查询的相关参数。
  23557. * @param {Object} options - 参数。
  23558. * @param {GeoJSONObject} options.geometry - 查询的几何对象。
  23559. * @param {Array.<string>} options.datasetNames - 数据集集合中的数据集名称列表。
  23560. * @param {string} [options.attributeFilter] - 几何查询属性过滤条件。
  23561. * @param {Array.<string>} [options.fields] - 设置查询结果返回字段。默认返回所有字段。
  23562. * @param {SpatialQueryMode} [options.spatialQueryMode=SpatialQueryMode.CONTAIN] - 空间查询模式常量。
  23563. * @param {boolean} [options.returnContent=true] - 是否直接返回查询结果。
  23564. * @param {number} [options.fromIndex=0] - 查询结果的最小索引号。
  23565. * @param {number} [options.toIndex=19] - 查询结果的最大索引号。
  23566. * @param {string|number} [options.targetEpsgCode] - 动态投影的目标坐标系对应的 EPSG Code,使用此参数时,returnContent 参数需为 true。
  23567. * @param {Object} [options.targetPrj] - 动态投影的目标坐标系。使用此参数时,returnContent 参数需为 true。如:prjCoordSys={"epsgCode":3857}。当同时设置 targetEpsgCode 参数时,此参数不生效。
  23568. * @param {MetricsAggParameter|GeoHashGridAggParameter} [options.aggregations] - 聚合查询参数。该参数仅支持数据来源 Elasticsearch 服务的Supermap iServer的rest数据服务。
  23569. * @extends {GetFeaturesParametersBase}
  23570. * @usage
  23571. */
  23572. var GetFeaturesByGeometryParameters = /*#__PURE__*/function (_GetFeaturesParameter) {
  23573. GetFeaturesByGeometryParameters_inherits(GetFeaturesByGeometryParameters, _GetFeaturesParameter);
  23574. var _super = GetFeaturesByGeometryParameters_createSuper(GetFeaturesByGeometryParameters);
  23575. function GetFeaturesByGeometryParameters(options) {
  23576. var _this;
  23577. GetFeaturesByGeometryParameters_classCallCheck(this, GetFeaturesByGeometryParameters);
  23578. _this = _super.call(this, options);
  23579. /**
  23580. * @member {string} GetFeaturesByGeometryParameters.prototype.getFeatureMode
  23581. * @description 数据集查询模式。几何查询有 "SPATIAL","SPATIAL_ATTRIBUTEFILTER" 两种,当用户设置 attributeFilter 时会自动切换到 SPATIAL_ATTRIBUTEFILTER 访问服务。
  23582. */
  23583. _this.getFeatureMode = 'SPATIAL';
  23584. /**
  23585. * @member {GeoJSONObject} GetFeaturesByGeometryParameters.prototype.geometry
  23586. * @description 用于查询的几何对象。 </br>
  23587. * 点类型可以是:{@link GeometryPoint}|{@link L.Marker}|{@link L.CircleMarker}|{@link L.Circle}|{@link L.GeoJSON}|{@link ol.geom.Point}|{@link ol.format.GeoJSON}|{@link mapboxgl.LngLat}|{@link mapboxgl.Point}|{@link GeoJSONObject}。</br>
  23588. * 线类型可以是:{@link GeometryLineString}|{@link GeometryLinearRing}|{@link L.Polyline}|{@link L.GeoJSON}|{@link ol.geom.LineString}|{@link ol.format.GeoJSON}|{@link GeoJSONObject}。</br>
  23589. * 面类型可以是:{@link GeometryPolygon}|{@link L.Polygon}|{@link L.GeoJSON}|{@link ol.geom.Polygon}|{@link ol.format.GeoJSON}|{@link mapboxgl.LngLatBounds}|{@link GeoJSONObject}。
  23590. */
  23591. _this.geometry = null;
  23592. /**
  23593. * @member {Array.<string>} GetFeaturesByGeometryParameters.prototype.fields
  23594. * @description 设置查询结果返回字段。当指定了返回结果字段后,则 GetFeaturesResult 中的 features 的属性字段只包含所指定的字段。不设置即返回全部字段。
  23595. */
  23596. _this.fields = null;
  23597. /**
  23598. * @member {string} GetFeaturesByGeometryParameters.prototype.attributeFilter
  23599. * @description 几何查询属性过滤条件。
  23600. */
  23601. _this.attributeFilter = null;
  23602. /**
  23603. * @member {SpatialQueryMode} [GetFeaturesByGeometryParameters.prototype.spatialQueryMode=SpatialQueryMode.CONTAIN]
  23604. * @description 空间查询模式常量。
  23605. */
  23606. _this.spatialQueryMode = SpatialQueryMode.CONTAIN;
  23607. Util_Util.extend(GetFeaturesByGeometryParameters_assertThisInitialized(_this), options);
  23608. _this.CLASS_NAME = 'SuperMap.GetFeaturesByGeometryParameters';
  23609. return _this;
  23610. }
  23611. /**
  23612. * @function GetFeaturesByGeometryParameters.prototype.destroy
  23613. * @description 释放资源,将引用资源的属性置空。
  23614. */
  23615. GetFeaturesByGeometryParameters_createClass(GetFeaturesByGeometryParameters, [{
  23616. key: "destroy",
  23617. value: function destroy() {
  23618. GetFeaturesByGeometryParameters_get(GetFeaturesByGeometryParameters_getPrototypeOf(GetFeaturesByGeometryParameters.prototype), "destroy", this).call(this);
  23619. var me = this;
  23620. if (me.geometry) {
  23621. me.geometry.destroy();
  23622. me.geometry = null;
  23623. }
  23624. if (me.fields) {
  23625. while (me.fields.length > 0) {
  23626. me.fields.pop();
  23627. }
  23628. me.fields = null;
  23629. }
  23630. me.attributeFilter = null;
  23631. me.spatialQueryMode = null;
  23632. me.getFeatureMode = null;
  23633. }
  23634. /**
  23635. * @function GetFeaturesByGeometryParameters.toJsonParameters
  23636. * @description 将 GetFeaturesByGeometryParameters 对象参数转换为 JSON 字符串。
  23637. * @param {GetFeaturesByGeometryParameters} params - 查询参数对象。
  23638. * @returns {string} 转化后的 JSON 字符串。
  23639. */
  23640. }], [{
  23641. key: "toJsonParameters",
  23642. value: function toJsonParameters(params) {
  23643. var filterParameter, geometry, parasByGeometry;
  23644. geometry = ServerGeometry.fromGeometry(params.geometry);
  23645. parasByGeometry = {
  23646. datasetNames: params.datasetNames,
  23647. getFeatureMode: 'SPATIAL',
  23648. geometry: geometry,
  23649. spatialQueryMode: params.spatialQueryMode
  23650. };
  23651. if (params.fields) {
  23652. filterParameter = new FilterParameter();
  23653. filterParameter.name = params.datasetNames;
  23654. filterParameter.fields = params.fields;
  23655. parasByGeometry.queryParameter = filterParameter;
  23656. }
  23657. if (params.attributeFilter) {
  23658. parasByGeometry.attributeFilter = params.attributeFilter;
  23659. parasByGeometry.getFeatureMode = 'SPATIAL_ATTRIBUTEFILTER';
  23660. }
  23661. if (params.maxFeatures && !isNaN(params.maxFeatures)) {
  23662. parasByGeometry.maxFeatures = params.maxFeatures;
  23663. }
  23664. if (typeof params.hasGeometry === 'boolean') {
  23665. parasByGeometry.hasGeometry = params.hasGeometry;
  23666. }
  23667. if (params.targetEpsgCode) {
  23668. parasByGeometry.targetEpsgCode = params.targetEpsgCode;
  23669. }
  23670. if (!params.targetEpsgCode && params.targetPrj) {
  23671. parasByGeometry.targetPrj = params.targetPrj;
  23672. }
  23673. if (params.aggregations) {
  23674. parasByGeometry.aggregations = params.aggregations;
  23675. }
  23676. return Util_Util.toJSON(parasByGeometry);
  23677. }
  23678. }]);
  23679. return GetFeaturesByGeometryParameters;
  23680. }(GetFeaturesParametersBase);
  23681. ;// CONCATENATED MODULE: ./src/common/iServer/GetFeaturesByGeometryService.js
  23682. function GetFeaturesByGeometryService_typeof(obj) { "@babel/helpers - typeof"; return GetFeaturesByGeometryService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, GetFeaturesByGeometryService_typeof(obj); }
  23683. function GetFeaturesByGeometryService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  23684. function GetFeaturesByGeometryService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  23685. function GetFeaturesByGeometryService_createClass(Constructor, protoProps, staticProps) { if (protoProps) GetFeaturesByGeometryService_defineProperties(Constructor.prototype, protoProps); if (staticProps) GetFeaturesByGeometryService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  23686. function GetFeaturesByGeometryService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { GetFeaturesByGeometryService_get = Reflect.get.bind(); } else { GetFeaturesByGeometryService_get = function _get(target, property, receiver) { var base = GetFeaturesByGeometryService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return GetFeaturesByGeometryService_get.apply(this, arguments); }
  23687. function GetFeaturesByGeometryService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GetFeaturesByGeometryService_getPrototypeOf(object); if (object === null) break; } return object; }
  23688. function GetFeaturesByGeometryService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) GetFeaturesByGeometryService_setPrototypeOf(subClass, superClass); }
  23689. function GetFeaturesByGeometryService_setPrototypeOf(o, p) { GetFeaturesByGeometryService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GetFeaturesByGeometryService_setPrototypeOf(o, p); }
  23690. function GetFeaturesByGeometryService_createSuper(Derived) { var hasNativeReflectConstruct = GetFeaturesByGeometryService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = GetFeaturesByGeometryService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = GetFeaturesByGeometryService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return GetFeaturesByGeometryService_possibleConstructorReturn(this, result); }; }
  23691. function GetFeaturesByGeometryService_possibleConstructorReturn(self, call) { if (call && (GetFeaturesByGeometryService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return GetFeaturesByGeometryService_assertThisInitialized(self); }
  23692. function GetFeaturesByGeometryService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  23693. function GetFeaturesByGeometryService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  23694. function GetFeaturesByGeometryService_getPrototypeOf(o) { GetFeaturesByGeometryService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GetFeaturesByGeometryService_getPrototypeOf(o); }
  23695. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  23696. * This program are made available under the terms of the Apache License, Version 2.0
  23697. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  23698. /**
  23699. * @class GetFeaturesByGeometryService
  23700. * @deprecatedclass SuperMap.GetFeaturesByGeometryService
  23701. * @category iServer Data FeatureResults
  23702. * @classdesc 数据集几何查询服务类,查询与指定几何对象符合一定空间关系的矢量要素。
  23703. * @param {string} url - 服务地址。请求数据服务中数据集查询服务。
  23704. * URL 应为:http://{服务器地址}:{服务端口号}/iserver/services/{数据服务名}/rest/data;
  23705. * 例如:"http://localhost:8090/iserver/services/data-jingjin/rest/data"
  23706. * @param {Object} options - 参数。
  23707. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  23708. * @param {DataFormat} [options.format=DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON、GeoJSON、FGB 三种格式。参数格式为 "ISERVER","GEOJSON","FGB"。
  23709. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  23710. * @param {Object} [options.headers] - 请求头。
  23711. * @extends {GetFeaturesServiceBase}
  23712. * @example
  23713. * var myService = new GetFeaturesByGeometryService(url, {
  23714. * eventListeners: {
  23715. * "processCompleted": getFeatureCompleted,
  23716. * "processFailed": getFeatureError
  23717. * }
  23718. * });
  23719. * function getFeatureCompleted(object){//todo};
  23720. * function getFeatureError(object){//todo}
  23721. * @usage
  23722. */
  23723. var GetFeaturesByGeometryService = /*#__PURE__*/function (_GetFeaturesServiceBa) {
  23724. GetFeaturesByGeometryService_inherits(GetFeaturesByGeometryService, _GetFeaturesServiceBa);
  23725. var _super = GetFeaturesByGeometryService_createSuper(GetFeaturesByGeometryService);
  23726. function GetFeaturesByGeometryService(url, options) {
  23727. var _this;
  23728. GetFeaturesByGeometryService_classCallCheck(this, GetFeaturesByGeometryService);
  23729. _this = _super.call(this, url, options);
  23730. _this.CLASS_NAME = "SuperMap.GetFeaturesByGeometryService";
  23731. return _this;
  23732. }
  23733. /**
  23734. * @function GetFeaturesByGeometryService.prototype.destroy
  23735. * @override
  23736. */
  23737. GetFeaturesByGeometryService_createClass(GetFeaturesByGeometryService, [{
  23738. key: "destroy",
  23739. value: function destroy() {
  23740. GetFeaturesByGeometryService_get(GetFeaturesByGeometryService_getPrototypeOf(GetFeaturesByGeometryService.prototype), "destroy", this).call(this);
  23741. }
  23742. /**
  23743. * @function GetFeaturesByGeometryService.prototype.getJsonParameters
  23744. * @param {GetFeaturesByGeometryParameters} params - 数据集几何查询参数类。
  23745. * @description 将查询参数转化为 JSON 字符串。
  23746. * 在本类中重写此方法,可以实现不同种类的查询(ID, SQL, Buffer, Geometry等)。
  23747. * @returns {Object} 转化后的 JSON 字符串。
  23748. */
  23749. }, {
  23750. key: "getJsonParameters",
  23751. value: function getJsonParameters(params) {
  23752. return GetFeaturesByGeometryParameters.toJsonParameters(params);
  23753. }
  23754. }]);
  23755. return GetFeaturesByGeometryService;
  23756. }(GetFeaturesServiceBase);
  23757. ;// CONCATENATED MODULE: ./src/common/iServer/FeatureService.js
  23758. function FeatureService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  23759. function FeatureService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  23760. function FeatureService_createClass(Constructor, protoProps, staticProps) { if (protoProps) FeatureService_defineProperties(Constructor.prototype, protoProps); if (staticProps) FeatureService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  23761. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  23762. * This program are made available under the terms of the Apache License, Version 2.0
  23763. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  23764. /**
  23765. * @class FeatureService
  23766. * @constructs FeatureService
  23767. * @category iServer Data Feature
  23768. * @classdesc 数据集类。提供:ID 查询,范围查询,SQL查询,几何查询,bounds 查询,缓冲区查询,地物编辑。
  23769. * @example
  23770. * new FeatureService(url).getFeaturesByIDs(param,function(result){
  23771. * //doSomething
  23772. * })
  23773. * @param {string} url - 服务地址。
  23774. * @param {Object} options - 参数。
  23775. * @param {string} [options.proxy] - 服务代理地址。
  23776. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  23777. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  23778. * @param {Object} [options.headers] - 请求头。
  23779. * @extends {ServiceBase}
  23780. * @usage
  23781. */
  23782. var FeatureService_FeatureService = /*#__PURE__*/function () {
  23783. function FeatureService(url, options) {
  23784. FeatureService_classCallCheck(this, FeatureService);
  23785. this.url = url;
  23786. this.options = options || {};
  23787. }
  23788. /**
  23789. * @function FeatureService.prototype.getFeaturesByIDs
  23790. * @description 数据集 ID 查询服务。
  23791. * @param {GetFeaturesByIDsParameters} params - ID查询参数类。
  23792. * @param {RequestCallback} callback - 回调函数。
  23793. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回的数据格式。
  23794. */
  23795. FeatureService_createClass(FeatureService, [{
  23796. key: "getFeaturesByIDs",
  23797. value: function getFeaturesByIDs(params, callback, resultFormat) {
  23798. var me = this;
  23799. var getFeaturesByIDsService = new GetFeaturesByIDsService(me.url, {
  23800. proxy: me.options.proxy,
  23801. withCredentials: me.options.withCredentials,
  23802. crossOrigin: me.options.crossOrigin,
  23803. headers: me.options.headers,
  23804. eventListeners: {
  23805. processCompleted: callback,
  23806. processFailed: callback
  23807. },
  23808. format: resultFormat
  23809. });
  23810. getFeaturesByIDsService.processAsync(params);
  23811. }
  23812. /**
  23813. * @function FeatureService.prototype.getFeaturesByBounds
  23814. * @description 数据集 Bounds 查询服务。
  23815. * @param {GetFeaturesByBoundsParameters} params - 数据集范围查询参数类。
  23816. * @param {RequestCallback} callback - 回调函数。
  23817. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回的数据格式。
  23818. */
  23819. }, {
  23820. key: "getFeaturesByBounds",
  23821. value: function getFeaturesByBounds(params, callback, resultFormat) {
  23822. var me = this;
  23823. var getFeaturesByBoundsService = new GetFeaturesByBoundsService(me.url, {
  23824. proxy: me.options.proxy,
  23825. withCredentials: me.options.withCredentials,
  23826. crossOrigin: me.options.crossOrigin,
  23827. headers: me.options.headers,
  23828. eventListeners: {
  23829. processCompleted: callback,
  23830. processFailed: callback
  23831. },
  23832. format: me._processFormat(resultFormat)
  23833. });
  23834. getFeaturesByBoundsService.processAsync(params);
  23835. }
  23836. /**
  23837. * @function FeatureService.prototype.getFeaturesByBuffer
  23838. * @description 数据集 Buffer 查询服务。
  23839. * @param {GetFeaturesByBufferParameters} params - 数据集缓冲区查询参数类。
  23840. * @param {RequestCallback} callback - 回调函数。
  23841. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回的数据格式。
  23842. */
  23843. }, {
  23844. key: "getFeaturesByBuffer",
  23845. value: function getFeaturesByBuffer(params, callback, resultFormat) {
  23846. var me = this;
  23847. var getFeatureService = new GetFeaturesByBufferService(me.url, {
  23848. proxy: me.options.proxy,
  23849. withCredentials: me.options.withCredentials,
  23850. crossOrigin: me.options.crossOrigin,
  23851. headers: me.options.headers,
  23852. eventListeners: {
  23853. processCompleted: callback,
  23854. processFailed: callback
  23855. },
  23856. format: me._processFormat(resultFormat)
  23857. });
  23858. getFeatureService.processAsync(params);
  23859. }
  23860. /**
  23861. * @function FeatureService.prototype.getFeaturesBySQL
  23862. * @description 数据集 SQL 查询服务。
  23863. * @param {GetFeaturesBySQLParameters} params - 数据集 SQL 查询参数类。
  23864. * @param {RequestCallback} callback - 回调函数。
  23865. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回的数据格式。
  23866. */
  23867. }, {
  23868. key: "getFeaturesBySQL",
  23869. value: function getFeaturesBySQL(params, callback, resultFormat) {
  23870. var me = this;
  23871. var getFeatureBySQLService = new GetFeaturesBySQLService(me.url, {
  23872. proxy: me.options.proxy,
  23873. withCredentials: me.options.withCredentials,
  23874. crossOrigin: me.options.crossOrigin,
  23875. headers: me.options.headers,
  23876. eventListeners: {
  23877. processCompleted: callback,
  23878. processFailed: callback
  23879. },
  23880. format: me._processFormat(resultFormat)
  23881. });
  23882. getFeatureBySQLService.processAsync(params);
  23883. }
  23884. /**
  23885. * @function FeatureService.prototype.getFeaturesByGeometry
  23886. * @description 数据集几何查询服务类。
  23887. * @param {GetFeaturesByGeometryParameters} params - 数据集几何查询参数类。
  23888. * @param {RequestCallback} callback - 回调函数。
  23889. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回的数据格式。
  23890. */
  23891. }, {
  23892. key: "getFeaturesByGeometry",
  23893. value: function getFeaturesByGeometry(params, callback, resultFormat) {
  23894. var me = this;
  23895. var getFeaturesByGeometryService = new GetFeaturesByGeometryService(me.url, {
  23896. proxy: me.options.proxy,
  23897. withCredentials: me.options.withCredentials,
  23898. crossOrigin: me.options.crossOrigin,
  23899. headers: me.options.headers,
  23900. eventListeners: {
  23901. processCompleted: callback,
  23902. processFailed: callback
  23903. },
  23904. format: me._processFormat(resultFormat)
  23905. });
  23906. getFeaturesByGeometryService.processAsync(params);
  23907. }
  23908. /**
  23909. * @function FeatureService.prototype.editFeatures
  23910. * @description 地物编辑服务。
  23911. * @param {EditFeaturesParameters} params - 数据服务中数据集添加、修改、删除参数类。
  23912. * @param {RequestCallback} callback - 回调函数。
  23913. */
  23914. }, {
  23915. key: "editFeatures",
  23916. value: function editFeatures(params, callback) {
  23917. if (!params || !params.dataSourceName || !params.dataSetName) {
  23918. return;
  23919. }
  23920. var me = this,
  23921. url = me.url,
  23922. dataSourceName = params.dataSourceName,
  23923. dataSetName = params.dataSetName;
  23924. url = Util_Util.urlPathAppend(url, "datasources/" + dataSourceName + "/datasets/" + dataSetName);
  23925. var editFeatureService = new EditFeaturesService(url, {
  23926. proxy: me.options.proxy,
  23927. withCredentials: me.options.withCredentials,
  23928. crossOrigin: me.options.crossOrigin,
  23929. headers: me.options.headers,
  23930. eventListeners: {
  23931. processCompleted: callback,
  23932. processFailed: callback
  23933. }
  23934. });
  23935. editFeatureService.processAsync(params);
  23936. }
  23937. }, {
  23938. key: "_processFormat",
  23939. value: function _processFormat(resultFormat) {
  23940. return resultFormat ? resultFormat : DataFormat.GEOJSON;
  23941. }
  23942. }]);
  23943. return FeatureService;
  23944. }();
  23945. ;// CONCATENATED MODULE: ./src/maplibregl/services/FeatureService.js
  23946. function FeatureService_typeof(obj) { "@babel/helpers - typeof"; return FeatureService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, FeatureService_typeof(obj); }
  23947. function services_FeatureService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  23948. function services_FeatureService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  23949. function services_FeatureService_createClass(Constructor, protoProps, staticProps) { if (protoProps) services_FeatureService_defineProperties(Constructor.prototype, protoProps); if (staticProps) services_FeatureService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  23950. function FeatureService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) FeatureService_setPrototypeOf(subClass, superClass); }
  23951. function FeatureService_setPrototypeOf(o, p) { FeatureService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FeatureService_setPrototypeOf(o, p); }
  23952. function FeatureService_createSuper(Derived) { var hasNativeReflectConstruct = FeatureService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = FeatureService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = FeatureService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return FeatureService_possibleConstructorReturn(this, result); }; }
  23953. function FeatureService_possibleConstructorReturn(self, call) { if (call && (FeatureService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return FeatureService_assertThisInitialized(self); }
  23954. function FeatureService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  23955. function FeatureService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  23956. function FeatureService_getPrototypeOf(o) { FeatureService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FeatureService_getPrototypeOf(o); }
  23957. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  23958. * This program are made available under the terms of the Apache License, Version 2.0
  23959. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  23960. /**
  23961. * @class FeatureService
  23962. * @category iServer Data Feature
  23963. * @classdesc 要素数据集类。提供:ID 查询、范围查询、SQL 查询、几何查询、bounds 查询、缓冲区查询、地物编辑。
  23964. * @version 11.1.0
  23965. * @modulecategory Services
  23966. * @example
  23967. * new FeatureService(url)
  23968. * .getFeaturesByIDs(param,function(result){
  23969. * //doSomething
  23970. * })
  23971. * @extends {ServiceBase}
  23972. * @param {string} url - 服务地址。
  23973. * @param {Object} options -参数。
  23974. * @param {string} [options.proxy] - 服务代理地址。
  23975. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  23976. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  23977. * @param {Object} [options.headers] - 请求头。
  23978. * @usage
  23979. */
  23980. var FeatureService = /*#__PURE__*/function (_ServiceBase) {
  23981. FeatureService_inherits(FeatureService, _ServiceBase);
  23982. var _super = FeatureService_createSuper(FeatureService);
  23983. function FeatureService(url, options) {
  23984. var _this;
  23985. services_FeatureService_classCallCheck(this, FeatureService);
  23986. _this = _super.call(this, url, options);
  23987. _this._featureService = new FeatureService_FeatureService(url, options);
  23988. return _this;
  23989. }
  23990. /**
  23991. * @function FeatureService.prototype.getFeaturesByIDs
  23992. * @description 数据集 ID 查询服务。
  23993. * @param {GetFeaturesByIDsParameters} params - ID查询参数类。
  23994. * @param {RequestCallback} callback - 回调函数。
  23995. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  23996. */
  23997. services_FeatureService_createClass(FeatureService, [{
  23998. key: "getFeaturesByIDs",
  23999. value: function getFeaturesByIDs(params, callback, resultFormat) {
  24000. params = this._processParams(params);
  24001. this._featureService.getFeaturesByIDs(params, callback, resultFormat);
  24002. }
  24003. /**
  24004. * @function FeatureService.prototype.getFeaturesByBounds
  24005. * @description 数据集 Bounds 查询服务。
  24006. * @param {GetFeaturesByBoundsParameters} params - 数据集范围查询参数类。
  24007. * @param {RequestCallback} callback - 回调函数。
  24008. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  24009. */
  24010. }, {
  24011. key: "getFeaturesByBounds",
  24012. value: function getFeaturesByBounds(params, callback, resultFormat) {
  24013. params = this._processParams(params);
  24014. this._featureService.getFeaturesByBounds(params, callback, resultFormat);
  24015. }
  24016. /**
  24017. * @function FeatureService.prototype.getFeaturesByBuffer
  24018. * @description 数据集 Buffer 查询服务。
  24019. * @param {GetFeaturesByBufferParameters} params - 数据集缓冲区查询参数类。
  24020. * @param {RequestCallback} callback 回调函数。
  24021. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  24022. */
  24023. }, {
  24024. key: "getFeaturesByBuffer",
  24025. value: function getFeaturesByBuffer(params, callback, resultFormat) {
  24026. params = this._processParams(params);
  24027. this._featureService.getFeaturesByBuffer(params, callback, resultFormat);
  24028. }
  24029. /**
  24030. * @function FeatureService.prototype.getFeaturesBySQL
  24031. * @description 数据集 SQL 查询服务。
  24032. * @param {GetFeaturesBySQLParameters} params - 数据集 SQL 查询参数类。
  24033. * @param {RequestCallback} callback 回调函数。
  24034. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  24035. */
  24036. }, {
  24037. key: "getFeaturesBySQL",
  24038. value: function getFeaturesBySQL(params, callback, resultFormat) {
  24039. params = this._processParams(params);
  24040. this._featureService.getFeaturesBySQL(params, callback, resultFormat);
  24041. }
  24042. /**
  24043. * @function FeatureService.prototype.getFeaturesByGeometry
  24044. * @description 数据集几何查询服务类。
  24045. * @param {GetFeaturesByGeometryParameters} params - 数据集几何查询参数类。
  24046. * @param {RequestCallback} callback - 回调函数。
  24047. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  24048. */
  24049. }, {
  24050. key: "getFeaturesByGeometry",
  24051. value: function getFeaturesByGeometry(params, callback, resultFormat) {
  24052. params = this._processParams(params);
  24053. this._featureService.getFeaturesByGeometry(params, callback, resultFormat);
  24054. }
  24055. /**
  24056. * @function FeatureService.prototype.editFeatures
  24057. * @description 地物编辑服务。
  24058. * @param {EditFeaturesParameters} params - 数据集添加、修改、删除参数类。
  24059. * @param {RequestCallback} callback 回调函数。
  24060. */
  24061. }, {
  24062. key: "editFeatures",
  24063. value: function editFeatures(params, callback) {
  24064. if (!params || !params.dataSourceName || !params.dataSetName) {
  24065. return;
  24066. }
  24067. var me = this,
  24068. url = me.url,
  24069. dataSourceName = params.dataSourceName,
  24070. dataSetName = params.dataSetName;
  24071. url = Util_Util.urlPathAppend(url, 'datasources/' + dataSourceName + '/datasets/' + dataSetName);
  24072. var editFeatureService = new EditFeaturesService(url, {
  24073. proxy: me.options.proxy,
  24074. withCredentials: me.options.withCredentials,
  24075. crossOrigin: me.options.crossOrigin,
  24076. headers: me.options.headers,
  24077. eventListeners: {
  24078. processCompleted: callback,
  24079. processFailed: callback
  24080. }
  24081. });
  24082. editFeatureService.processAsync(me._processParams(params));
  24083. }
  24084. /**
  24085. * @private
  24086. * @description 参数类型转换。
  24087. * @param {Object} params - 参数 。
  24088. * @returns {Object} params - 转换后的对接 SuperMap 服务的参数。
  24089. */
  24090. }, {
  24091. key: "_processParams",
  24092. value: function _processParams(params) {
  24093. if (!params) {
  24094. return {};
  24095. }
  24096. var me = this;
  24097. params.returnContent = params.returnContent == null ? true : params.returnContent;
  24098. params.fromIndex = params.fromIndex ? params.fromIndex : 0;
  24099. params.toIndex = params.toIndex === 0 ? 0 : params.toIndex ? params.toIndex : -1;
  24100. if (params.bounds) {
  24101. params.bounds = core_Util_Util.toSuperMapBounds(params.bounds);
  24102. }
  24103. if (params.editType) {
  24104. params.editType = params.editType.toLowerCase();
  24105. }
  24106. //maplibregl geojson要素对象转 SuperMap Geometry 对象
  24107. if (params.geometry) {
  24108. if (params.geometry instanceof (external_maplibregl_default()).LngLatBounds) {
  24109. params.geometry = core_Util_Util.toSuperMapPolygon(params.geometry);
  24110. params.geometry.SRID = 4326;
  24111. } else if (params.geometry instanceof (external_maplibregl_default()).Point) {
  24112. params.geometry = new Point(params.geometry.x, params.geometry.y);
  24113. } else if (params.geometry instanceof (external_maplibregl_default()).LngLat) {
  24114. params.geometry = new Point(params.geometry.lng, params.geometry.lat);
  24115. params.geometry.SRID = 4326;
  24116. } else if (!(params.geometry instanceof Geometry_Geometry)) {
  24117. params.geometry = core_Util_Util.toSuperMapGeometry(params.geometry);
  24118. }
  24119. }
  24120. //editFeature服务参数转换,传入单独得对象或对象数组
  24121. if (params.features) {
  24122. var features = [];
  24123. if (core_Util_Util.isArray(params.features)) {
  24124. params.features.map(function (feature) {
  24125. features.push(me._createServerFeature(feature));
  24126. return features;
  24127. });
  24128. } else {
  24129. features.push(me._createServerFeature(params.features));
  24130. }
  24131. params.features = features;
  24132. }
  24133. return params;
  24134. }
  24135. //geoFeature严格按照 MapLibreGL geojson的结构
  24136. }, {
  24137. key: "_createServerFeature",
  24138. value: function _createServerFeature(geoFeature) {
  24139. var feature = {},
  24140. fieldNames = [],
  24141. fieldValues = [];
  24142. var properties = geoFeature.properties;
  24143. for (var key in properties) {
  24144. fieldNames.push(key);
  24145. fieldValues.push(properties[key]);
  24146. }
  24147. feature.fieldNames = fieldNames;
  24148. feature.fieldValues = fieldValues;
  24149. if (geoFeature.id) {
  24150. feature.id = geoFeature.id;
  24151. }
  24152. feature.geometry = core_Util_Util.toSuperMapGeometry(geoFeature);
  24153. return feature;
  24154. }
  24155. }]);
  24156. return FeatureService;
  24157. }(ServiceBase);
  24158. ;// CONCATENATED MODULE: ./src/common/iServer/GetFieldsService.js
  24159. function GetFieldsService_typeof(obj) { "@babel/helpers - typeof"; return GetFieldsService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, GetFieldsService_typeof(obj); }
  24160. function GetFieldsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  24161. function GetFieldsService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  24162. function GetFieldsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) GetFieldsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) GetFieldsService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  24163. function GetFieldsService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { GetFieldsService_get = Reflect.get.bind(); } else { GetFieldsService_get = function _get(target, property, receiver) { var base = GetFieldsService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return GetFieldsService_get.apply(this, arguments); }
  24164. function GetFieldsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GetFieldsService_getPrototypeOf(object); if (object === null) break; } return object; }
  24165. function GetFieldsService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) GetFieldsService_setPrototypeOf(subClass, superClass); }
  24166. function GetFieldsService_setPrototypeOf(o, p) { GetFieldsService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GetFieldsService_setPrototypeOf(o, p); }
  24167. function GetFieldsService_createSuper(Derived) { var hasNativeReflectConstruct = GetFieldsService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = GetFieldsService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = GetFieldsService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return GetFieldsService_possibleConstructorReturn(this, result); }; }
  24168. function GetFieldsService_possibleConstructorReturn(self, call) { if (call && (GetFieldsService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return GetFieldsService_assertThisInitialized(self); }
  24169. function GetFieldsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  24170. function GetFieldsService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  24171. function GetFieldsService_getPrototypeOf(o) { GetFieldsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GetFieldsService_getPrototypeOf(o); }
  24172. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  24173. * This program are made available under the terms of the Apache License, Version 2.0
  24174. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  24175. /**
  24176. * @class GetFieldsService
  24177. * @deprecatedclass SuperMap.GetFieldsService
  24178. * @category iServer Data Field
  24179. * @classdesc 字段查询服务,支持查询指定数据集的中所有属性字段(field)的集合。
  24180. * @param {string} url - 服务地址。如访问World Map服务,只需将url设为:http://localhost:8090/iserver/services/data-world/rest/data 即可。
  24181. * @param {Object} options - 参数。
  24182. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  24183. * @param {DataFormat} [options.format=DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
  24184. * @param {string}options.datasource - 数据源名称。
  24185. * @param {string}options.dataset - 数据集名称。
  24186. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  24187. * @param {Object} [options.headers] - 请求头。
  24188. * @extends {CommonServiceBase}
  24189. * @example
  24190. * var myService = new GetFieldsService(url, {eventListeners: {
  24191. * "processCompleted": getFieldsCompleted,
  24192. * "processFailed": getFieldsError
  24193. * },
  24194. * datasource: "World",
  24195. * dataset: "Countries"
  24196. * };
  24197. * @usage
  24198. */
  24199. var GetFieldsService = /*#__PURE__*/function (_CommonServiceBase) {
  24200. GetFieldsService_inherits(GetFieldsService, _CommonServiceBase);
  24201. var _super = GetFieldsService_createSuper(GetFieldsService);
  24202. function GetFieldsService(url, options) {
  24203. var _this;
  24204. GetFieldsService_classCallCheck(this, GetFieldsService);
  24205. _this = _super.call(this, url, options);
  24206. /**
  24207. * @member {string} GetFieldsService.prototype.datasource
  24208. * @description 要查询的数据集所在的数据源名称。
  24209. */
  24210. _this.datasource = null;
  24211. /**
  24212. * @member {string} GetFieldsService.prototype.dataset
  24213. * @description 要查询的数据集名称。
  24214. */
  24215. _this.dataset = null;
  24216. if (options) {
  24217. Util_Util.extend(GetFieldsService_assertThisInitialized(_this), options);
  24218. }
  24219. _this.CLASS_NAME = "SuperMap.GetFieldsService";
  24220. return _this;
  24221. }
  24222. /**
  24223. * @function GetFieldsService.prototype.destroy
  24224. * @override
  24225. */
  24226. GetFieldsService_createClass(GetFieldsService, [{
  24227. key: "destroy",
  24228. value: function destroy() {
  24229. GetFieldsService_get(GetFieldsService_getPrototypeOf(GetFieldsService.prototype), "destroy", this).call(this);
  24230. var me = this;
  24231. me.datasource = null;
  24232. me.dataset = null;
  24233. }
  24234. /**
  24235. * @function GetFieldsService.prototype.processAsync
  24236. * @description 执行服务,查询指定数据集的字段信息。
  24237. */
  24238. }, {
  24239. key: "processAsync",
  24240. value: function processAsync() {
  24241. var me = this;
  24242. me.url = Util_Util.urlPathAppend(me.url, "datasources/".concat(me.datasource, "/datasets/").concat(me.dataset, "/fields"));
  24243. me.request({
  24244. method: "GET",
  24245. data: null,
  24246. scope: me,
  24247. success: me.serviceProcessCompleted,
  24248. failure: me.serviceProcessFailed
  24249. });
  24250. }
  24251. }]);
  24252. return GetFieldsService;
  24253. }(CommonServiceBase);
  24254. ;// CONCATENATED MODULE: ./src/common/iServer/FieldParameters.js
  24255. function FieldParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  24256. function FieldParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  24257. function FieldParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) FieldParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) FieldParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  24258. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  24259. * This program are made available under the terms of the Apache License, Version 2.0
  24260. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  24261. /**
  24262. * @class FieldParameters
  24263. * @deprecatedclass SuperMap.FieldParameters
  24264. * @category iServer Data Field
  24265. * @classdesc 字段信息查询参数类。
  24266. * @param {Object} options - 参数。
  24267. * @param {string} options.datasource - 数据源名称。
  24268. * @param {string} options.dataset - 数据集名称。
  24269. * @usage
  24270. */
  24271. var FieldParameters = /*#__PURE__*/function () {
  24272. function FieldParameters(options) {
  24273. FieldParameters_classCallCheck(this, FieldParameters);
  24274. /**
  24275. * @member {string} FieldParameters.prototype.datasource
  24276. * @description 要查询的数据集所在的数据源名称。
  24277. */
  24278. this.datasource = null;
  24279. /**
  24280. * @member {string} FieldParameters.prototype.dataset
  24281. * @description 要查询的数据集名称。
  24282. */
  24283. this.dataset = null;
  24284. if (options) {
  24285. Util_Util.extend(this, options);
  24286. }
  24287. this.CLASS_NAME = "SuperMap.FieldParameters";
  24288. }
  24289. /**
  24290. * @function FieldParameters.prototype.destroy
  24291. * @description 释放资源,将引用资源的属性置空。
  24292. */
  24293. FieldParameters_createClass(FieldParameters, [{
  24294. key: "destroy",
  24295. value: function destroy() {
  24296. var me = this;
  24297. me.datasource = null;
  24298. me.dataset = null;
  24299. }
  24300. }]);
  24301. return FieldParameters;
  24302. }();
  24303. ;// CONCATENATED MODULE: ./src/common/iServer/FieldStatisticsParameters.js
  24304. function FieldStatisticsParameters_typeof(obj) { "@babel/helpers - typeof"; return FieldStatisticsParameters_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, FieldStatisticsParameters_typeof(obj); }
  24305. function FieldStatisticsParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  24306. function FieldStatisticsParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  24307. function FieldStatisticsParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) FieldStatisticsParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) FieldStatisticsParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  24308. function FieldStatisticsParameters_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) FieldStatisticsParameters_setPrototypeOf(subClass, superClass); }
  24309. function FieldStatisticsParameters_setPrototypeOf(o, p) { FieldStatisticsParameters_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FieldStatisticsParameters_setPrototypeOf(o, p); }
  24310. function FieldStatisticsParameters_createSuper(Derived) { var hasNativeReflectConstruct = FieldStatisticsParameters_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = FieldStatisticsParameters_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = FieldStatisticsParameters_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return FieldStatisticsParameters_possibleConstructorReturn(this, result); }; }
  24311. function FieldStatisticsParameters_possibleConstructorReturn(self, call) { if (call && (FieldStatisticsParameters_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return FieldStatisticsParameters_assertThisInitialized(self); }
  24312. function FieldStatisticsParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  24313. function FieldStatisticsParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  24314. function FieldStatisticsParameters_getPrototypeOf(o) { FieldStatisticsParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FieldStatisticsParameters_getPrototypeOf(o); }
  24315. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  24316. * This program are made available under the terms of the Apache License, Version 2.0
  24317. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  24318. /**
  24319. * @class FieldStatisticsParameters
  24320. * @deprecatedclass SuperMap.FieldStatisticsParameters
  24321. * @category iServer Data Field
  24322. * @classdesc 字段统计信息查询参数类。
  24323. * @param {Object} options - 参数。
  24324. * @param {string} options.datasource - 数据源名称。
  24325. * @param {string} options.dataset - 数据集名称。
  24326. * @param {string} options.fieldName - 字段名。
  24327. * @param {(string.<StatisticMode>|Array.<string.<StatisticMode>>)} statisticMode - 字段统计方法类型。
  24328. * @extends {FieldParameters}
  24329. * @usage
  24330. */
  24331. var FieldStatisticsParameters = /*#__PURE__*/function (_FieldParameters) {
  24332. FieldStatisticsParameters_inherits(FieldStatisticsParameters, _FieldParameters);
  24333. var _super = FieldStatisticsParameters_createSuper(FieldStatisticsParameters);
  24334. function FieldStatisticsParameters(options) {
  24335. var _this;
  24336. FieldStatisticsParameters_classCallCheck(this, FieldStatisticsParameters);
  24337. _this = _super.call(this, options);
  24338. /**
  24339. * @member {string} FieldStatisticsParameters.prototype.fieldName
  24340. * @description 字段名。
  24341. */
  24342. _this.fieldName = null;
  24343. /**
  24344. * @member {(string.<StatisticMode>|Array.<string.<StatisticMode>>)} FieldStatisticsParameters.prototype.statisticMode
  24345. * @description 字段统计方法类型。
  24346. */
  24347. _this.statisticMode = null;
  24348. if (options) {
  24349. Util_Util.extend(FieldStatisticsParameters_assertThisInitialized(_this), options);
  24350. }
  24351. _this.CLASS_NAME = "SuperMap.FieldStatisticsParameters";
  24352. return _this;
  24353. }
  24354. /**
  24355. * @function FieldStatisticsParameters.prototype.destroy
  24356. * @description 释放资源,将引用资源的属性置空。
  24357. */
  24358. FieldStatisticsParameters_createClass(FieldStatisticsParameters, [{
  24359. key: "destroy",
  24360. value: function destroy() {
  24361. var me = this;
  24362. me.fieldName = null;
  24363. me.statisticMode = null;
  24364. }
  24365. }]);
  24366. return FieldStatisticsParameters;
  24367. }(FieldParameters);
  24368. ;// CONCATENATED MODULE: ./src/common/iServer/FieldStatisticService.js
  24369. function FieldStatisticService_typeof(obj) { "@babel/helpers - typeof"; return FieldStatisticService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, FieldStatisticService_typeof(obj); }
  24370. function FieldStatisticService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  24371. function FieldStatisticService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  24372. function FieldStatisticService_createClass(Constructor, protoProps, staticProps) { if (protoProps) FieldStatisticService_defineProperties(Constructor.prototype, protoProps); if (staticProps) FieldStatisticService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  24373. function FieldStatisticService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { FieldStatisticService_get = Reflect.get.bind(); } else { FieldStatisticService_get = function _get(target, property, receiver) { var base = FieldStatisticService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return FieldStatisticService_get.apply(this, arguments); }
  24374. function FieldStatisticService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FieldStatisticService_getPrototypeOf(object); if (object === null) break; } return object; }
  24375. function FieldStatisticService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) FieldStatisticService_setPrototypeOf(subClass, superClass); }
  24376. function FieldStatisticService_setPrototypeOf(o, p) { FieldStatisticService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FieldStatisticService_setPrototypeOf(o, p); }
  24377. function FieldStatisticService_createSuper(Derived) { var hasNativeReflectConstruct = FieldStatisticService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = FieldStatisticService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = FieldStatisticService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return FieldStatisticService_possibleConstructorReturn(this, result); }; }
  24378. function FieldStatisticService_possibleConstructorReturn(self, call) { if (call && (FieldStatisticService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return FieldStatisticService_assertThisInitialized(self); }
  24379. function FieldStatisticService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  24380. function FieldStatisticService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  24381. function FieldStatisticService_getPrototypeOf(o) { FieldStatisticService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FieldStatisticService_getPrototypeOf(o); }
  24382. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  24383. * This program are made available under the terms of the Apache License, Version 2.0
  24384. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  24385. /**
  24386. * @class FieldStatisticService
  24387. * @deprecatedclass SuperMap.FieldStatisticService
  24388. * @category iServer Data Field
  24389. * @classdesc 字段查询统计服务类。用来完成对指定数据集指定字段的查询统计分析,即求平均值,最大值等。
  24390. * @extends {CommonServiceBase}
  24391. * @param {string} url - 服务地址。如访问 World Map 服务,只需将 url 设为:http://localhost:8090/iserver/services/data-world/rest/data 即可。
  24392. * @param {Object} options - 参数。
  24393. * @param {Object} options.eventListeners - 事件监听器对象。有 processCompleted 属性可传入处理完成后的回调函数。processFailed 属性传入处理失败后的回调函数。
  24394. * @param {DataFormat} [options.format] - 查询结果返回格式,目前支持 iServerJSON 和GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
  24395. * @param {string} options.datasource - 数据集所在的数据源名称。
  24396. * @param {string} options.dataset - 数据集名称。
  24397. * @param {string} options.field - 查询统计的目标字段名称。
  24398. * @param {StatisticMode} options.statisticMode - 字段查询统计的方法类型。
  24399. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  24400. * @param {Object} [options.headers] - 请求头。
  24401. * @example
  24402. * var myService = new FieldStatisticService(url, {eventListeners: {
  24403. * "processCompleted": fieldStatisticCompleted,
  24404. * "processFailed": fieldStatisticError
  24405. * },
  24406. * datasource: "World",
  24407. * dataset: "Countries",
  24408. * field: "SmID",
  24409. * statisticMode: StatisticMode.AVERAGE
  24410. * };
  24411. * @usage
  24412. */
  24413. var FieldStatisticService = /*#__PURE__*/function (_CommonServiceBase) {
  24414. FieldStatisticService_inherits(FieldStatisticService, _CommonServiceBase);
  24415. var _super = FieldStatisticService_createSuper(FieldStatisticService);
  24416. function FieldStatisticService(url, options) {
  24417. var _this;
  24418. FieldStatisticService_classCallCheck(this, FieldStatisticService);
  24419. _this = _super.call(this, url, options);
  24420. /**
  24421. * @member {string} FieldStatisticService.prototype.datasource
  24422. * @description 数据集所在的数据源名称。
  24423. */
  24424. _this.datasource = null;
  24425. /**
  24426. * @member {string} FieldStatisticService.prototype.dataset
  24427. * @description 数据集名称。
  24428. */
  24429. _this.dataset = null;
  24430. /**
  24431. * @member {string} FieldStatisticService.prototype.field
  24432. * @description 查询统计的目标字段名称。
  24433. */
  24434. _this.field = null;
  24435. /**
  24436. * @member {StatisticMode} FieldStatisticService.prototype.statisticMode
  24437. * @description 字段查询统计的方法类型。
  24438. */
  24439. _this.statisticMode = null;
  24440. if (options) {
  24441. Util_Util.extend(FieldStatisticService_assertThisInitialized(_this), options);
  24442. }
  24443. _this.CLASS_NAME = "SuperMap.FieldStatisticService";
  24444. return _this;
  24445. }
  24446. /**
  24447. * @function FieldStatisticService.prototype.destroy
  24448. * @override
  24449. */
  24450. FieldStatisticService_createClass(FieldStatisticService, [{
  24451. key: "destroy",
  24452. value: function destroy() {
  24453. FieldStatisticService_get(FieldStatisticService_getPrototypeOf(FieldStatisticService.prototype), "destroy", this).call(this);
  24454. var me = this;
  24455. me.datasource = null;
  24456. me.dataset = null;
  24457. me.field = null;
  24458. me.statisticMode = null;
  24459. }
  24460. /**
  24461. * @function FieldStatisticService.prototype.processAsync
  24462. * @description 执行服务,进行指定字段的查询统计。
  24463. */
  24464. }, {
  24465. key: "processAsync",
  24466. value: function processAsync() {
  24467. var me = this,
  24468. fieldStatisticURL = "datasources/" + me.datasource + "/datasets/" + me.dataset + "/fields/" + me.field + "/" + me.statisticMode;
  24469. me.url = Util_Util.urlPathAppend(me.url, fieldStatisticURL);
  24470. me.request({
  24471. method: "GET",
  24472. data: null,
  24473. scope: me,
  24474. success: me.serviceProcessCompleted,
  24475. failure: me.serviceProcessFailed
  24476. });
  24477. }
  24478. }]);
  24479. return FieldStatisticService;
  24480. }(CommonServiceBase);
  24481. ;// CONCATENATED MODULE: ./src/common/iServer/FieldService.js
  24482. function FieldService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  24483. function FieldService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  24484. function FieldService_createClass(Constructor, protoProps, staticProps) { if (protoProps) FieldService_defineProperties(Constructor.prototype, protoProps); if (staticProps) FieldService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  24485. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  24486. * This program are made available under the terms of the Apache License, Version 2.0
  24487. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  24488. /**
  24489. * @class FieldService
  24490. * @category iServer Data Field
  24491. * @classdesc 字段服务类。
  24492. * @example
  24493. * new FieldService(url).getFields(function(result){
  24494. * //doSomething
  24495. * });
  24496. * @param {string} url - 服务地址。
  24497. * @param {Object} options - 参数。
  24498. * @param {string} [options.proxy] - 服务代理地址。
  24499. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  24500. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  24501. * @param {Object} [options.headers] - 请求头。
  24502. * @extends {ServiceBase}
  24503. * @usage
  24504. */
  24505. var FieldService_FieldService = /*#__PURE__*/function () {
  24506. function FieldService(url, options) {
  24507. FieldService_classCallCheck(this, FieldService);
  24508. this.url = url;
  24509. this.options = options || {};
  24510. }
  24511. /**
  24512. * @function FieldService.prototype.getFields
  24513. * @description 字段查询服务。
  24514. * @param {FieldParameters} params - 字段信息查询参数类。
  24515. * @param {RequestCallback} callback 回调函数。
  24516. */
  24517. FieldService_createClass(FieldService, [{
  24518. key: "getFields",
  24519. value: function getFields(params, callback) {
  24520. var me = this;
  24521. var getFieldsService = new GetFieldsService(me.url, {
  24522. proxy: me.options.proxy,
  24523. withCredentials: me.options.withCredentials,
  24524. crossOrigin: me.options.crossOrigin,
  24525. headers: me.options.headers,
  24526. eventListeners: {
  24527. scope: me,
  24528. processCompleted: callback,
  24529. processFailed: callback
  24530. },
  24531. datasource: params.datasource,
  24532. dataset: params.dataset
  24533. });
  24534. getFieldsService.processAsync();
  24535. }
  24536. /**
  24537. * @function FieldService.prototype.getFieldStatisticsInfo
  24538. * @description 字段统计服务。
  24539. * @param {FieldStatisticsParameters} params - 字段统计信息查询参数类。
  24540. * @param {RequestCallback} callback 回调函数。
  24541. */
  24542. }, {
  24543. key: "getFieldStatisticsInfo",
  24544. value: function getFieldStatisticsInfo(params, callback) {
  24545. if (!(params instanceof FieldStatisticsParameters)) {
  24546. return;
  24547. }
  24548. var me = this,
  24549. fieldName = params.fieldName,
  24550. modes = params.statisticMode;
  24551. if (modes && !Array.isArray(modes)) {
  24552. modes = [modes];
  24553. }
  24554. me.currentStatisticResult = {
  24555. fieldName: fieldName
  24556. };
  24557. me._statisticsCallback = callback;
  24558. //针对每种统计方式分别进行请求
  24559. modes.forEach(function (mode) {
  24560. me.currentStatisticResult[mode] = null;
  24561. me._fieldStatisticRequest(params.datasource, params.dataset, fieldName, mode);
  24562. });
  24563. }
  24564. }, {
  24565. key: "_fieldStatisticRequest",
  24566. value: function _fieldStatisticRequest(datasource, dataset, fieldName, statisticMode) {
  24567. var me = this;
  24568. var statisticService = new FieldStatisticService(me.url, {
  24569. eventListeners: {
  24570. scope: me,
  24571. processCompleted: me._processCompleted.bind(me),
  24572. processFailed: me._statisticsCallback
  24573. },
  24574. datasource: datasource,
  24575. dataset: dataset,
  24576. field: fieldName,
  24577. statisticMode: statisticMode,
  24578. crossOrigin: me.options.crossOrigin,
  24579. headers: me.options.headers
  24580. });
  24581. statisticService.processAsync();
  24582. }
  24583. }, {
  24584. key: "_processCompleted",
  24585. value: function _processCompleted(fieldStatisticResult, options) {
  24586. var me = this;
  24587. var getAll = true,
  24588. result = fieldStatisticResult.result;
  24589. if (this.currentStatisticResult) {
  24590. if (null == me.currentStatisticResult[result.mode]) {
  24591. this.currentStatisticResult[result.mode] = result.result;
  24592. }
  24593. }
  24594. for (var mode in me.currentStatisticResult) {
  24595. if (null == me.currentStatisticResult[mode]) {
  24596. getAll = false;
  24597. break;
  24598. }
  24599. }
  24600. if (getAll) {
  24601. me._statisticsCallback({
  24602. result: me.currentStatisticResult,
  24603. options: options
  24604. });
  24605. }
  24606. }
  24607. }]);
  24608. return FieldService;
  24609. }();
  24610. ;// CONCATENATED MODULE: ./src/maplibregl/services/FieldService.js
  24611. function FieldService_typeof(obj) { "@babel/helpers - typeof"; return FieldService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, FieldService_typeof(obj); }
  24612. function services_FieldService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  24613. function services_FieldService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  24614. function services_FieldService_createClass(Constructor, protoProps, staticProps) { if (protoProps) services_FieldService_defineProperties(Constructor.prototype, protoProps); if (staticProps) services_FieldService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  24615. function FieldService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) FieldService_setPrototypeOf(subClass, superClass); }
  24616. function FieldService_setPrototypeOf(o, p) { FieldService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FieldService_setPrototypeOf(o, p); }
  24617. function FieldService_createSuper(Derived) { var hasNativeReflectConstruct = FieldService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = FieldService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = FieldService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return FieldService_possibleConstructorReturn(this, result); }; }
  24618. function FieldService_possibleConstructorReturn(self, call) { if (call && (FieldService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return FieldService_assertThisInitialized(self); }
  24619. function FieldService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  24620. function FieldService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  24621. function FieldService_getPrototypeOf(o) { FieldService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FieldService_getPrototypeOf(o); }
  24622. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  24623. * This program are made available under the terms of the Apache License, Version 2.0
  24624. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  24625. /**
  24626. * @class FieldService
  24627. * @category iServer Data Field
  24628. * @classdesc 字段服务类。
  24629. * @version 11.1.0
  24630. * @modulecategory Services
  24631. * @example
  24632. * new FieldService(url).getFields(function(result){
  24633. * //doSomething
  24634. * });
  24635. * @param {string} url - 服务地址。
  24636. * @param {Object} options - 参数。
  24637. * @param {string} [options.proxy] - 服务代理地址。
  24638. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  24639. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  24640. * @param {Object} [options.headers] - 请求头。
  24641. * @extends {ServiceBase}
  24642. * @usage
  24643. */
  24644. var FieldService = /*#__PURE__*/function (_ServiceBase) {
  24645. FieldService_inherits(FieldService, _ServiceBase);
  24646. var _super = FieldService_createSuper(FieldService);
  24647. function FieldService(url, options) {
  24648. var _this;
  24649. services_FieldService_classCallCheck(this, FieldService);
  24650. _this = _super.call(this, url, options);
  24651. _this._fieldService = new FieldService_FieldService(url, options);
  24652. return _this;
  24653. }
  24654. /**
  24655. * @function FieldService.prototype.getFields
  24656. * @description 字段查询服务。
  24657. * @param {FieldParameters} params - 字段信息查询参数类。
  24658. * @param {RequestCallback} callback 回调函数。
  24659. */
  24660. services_FieldService_createClass(FieldService, [{
  24661. key: "getFields",
  24662. value: function getFields(params, callback) {
  24663. this._fieldService.getFields(params, callback);
  24664. }
  24665. /**
  24666. * @function FieldService.prototype.getFieldStatisticsInfo
  24667. * @description 字段统计服务。
  24668. * @param {FieldStatisticsParameters} params - 字段统计信息查询参数类。
  24669. * @param {RequestCallback} callback 回调函数。
  24670. */
  24671. }, {
  24672. key: "getFieldStatisticsInfo",
  24673. value: function getFieldStatisticsInfo(params, callback) {
  24674. this._fieldService.getFieldStatisticsInfo(params, callback);
  24675. }
  24676. }]);
  24677. return FieldService;
  24678. }(ServiceBase);
  24679. ;// CONCATENATED MODULE: ./src/common/iServer/GetGridCellInfosParameters.js
  24680. function GetGridCellInfosParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  24681. function GetGridCellInfosParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  24682. function GetGridCellInfosParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) GetGridCellInfosParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) GetGridCellInfosParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  24683. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  24684. * This program are made available under the terms of the Apache License, Version 2.0
  24685. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  24686. /**
  24687. * @class GetGridCellInfosParameters
  24688. * @deprecatedclass SuperMap.GetGridCellInfosParameters
  24689. * @category iServer Data Grid
  24690. * @classdesc 数据服务栅格查询参数类。
  24691. * @param {Object} options - 参数。
  24692. * @param {string} options.datasetName - 数据集名称。
  24693. * @param {string} options.dataSourceName - 数据源名称。
  24694. * @param {number} options.X - 地理位置 X 轴。
  24695. * @param {number} options.Y - 地理位置 Y 轴。
  24696. * @usage
  24697. */
  24698. var GetGridCellInfosParameters = /*#__PURE__*/function () {
  24699. function GetGridCellInfosParameters(options) {
  24700. GetGridCellInfosParameters_classCallCheck(this, GetGridCellInfosParameters);
  24701. /**
  24702. * @member {string} GetGridCellInfosParameters.prototype.datasetName
  24703. * @description 数据集名称。
  24704. */
  24705. this.datasetName = null;
  24706. /**
  24707. * @member {string} GetGridCellInfosParameters.prototype.dataSourceName
  24708. * @description 数据源名称。
  24709. */
  24710. this.dataSourceName = null;
  24711. /**
  24712. * @member {number} GetGridCellInfosParameters.prototype.X
  24713. * @description 要查询的地理位置 X 轴。
  24714. */
  24715. this.X = null;
  24716. /**
  24717. * @member {number} GetGridCellInfosParameters.prototype.Y
  24718. * @description 要查询的地理位置 Y 轴。
  24719. */
  24720. this.Y = null;
  24721. Util_Util.extend(this, options);
  24722. this.CLASS_NAME = "SuperMap.GetGridCellInfosParameters";
  24723. }
  24724. /**
  24725. * @function GetGridCellInfosParameters.prototype.destroy
  24726. * @description 释放资源,将引用的资源属性置空。
  24727. */
  24728. GetGridCellInfosParameters_createClass(GetGridCellInfosParameters, [{
  24729. key: "destroy",
  24730. value: function destroy() {
  24731. var me = this;
  24732. me.datasetName = null;
  24733. me.dataSourceName = null;
  24734. me.X = null;
  24735. me.Y = null;
  24736. }
  24737. }]);
  24738. return GetGridCellInfosParameters;
  24739. }();
  24740. ;// CONCATENATED MODULE: ./src/common/iServer/GetGridCellInfosService.js
  24741. function GetGridCellInfosService_typeof(obj) { "@babel/helpers - typeof"; return GetGridCellInfosService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, GetGridCellInfosService_typeof(obj); }
  24742. function GetGridCellInfosService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  24743. function GetGridCellInfosService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  24744. function GetGridCellInfosService_createClass(Constructor, protoProps, staticProps) { if (protoProps) GetGridCellInfosService_defineProperties(Constructor.prototype, protoProps); if (staticProps) GetGridCellInfosService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  24745. function GetGridCellInfosService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { GetGridCellInfosService_get = Reflect.get.bind(); } else { GetGridCellInfosService_get = function _get(target, property, receiver) { var base = GetGridCellInfosService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return GetGridCellInfosService_get.apply(this, arguments); }
  24746. function GetGridCellInfosService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GetGridCellInfosService_getPrototypeOf(object); if (object === null) break; } return object; }
  24747. function GetGridCellInfosService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) GetGridCellInfosService_setPrototypeOf(subClass, superClass); }
  24748. function GetGridCellInfosService_setPrototypeOf(o, p) { GetGridCellInfosService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GetGridCellInfosService_setPrototypeOf(o, p); }
  24749. function GetGridCellInfosService_createSuper(Derived) { var hasNativeReflectConstruct = GetGridCellInfosService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = GetGridCellInfosService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = GetGridCellInfosService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return GetGridCellInfosService_possibleConstructorReturn(this, result); }; }
  24750. function GetGridCellInfosService_possibleConstructorReturn(self, call) { if (call && (GetGridCellInfosService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return GetGridCellInfosService_assertThisInitialized(self); }
  24751. function GetGridCellInfosService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  24752. function GetGridCellInfosService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  24753. function GetGridCellInfosService_getPrototypeOf(o) { GetGridCellInfosService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GetGridCellInfosService_getPrototypeOf(o); }
  24754. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  24755. * This program are made available under the terms of the Apache License, Version 2.0
  24756. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  24757. /**
  24758. * @class GetGridCellInfosService
  24759. * @deprecatedclass SuperMap.GetGridCellInfosService
  24760. * @category iServer Data Grid
  24761. * @classdesc 数据栅格查询服务,支持查询指定地理位置的栅格信息。
  24762. * @param {string} url - 服务地址。例如: http://localhost:8090/iserver/services/data-jingjin/rest/data
  24763. * @param {Object} options - 参数。
  24764. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。<br>
  24765. * @param {DataFormat} [options.format=DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
  24766. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  24767. * @param {Object} [options.headers] - 请求头。
  24768. * @extends {CommonServiceBase}
  24769. * @example
  24770. * var myService = new GetGridCellInfosService(url, {eventListeners: {
  24771. * "processCompleted": queryCompleted,
  24772. * "processFailed": queryError
  24773. * }
  24774. * });
  24775. * @usage
  24776. */
  24777. var GetGridCellInfosService = /*#__PURE__*/function (_CommonServiceBase) {
  24778. GetGridCellInfosService_inherits(GetGridCellInfosService, _CommonServiceBase);
  24779. var _super = GetGridCellInfosService_createSuper(GetGridCellInfosService);
  24780. function GetGridCellInfosService(url, options) {
  24781. var _this;
  24782. GetGridCellInfosService_classCallCheck(this, GetGridCellInfosService);
  24783. _this = _super.call(this, url, options);
  24784. /**
  24785. * @member {string} GetGridCellInfosService.prototype.datasetName
  24786. * @description 数据集名称。
  24787. */
  24788. _this.datasetName = null;
  24789. /**
  24790. * @member {string} GetGridCellInfosService.prototype.dataSourceName
  24791. * @description 数据源名称。
  24792. */
  24793. _this.dataSourceName = null;
  24794. /**
  24795. * @member {string} GetGridCellInfosService.prototype.datasetType
  24796. * @description 数据集类型。
  24797. */
  24798. _this.datasetType = null;
  24799. /**
  24800. * @member {number} GetGridCellInfosService.prototype.X
  24801. * @description 要查询的地理位置X轴
  24802. */
  24803. _this.X = null;
  24804. /**
  24805. * @member {number} GetGridCellInfosService.prototype.Y
  24806. * @description 要查询的地理位置Y轴
  24807. */
  24808. _this.Y = null;
  24809. if (options) {
  24810. Util_Util.extend(GetGridCellInfosService_assertThisInitialized(_this), options);
  24811. }
  24812. _this.eventCount = 0;
  24813. _this.CLASS_NAME = "SuperMap.GetGridCellInfosService";
  24814. return _this;
  24815. }
  24816. /**
  24817. * @function GetGridCellInfosService.prototype.destroy
  24818. * @override
  24819. */
  24820. GetGridCellInfosService_createClass(GetGridCellInfosService, [{
  24821. key: "destroy",
  24822. value: function destroy() {
  24823. GetGridCellInfosService_get(GetGridCellInfosService_getPrototypeOf(GetGridCellInfosService.prototype), "destroy", this).call(this);
  24824. var me = this;
  24825. me.X = null;
  24826. me.Y = null;
  24827. me.datasetName = null;
  24828. me.dataSourceName = null;
  24829. me.datasetType = null;
  24830. }
  24831. /**
  24832. * @function GetGridCellInfosService.prototype.processAsync
  24833. * @description 执行服务,查询数据集信息。
  24834. * @param {GetGridCellInfosParameters} params - 查询参数。
  24835. */
  24836. }, {
  24837. key: "processAsync",
  24838. value: function processAsync(params, callback) {
  24839. if (!(params instanceof GetGridCellInfosParameters)) {
  24840. return;
  24841. }
  24842. Util_Util.extend(this, params);
  24843. var me = this;
  24844. me.url = Util_Util.urlPathAppend(me.url, "datasources/".concat(me.dataSourceName, "/datasets/").concat(me.datasetName));
  24845. me.queryRequest(me.getDatasetInfoCompleted.bind(me), me.getDatasetInfoFailed.bind(me), callback);
  24846. }
  24847. /**
  24848. * @function GetGridCellInfosService.prototype.queryRequest
  24849. * @description 执行服务,查询。
  24850. * @callback {function} successFun - 成功后执行的函数。
  24851. * @callback {function} failedFunc - 失败后执行的函数。
  24852. */
  24853. }, {
  24854. key: "queryRequest",
  24855. value: function queryRequest(successFun, failedFunc, callback) {
  24856. var eventId = ++this.eventCount;
  24857. var eventListeners = {
  24858. scope: this,
  24859. processCompleted: function processCompleted(result) {
  24860. if (eventId === result.result.eventId && callback) {
  24861. delete result.result.eventId;
  24862. callback(result);
  24863. this.events && this.events.un(eventListeners);
  24864. return false;
  24865. }
  24866. },
  24867. processFailed: function processFailed(result) {
  24868. if ((eventId === result.error.eventId || eventId === result.eventId) && callback) {
  24869. callback(result);
  24870. this.events && this.events.un(eventListeners);
  24871. return false;
  24872. }
  24873. }
  24874. };
  24875. this.events.on(eventListeners);
  24876. var me = this;
  24877. me.request({
  24878. method: "GET",
  24879. data: null,
  24880. scope: me,
  24881. success: function success(result, options) {
  24882. result.eventId = eventId;
  24883. successFun(result, options, callback);
  24884. },
  24885. failure: function failure(result, options) {
  24886. if (result.error) {
  24887. result.error.eventId = eventId;
  24888. }
  24889. result.eventId = eventId;
  24890. failedFunc(result, options);
  24891. }
  24892. });
  24893. }
  24894. /**
  24895. * @function GetGridCellInfosService.prototype.getDatasetInfoCompleted
  24896. * @description 数据集查询完成,执行此方法。
  24897. * @param {Object} result - 服务器返回的结果对象。
  24898. */
  24899. }, {
  24900. key: "getDatasetInfoCompleted",
  24901. value: function getDatasetInfoCompleted(result, options, callback) {
  24902. var me = this;
  24903. result = Util_Util.transformResult(result);
  24904. me.datasetType = result.datasetInfo.type;
  24905. me.queryGridInfos(callback);
  24906. }
  24907. /**
  24908. * @function GetGridCellInfosService.prototype.queryGridInfos
  24909. * @description 执行服务,查询数据集栅格信息。
  24910. */
  24911. }, {
  24912. key: "queryGridInfos",
  24913. value: function queryGridInfos(callback) {
  24914. var me = this;
  24915. me.url = Util_Util.urlPathAppend(me.url, me.datasetType == 'GRID' ? 'gridValue' : 'imageValue');
  24916. if (me.X != null && me.Y != null) {
  24917. me.url = Util_Util.urlAppend(me.url, "x=".concat(me.X, "&y=").concat(me.Y));
  24918. }
  24919. me.queryRequest(me.serviceProcessCompleted.bind(me), me.serviceProcessFailed.bind(me), callback);
  24920. }
  24921. /**
  24922. * @function GetGridCellInfosService.prototype.getDatasetInfoFailed
  24923. * @description 数据集查询失败,执行此方法。
  24924. * @param {Object} result - 服务器返回的结果对象。
  24925. */
  24926. }, {
  24927. key: "getDatasetInfoFailed",
  24928. value: function getDatasetInfoFailed(result, options) {
  24929. var me = this;
  24930. me.serviceProcessFailed(result, options);
  24931. }
  24932. }]);
  24933. return GetGridCellInfosService;
  24934. }(CommonServiceBase);
  24935. ;// CONCATENATED MODULE: ./src/maplibregl/services/GridCellInfosService.js
  24936. function GridCellInfosService_typeof(obj) { "@babel/helpers - typeof"; return GridCellInfosService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, GridCellInfosService_typeof(obj); }
  24937. function GridCellInfosService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  24938. function GridCellInfosService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  24939. function GridCellInfosService_createClass(Constructor, protoProps, staticProps) { if (protoProps) GridCellInfosService_defineProperties(Constructor.prototype, protoProps); if (staticProps) GridCellInfosService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  24940. function GridCellInfosService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) GridCellInfosService_setPrototypeOf(subClass, superClass); }
  24941. function GridCellInfosService_setPrototypeOf(o, p) { GridCellInfosService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GridCellInfosService_setPrototypeOf(o, p); }
  24942. function GridCellInfosService_createSuper(Derived) { var hasNativeReflectConstruct = GridCellInfosService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = GridCellInfosService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = GridCellInfosService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return GridCellInfosService_possibleConstructorReturn(this, result); }; }
  24943. function GridCellInfosService_possibleConstructorReturn(self, call) { if (call && (GridCellInfosService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return GridCellInfosService_assertThisInitialized(self); }
  24944. function GridCellInfosService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  24945. function GridCellInfosService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  24946. function GridCellInfosService_getPrototypeOf(o) { GridCellInfosService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GridCellInfosService_getPrototypeOf(o); }
  24947. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  24948. * This program are made available under the terms of the Apache License, Version 2.0
  24949. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  24950. /**
  24951. * @class GridCellInfosService
  24952. * @category iServer Data Grid
  24953. * @classdesc 数据栅格查询服务类。
  24954. * @version 11.1.0
  24955. * @modulecategory Services
  24956. * @extends {ServiceBase}
  24957. * @example
  24958. * new GridCellInfosService(url)
  24959. * .getGridCellInfos(param,function(result){
  24960. * //doSomething
  24961. * })
  24962. * @param {string} url - 服务地址。请求地图服务,URL 应为:</br>
  24963. * http://{服务器地址}:{服务端口号}/iserver/services/{地图服务名}/rest/maps/{地图名}/tempLayersSet/{tempLayerID}/Rivers@World@@World。
  24964. * @param {Object} options - 参数。
  24965. * @param {string} [options.proxy] - 服务代理地址。
  24966. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  24967. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  24968. * @param {Object} [options.headers] - 请求头。
  24969. * @usage
  24970. */
  24971. var GridCellInfosService = /*#__PURE__*/function (_ServiceBase) {
  24972. GridCellInfosService_inherits(GridCellInfosService, _ServiceBase);
  24973. var _super = GridCellInfosService_createSuper(GridCellInfosService);
  24974. function GridCellInfosService(url, options) {
  24975. var _this;
  24976. GridCellInfosService_classCallCheck(this, GridCellInfosService);
  24977. _this = _super.call(this, url, options);
  24978. _this._gridCellQueryService = new GetGridCellInfosService(_this.url, {
  24979. proxy: _this.options.proxy,
  24980. withCredentials: _this.options.withCredentials,
  24981. crossOrigin: _this.options.crossOrigin,
  24982. headers: _this.options.headers
  24983. });
  24984. return _this;
  24985. }
  24986. /**
  24987. * @function GridCellInfosService.prototype.getGridCellInfos
  24988. * @param {GetGridCellInfosParameters} params - 数据服务栅格查询参数类。
  24989. * @param {RequestCallback} callback 回调函数。
  24990. */
  24991. GridCellInfosService_createClass(GridCellInfosService, [{
  24992. key: "getGridCellInfos",
  24993. value: function getGridCellInfos(params, callback) {
  24994. if (!params) {
  24995. return null;
  24996. }
  24997. this._gridCellQueryService.processAsync(params, callback);
  24998. }
  24999. }]);
  25000. return GridCellInfosService;
  25001. }(ServiceBase);
  25002. ;// CONCATENATED MODULE: ./src/common/iServer/GeoprocessingService.js
  25003. function GeoprocessingService_typeof(obj) { "@babel/helpers - typeof"; return GeoprocessingService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, GeoprocessingService_typeof(obj); }
  25004. function GeoprocessingService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  25005. function GeoprocessingService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  25006. function GeoprocessingService_createClass(Constructor, protoProps, staticProps) { if (protoProps) GeoprocessingService_defineProperties(Constructor.prototype, protoProps); if (staticProps) GeoprocessingService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  25007. function GeoprocessingService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) GeoprocessingService_setPrototypeOf(subClass, superClass); }
  25008. function GeoprocessingService_setPrototypeOf(o, p) { GeoprocessingService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GeoprocessingService_setPrototypeOf(o, p); }
  25009. function GeoprocessingService_createSuper(Derived) { var hasNativeReflectConstruct = GeoprocessingService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = GeoprocessingService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = GeoprocessingService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return GeoprocessingService_possibleConstructorReturn(this, result); }; }
  25010. function GeoprocessingService_possibleConstructorReturn(self, call) { if (call && (GeoprocessingService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return GeoprocessingService_assertThisInitialized(self); }
  25011. function GeoprocessingService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  25012. function GeoprocessingService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  25013. function GeoprocessingService_getPrototypeOf(o) { GeoprocessingService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GeoprocessingService_getPrototypeOf(o); }
  25014. /**
  25015. * @class GeoprocessingService
  25016. * @deprecatedclass SuperMap.GeoprocessingService
  25017. * @category iServer ProcessingAutomationService
  25018. * @classdesc 处理自动化服务接口的基类。
  25019. * @version 10.1.0
  25020. * @extends {CommonServiceBase}
  25021. * @param {string} url - 服务地址。
  25022. * @param {Object} options - 参数。
  25023. * @param {Events} options.events - 处理所有事件的对象。
  25024. * @param {Object} [options.eventListeners] - 事件监听器对象。有 processCompleted 属性可传入处理完成后的回调函数。processFailed 属性传入处理失败后的回调函数。
  25025. * @usage
  25026. */
  25027. var GeoprocessingService_GeoprocessingService = /*#__PURE__*/function (_CommonServiceBase) {
  25028. GeoprocessingService_inherits(GeoprocessingService, _CommonServiceBase);
  25029. var _super = GeoprocessingService_createSuper(GeoprocessingService);
  25030. function GeoprocessingService(url, options) {
  25031. var _this;
  25032. GeoprocessingService_classCallCheck(this, GeoprocessingService);
  25033. options = options || {};
  25034. options.EVENT_TYPES = ['processCompleted', 'processFailed', 'processRunning'];
  25035. _this = _super.call(this, url, options);
  25036. _this.CLASS_NAME = 'SuperMap.GeoprocessingService';
  25037. _this.headers = {};
  25038. _this.crossOrigin = true;
  25039. _this.eventCount = 0;
  25040. return _this;
  25041. }
  25042. /**
  25043. * @function GeoprocessingService.prototype.getTools
  25044. * @description 获取处理自动化工具列表。
  25045. * @param {string} identifier - 处理自动化工具ID。
  25046. */
  25047. GeoprocessingService_createClass(GeoprocessingService, [{
  25048. key: "getTools",
  25049. value: function getTools(callback) {
  25050. this._processAsync({
  25051. url: "".concat(this.url, "/list"),
  25052. callback: callback
  25053. });
  25054. }
  25055. /**
  25056. * @function GeoprocessingService.prototype.getTool
  25057. * @description 获取处理自动化工具的ID、名称、描述、输入参数、环境参数和输出结果等相关参数。
  25058. * @param {string} identifier - 处理自动化工具ID。
  25059. */
  25060. }, {
  25061. key: "getTool",
  25062. value: function getTool(identifier, callback) {
  25063. this._processAsync({
  25064. url: "".concat(this.url, "/").concat(identifier),
  25065. callback: callback
  25066. });
  25067. }
  25068. /**
  25069. * @function GeoprocessingService.prototype.execute
  25070. * @description 同步执行处理自动化工具。
  25071. * @param {string} identifier - 处理自动化工具ID。
  25072. * @param {Object} parameter - 处理自动化工具的输入参数。
  25073. * @param {Object} environment - 处理自动化工具的环境参数。
  25074. */
  25075. }, {
  25076. key: "execute",
  25077. value: function execute(identifier, parameter, environment, callback) {
  25078. parameter = parameter ? parameter : null;
  25079. environment = environment ? environment : null;
  25080. var executeParamter = {
  25081. parameter: parameter,
  25082. environment: environment
  25083. };
  25084. this._processAsync({
  25085. url: "".concat(this.url, "/").concat(identifier, "/execute"),
  25086. executeParamter: executeParamter,
  25087. callback: callback
  25088. });
  25089. }
  25090. /**
  25091. * @function GeoprocessingService.prototype.submitJob
  25092. * @description 异步执行处理自动化工具。
  25093. * @param {string} identifier - 处理自动化工具ID。
  25094. * @param {Object} parameter - 处理自动化工具的输入参数。
  25095. * @param {Object} environments - 处理自动化工具的环境参数。
  25096. */
  25097. }, {
  25098. key: "submitJob",
  25099. value: function submitJob(identifier, parameter, environments, callback) {
  25100. parameter = parameter ? parameter : null;
  25101. environments = environments ? environments : null;
  25102. var asyncParamter = JSON.stringify({
  25103. parameter: parameter,
  25104. environments: environments
  25105. });
  25106. this._processAsync({
  25107. url: "".concat(this.url, "/").concat(identifier, "/jobs"),
  25108. method: 'POST',
  25109. callback: callback,
  25110. params: asyncParamter
  25111. });
  25112. }
  25113. /**
  25114. * @function GeoprocessingService.prototype.waitForJobCompletion
  25115. * @description 获取处理自动化异步执行状态信息。
  25116. * @param {string} jobId - 处理自动化任务ID。
  25117. * @param {string} identifier - 处理自动化工具ID。
  25118. * @param {Object} options - 状态信息参数。
  25119. * @param {number} options.interval - 定时器时间间隔。
  25120. * @param {function} options.statusCallback - 任务状态的回调函数。
  25121. */
  25122. }, {
  25123. key: "waitForJobCompletion",
  25124. value: function waitForJobCompletion(jobId, identifier, options, callback) {
  25125. var me = this;
  25126. var timer = setInterval(function () {
  25127. var serviceProcessCompleted = function serviceProcessCompleted(serverResult, options) {
  25128. var state = serverResult.state.runState;
  25129. if (options.statusCallback) {
  25130. options.statusCallback(state);
  25131. }
  25132. switch (state) {
  25133. case 'FINISHED':
  25134. clearInterval(timer);
  25135. me.events.triggerEvent('processCompleted', {
  25136. result: serverResult,
  25137. options: options
  25138. });
  25139. break;
  25140. case 'FAILED':
  25141. clearInterval(timer);
  25142. me.events.triggerEvent('processFailed', {
  25143. result: serverResult,
  25144. options: options
  25145. });
  25146. break;
  25147. case 'CANCELED':
  25148. clearInterval(timer);
  25149. me.events.triggerEvent('processFailed', {
  25150. result: serverResult,
  25151. options: options
  25152. });
  25153. break;
  25154. }
  25155. };
  25156. me._processAsync({
  25157. url: "".concat(me.url, "/").concat(identifier, "/jobs/").concat(jobId),
  25158. serviceProcessCompleted: serviceProcessCompleted,
  25159. callback: callback
  25160. });
  25161. }, options.interval);
  25162. }
  25163. /**
  25164. * @function GeoprocessingService.prototype.getJobInfo
  25165. * @description 获取处理自动化任务的执行信息。
  25166. * @param {string} identifier - 处理自动化工具ID。
  25167. * @param {string} jobId - 处理自动化任务ID。
  25168. */
  25169. }, {
  25170. key: "getJobInfo",
  25171. value: function getJobInfo(identifier, jobId, callback) {
  25172. this._processAsync({
  25173. url: "".concat(this.url, "/").concat(identifier, "/jobs/").concat(jobId),
  25174. callback: callback
  25175. });
  25176. }
  25177. /**
  25178. * @function GeoprocessingService.prototype.cancelJob
  25179. * @description 取消处理自动化任务的异步执行。
  25180. * @param {string} identifier - 处理自动化工具ID。
  25181. * @param {string} jobId - 处理自动化任务ID。
  25182. */
  25183. }, {
  25184. key: "cancelJob",
  25185. value: function cancelJob(identifier, jobId, callback) {
  25186. this._processAsync({
  25187. url: "".concat(this.url, "/").concat(identifier, "/jobs/").concat(jobId, "/cancel"),
  25188. callback: callback
  25189. });
  25190. }
  25191. /**
  25192. * @function GeoprocessingService.prototype.getJobs
  25193. * @description 获取处理自动化服务任务列表。
  25194. * @param {string} identifier - 处理自动化工具ID。(传参代表identifier算子的任务列表,不传参代表所有任务的列表)
  25195. */
  25196. }, {
  25197. key: "getJobs",
  25198. value: function getJobs(identifier, callback) {
  25199. var url = "".concat(this.url, "/jobs");
  25200. if (identifier) {
  25201. url = "".concat(this.url, "/").concat(identifier, "/jobs");
  25202. }
  25203. this._processAsync({
  25204. url: url,
  25205. callback: callback
  25206. });
  25207. }
  25208. /**
  25209. * @function GeoprocessingService.prototype.getResults
  25210. * @description 处理自动化工具执行的结果等,支持结果过滤。
  25211. * @param {string} identifier - 处理自动化工具ID。
  25212. * @param {string} jobId - 处理自动化任务ID。
  25213. * @param {string} filter - 输出异步结果的ID。(可选,传入filter参数时对该处理自动化工具执行的结果进行过滤获取,不填参时显示所有的执行结果)
  25214. */
  25215. }, {
  25216. key: "getResults",
  25217. value: function getResults(identifier, jobId, filter, callback) {
  25218. var url = "".concat(this.url, "/").concat(identifier, "/jobs/").concat(jobId, "/results");
  25219. if (filter) {
  25220. url = "".concat(url, "/").concat(filter);
  25221. }
  25222. this._processAsync({
  25223. url: url,
  25224. callback: callback
  25225. });
  25226. }
  25227. }, {
  25228. key: "_processAsync",
  25229. value: function _processAsync(_ref) {
  25230. var url = _ref.url,
  25231. method = _ref.method,
  25232. callback = _ref.callback,
  25233. paramter = _ref.paramter,
  25234. serviceProcessCompleted = _ref.serviceProcessCompleted,
  25235. serviceProcessFailed = _ref.serviceProcessFailed;
  25236. var eventId = ++this.eventCount;
  25237. var eventListeners = {
  25238. scope: this,
  25239. processCompleted: function processCompleted(result) {
  25240. if (eventId === result.result.eventId && callback) {
  25241. delete result.result.eventId;
  25242. callback(result);
  25243. this.events && this.events.un(eventListeners);
  25244. return false;
  25245. }
  25246. },
  25247. processFailed: function processFailed(result) {
  25248. if ((eventId === result.error.eventId || eventId === result.eventId) && callback) {
  25249. callback(result);
  25250. this.events && this.events.un(eventListeners);
  25251. return false;
  25252. }
  25253. }
  25254. };
  25255. this.events.on(eventListeners);
  25256. this.request({
  25257. url: url,
  25258. method: method || 'GET',
  25259. params: paramter,
  25260. headers: {
  25261. 'Content-type': 'application/json'
  25262. },
  25263. scope: this,
  25264. success: function success(result, options) {
  25265. result.eventId = eventId;
  25266. var callback = serviceProcessCompleted || this.serviceProcessCompleted.bind(this);
  25267. callback(result, options);
  25268. },
  25269. failure: function failure(result, options) {
  25270. if (result.error) {
  25271. result.error.eventId = eventId;
  25272. }
  25273. result.eventId = eventId;
  25274. var callback = serviceProcessFailed || this.serviceProcessFailed.bind(this);
  25275. callback(result, options);
  25276. }
  25277. });
  25278. }
  25279. }]);
  25280. return GeoprocessingService;
  25281. }(CommonServiceBase);
  25282. ;// CONCATENATED MODULE: ./src/maplibregl/services/GeoprocessingService.js
  25283. function services_GeoprocessingService_typeof(obj) { "@babel/helpers - typeof"; return services_GeoprocessingService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, services_GeoprocessingService_typeof(obj); }
  25284. function services_GeoprocessingService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  25285. function services_GeoprocessingService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  25286. function services_GeoprocessingService_createClass(Constructor, protoProps, staticProps) { if (protoProps) services_GeoprocessingService_defineProperties(Constructor.prototype, protoProps); if (staticProps) services_GeoprocessingService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  25287. function services_GeoprocessingService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) services_GeoprocessingService_setPrototypeOf(subClass, superClass); }
  25288. function services_GeoprocessingService_setPrototypeOf(o, p) { services_GeoprocessingService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return services_GeoprocessingService_setPrototypeOf(o, p); }
  25289. function services_GeoprocessingService_createSuper(Derived) { var hasNativeReflectConstruct = services_GeoprocessingService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = services_GeoprocessingService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = services_GeoprocessingService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return services_GeoprocessingService_possibleConstructorReturn(this, result); }; }
  25290. function services_GeoprocessingService_possibleConstructorReturn(self, call) { if (call && (services_GeoprocessingService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return services_GeoprocessingService_assertThisInitialized(self); }
  25291. function services_GeoprocessingService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  25292. function services_GeoprocessingService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  25293. function services_GeoprocessingService_getPrototypeOf(o) { services_GeoprocessingService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return services_GeoprocessingService_getPrototypeOf(o); }
  25294. /**
  25295. * @class GeoprocessingService
  25296. * @classdesc 处理自动化服务接口类。
  25297. * @version 11.1.0
  25298. * @category iServer ProcessingAutomationService
  25299. * @modulecategory Services
  25300. * @extends {ServiceBase}
  25301. * @example
  25302. * //为了安全访问受保护的处理自动化服务,必须通过传递iserver令牌(token),才能正确访问相关资源。
  25303. * SecurityManager.registerToken(serviceUrl, token);
  25304. * var geoprocessingService = new GeoprocessingService("http://localhost:8090/iserver/services/geoprocessing/restjsr/gp/v2")
  25305. geoprocessingService.submitJob(identifier,params, environments, function(serverResult) {
  25306. console.log(serverResult.result);
  25307. var jobID = serverResult.result.jobID;
  25308. var options = {
  25309. interval: 5000,
  25310. statusCallback: function(state) {
  25311. console.log("Job Status: ", state);
  25312. }
  25313. };
  25314. geoprocessingService.waitForJobCompletion(jobID, identifier, options, function(serverResult) {
  25315. console.log(serverResult);
  25316. })
  25317. })
  25318. * @param {string} url - 服务地址。
  25319. * @param {Object} options - 参数。
  25320. * @usage
  25321. */
  25322. var GeoprocessingService = /*#__PURE__*/function (_ServiceBase) {
  25323. services_GeoprocessingService_inherits(GeoprocessingService, _ServiceBase);
  25324. var _super = services_GeoprocessingService_createSuper(GeoprocessingService);
  25325. function GeoprocessingService(url, options) {
  25326. var _this;
  25327. services_GeoprocessingService_classCallCheck(this, GeoprocessingService);
  25328. _this = _super.call(this, url, options);
  25329. _this.headers = {};
  25330. _this.crossOrigin = true;
  25331. _this.withCredentials = true;
  25332. _this.proxy = true;
  25333. _this._geoprocessingJobsService = new GeoprocessingService_GeoprocessingService(_this.url, {
  25334. proxy: _this.options.proxy,
  25335. withCredentials: _this.options.withCredentials,
  25336. crossOrigin: _this.options.crossOrigin,
  25337. headers: _this.options.headers
  25338. });
  25339. return _this;
  25340. }
  25341. /**
  25342. * @function GeoprocessingService.prototype.getTools
  25343. * @description 获取处理自动化工具列表。
  25344. * @param {RequestCallback} callback 回调函数。
  25345. */
  25346. services_GeoprocessingService_createClass(GeoprocessingService, [{
  25347. key: "getTools",
  25348. value: function getTools(callback) {
  25349. this._geoprocessingJobsService.getTools(callback);
  25350. }
  25351. /**
  25352. * @function GeoprocessingService.prototype.getTool
  25353. * @description 获取处理自动化工具的ID、名称、描述、输入参数、环境参数和输出结果等相关参数。
  25354. * @param {string} identifier - 处理自动化工具ID。
  25355. * @param {RequestCallback} callback 回调函数。
  25356. */
  25357. }, {
  25358. key: "getTool",
  25359. value: function getTool(identifier, callback) {
  25360. this._geoprocessingJobsService.getTool(identifier, callback);
  25361. }
  25362. /**
  25363. * @function GeoprocessingService.prototype.execute
  25364. * @description 同步执行处理自动化工具。
  25365. * @param {string} identifier - 处理自动化工具ID。
  25366. * @param {Object} parameter - 处理自动化工具的输入参数。
  25367. * @param {Object} environment - 处理自动化工具的环境参数。
  25368. * @param {RequestCallback} callback 回调函数。
  25369. */
  25370. }, {
  25371. key: "execute",
  25372. value: function execute(identifier, parameter, environment, callback) {
  25373. this._geoprocessingJobsService.execute(identifier, parameter, environment, callback);
  25374. }
  25375. /**
  25376. * @function GeoprocessingService.prototype.submitJob
  25377. * @description 异步执行处理自动化工具。
  25378. * @param {string} identifier - 处理自动化工具ID。
  25379. * @param {Object} parameter - 处理自动化工具的输入参数。
  25380. * @param {Object} environment - 处理自动化工具的环境参数。
  25381. * @param {RequestCallback} callback 回调函数。
  25382. */
  25383. }, {
  25384. key: "submitJob",
  25385. value: function submitJob(identifier, parameter, environment, callback) {
  25386. this._geoprocessingJobsService.submitJob(identifier, parameter, environment, callback);
  25387. }
  25388. /**
  25389. * @function GeoprocessingService.prototype.waitForJobCompletion
  25390. * @description 获取处理自动化异步执行状态信息。
  25391. * @param {string} jobId - 处理自动化任务ID。
  25392. * @param {string} identifier - 处理自动化工具ID。
  25393. * @param {Object} options - 状态信息参数。
  25394. * @param {number} options.interval - 定时器时间间隔。
  25395. * @param {function} options.statusCallback - 任务状态的回调函数。
  25396. * @param {RequestCallback} callback 回调函数。
  25397. */
  25398. }, {
  25399. key: "waitForJobCompletion",
  25400. value: function waitForJobCompletion(jobId, identifier, options, callback) {
  25401. this._geoprocessingJobsService.waitForJobCompletion(jobId, identifier, options, callback);
  25402. }
  25403. /**
  25404. * @function GeoprocessingService.prototype.getJobInfo
  25405. * @description 获取处理自动化任务的执行信息。
  25406. * @param {string} identifier - 处理自动化工具ID。
  25407. * @param {string} jobId - 处理自动化任务ID。
  25408. * @param {RequestCallback} callback 回调函数。
  25409. */
  25410. }, {
  25411. key: "getJobInfo",
  25412. value: function getJobInfo(identifier, jobId, callback) {
  25413. this._geoprocessingJobsService.getJobInfo(identifier, jobId, callback);
  25414. }
  25415. /**
  25416. * @function GeoprocessingService.prototype.cancelJob
  25417. * @description 取消处理自动化任务的异步执行。
  25418. * @param {string} identifier - 处理自动化工具ID。
  25419. * @param {string} jobId - 处理自动化任务ID。
  25420. * @param {RequestCallback} callback 回调函数。
  25421. */
  25422. }, {
  25423. key: "cancelJob",
  25424. value: function cancelJob(identifier, jobId, callback) {
  25425. this._geoprocessingJobsService.cancelJob(identifier, jobId, callback);
  25426. }
  25427. /**
  25428. * @function GeoprocessingService.prototype.getJobs
  25429. * @description 获取处理自动化服务任务列表。
  25430. * @param {string} identifier - 处理自动化工具ID。(可选,传参代表identifier算子的任务列表,不传参代表所有任务的列表)
  25431. * @param {RequestCallback} callback 回调函数。
  25432. */
  25433. }, {
  25434. key: "getJobs",
  25435. value: function getJobs(identifier, callback) {
  25436. this._geoprocessingJobsService.getJobs(identifier, callback);
  25437. }
  25438. /**
  25439. * @function GeoprocessingService.prototype.getResults
  25440. * @description 处理自动化工具异步执行的结果,支持结果过滤。
  25441. * @param {string} identifier - 处理自动化工具ID。
  25442. * @param {string} jobId - 处理自动化任务ID。
  25443. * @param {string} filter - 输出异步结果的ID。(可选,传入filter参数时对该处理自动化工具执行的结果进行过滤获取,不填参时显示所有的执行结果)
  25444. * @param {RequestCallback} callback 回调函数。
  25445. */
  25446. }, {
  25447. key: "getResults",
  25448. value: function getResults(identifier, jobId, filter, callback) {
  25449. this._geoprocessingJobsService.getResults(identifier, jobId, filter, callback);
  25450. }
  25451. }]);
  25452. return GeoprocessingService;
  25453. }(ServiceBase);
  25454. ;// CONCATENATED MODULE: ./src/common/iServer/Theme.js
  25455. function Theme_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  25456. function Theme_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  25457. function Theme_createClass(Constructor, protoProps, staticProps) { if (protoProps) Theme_defineProperties(Constructor.prototype, protoProps); if (staticProps) Theme_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  25458. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  25459. * This program are made available under the terms of the Apache License, Version 2.0
  25460. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  25461. /**
  25462. * @class CommonTheme
  25463. * @aliasclass Theme
  25464. * @deprecatedclass SuperMap.Theme
  25465. * @category iServer Map Theme
  25466. * @classdesc 专题图基类。
  25467. * @param {string} type - 专题图类型。
  25468. * @param {Object} options - 可选参数。
  25469. * @param {ThemeMemoryData} [options.memoryData] - 专题图内存数据。
  25470. * @usage
  25471. */
  25472. var Theme = /*#__PURE__*/function () {
  25473. function Theme(type, options) {
  25474. Theme_classCallCheck(this, Theme);
  25475. if (!type) {
  25476. return this;
  25477. }
  25478. /**
  25479. * @member {ThemeMemoryData} CommonTheme.prototype.memoryData
  25480. * @description 专题图内存数据。<br>
  25481. * 用内存数据制作专题图的方式与表达式制作专题图的方式互斥,前者优先级较高。
  25482. * 第一个参数代表专题值,即数据集中用来做专题图的字段或表达式的值;第二个参数代表外部值。在制作专题图时,会用外部值代替专题值来制作相应的专题图。
  25483. */
  25484. this.memoryData = null;
  25485. /**
  25486. * @member {string} CommonTheme.prototype.type
  25487. * @description 专题图类型。
  25488. */
  25489. this.type = type;
  25490. if (options) {
  25491. Util_Util.extend(this, options);
  25492. }
  25493. this.CLASS_NAME = "SuperMap.Theme";
  25494. }
  25495. /**
  25496. * @function CommonTheme.prototype.destroy
  25497. * @description 释放资源,将引用资源的属性置空。
  25498. */
  25499. Theme_createClass(Theme, [{
  25500. key: "destroy",
  25501. value: function destroy() {
  25502. var me = this;
  25503. if (me.memoryData) {
  25504. me.memoryData.destroy();
  25505. me.memoryData = null;
  25506. }
  25507. me.type = null;
  25508. }
  25509. /**
  25510. * @function CommonTheme.prototype.toServerJSONObject
  25511. * @description 转换成对应的 JSON 格式对象。
  25512. * @returns {Object} 对应的 JSON 格式对象。
  25513. */
  25514. }, {
  25515. key: "toServerJSONObject",
  25516. value: function toServerJSONObject() {
  25517. //return 子类实现
  25518. return;
  25519. }
  25520. }]);
  25521. return Theme;
  25522. }();
  25523. ;// CONCATENATED MODULE: ./src/common/iServer/ServerTextStyle.js
  25524. function ServerTextStyle_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  25525. function ServerTextStyle_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  25526. function ServerTextStyle_createClass(Constructor, protoProps, staticProps) { if (protoProps) ServerTextStyle_defineProperties(Constructor.prototype, protoProps); if (staticProps) ServerTextStyle_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  25527. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  25528. * This program are made available under the terms of the Apache License, Version 2.0
  25529. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  25530. /**
  25531. * @class ServerTextStyle
  25532. * @deprecatedclass SuperMap.ServerTextStyle
  25533. * @category iServer Map Theme
  25534. * @classdesc 服务端文本风格类。该类用于定义文本风格的相关属性。
  25535. * @param {Object} options - 可选参数。
  25536. * @param {TextAlignment} [options.align=TextAlignment.BASELINECENTER] - 文本的对齐方式。
  25537. * @param {ServerColor} [options.backColor] - 文本的背景色。默认 backColor = new ServerColor(255, 255, 255)。
  25538. * @param {ServerColor} [options.foreColor] - 文本的前景色。默认 foreColor = new ServerColor(0, 0, 0)。
  25539. * @param {boolean} [options.backOpaque=false] - 文本背景是否不透明。
  25540. * @param {boolean} [options.sizeFixed=true] - 文本大小是否固定。
  25541. * @param {number} [options.fontHeight=6] - 文本字体的高度。
  25542. * @param {number} [options.fontWidth=0] - 文本字体的宽度。
  25543. * @param {number} [options.fontWeight=400] - 文本字体的磅数。
  25544. * @param {string} [options.fontName='Times New Roman'] - 文本字体的名称。
  25545. * @param {boolean} [options.bold=false] - 文本是否为粗体字。
  25546. * @param {boolean} [options.italic=false] - 文本是否采用斜体。
  25547. * @param {number} [options.italicAngle=0] - 字体倾斜角度。
  25548. * @param {boolean} [options.shadow=false] - 文本是否有阴影。
  25549. * @param {boolean} [options.strikeout=false] - 文本字体是否加删除线。
  25550. * @param {boolean} [options.outline=false] - 是否以轮廓的方式来显示文本的背景。
  25551. * @param {number} [options.opaqueRate=0] - 注记文字的不透明度。
  25552. * @param {boolean} [options.underline=false] - 文本字体是否加下划线。
  25553. * @param {number} [options.rotation=0.0] - 文本旋转的角度。
  25554. * @usage
  25555. */
  25556. var ServerTextStyle = /*#__PURE__*/function () {
  25557. function ServerTextStyle(options) {
  25558. ServerTextStyle_classCallCheck(this, ServerTextStyle);
  25559. /**
  25560. * @member {TextAlignment} [ServerTextStyle.prototype.align= TextAlignment.BASELINECENTER]
  25561. * @description 文本的对齐方式。
  25562. */
  25563. this.align = TextAlignment.BASELINECENTER;
  25564. /**
  25565. * @member {ServerColor} [ServerTextStyle.prototype.backColor=(255, 255, 255)]
  25566. * @description 文本的背景色。
  25567. */
  25568. this.backColor = new ServerColor(255, 255, 255);
  25569. /**
  25570. * @member {ServerColor} [ServerTextStyle.prototype.foreColor=(0, 0, 0)]
  25571. * @description 文本的前景色。
  25572. */
  25573. this.foreColor = new ServerColor(0, 0, 0);
  25574. /**
  25575. * @member {boolean} [ServerTextStyle.prototype.backOpaque=false]
  25576. * @description 文本背景是否不透明。true 表示文本背景不透明。
  25577. */
  25578. this.backOpaque = false;
  25579. /**
  25580. * @member {boolean} [ServerTextStyle.prototype.sizeFixed=true]
  25581. * @description 文本大小是否固定。设置为 true,表示图片为固定像素大小,具体大小请参考 fontHeight。当设为 false 时,图片会随着地图缩放而缩放。
  25582. */
  25583. this.sizeFixed = true;
  25584. /**
  25585. * @member {number} [ServerTextStyle.prototype.fontHeight=6]
  25586. * @description 文本字体的高度,单位与 sizeFixed 有关,当 sizeFixed 为 False 时,即非固定文本大小时使用地图坐标单位,
  25587. * 如地理坐标系下的地图中单位为度;当 sizeFixed 为 True 时,单位为毫米(mm)。
  25588. */
  25589. this.fontHeight = 6;
  25590. /**
  25591. * @member {number} [ServerTextStyle.prototype.fontWidth=0]
  25592. * @description 文本字体的宽度。字体的宽度以英文字符为标准,由于一个中文字符相当于两个英文字符。
  25593. */
  25594. this.fontWidth = 0;
  25595. /**
  25596. * @member {number} [ServerTextStyle.prototype.fontWeight=400]
  25597. * @description 文本字体的磅数。表示粗体的具体数值。取值范围为从0-900之间的整百数。
  25598. */
  25599. this.fontWeight = 400;
  25600. /**
  25601. * @member {string} [ServerTextStyle.prototype.fontName="Times New Roman"]
  25602. * @description 文本字体的名称。
  25603. */
  25604. this.fontName = "Times New Roman";
  25605. /**
  25606. * @member {boolean} [ServerTextStyle.prototype.bold=false]
  25607. * @description 文本是否为粗体字。true 表示为粗体。false 表示文本不是粗体字。
  25608. */
  25609. this.bold = false;
  25610. /**
  25611. * @member {boolean} [ServerTextStyle.prototype.italic=false]
  25612. * @description 文本是否采用斜体。true 表示采用斜体。
  25613. */
  25614. this.italic = false;
  25615. /**
  25616. * @member {number} [ServerTextStyle.prototype.italicAngle=0]
  25617. * @description 字体倾斜角度。正负度之间,以度为单位,精确到0.1度。当倾斜角度为0度,为系统默认的字体倾斜样式。
  25618. * 正负度是指以纵轴为起始零度线,其纵轴左侧为正,右侧为负。允许的最大角度为60,最小-60。大于60按照60处理,小于-60按照-60处理。目前只对标签专题图有效。
  25619. */
  25620. this.italicAngle = 0;
  25621. /**
  25622. * @member {boolean} [ServerTextStyle.prototype.shadow=false]
  25623. * @description 文本是否有阴影。true 表示给文本增加阴影。false 表示文本没有阴影。
  25624. */
  25625. this.shadow = false;
  25626. /**
  25627. * @member {boolean} [ServerTextStyle.prototype.strikeout=false]
  25628. * @description 文本字体是否加删除线。true 表示加删除线。false 表示文本字体不加删除线。
  25629. */
  25630. this.strikeout = false;
  25631. /**
  25632. * @member {boolean} [ServerTextStyle.prototype.outline=false]
  25633. * @description 是否以轮廓的方式来显示文本的背景。true 表示以轮廓的方式来显示文本的背景。false 表示不以轮廓的方式来显示文本的背景。
  25634. */
  25635. this.outline = false;
  25636. /**
  25637. * @member {number} [ServerTextStyle.prototype.opaqueRate=0]
  25638. * @description 注记文字的不透明度。不透明度的范围为0-100。0表示透明。
  25639. */
  25640. this.opaqueRate = 0;
  25641. /**
  25642. * @member {boolean} [ServerTextStyle.prototype.underline=false]
  25643. * @description 文本字体是否加下划线。true 表示加下划线。
  25644. */
  25645. this.underline = false;
  25646. /**
  25647. * @member {number} [ServerTextStyle.prototype.rotation=0.0]
  25648. * @description 文本旋转的角度。逆时针方向为正方向,单位为度,精确到0.1度。
  25649. */
  25650. this.rotation = 0.0;
  25651. if (options) {
  25652. Util_Util.extend(this, options);
  25653. }
  25654. this.CLASS_NAME = "SuperMap.ServerTextStyle";
  25655. }
  25656. /**
  25657. * @function ServerTextStyle.prototype.destroy
  25658. * @description 释放资源,将引用资源的属性置空。
  25659. */
  25660. ServerTextStyle_createClass(ServerTextStyle, [{
  25661. key: "destroy",
  25662. value: function destroy() {
  25663. var me = this;
  25664. me.align = null;
  25665. if (me.backColor) {
  25666. me.backColor.destroy();
  25667. me.backColor = null;
  25668. }
  25669. if (me.foreColor) {
  25670. me.foreColor.destroy();
  25671. me.foreColor = null;
  25672. }
  25673. me.backOpaque = null;
  25674. me.sizeFixed = null;
  25675. me.fontHeight = null;
  25676. me.fontWidth = null;
  25677. me.fontWeight = null;
  25678. me.fontName = null;
  25679. me.bold = null;
  25680. me.italic = null;
  25681. me.italicAngle = null;
  25682. me.shadow = null;
  25683. me.strikeout = null;
  25684. me.outline = null;
  25685. me.opaqueRate = null;
  25686. me.underline = null;
  25687. me.rotation = null;
  25688. }
  25689. /**
  25690. * @function ServerTextStyle.fromObj
  25691. * @description 从传入对象获服务端文本风格类。
  25692. * @param {Object} obj - 传入对象
  25693. * @returns {ServerTextStyle} 返回服务端文本风格对象
  25694. */
  25695. }], [{
  25696. key: "fromObj",
  25697. value: function fromObj(obj) {
  25698. var res = new ServerTextStyle(obj);
  25699. Util_Util.copy(res, obj);
  25700. res.backColor = ServerColor.fromJson(obj.backColor);
  25701. res.foreColor = ServerColor.fromJson(obj.foreColor);
  25702. return res;
  25703. }
  25704. }]);
  25705. return ServerTextStyle;
  25706. }();
  25707. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeLabelItem.js
  25708. function ThemeLabelItem_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  25709. function ThemeLabelItem_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  25710. function ThemeLabelItem_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeLabelItem_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeLabelItem_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  25711. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  25712. * This program are made available under the terms of the Apache License, Version 2.0
  25713. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  25714. /**
  25715. * @class ThemeLabelItem
  25716. * @deprecatedclass SuperMap.ThemeLabelItem
  25717. * @category iServer Map Theme
  25718. * @classdesc 分段标签专题图的子项。标签专题图用专题值对点、线、面等对象做标注。
  25719. * 值得注意的是,分段标签专题图允许用户通过 rangeExpression 字段指定用于分段的数值型字段,
  25720. * 同一范围段内的标签具有相同的显示风格,其中每一个范围段就是一个专题图子项,
  25721. * 每一个子项都具有其名称、风格、起始值和终止值。注意:每个分段所表示的范围为 [Start, End)。例如:标签专题图的分段点有两个子项,
  25722. * 他们所代表的分段区间分别为[0,5),[5,10)。那么需要分别设置 ThemeLabelItem[0].start=0,
  25723. * ThemeLabelItem[0].end=5,SuperMap.ThemeLabelItem[1].start=5,SuperMap.ThemeLabelItem[1].end=10。
  25724. * @param {Object} options - 可选参数。
  25725. * @param {string} [options.caption] - 子项的名称。
  25726. * @param {number} [options.end=0] - 子项的终止值。
  25727. * @param {number} [options.start=0] - 子项的分段起始值。
  25728. * @param {boolean} [options.visible=true] - 子项是否可见。
  25729. * @param {ServerTextStyle} [options.style] - 子项文本的显示风格。
  25730. * @usage
  25731. */
  25732. var ThemeLabelItem = /*#__PURE__*/function () {
  25733. function ThemeLabelItem(options) {
  25734. ThemeLabelItem_classCallCheck(this, ThemeLabelItem);
  25735. /**
  25736. * @member {string} [ThemeLabelItem.prototype.caption]
  25737. * @description 标签专题子项的标题。
  25738. */
  25739. this.caption = null;
  25740. /**
  25741. * @member {number} [ThemeLabelItem.prototype.end=0]
  25742. * @description 标签专题图子项的终止值。如果该子项是分段中最后一个子项,那么该终止值就是分段的最大值;
  25743. * 如果不是最后一项,该终止值必须与其下一子项的起始值相同,否则系统抛出异常。
  25744. */
  25745. this.end = 0;
  25746. /**
  25747. * @member {number} [ThemeLabelItem.prototype.start=0]
  25748. * @description 标签专题图子项的分段起始值。如果该子项是分段中第一项,那么该起始值就是分段的最小值;
  25749. * 如果该子项的序号大于等于 1 的时候,该起始值必须与前一子项的终止值相同,否则系统会抛出异常。
  25750. */
  25751. this.start = 0;
  25752. /**
  25753. * @member {boolean} [ThemeLabelItem.prototype.visible=true]
  25754. * @description 标签专题图子项是否可见。如果标签专题图子项可见,则为 true,否则为 false。
  25755. */
  25756. this.visible = true;
  25757. /**
  25758. * @member {ServerTextStyle} ThemeLabelItem.prototype.style
  25759. * @description 标签专题图子项文本的显示风格。各种风格的优先级从高到低为:<br>
  25760. * uniformMixedStyle(标签文本的复合风格),ThemeLabelItem.style(分段子项的文本风格),uniformStyle(统一文本风格)。
  25761. */
  25762. this.style = new ServerTextStyle();
  25763. if (options) {
  25764. Util_Util.extend(this, options);
  25765. }
  25766. this.CLASS_NAME = "SuperMap.ThemeLabelItem";
  25767. }
  25768. /**
  25769. * @function ThemeLabelItem.prototype.destroy
  25770. * @description 释放资源,将引用资源的属性置空。
  25771. */
  25772. ThemeLabelItem_createClass(ThemeLabelItem, [{
  25773. key: "destroy",
  25774. value: function destroy() {
  25775. var me = this;
  25776. me.caption = null;
  25777. me.end = null;
  25778. me.start = null;
  25779. if (me.style) {
  25780. me.style.destroy();
  25781. me.style = null;
  25782. }
  25783. me.visible = null;
  25784. }
  25785. /**
  25786. * @function ThemeLabelItem.fromObj
  25787. * @description 从传入对象获取分段标签专题图的子项类。
  25788. * @param {Object} obj - 传入对象。
  25789. * @returns {ThemeLabelItem} ThemeLabelItem 对象。
  25790. */
  25791. }], [{
  25792. key: "fromObj",
  25793. value: function fromObj(obj) {
  25794. if (!obj) {
  25795. return;
  25796. }
  25797. var t = new ThemeLabelItem();
  25798. Util_Util.copy(t, obj);
  25799. return t;
  25800. }
  25801. }]);
  25802. return ThemeLabelItem;
  25803. }();
  25804. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeUniqueItem.js
  25805. function ThemeUniqueItem_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  25806. function ThemeUniqueItem_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  25807. function ThemeUniqueItem_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeUniqueItem_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeUniqueItem_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  25808. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  25809. * This program are made available under the terms of the Apache License, Version 2.0
  25810. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  25811. /**
  25812. * @class ThemeUniqueItem
  25813. * @deprecatedclass SuperMap.ThemeUniqueItem
  25814. * @category iServer Map Theme
  25815. * @classdesc 单值专题图子项类。单值专题图是将专题值相同的要素归为一类,为每一类设定一种渲染风格,其中每一类就是一个专题图子项。比如,利用单值专题图制作行政区划图,Name 字段代表省/直辖市名,该字段用来做专题变量,如果该字段的字段值总共有 5 种不同值,则该行政区划图有 5 个专题图子项。
  25816. * @param {Object} options - 参数。
  25817. * @param {string} options.unique - 子项的单值字段。
  25818. * @param {string} [options.caption] - 子项的标题。
  25819. * @param {ServerStyle} [options.style] - 子项的风格。
  25820. * @param {boolean} [options.visible=true] - 子项是否可见。
  25821. * @usage
  25822. */
  25823. var ThemeUniqueItem = /*#__PURE__*/function () {
  25824. function ThemeUniqueItem(options) {
  25825. ThemeUniqueItem_classCallCheck(this, ThemeUniqueItem);
  25826. /**
  25827. * @member {string} [ThemeUniqueItem.prototype.caption]
  25828. * @description 单值专题图子项的标题。
  25829. */
  25830. this.caption = null;
  25831. /**
  25832. * @member {ServerStyle} [ThemeUniqueItem.prototype.style]
  25833. * @description 单值专题图子项的显示风格。
  25834. */
  25835. this.style = new ServerStyle();
  25836. /**
  25837. * @member {string} ThemeUniqueItem.prototype.unique
  25838. * @description 单值专题图子项的值,可以为数字、字符串等。
  25839. */
  25840. this.unique = null;
  25841. /**
  25842. * @member {boolean} [ThemeUniqueItem.prototype.visible=true]
  25843. * @description 单值专题图子项的可见性。
  25844. */
  25845. this.visible = true;
  25846. if (options) {
  25847. Util_Util.extend(this, options);
  25848. }
  25849. this.CLASS_NAME = "SuperMap.ThemeUniqueItem";
  25850. }
  25851. /**
  25852. * @function ThemeUniqueItem.prototype.destroy
  25853. * @description 释放资源,将引用资源的属性置空。
  25854. */
  25855. ThemeUniqueItem_createClass(ThemeUniqueItem, [{
  25856. key: "destroy",
  25857. value: function destroy() {
  25858. var me = this;
  25859. me.caption = null;
  25860. me.unique = null;
  25861. if (me.style) {
  25862. me.style.destroy();
  25863. me.style = null;
  25864. }
  25865. me.visible = null;
  25866. }
  25867. /**
  25868. * @function ThemeUniqueItem.prototype.toServerJSONObject
  25869. * @description 转换成对应的 JSON 格式对象。
  25870. * @returns {Object} 对应的 JSON 格式对象。
  25871. */
  25872. }, {
  25873. key: "toServerJSONObject",
  25874. value: function toServerJSONObject() {
  25875. var obj = {};
  25876. obj = Util_Util.copyAttributes(obj, this);
  25877. if (obj.style) {
  25878. if (obj.style.toServerJSONObject) {
  25879. obj.style = obj.style.toServerJSONObject();
  25880. }
  25881. }
  25882. return obj;
  25883. }
  25884. /**
  25885. * @function ThemeUniqueItem.fromObj
  25886. * @description 从传入对象获取单值专题图子项类。
  25887. * @param {Object} obj - 传入对象。
  25888. * @returns {ThemeUniqueItem} ThemeUniqueItem 对象。
  25889. */
  25890. }], [{
  25891. key: "fromObj",
  25892. value: function fromObj(obj) {
  25893. var res = new ThemeUniqueItem();
  25894. Util_Util.copy(res, obj);
  25895. res.style = ServerStyle.fromJson(obj.style);
  25896. return res;
  25897. }
  25898. }]);
  25899. return ThemeUniqueItem;
  25900. }();
  25901. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeOffset.js
  25902. function ThemeOffset_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  25903. function ThemeOffset_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  25904. function ThemeOffset_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeOffset_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeOffset_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  25905. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  25906. * This program are made available under the terms of the Apache License, Version 2.0
  25907. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  25908. /**
  25909. * @class ThemeOffset
  25910. * @deprecatedclass SuperMap.ThemeOffset
  25911. * @category iServer Map Theme
  25912. * @classdesc 专题图中文本或符号相对于要素内点的偏移量设置类。
  25913. * 通过该类可以设置专题图中标记文本或符号的偏移量以及偏移量是否随地图缩放而改变。
  25914. * @param {Object} options - 可选参数。
  25915. * @param {boolean} [options.offsetFixed=false] - 当前专题图是否固定标记文本或符号的偏移量。
  25916. * @param {string} [options.offsetX='0.0'] - 专题图中文本或符号相对于要素内点的水平偏移量。
  25917. * @param {string} [options.offsetY='0.0'] - 专题图中文本或符号相对于要素内点的垂直偏移量。
  25918. * @usage
  25919. */
  25920. var ThemeOffset = /*#__PURE__*/function () {
  25921. function ThemeOffset(options) {
  25922. ThemeOffset_classCallCheck(this, ThemeOffset);
  25923. /**
  25924. * @member {boolean} [ThemeOffset.prototype.offsetFixed=false]
  25925. * @description 当前专题图是否固定标记文本或符号的偏移量。所谓固定偏移量,指文本或符号的偏移量不随地图的缩放而变化。
  25926. */
  25927. this.offsetFixed = false;
  25928. /**
  25929. * @member {string} [ThemeOffset.prototype.offsetX=0.0]
  25930. * @description 专题图中文本或符号相对于要素内点的水平偏移量。偏移量的单位为地图单位。
  25931. * 该偏移量的值为一个常量值或者字段表达式所表示的值,即如果字段表达式为 SmID,其中 SmID = 2,那么水平偏移量为2。
  25932. */
  25933. this.offsetX = "0.0";
  25934. /**
  25935. * @member {string} [ThemeOffset.prototype.offsetY=0.0]
  25936. * @description 专题图中文本或符号相对于要素内点的垂直偏移量。偏移量的单位为地图单位。
  25937. * 该偏移量的值为一个常量值或者字段表达式所表示的值,即如果字段表达式为 SmID,其中 SmID = 2,那么垂直偏移量为2。
  25938. */
  25939. this.offsetY = "0.0";
  25940. if (options) {
  25941. Util_Util.extend(this, options);
  25942. }
  25943. this.CLASS_NAME = "SuperMap.ThemeOffset";
  25944. }
  25945. /**
  25946. * @function ThemeOffset.prototype.destroy
  25947. * @description 释放资源,将引用资源的属性置空。
  25948. */
  25949. ThemeOffset_createClass(ThemeOffset, [{
  25950. key: "destroy",
  25951. value: function destroy() {
  25952. var me = this;
  25953. me.offsetFixed = null;
  25954. me.offsetX = null;
  25955. me.offsetY = null;
  25956. }
  25957. /**
  25958. * @function ThemeOffset.fromObj
  25959. * @description 从传入对象获取专题图中文本或符号相对于要素内点的偏移量设置类。
  25960. * @param {Object} obj - 传入对象。
  25961. * @returns {ThemeOffset} ThemeOffset 对象。
  25962. */
  25963. }], [{
  25964. key: "fromObj",
  25965. value: function fromObj(obj) {
  25966. if (!obj) {
  25967. return;
  25968. }
  25969. var res = new ThemeOffset();
  25970. Util_Util.copy(res, obj);
  25971. return res;
  25972. }
  25973. }]);
  25974. return ThemeOffset;
  25975. }();
  25976. ;// CONCATENATED MODULE: ./src/common/iServer/LabelMixedTextStyle.js
  25977. function LabelMixedTextStyle_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  25978. function LabelMixedTextStyle_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  25979. function LabelMixedTextStyle_createClass(Constructor, protoProps, staticProps) { if (protoProps) LabelMixedTextStyle_defineProperties(Constructor.prototype, protoProps); if (staticProps) LabelMixedTextStyle_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  25980. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  25981. * This program are made available under the terms of the Apache License, Version 2.0
  25982. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  25983. /**
  25984. * @class LabelMixedTextStyle
  25985. * @deprecatedclass SuperMap.LabelMixedTextStyle
  25986. * @category iServer Map Theme
  25987. * @classdesc 标签文本复合风格类。
  25988. * 该类主要用于对标签专题图中标签的文本内容进行风格设置。通过该类用户可以使标签的文字显示不同的风格,比如文本 “喜马拉雅山”,通过本类可以将前三个字用红色显示,后两个字用蓝色显示。对同一文本设置不同的风格实质上是对文本的字符进行分段,同一分段内的字符具有相同的显示风格。对字符分段有两种方式,一种是利用分隔符对文本进行分段;另一种是根据分段索引值进行分段:</br>
  25989. * 1.利用分隔符对文本进行分段: 比如文本 “5&109” 被分隔符 “&” 分为 “5” 和 “109” 两部分,
  25990. * 在显示时,“5” 和分隔符 “&” 使用同一个风格,字符串 “109” 使用相同的风格。<br>
  25991. * 2.利用分段索引值进行分段: 文本中字符的索引值是以0开始的整数,比如文本 “珠穆朗玛峰”,
  25992. * 第一个字符(“珠”)的索引值为 0,第二个字符(“穆”)的索引值为 1,以此类推;当设置分段索引值为 1,3,4,9 时,
  25993. * 字符分段范围相应的就是 (-∞,1),[1,3),[3,4),[4,9),[9,+∞),可以看出索引号为 0 的字符(即“珠” )在第一个分段内,
  25994. * 索引号为 1,2 的字符(即“穆”、“朗”)位于第二个分段内,索引号为 3 的字符(“玛”)在第三个分段内,索引号为 4 的字符(“峰”)在第四个分段内,其余分段中没有字符。
  25995. * @param {Object} options - 可选参数。
  25996. * @param {ServerTextStyle} [options.defaultStyle] - 默认的文本复合风格。
  25997. * @param {string} [options.separator] - 文本的分隔符。
  25998. * @param {boolean} [options.separatorEnabled=false] - 文本的分隔符是否有效。
  25999. * @param {Array.<number>} [options.splitIndexes] - 分段索引值,分段索引值用来对文本中的字符进行分段。
  26000. * @param {Array.<ServerTextStyle>} [options.styles] - 文本样式集合。
  26001. * @usage
  26002. */
  26003. var LabelMixedTextStyle = /*#__PURE__*/function () {
  26004. function LabelMixedTextStyle(options) {
  26005. LabelMixedTextStyle_classCallCheck(this, LabelMixedTextStyle);
  26006. /**
  26007. * @member {ServerTextStyle} LabelMixedTextStyle.prototype.defaultStyle
  26008. * @description 默认的文本复合风格,即 ServerTextStyle 各字段的默认值。
  26009. */
  26010. this.defaultStyle = null;
  26011. /**
  26012. * @member {string} LabelMixedTextStyle.prototype.separator
  26013. * @description 文本的分隔符,分隔符的风格与前一个字符的风格一样。文本的分隔符是一个将文本分割开的符号,
  26014. * 比如文本 “5_109” 被 “ _ ” 分隔为 “5” 和 “109” 两部分,假设有风格数组:style1、style2。
  26015. * 在显示时,“5” 和分隔符 “ _ ” 使用 Style1 风格渲染,字符串 “109” 使用 Style2 的风格。
  26016. */
  26017. this.separator = null;
  26018. /**
  26019. * @member {boolean} [LabelMixedTextStyle.prototype.separatorEnabled=false]
  26020. * @description 文本的分隔符是否有效。分隔符有效时利用分隔符对文本进行分段;无效时根据文本中字符的位置进行分段。
  26021. * 分段后,同一分段内的字符具有相同的显示风格。
  26022. */
  26023. this.separatorEnabled = false;
  26024. /**
  26025. * @member {Array.<number>} LabelMixedTextStyle.prototype.splitIndexes
  26026. * @description 分段索引值,分段索引值用来对文本中的字符进行分段。
  26027. * 文本中字符的索引值是以 0 开始的整数,比如文本“珠穆朗玛峰”,第一个字符(“珠”)的索引值为0,第二个字符(“穆”)的索引值为 1,
  26028. * 以此类推;当设置分段索引值数组为 [1,3,4,9] 时,字符分段范围相应的就是 (-∞,1),[1,3),[3,4),[4,9),[9,+∞),
  26029. * 可以看出索引号为 0 的字符(即 “珠”)在第一个分段内,索引号为 1,2 的字符(即 “穆”、“朗”)位于第二个分段内,
  26030. * 索引号为 3 的字符(“玛”)在第三个分段内,索引号为 4 的字符(“峰”)在第四个分段内,其余分段中没有字符。
  26031. */
  26032. this.splitIndexes = null;
  26033. /**
  26034. * @member {Array.<ServerTextStyle>} LabelMixedTextStyle.prototype.styles
  26035. * @description 文本样式集合。文本样式集合中的样式根据索引与不同分段一一对应,
  26036. * 如果有分段没有风格对应则使用 defaultStyle。
  26037. */
  26038. this.styles = new ServerTextStyle();
  26039. if (options) {
  26040. Util_Util.extend(this, options);
  26041. }
  26042. this.CLASS_NAME = "SuperMap.LabelMixedTextStyle";
  26043. }
  26044. /**
  26045. * @function LabelMixedTextStyle.prototype.destroy
  26046. * @description 释放资源,将引用资源的属性置空。
  26047. */
  26048. LabelMixedTextStyle_createClass(LabelMixedTextStyle, [{
  26049. key: "destroy",
  26050. value: function destroy() {
  26051. var me = this;
  26052. if (me.defaultStyle) {
  26053. me.defaultStyle.destroy();
  26054. me.defaultStyle = null;
  26055. }
  26056. me.separator = null;
  26057. me.separatorEnabled = null;
  26058. if (me.splitIndexes) {
  26059. me.splitIndexes = null;
  26060. }
  26061. if (me.styles) {
  26062. for (var i = 0, styles = me.styles, len = styles.length; i < len; i++) {
  26063. styles[i].destroy();
  26064. }
  26065. me.styles = null;
  26066. }
  26067. }
  26068. /**
  26069. * @function LabelMixedTextStyle.fromObj
  26070. * @description 从传入对象获取标签文本复合风格类。
  26071. * @param {Object} obj - 传入对象。
  26072. * @returns {LabelMixedTextStyle} 返回新的 LabelMixedTextStyle 对象。
  26073. */
  26074. }], [{
  26075. key: "fromObj",
  26076. value: function fromObj(obj) {
  26077. if (!obj) {
  26078. return;
  26079. }
  26080. var res = new LabelMixedTextStyle();
  26081. var stys = obj.styles;
  26082. Util_Util.copy(res, obj);
  26083. res.defaultStyle = new ServerTextStyle(obj.defaultStyle);
  26084. if (stys) {
  26085. res.styles = [];
  26086. for (var i = 0, len = stys.length; i < len; i++) {
  26087. res.styles.push(new ServerTextStyle(stys[i]));
  26088. }
  26089. }
  26090. return res;
  26091. }
  26092. }]);
  26093. return LabelMixedTextStyle;
  26094. }();
  26095. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeLabelText.js
  26096. function ThemeLabelText_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  26097. function ThemeLabelText_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  26098. function ThemeLabelText_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeLabelText_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeLabelText_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  26099. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  26100. * This program are made available under the terms of the Apache License, Version 2.0
  26101. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  26102. /**
  26103. * @class ThemeLabelText
  26104. * @deprecatedclass SuperMap.ThemeLabelText
  26105. * @category iServer Map Theme
  26106. * @classdesc 标签中文本风格类。
  26107. * 通过该类可以设置标签中的文本字体大小和显示风格。
  26108. * @param {Object} options - 参数。
  26109. * @param {number} [options.maxTextHeight=0] - 标签中文本的最大高度。
  26110. * @param {number} [options.maxTextWidth=0] - 标签中文本的最大宽度。
  26111. * @param {number} [options.minTextHeight=0] - 标签中文本的最小高度。
  26112. * @param {number} [options.minTextWidth=0] - 标签中文本的最小宽度。
  26113. * @param {ServerTextStyle} [options.uniformStyle] - 统一文本风格。
  26114. * @param {LabelMixedTextStyle} [options.uniformMixedStyle] - 标签专题图统一的文本复合风格。
  26115. * @usage
  26116. */
  26117. var ThemeLabelText = /*#__PURE__*/function () {
  26118. function ThemeLabelText(options) {
  26119. ThemeLabelText_classCallCheck(this, ThemeLabelText);
  26120. /**
  26121. * @member {number} [ThemeLabelText.prototype.maxTextHeight=0]
  26122. * @description 标签中文本的最大高度。当标签文本不固定大小时,即 ServerTextStyle.sizeFixed = false 有效,
  26123. * 当放大后的文本高度超过最大高度之后就不再放大。高度单位为毫米。
  26124. */
  26125. this.maxTextHeight = 0;
  26126. /**
  26127. * @member {number} [ThemeLabelText.prototype.maxTextWidth=0]
  26128. * @description 标签中文本的最大宽度。当标签文本不固定大小时,即 ServerTextStyle.sizeFixed = false 有效,
  26129. * 当放大后的文本宽度超过最大高度之后就不再放大。宽度单位为毫米。
  26130. */
  26131. this.maxTextWidth = 0;
  26132. /**
  26133. * @member {number} [ThemeLabelText.prototype.minTextHeight=0]
  26134. * @description 标签中文本的最小高度。当标签文本不固定大小时,即 ServerTextStyle.sizeFixed = false 有效,
  26135. * 当缩小后的文本高度小于最小高度之后就不再缩小。高度单位为毫米。
  26136. */
  26137. this.minTextHeight = 0;
  26138. /**
  26139. * @member {number} [ThemeLabelText.prototype.minTextWidth=0]
  26140. * @description 标签中文本的最小宽度。当标签文本不固定大小时,即 ServerTextStyle.sizeFixed = false 有效,
  26141. * 当缩小后的文本宽度小于最小宽度之后就不再缩小。宽度单位为毫米。
  26142. */
  26143. this.minTextWidth = 0;
  26144. /**
  26145. * @member {ServerTextStyle} [ThemeLabelText.prototype.uniformStyle]
  26146. * @description 统一文本风格。当标签专题图子项的个数大于等于1时,
  26147. * uniformStyle 不起作用,各标签的风格使用子项中设置的风格。各种风格的优先级从高到低为:uniformMixedStyle(标签文本的复合风格),
  26148. * ThemeLabelItem.style(分段子项的文本风格),uniformStyle(统一文本风格)。
  26149. */
  26150. this.uniformStyle = new ServerTextStyle();
  26151. /**
  26152. *@member {LabelMixedTextStyle} [ThemeLabelText.prototype.uniformMixedStyle]
  26153. *@description 标签专题图统一的文本复合风格。通过该类可以使同一个标签中的文字使用多种风格显示。各种风格的优先级从高到低为:uniformMixedStyle(标签文本的复合风格),
  26154. * ThemeLabelItem.style(分段子项的文本风格),uniformStyle(统一文本风格)。
  26155. */
  26156. this.uniformMixedStyle = null;
  26157. if (options) {
  26158. Util_Util.extend(this, options);
  26159. }
  26160. this.CLASS_NAME = "SuperMap.ThemeLabelText";
  26161. }
  26162. /**
  26163. * @function ThemeLabelText.prototype.destroy
  26164. * @description 释放资源,将引用资源的属性置空。
  26165. */
  26166. ThemeLabelText_createClass(ThemeLabelText, [{
  26167. key: "destroy",
  26168. value: function destroy() {
  26169. var me = this;
  26170. me.maxTextHeight = null;
  26171. me.maxTextWidth = null;
  26172. me.minTextHeight = null;
  26173. me.minTextWidth = null;
  26174. if (me.uniformStyle) {
  26175. me.uniformStyle.destroy();
  26176. me.uniformStyle = null;
  26177. }
  26178. if (me.uniformMixedStyle) {
  26179. me.uniformMixedStyle.destroy();
  26180. me.uniformMixedStyle = null;
  26181. }
  26182. }
  26183. /**
  26184. * @function ThemeLabelText.fromObj
  26185. * @description 从传入对象获取标签中文本风格类。
  26186. * @param {Object} obj - 传入对象。
  26187. * @returns {ThemeLabelText} ThemeLabelText 对象。
  26188. */
  26189. }], [{
  26190. key: "fromObj",
  26191. value: function fromObj(obj) {
  26192. if (!obj) {
  26193. return;
  26194. }
  26195. var res = new ThemeLabelText();
  26196. Util_Util.copy(res, obj);
  26197. res.uniformStyle = ServerTextStyle.fromObj(obj.uniformStyle);
  26198. res.uniformMixedStyle = LabelMixedTextStyle.fromObj(obj.uniformMixedStyle);
  26199. return res;
  26200. }
  26201. }]);
  26202. return ThemeLabelText;
  26203. }();
  26204. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeLabelAlongLine.js
  26205. function ThemeLabelAlongLine_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  26206. function ThemeLabelAlongLine_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  26207. function ThemeLabelAlongLine_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeLabelAlongLine_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeLabelAlongLine_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  26208. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  26209. * This program are made available under the terms of the Apache License, Version 2.0
  26210. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  26211. /**
  26212. * @class ThemeLabelAlongLine
  26213. * @deprecatedclass SuperMap.ThemeLabelAlongLine
  26214. * @category iServer Map Theme
  26215. * @classdesc 标签沿线标注样式类。
  26216. * @param {Object} options - 可选参数。
  26217. * @param {boolean} [options.isAlongLine=true] - 是否沿线显示文本。
  26218. * @param {AlongLineDirection} [options.alongLineDirection=AlongLineDirection.LB_TO_RT] - 标签沿线标注方向。
  26219. * @param {boolean} [options.angleFixed=false] - 当沿线显示文本时,是否将文本角度固定。
  26220. * @param {boolean} [options.repeatedLabelAvoided=false] - 沿线循环标注时是否避免标签重复标注。
  26221. * @param {boolean} [options.repeatIntervalFixed=false] - 循环标注间隔是否固定。
  26222. * @param {number} [options.labelRepeatInterval=0] - 沿线且循环标注时循环标注的间隔。
  26223. * @usage
  26224. */
  26225. var ThemeLabelAlongLine = /*#__PURE__*/function () {
  26226. function ThemeLabelAlongLine(options) {
  26227. ThemeLabelAlongLine_classCallCheck(this, ThemeLabelAlongLine);
  26228. /**
  26229. * @member {boolean} [ThemeLabelAlongLine.prototype.isAlongLine=true]
  26230. * @description 是否沿线显示文本。true 表示沿线显示文本,false 表示正常显示文本。
  26231. */
  26232. this.isAlongLine = true;
  26233. /**
  26234. * @member {AlongLineDirection} [ThemeLabelAlongLine.prototype.alongLineDirection=AlongLineDirection.LB_TO_RT]
  26235. * @description 标签沿线标注方向。
  26236. */
  26237. this.alongLineDirection = AlongLineDirection.LB_TO_RT;
  26238. /**
  26239. * @member {boolean} [ThemeLabelAlongLine.prototype.angleFixed=false]
  26240. * @description 当沿线显示文本时,是否将文本角度固定。true 表示按固定文本角度显示文本,false 表示按照沿线角度显示文本。
  26241. * 如果固定角度,则所有标签均按所设置的文本风格中字体的旋转角度来显示,不考虑沿线标注的方向;
  26242. * 如果不固定角度,在显示标签时会同时考虑字体的旋转角度和沿线标注的方向。
  26243. */
  26244. this.angleFixed = false;
  26245. /**
  26246. * @member {boolean} ThemeLabelAlongLine.prototype.repeatedLabelAvoided
  26247. * @description 沿线循环标注时是否避免标签重复标注。
  26248. */
  26249. this.repeatedLabelAvoided = false;
  26250. /**
  26251. * @member {boolean} [ThemeLabelAlongLine.prototype.repeatIntervalFixed=false]
  26252. * @description 循环标注间隔是否固定。true 表示使用固定循环标注间隔,即使用逻辑坐标来显示循环标注间隔;
  26253. * false 表示循环标注间隔随地图的缩放而变化,即使用地理坐标来显示循环标注间隔。
  26254. */
  26255. this.repeatIntervalFixed = false;
  26256. /**
  26257. * @member {number} [ThemeLabelAlongLine.prototype.labelRepeatInterval=0]
  26258. * @description 沿线且循环标注时循环标注的间隔。长度的单位与地图的地理单位一致。只有设定 RepeatedLabelAvoided 为 true
  26259. * 的时候,labelRepeatInterval 属性才有效。
  26260. */
  26261. this.labelRepeatInterval = 0;
  26262. if (options) {
  26263. Util_Util.extend(this, options);
  26264. }
  26265. this.CLASS_NAME = "SuperMap.ThemeLabelAlongLine";
  26266. }
  26267. /**
  26268. * @function ThemeLabelAlongLine.prototype.destroy
  26269. * @description 释放资源,将引用资源的属性置空。
  26270. */
  26271. ThemeLabelAlongLine_createClass(ThemeLabelAlongLine, [{
  26272. key: "destroy",
  26273. value: function destroy() {
  26274. var me = this;
  26275. me.isAlongLine = null;
  26276. me.alongLineDirection = null;
  26277. me.angleFixed = null;
  26278. me.repeatedLabelAvoided = null;
  26279. me.repeatIntervalFixed = null;
  26280. me.labelRepeatInterval = null;
  26281. }
  26282. /**
  26283. * @function ThemeLabelAlongLine.fromObj
  26284. * @description 从传入对象获取标签沿线标注样式类。
  26285. * @param {Object} obj - 传入对象。
  26286. * @returns {ThemeLabelAlongLine} ThemeLabelAlongLine 对象。
  26287. */
  26288. }], [{
  26289. key: "fromObj",
  26290. value: function fromObj(obj) {
  26291. if (!obj) {
  26292. return;
  26293. }
  26294. var t = new ThemeLabelAlongLine();
  26295. Util_Util.copy(t, obj);
  26296. return t;
  26297. }
  26298. }]);
  26299. return ThemeLabelAlongLine;
  26300. }();
  26301. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeLabelBackground.js
  26302. function ThemeLabelBackground_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  26303. function ThemeLabelBackground_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  26304. function ThemeLabelBackground_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeLabelBackground_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeLabelBackground_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  26305. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  26306. * This program are made available under the terms of the Apache License, Version 2.0
  26307. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  26308. /**
  26309. * @class ThemeLabelBackground
  26310. * @deprecatedclass SuperMap.ThemeLabelBackground
  26311. * @category iServer Map Theme
  26312. * @classdesc 标签背景风格类。通过该类可以设置标签的背景形状和风格。
  26313. * @param {Object} options - 可选参数。
  26314. * @param {LabelBackShape} [options.labelBackShape=LabelBackShape.NONE] - 标签专题图中标签背景的形状枚举类。
  26315. * @param {ServerStyle} [options.backStyle] - 标签专题图中标签背景风格。
  26316. * @usage
  26317. */
  26318. var ThemeLabelBackground = /*#__PURE__*/function () {
  26319. function ThemeLabelBackground(options) {
  26320. ThemeLabelBackground_classCallCheck(this, ThemeLabelBackground);
  26321. /**
  26322. * @member {LabelBackShape} [ThemeLabelBackground.prototype.labelBackShape=LabelBackShape.NONE]
  26323. * @description 标签专题图中标签背景风格。当背景形状
  26324. * labelBackShape 属性设为 NONE(即无背景形状)时,backStyle 属性无效。
  26325. */
  26326. this.labelBackShape = LabelBackShape.NONE;
  26327. /**
  26328. * @member {ServerStyle} [ThemeLabelBackground.prototype.backStyle]
  26329. * @description 标签专题图中标签背景的形状枚举类。背景类型可以是矩形、圆角矩形、菱形、椭圆形、三角形和符号等,即不使用任何的形状作为标签的背景。
  26330. */
  26331. this.backStyle = new ServerStyle();
  26332. if (options) {
  26333. Util_Util.extend(this, options);
  26334. }
  26335. this.CLASS_NAME = "SuperMap.ThemeLabelBackground";
  26336. }
  26337. /**
  26338. * @function ThemeLabelBackground.prototype.destroy
  26339. * @description 释放资源,将引用资源的属性置空。
  26340. */
  26341. ThemeLabelBackground_createClass(ThemeLabelBackground, [{
  26342. key: "destroy",
  26343. value: function destroy() {
  26344. var me = this;
  26345. me.labelBackShape = null;
  26346. if (me.backStyle) {
  26347. me.backStyle.destroy();
  26348. me.backStyle = null;
  26349. }
  26350. }
  26351. /**
  26352. * @function ThemeLabelBackground.fromObj
  26353. * @description 从传入对象获取标签背景风格类。
  26354. * @param {Object} obj - 传入对象。
  26355. * @returns {ThemeLabelBackground} ThemeLabelBackground 对象。
  26356. */
  26357. }], [{
  26358. key: "fromObj",
  26359. value: function fromObj(obj) {
  26360. if (!obj) {
  26361. return;
  26362. }
  26363. var t = new ThemeLabelBackground();
  26364. t.labelBackShape = obj.labelBackShape;
  26365. t.backStyle = ServerStyle.fromJson(obj.backStyle);
  26366. return t;
  26367. }
  26368. }]);
  26369. return ThemeLabelBackground;
  26370. }();
  26371. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeLabel.js
  26372. function ThemeLabel_typeof(obj) { "@babel/helpers - typeof"; return ThemeLabel_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, ThemeLabel_typeof(obj); }
  26373. function ThemeLabel_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  26374. function ThemeLabel_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  26375. function ThemeLabel_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeLabel_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeLabel_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  26376. function ThemeLabel_get() { if (typeof Reflect !== "undefined" && Reflect.get) { ThemeLabel_get = Reflect.get.bind(); } else { ThemeLabel_get = function _get(target, property, receiver) { var base = ThemeLabel_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return ThemeLabel_get.apply(this, arguments); }
  26377. function ThemeLabel_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ThemeLabel_getPrototypeOf(object); if (object === null) break; } return object; }
  26378. function ThemeLabel_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) ThemeLabel_setPrototypeOf(subClass, superClass); }
  26379. function ThemeLabel_setPrototypeOf(o, p) { ThemeLabel_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ThemeLabel_setPrototypeOf(o, p); }
  26380. function ThemeLabel_createSuper(Derived) { var hasNativeReflectConstruct = ThemeLabel_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = ThemeLabel_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = ThemeLabel_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return ThemeLabel_possibleConstructorReturn(this, result); }; }
  26381. function ThemeLabel_possibleConstructorReturn(self, call) { if (call && (ThemeLabel_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return ThemeLabel_assertThisInitialized(self); }
  26382. function ThemeLabel_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  26383. function ThemeLabel_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  26384. function ThemeLabel_getPrototypeOf(o) { ThemeLabel_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ThemeLabel_getPrototypeOf(o); }
  26385. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  26386. * This program are made available under the terms of the Apache License, Version 2.0
  26387. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  26388. /**
  26389. * @class ThemeLabel
  26390. * @deprecatedclass SuperMap.ThemeLabel
  26391. * @category iServer Map Theme
  26392. * @classdesc 标签专题图类。
  26393. * @extends CommonTheme
  26394. * @param {Object} options - 参数。
  26395. * @param {Array.<ThemeLabelItem>} options.items - 子项数组。
  26396. * @param {string} options.labelExpression - 标注字段表达式。
  26397. * @param {Array.<LabelImageCell|LabelSymbolCell|LabelThemeCell>} options.matrixCells - 矩阵标签元素数组。
  26398. * @param {ThemeLabelAlongLine} [options.alongLine] - 标签沿线标注方向样式类。
  26399. * @param {ThemeLabelBackground} [options.background] - 标签的背景风格类。
  26400. * @param {LabelOverLengthMode} [options.labelOverLengthMode=LabelOverLengthMode.NONE] - 超长标签的处理模式枚举类。
  26401. * @param {number} [options.maxLabelLength=256] - 标签在每一行显示的最大长度。
  26402. * @param {number} [options.numericPrecision=0] - 通过该字段设置其显示的精度。
  26403. * @param {ThemeOffset} [options.offset] - 指定标签专题图中标记文本相对于要素内点的偏移量对象。
  26404. * @param {boolean} [options.overlapAvoided=true] - 是否允许以文本避让方式显示文本。
  26405. * @param {string} [options.rangeExpression] - 制作分段标签专题的分段字段或字段表达式。
  26406. * @param {boolean} [options.smallGeometryLabeled=false] - 是否显示长度大于被标注对象本身长度的标签。
  26407. * @param {ThemeLabelText} options.text - 标签中文本风格。
  26408. * @param {number} [options.textSpace=0] - 沿线标注,相邻两个文字之间的间距,单位当前设置的字高。
  26409. * @param {ThemeMemoryData} [options.memoryData] - 专题图内存数据。
  26410. * @usage
  26411. */
  26412. var ThemeLabel = /*#__PURE__*/function (_Theme) {
  26413. ThemeLabel_inherits(ThemeLabel, _Theme);
  26414. var _super = ThemeLabel_createSuper(ThemeLabel);
  26415. function ThemeLabel(options) {
  26416. var _this;
  26417. ThemeLabel_classCallCheck(this, ThemeLabel);
  26418. _this = _super.call(this, "LABEL", options);
  26419. /**
  26420. * @member {ThemeLabelAlongLine} [ThemeLabel.prototype.alongLine]
  26421. * @description 标签沿线标注方向样式类。
  26422. * 在该类中可以设置标签是否沿线标注以及沿线标注的多种方式。沿线标注属性只适用于线数据集专题图。
  26423. */
  26424. _this.alongLine = new ThemeLabelAlongLine();
  26425. /**
  26426. * @member {ThemeLabelBackground} [ThemeLabel.prototype.background]
  26427. * @description 标签专题图中标签的背景风格类。通过该字段可以设置标签的背景形状和风格。
  26428. */
  26429. _this.background = new ThemeLabelBackground();
  26430. /**
  26431. * @member {Array.<ThemeLabelItem>} [ThemeLabel.prototype.items]
  26432. * @description 分段标签专题图的子项数组。分段标签专题图使用 rangeExpression
  26433. * 指定数字型的字段作为分段数据,items 中的每个子对象的 [start,end) 分段值必须来源于属性 rangeExpression 的字段值。每个子项拥有自己的风格。
  26434. */
  26435. _this.items = null;
  26436. /**
  26437. * @member {Array.<ThemeLabelUniqueItem>} ThemeLabel.prototype.uniqueItems
  26438. * @description 单值标签专题图子项数组。单值标签专题图使用 uniqueExpression单值标签专题图子项集合。
  26439. */
  26440. _this.uniqueItems = null;
  26441. /**
  26442. * @member {string} ThemeLabel.prototype.labelExpression
  26443. * @description 标注字段表达式。系统将 labelExpression 对应的字段或字段表达式的值以标签的形式显示在图层中。
  26444. */
  26445. _this.labelExpression = null;
  26446. /**
  26447. * @member {LabelOverLengthMode} [ThemeLabel.prototype.labelOverLengthMode=LabelOverLengthMode.NONE] - 标签专题图中超长标签的处理模式枚举类。
  26448. * @description 对于标签的长度超过设置的标签最大长度 maxLabelLength 时称为超长标签。
  26449. */
  26450. _this.labelOverLengthMode = LabelOverLengthMode.NONE;
  26451. /**
  26452. * @member {Array.<LabelImageCell|LabelSymbolCell|LabelThemeCell>} ThemeLabel.prototype.matrixCells
  26453. * @description 矩阵标签元素数组,用于制作矩阵标签专题图。
  26454. * 数组中可以放置符号类型的矩阵标签元素和图片类型的矩阵标签元素。
  26455. */
  26456. _this.matrixCells = null;
  26457. /**
  26458. * @member {number} [ThemeLabel.prototype.maxLabelLength=256]
  26459. * @description 标签在每一行显示的最大长度,一个中文为两个字符。
  26460. * 如果超过最大长度,可以采用两种方式来处理,一种是换行的模式进行显示,另一种是以省略号方式显示。单位为字符。
  26461. */
  26462. _this.maxLabelLength = 256;
  26463. /**
  26464. * @member {number} [ThemeLabel.prototype.numericPrecision=0]
  26465. * @description 如果显示的标签内容为数字,通过该字段设置其显示的精度。例如标签对应的数字是8071.64529347,
  26466. * 如果该属性为0时,显示8071;为1时,显示8071.6;为3时,则是8071.645。
  26467. */
  26468. _this.numericPrecision = 0;
  26469. /**
  26470. * @member {ThemeOffset} [ThemeLabel.prototype.offset]
  26471. * @description 用于设置标签专题图中标记文本相对于要素内点的偏移量对象。
  26472. */
  26473. _this.offset = new ThemeOffset();
  26474. /**
  26475. * @member {boolean} [ThemeLabel.prototype.overlapAvoided=true]
  26476. * @description 是否允许以文本避让方式显示文本。true 表示自动避免文本叠盖。只针对该标签专题图层中的文本数据。
  26477. * 在标签重叠度很大的情况下,即使使用自动避让功能,可能也无法完全避免标签重叠现象。
  26478. */
  26479. _this.overlapAvoided = true;
  26480. /**
  26481. * @member {string} ThemeLabel.prototype.rangeExpression
  26482. * @description 制作分段标签专题的分段字段或字段表达式。该表达式对应的字段(或者字段表达式)的值应该为数值型。
  26483. * 该字段与 items 分段子项联合使用,每个子项的起始值 [start,end)来源于 rangeExpression 字段值。
  26484. * 最后 labelExpression 指定的标签字段(标签专题图要显示的具体内容)会根据分段子项的风格进行分段显示。
  26485. */
  26486. _this.rangeExpression = null;
  26487. /**
  26488. * @member {string} ThemeLabel.prototype.uniqueExpression
  26489. * @description 用于制作单值专题图的字段或字段表达式。
  26490. * 该字段值的数据类型可以为数值型或字符型。如果设置字段表达式,只能是相同数据类型字段间的运算。必须与labelExpression一起使用。
  26491. */
  26492. _this.uniqueExpression = null;
  26493. /**
  26494. * @member {boolean} [ThemeLabel.prototype.smallGeometryLabeled=false]
  26495. * @description 是否显示长度大于被标注对象本身长度的标签。在标签的长度大于线或者面对象本身的长度时,
  26496. * 如果该值为 true,则标签文字会叠加在一起显示,为了清楚完整的显示该标签,
  26497. * 可以采用换行模式来显示标签,但必须保证每行的长度小于对象本身的长度。
  26498. */
  26499. _this.smallGeometryLabeled = false;
  26500. /**
  26501. * @member {ThemeLabelText} ThemeLabel.prototype.text
  26502. * @description 标签中文本风格。
  26503. */
  26504. _this.text = new ThemeLabelText();
  26505. /**
  26506. * @member {number} [ThemeLabel.prototype.textSpace=0]
  26507. * @description 沿线标注,相邻两个文字之间的间距,单位当前设置的字高。
  26508. */
  26509. _this.textSpace = 0;
  26510. if (options) {
  26511. Util_Util.extend(ThemeLabel_assertThisInitialized(_this), options);
  26512. }
  26513. _this.CLASS_NAME = "SuperMap.ThemeLabel";
  26514. return _this;
  26515. }
  26516. /**
  26517. * @function ThemeLabel.prototype.destroy
  26518. * @override
  26519. */
  26520. ThemeLabel_createClass(ThemeLabel, [{
  26521. key: "destroy",
  26522. value: function destroy() {
  26523. ThemeLabel_get(ThemeLabel_getPrototypeOf(ThemeLabel.prototype), "destroy", this).call(this);
  26524. var me = this;
  26525. me.alongLine = null;
  26526. if (me.background) {
  26527. me.background.destroy();
  26528. me.background = null;
  26529. }
  26530. if (me.items) {
  26531. for (var i = 0, items = me.items, len = items.length; i < len; i++) {
  26532. items[i].destroy();
  26533. }
  26534. me.items = null;
  26535. }
  26536. if (me.uniqueItems) {
  26537. for (var j = 0, uniqueItems = me.uniqueItems, uniqueLen = uniqueItems.length; j < uniqueLen; j++) {
  26538. uniqueItems[j].destory();
  26539. }
  26540. me.uniqueItems = null;
  26541. }
  26542. me.labelExpression = null;
  26543. me.labelOverLengthMode = null;
  26544. me.matrixCells = null;
  26545. me.maxLabelLength = null;
  26546. me.numericPrecision = null;
  26547. me.overlapAvoided = null;
  26548. me.rangeExpression = null;
  26549. me.uniqueExpression = null;
  26550. if (me.offset) {
  26551. me.offset.destroy();
  26552. me.offset = null;
  26553. }
  26554. me.overlapAvoided = null;
  26555. me.smallGeometryLabeled = null;
  26556. if (me.text) {
  26557. me.text.destroy();
  26558. me.text = null;
  26559. }
  26560. me.textSpace = null;
  26561. }
  26562. /**
  26563. * @function ThemeLabel.prototype.toJSON
  26564. * @description 将themeLabel对象转化为 JSON 字符串。
  26565. * @returns {string} 返回转换后的 JSON 字符串。
  26566. */
  26567. }, {
  26568. key: "toJSON",
  26569. value: function toJSON() {
  26570. return Util_Util.toJSON(this.toServerJSONObject());
  26571. }
  26572. /**
  26573. * @function ThemeLabel.prototype.toServerJSONObject
  26574. * @description 转换成对应的 JSON 格式对象。
  26575. * @returns {Object} 对应的 JSON 格式对象。
  26576. */
  26577. }, {
  26578. key: "toServerJSONObject",
  26579. value: function toServerJSONObject() {
  26580. var obj = {};
  26581. obj.type = this.type;
  26582. obj.memoryData = this.memoryData;
  26583. if (this.alongLine) {
  26584. obj.alongLine = this.alongLine.isAlongLine;
  26585. obj.alongLineDirection = this.alongLine.alongLineDirection;
  26586. obj.angleFixed = this.alongLine.angleFixed;
  26587. obj.isLabelRepeated = this.alongLine.isLabelRepeated;
  26588. obj.labelRepeatInterval = this.alongLine.labelRepeatInterval;
  26589. obj.repeatedLabelAvoided = this.alongLine.repeatedLabelAvoided;
  26590. obj.repeatIntervalFixed = this.alongLine.repeatIntervalFixed;
  26591. }
  26592. if (this.offset) {
  26593. obj.offsetFixed = this.offset.offsetFixed;
  26594. obj.offsetX = this.offset.offsetX;
  26595. obj.offsetY = this.offset.offsetY;
  26596. }
  26597. if (this.text) {
  26598. obj.maxTextHeight = this.text.maxTextHeight;
  26599. obj.maxTextWidth = this.text.maxTextWidth;
  26600. obj.minTextHeight = this.text.minTextHeight;
  26601. obj.minTextWidth = this.text.minTextWidth;
  26602. obj.uniformStyle = this.text.uniformStyle;
  26603. obj.uniformMixedStyle = this.text.uniformMixedStyle;
  26604. }
  26605. if (this.background) {
  26606. obj.labelBackShape = this.background.labelBackShape;
  26607. obj.backStyle = this.background.backStyle;
  26608. }
  26609. obj.labelOverLengthMode = this.labelOverLengthMode;
  26610. obj.maxLabelLength = this.maxLabelLength;
  26611. obj.smallGeometryLabeled = this.smallGeometryLabeled;
  26612. obj.rangeExpression = this.rangeExpression;
  26613. obj.uniqueExpression = this.uniqueExpression;
  26614. obj.numericPrecision = this.numericPrecision;
  26615. obj.items = this.items;
  26616. obj.uniqueItems = this.uniqueItems;
  26617. obj.labelExpression = this.labelExpression;
  26618. obj.overlapAvoided = this.overlapAvoided;
  26619. obj.matrixCells = this.matrixCells;
  26620. obj.textSpace = this.textSpace;
  26621. return obj;
  26622. }
  26623. /**
  26624. * @function ThemeLabel.fromObj
  26625. * @description 从传入对象获取标签专题图类。
  26626. * @param {Object} obj - 传入对象。
  26627. * @returns {ThemeLabel} ThemeLabel 对象。
  26628. */
  26629. }], [{
  26630. key: "fromObj",
  26631. value: function fromObj(obj) {
  26632. if (!obj) {
  26633. return;
  26634. }
  26635. var lab = new ThemeLabel();
  26636. var itemsL = obj.items,
  26637. itemsU = obj.uniqueItems,
  26638. cells = obj.matrixCells;
  26639. obj.matrixCells = null;
  26640. Util_Util.copy(lab, obj);
  26641. lab.alongLine = ThemeLabelAlongLine.fromObj(obj);
  26642. lab.background = ThemeLabelBackground.fromObj(obj);
  26643. if (itemsL) {
  26644. lab.items = [];
  26645. for (var i = 0, len = itemsL.length; i < len; i++) {
  26646. lab.items.push(ThemeLabelItem.fromObj(itemsL[i]));
  26647. }
  26648. }
  26649. if (itemsU) {
  26650. lab.uniqueItems = [];
  26651. for (var j = 0, uniqueLen = itemsU.length; j < uniqueLen; j++) {
  26652. lab.uniqueItems.push(ThemeUniqueItem.fromObj(itemsU[j]));
  26653. }
  26654. }
  26655. if (cells) {
  26656. lab.matrixCells = [];
  26657. for (var _i2 = 0, _len2 = cells.length; _i2 < _len2; _i2++) {
  26658. //TODO
  26659. //lab.matrixCells.push(LabelMatrixCell.fromObj(cells[i]));
  26660. }
  26661. }
  26662. lab.offset = ThemeOffset.fromObj(obj);
  26663. lab.text = ThemeLabelText.fromObj(obj);
  26664. return lab;
  26665. }
  26666. }]);
  26667. return ThemeLabel;
  26668. }(Theme);
  26669. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeUnique.js
  26670. function ThemeUnique_typeof(obj) { "@babel/helpers - typeof"; return ThemeUnique_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, ThemeUnique_typeof(obj); }
  26671. function ThemeUnique_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  26672. function ThemeUnique_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  26673. function ThemeUnique_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeUnique_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeUnique_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  26674. function ThemeUnique_get() { if (typeof Reflect !== "undefined" && Reflect.get) { ThemeUnique_get = Reflect.get.bind(); } else { ThemeUnique_get = function _get(target, property, receiver) { var base = ThemeUnique_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return ThemeUnique_get.apply(this, arguments); }
  26675. function ThemeUnique_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ThemeUnique_getPrototypeOf(object); if (object === null) break; } return object; }
  26676. function ThemeUnique_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) ThemeUnique_setPrototypeOf(subClass, superClass); }
  26677. function ThemeUnique_setPrototypeOf(o, p) { ThemeUnique_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ThemeUnique_setPrototypeOf(o, p); }
  26678. function ThemeUnique_createSuper(Derived) { var hasNativeReflectConstruct = ThemeUnique_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = ThemeUnique_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = ThemeUnique_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return ThemeUnique_possibleConstructorReturn(this, result); }; }
  26679. function ThemeUnique_possibleConstructorReturn(self, call) { if (call && (ThemeUnique_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return ThemeUnique_assertThisInitialized(self); }
  26680. function ThemeUnique_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  26681. function ThemeUnique_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  26682. function ThemeUnique_getPrototypeOf(o) { ThemeUnique_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ThemeUnique_getPrototypeOf(o); }
  26683. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  26684. * This program are made available under the terms of the Apache License, Version 2.0
  26685. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  26686. /**
  26687. * @class ThemeUnique
  26688. * @deprecatedclass SuperMap.ThemeUnique
  26689. * @category iServer Map Theme
  26690. * @classdesc 单值专题图。单值专题图是利用不同的颜色或符号(线型、填充)表示图层中某一属性信息的不同属性值,属性值相同的要素具有相同的渲染风格。单值专题图多用于具有分类属性的地图上,
  26691. * 比如土壤类型分布图、土地利用图、行政区划图等。单值专题图着重表示现象质的差别,一般不表示数量的特征。尤其是有交叉或重叠现象时,此类不推荐使用,例如:民族分布区等。
  26692. * @extends {CommonTheme}
  26693. * @param {Object} options - 参数。
  26694. * @param {Array.<ThemeUniqueItem>} options.items - 子项类数组。
  26695. * @param {string} options.uniqueExpression - 指定单值专题图的字段或字段表达式。
  26696. * @param {ServerStyle} [options.defaultStyle] - 未参与单值专题图制作的对象的显示风格。
  26697. * @param {ColorGradientType} [options.colorGradientType=ColorGradientType.YELLOW_RED] - 渐变颜色枚举类。
  26698. * @param {ThemeMemoryData} [options.memoryData] - 专题图内存数据。
  26699. * @usage
  26700. */
  26701. var ThemeUnique = /*#__PURE__*/function (_Theme) {
  26702. ThemeUnique_inherits(ThemeUnique, _Theme);
  26703. var _super = ThemeUnique_createSuper(ThemeUnique);
  26704. function ThemeUnique(options) {
  26705. var _this;
  26706. ThemeUnique_classCallCheck(this, ThemeUnique);
  26707. _this = _super.call(this, "UNIQUE", options);
  26708. /**
  26709. * @member {ServerStyle} ThemeUnique.prototype.defaultStyle
  26710. * @description 未参与单值专题图制作的对象的显示风格。
  26711. * 通过单值专题图子项数组 (items)可以指定某些要素参与单值专题图制作,对于那些没有被包含的要素,即不参加单值专题表达的要素,使用该风格显示。
  26712. */
  26713. _this.defaultStyle = new ServerStyle();
  26714. /**
  26715. * @member {Array.<ThemeUniqueItem>} ThemeUnique.prototype.items
  26716. * @description 单值专题图子项类数组。
  26717. * 单值专题图是将专题值相同的要素归为一类,为每一类设定一种渲染风格,其中每一类就是一个专题图子项。比如,利用单值专题图制作行政区划图,
  26718. * Name 字段代表省/直辖市名,该字段用来做专题变量,如果该字段的字段值总共有5种不同值,则该行政区划图有 5 个专题图子项。
  26719. */
  26720. _this.items = null;
  26721. /**
  26722. * @member {string} ThemeUnique.prototype.uniqueExpression
  26723. * @description 用于制作单值专题图的字段或字段表达式。
  26724. * 该字段值的数据类型可以为数值型或字符型。如果设置字段表达式,只能是相同数据类型字段间的运算。
  26725. */
  26726. _this.uniqueExpression = null;
  26727. /**
  26728. * @member {ColorGradientType} [ThemeUnique.prototype.colorGradientType=ColorGradientType.YELLOW_RED]
  26729. * @description 渐变颜色枚举类。
  26730. * 渐变色是由起始色根据一定算法逐渐过渡到终止色的一种混合型颜色。
  26731. * 该类作为单值专题图参数类、分段专题图参数类的属性,负责设置单值专题图、分段专题图的配色方案,在默认情况下专题图所有子项会根据这个配色方案完成填充。
  26732. * 但如果为某几个子项的风格进行单独设置后(设置了 ThemeUniqueItem 或 ThemeRangeItem 类中Style属性),
  26733. * 该配色方案对于这几个子项将不起作用。
  26734. */
  26735. _this.colorGradientType = ColorGradientType.YELLOW_RED;
  26736. if (options) {
  26737. Util_Util.extend(ThemeUnique_assertThisInitialized(_this), options);
  26738. }
  26739. _this.CLASS_NAME = "SuperMap.ThemeUnique";
  26740. return _this;
  26741. }
  26742. /**
  26743. * @function ThemeUnique.prototype.destroy
  26744. * @override
  26745. */
  26746. ThemeUnique_createClass(ThemeUnique, [{
  26747. key: "destroy",
  26748. value: function destroy() {
  26749. ThemeUnique_get(ThemeUnique_getPrototypeOf(ThemeUnique.prototype), "destroy", this).call(this);
  26750. var me = this;
  26751. me.uniqueExpression = null;
  26752. me.colorGradientType = null;
  26753. if (me.items) {
  26754. if (me.items.length > 0) {
  26755. for (var item in me.items) {
  26756. me.items[item].destroy();
  26757. me.items[item] = null;
  26758. }
  26759. }
  26760. me.items = null;
  26761. }
  26762. if (me.defaultStyle) {
  26763. me.defaultStyle.destroy();
  26764. me.defaultStyle = null;
  26765. }
  26766. }
  26767. /**
  26768. * @function ThemeUnique.prototype.toServerJSONObject
  26769. * @description 转换成对应的 JSON 格式对象。
  26770. * @returns {Object} 对应的 JSON 格式对象。
  26771. */
  26772. }, {
  26773. key: "toServerJSONObject",
  26774. value: function toServerJSONObject() {
  26775. var obj = {};
  26776. obj = Util_Util.copyAttributes(obj, this);
  26777. if (obj.defaultStyle) {
  26778. if (obj.defaultStyle.toServerJSONObject) {
  26779. obj.defaultStyle = obj.defaultStyle.toServerJSONObject();
  26780. }
  26781. }
  26782. if (obj.items) {
  26783. var items = [],
  26784. len = obj.items.length;
  26785. for (var i = 0; i < len; i++) {
  26786. items.push(obj.items[i].toServerJSONObject());
  26787. }
  26788. obj.items = items;
  26789. }
  26790. return obj;
  26791. }
  26792. /**
  26793. * @function ThemeUnique.fromObj
  26794. * @description 从传入对象获取单值专题图类。
  26795. * @param {Object} obj - 传入对象。
  26796. * @returns {ThemeUnique} ThemeUnique 对象。
  26797. */
  26798. }], [{
  26799. key: "fromObj",
  26800. value: function fromObj(obj) {
  26801. var res = new ThemeUnique();
  26802. var uItems = obj.items;
  26803. var len = uItems ? uItems.length : 0;
  26804. Util_Util.extend(res, obj);
  26805. res.items = [];
  26806. res.defaultStyle = ServerStyle.fromJson(obj.defaultStyle);
  26807. for (var i = 0; i < len; i++) {
  26808. res.items.push(ThemeUniqueItem.fromObj(uItems[i]));
  26809. }
  26810. return res;
  26811. }
  26812. }]);
  26813. return ThemeUnique;
  26814. }(Theme);
  26815. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeGraphAxes.js
  26816. function ThemeGraphAxes_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  26817. function ThemeGraphAxes_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  26818. function ThemeGraphAxes_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeGraphAxes_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeGraphAxes_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  26819. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  26820. * This program are made available under the terms of the Apache License, Version 2.0
  26821. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  26822. /**
  26823. * @class ThemeGraphAxes
  26824. * @deprecatedclass SuperMap.ThemeGraphAxes
  26825. * @category iServer Map Theme
  26826. * @classdesc 统计专题图坐标轴样式类。
  26827. * @param {Object} options - 参数。
  26828. * @param {ServerColor} [options.axesColor=(0, 0, 0)] - 坐标轴颜色。
  26829. * @param {boolean} [options.axesDisplayed=false] - 是否显示坐标轴。
  26830. * @param {boolean} [options.axesGridDisplayed=false] - 是否在统计图坐标轴上显示网格。
  26831. * @param {boolean} [options.axesTextDisplayed=false] - 是否显示坐标轴的文本标注。
  26832. * @param {ServerTextStyle} [options.axesTextStyle] - 统计符号的最大最小尺寸。
  26833. * @usage
  26834. */
  26835. var ThemeGraphAxes = /*#__PURE__*/function () {
  26836. function ThemeGraphAxes(options) {
  26837. ThemeGraphAxes_classCallCheck(this, ThemeGraphAxes);
  26838. /**
  26839. * @member {ServerColor} [ThemeGraphAxes.prototype.axesColor=(0, 0, 0)]
  26840. * @description 坐标轴颜色。当 axesDisplayed = true 时有效。
  26841. */
  26842. this.axesColor = new ServerColor(0, 0, 0);
  26843. /**
  26844. * @member {boolean} [ThemeGraphAxes.prototype.axesDisplayed=false]
  26845. * @description 是否显示坐标轴。<br>
  26846. * 由于饼状图和环状图无坐标轴,故该属性以及所有与坐标轴设置相关的属性都不适用于它们。并且只有当该值为 true 时,其它设置坐标轴的属性才起作用。
  26847. */
  26848. this.axesDisplayed = false;
  26849. /**
  26850. * @member {boolean} [ThemeGraphAxes.prototype.axesGridDisplayed=false]
  26851. * @description 是否在统计图坐标轴上显示网格。
  26852. */
  26853. this.axesGridDisplayed = false;
  26854. /**
  26855. * @member {boolean} [ThemeGraphAxes.prototype.axesTextDisplayed=false]
  26856. * @description 是否显示坐标轴的文本标注。
  26857. */
  26858. this.axesTextDisplayed = false;
  26859. /**
  26860. * @member {ServerTextStyle} ThemeGraphAxes.prototype.axesTextStyle
  26861. * @description 坐标轴文本风格。当 axesTextDisplayed = true 时有效。
  26862. */
  26863. this.axesTextStyle = new ServerTextStyle();
  26864. if (options) {
  26865. Util_Util.extend(this, options);
  26866. }
  26867. this.CLASS_NAME = "SuperMap.ThemeGraphAxes";
  26868. }
  26869. /**
  26870. * @function ThemeGraphAxes.prototype.destroy
  26871. * @description 释放资源,将引用资源的属性置空。
  26872. */
  26873. ThemeGraphAxes_createClass(ThemeGraphAxes, [{
  26874. key: "destroy",
  26875. value: function destroy() {
  26876. var me = this;
  26877. if (me.axesColor) {
  26878. me.axesColor.destroy();
  26879. me.axesColor = null;
  26880. }
  26881. me.axesDisplayed = null;
  26882. me.axesGridDisplayed = null;
  26883. me.axesTextDisplayed = null;
  26884. if (me.axesTextStyle) {
  26885. me.axesTextStyle.destroy();
  26886. me.axesTextStyle = null;
  26887. }
  26888. }
  26889. /**
  26890. * @function ThemeGraphAxes.fromObj
  26891. * @description 从传入对象获取统计专题图坐标轴样式类。
  26892. * @param {Object} obj - 传入对象。
  26893. * @returns {ThemeGraphAxes} ThemeGraphAxes 对象。
  26894. */
  26895. }], [{
  26896. key: "fromObj",
  26897. value: function fromObj(obj) {
  26898. if (!obj) {
  26899. return;
  26900. }
  26901. var res = new ThemeGraphAxes();
  26902. Util_Util.copy(res, obj);
  26903. res.axesColor = ServerColor.fromJson(obj.axesColor);
  26904. res.axesTextStyle = ServerTextStyle.fromObj(obj.axesTextStyle);
  26905. return res;
  26906. }
  26907. }]);
  26908. return ThemeGraphAxes;
  26909. }();
  26910. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeGraphSize.js
  26911. function ThemeGraphSize_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  26912. function ThemeGraphSize_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  26913. function ThemeGraphSize_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeGraphSize_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeGraphSize_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  26914. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  26915. * This program are made available under the terms of the Apache License, Version 2.0
  26916. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  26917. /**
  26918. * @class ThemeGraphSize
  26919. * @deprecatedclass SuperMap.ThemeGraphSize
  26920. * @category iServer Map Theme
  26921. * @classdesc 统计专题图符号尺寸类。
  26922. * @param {Object} options - 参数。
  26923. * @param {number} [options.maxGraphSize=0] - 统计图中显示的最大图表尺寸基准值。
  26924. * @param {number} [options.minGraphSize=0] - 统计图中显示的最小图表尺寸基准值。
  26925. * @usage
  26926. */
  26927. var ThemeGraphSize = /*#__PURE__*/function () {
  26928. function ThemeGraphSize(options) {
  26929. ThemeGraphSize_classCallCheck(this, ThemeGraphSize);
  26930. /**
  26931. * @member {number} [ThemeGraphSize.prototype.maxGraphSize=0]
  26932. * @description 获取或设置统计图中显示的最大图表尺寸基准值,单位为像素。
  26933. */
  26934. this.maxGraphSize = 0;
  26935. /**
  26936. * @member {number} [ThemeGraphSize.prototype.minGraphSize=0]
  26937. * @description 获取或设置统计图中显示的最小图表尺寸基准值,单位为像素。
  26938. */
  26939. this.minGraphSize = 0;
  26940. if (options) {
  26941. Util_Util.extend(this, options);
  26942. }
  26943. this.CLASS_NAME = "SuperMap.ThemeGraphSize";
  26944. }
  26945. /**
  26946. * @function ThemeGraphSize.prototype.destroy
  26947. * @description 释放资源,将引用资源的属性置空。
  26948. */
  26949. ThemeGraphSize_createClass(ThemeGraphSize, [{
  26950. key: "destroy",
  26951. value: function destroy() {
  26952. var me = this;
  26953. me.maxGraphSize = null;
  26954. me.minGraphSize = null;
  26955. }
  26956. /**
  26957. * @function ThemeGraphSize.fromObj
  26958. * @description 从传入对象获统计专题图符号尺寸类。
  26959. * @param {Object} obj - 传入对象。
  26960. * @returns {ThemeGraphSize} ThemeGraphSize 对象。
  26961. */
  26962. }], [{
  26963. key: "fromObj",
  26964. value: function fromObj(obj) {
  26965. var res = new ThemeGraphSize();
  26966. Util_Util.copy(res, obj);
  26967. return res;
  26968. }
  26969. }]);
  26970. return ThemeGraphSize;
  26971. }();
  26972. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeGraphText.js
  26973. function ThemeGraphText_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  26974. function ThemeGraphText_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  26975. function ThemeGraphText_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeGraphText_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeGraphText_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  26976. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  26977. * This program are made available under the terms of the Apache License, Version 2.0
  26978. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  26979. /**
  26980. * @class ThemeGraphText
  26981. * @deprecatedclass SuperMap.ThemeGraphText
  26982. * @category iServer Map Theme
  26983. * @classdesc 统计图文字标注风格类。
  26984. * @param {Object} options - 可选参数。
  26985. * @param {boolean} [options.graphTextDisplayed=false] - 是否显示统计图上的文字标注。
  26986. * @param {ThemeGraphTextFormat} [options.graphTextFormat=ThemeGraphTextFormat.CAPTION] - 统计专题图文本显示格式。
  26987. * @param {ServerTextStyle} [options.graphTextStyle] - 统计图上的文字标注风格。
  26988. * @usage
  26989. */
  26990. var ThemeGraphText = /*#__PURE__*/function () {
  26991. function ThemeGraphText(options) {
  26992. ThemeGraphText_classCallCheck(this, ThemeGraphText);
  26993. /**
  26994. * @member {boolean} [ThemeGraphText.prototype.graphTextDisplayed=false]
  26995. * @description 是否显示统计图上的文字标注。
  26996. */
  26997. this.graphTextDisplayed = false;
  26998. /**
  26999. * @member {ThemeGraphTextFormat} [ThemeGraphText.prototype.graphTextFormat=ThemeGraphTextFormat.CAPTION]
  27000. * @description 统计专题图文本显示格式。
  27001. * 文本显示格式包括百分数、真实数值、标题、标题+百分数、标题+真实数值。
  27002. */
  27003. this.graphTextFormat = ThemeGraphTextFormat.CAPTION;
  27004. /**
  27005. * @member {ServerTextStyle} ThemeGraphText.prototype.graphTextStyle
  27006. * @description 统计图上的文字标注风格。
  27007. */
  27008. this.graphTextStyle = new ServerTextStyle();
  27009. if (options) {
  27010. Util_Util.extend(this, options);
  27011. }
  27012. this.CLASS_NAME = "SuperMap.ThemeGraphText";
  27013. }
  27014. /**
  27015. * @function ThemeGraphText.prototype.destroy
  27016. * @description 释放资源,将引用资源的属性置空。
  27017. */
  27018. ThemeGraphText_createClass(ThemeGraphText, [{
  27019. key: "destroy",
  27020. value: function destroy() {
  27021. var me = this;
  27022. me.graphTextDisplayed = null;
  27023. me.graphTextFormat = null;
  27024. if (me.graphTextStyle) {
  27025. me.graphTextStyle.destroy();
  27026. me.graphTextStyle = null;
  27027. }
  27028. }
  27029. /**
  27030. * @function ThemeGraphText.fromObj
  27031. * @description 从传入对象获取统计图文字标注风格类。
  27032. * @param {Object} obj - 传入对象。
  27033. * @returns {ThemeGraphText} ThemeGraphText 对象。
  27034. */
  27035. }], [{
  27036. key: "fromObj",
  27037. value: function fromObj(obj) {
  27038. var res = new ThemeGraphText();
  27039. Util_Util.copy(res, obj);
  27040. res.graphTextStyle = ServerTextStyle.fromObj(obj.graphTextStyle);
  27041. return res;
  27042. }
  27043. }]);
  27044. return ThemeGraphText;
  27045. }();
  27046. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeGraphItem.js
  27047. function ThemeGraphItem_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  27048. function ThemeGraphItem_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  27049. function ThemeGraphItem_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeGraphItem_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeGraphItem_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  27050. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  27051. * This program are made available under the terms of the Apache License, Version 2.0
  27052. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  27053. /**
  27054. * @class ThemeGraphItem
  27055. * @deprecatedclass SuperMap.ThemeGraphItem
  27056. * @category iServer Map Theme
  27057. * @classdesc 统计专题图子项类。
  27058. * @param {Object} options - 参数。
  27059. * @param {string} [options.caption] - 专题图子项的名称。
  27060. * @param {string} options.graphExpression - 统计专题图的专题变量。
  27061. * @param {Array.<number>} [options.memoryDoubleValues] - 内存数组方式制作专题图时的值数组。
  27062. * @param {ServerStyle} [options.uniformStyle] - 统计专题图子项的显示风格。
  27063. * @usage
  27064. */
  27065. var ThemeGraphItem = /*#__PURE__*/function () {
  27066. function ThemeGraphItem(options) {
  27067. ThemeGraphItem_classCallCheck(this, ThemeGraphItem);
  27068. /**
  27069. * @member {string} [ThemeGraphItem.prototype.caption]
  27070. * @description 专题图子项的名称。
  27071. */
  27072. this.caption = null;
  27073. /**
  27074. * @member {string} ThemeGraphItem.prototype.graphExpression
  27075. * @description 统计专题图的专题变量。专题变量可以是一个字段或字段表达式。字段必须为数值型;表达式只能为数值型的字段间的运算。
  27076. */
  27077. this.graphExpression = null;
  27078. /**
  27079. * @member {Array.<number>} [ThemeGraphItem.prototype.memoryDoubleValues]
  27080. * @description 内存数组方式制作专题图时的值数组。<br>
  27081. * 内存数组方式制作专题图时,只对 SmID 值在键数组({@link ThemeGraph#memoryKeys})中的记录制作专题图。
  27082. * 值数组的数值个数必须与键数组中数值的个数一致。值数组中的值将代替原来的专题值来制作统计专题图。
  27083. * 比如:利用面积字段和周长字段(即有两个统计专题图子项 )作为专题变量制作统计专题图。
  27084. */
  27085. this.memoryDoubleValues = null;
  27086. /**
  27087. * @member {ServerStyle} [ThemeGraphItem.prototype.uniformStyle]
  27088. * @description 统计专题图子项的显示风格。
  27089. * 每一个统计专题图子项都对应一种显示风格。
  27090. */
  27091. this.uniformStyle = new ServerStyle();
  27092. if (options) {
  27093. Util_Util.extend(this, options);
  27094. }
  27095. this.CLASS_NAME = "SuperMap.ThemeGraphItem";
  27096. }
  27097. /**
  27098. * @function ThemeGraphItem.prototype.destroy
  27099. * @description 释放资源,将引用资源的属性置空。
  27100. */
  27101. ThemeGraphItem_createClass(ThemeGraphItem, [{
  27102. key: "destroy",
  27103. value: function destroy() {
  27104. var me = this;
  27105. me.caption = null;
  27106. me.graphExpression = null;
  27107. me.memoryDoubleValues = null;
  27108. me.uniformStyle = null;
  27109. }
  27110. /**
  27111. * @function ThemeGraphItem.fromObj
  27112. * @description 从传入对象获取统计专题图子项类。
  27113. * @param {Object} obj - 传入对象。
  27114. * @returns {ThemeGraphItem} ThemeGraphItem 对象。
  27115. */
  27116. }], [{
  27117. key: "fromObj",
  27118. value: function fromObj(obj) {
  27119. if (!obj) {
  27120. return;
  27121. }
  27122. var res = new ThemeGraphItem();
  27123. Util_Util.copy(res, obj);
  27124. res.uniformStyle = ServerStyle.fromJson(obj.uniformStyle);
  27125. return res;
  27126. }
  27127. }]);
  27128. return ThemeGraphItem;
  27129. }();
  27130. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeGraph.js
  27131. function ThemeGraph_typeof(obj) { "@babel/helpers - typeof"; return ThemeGraph_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, ThemeGraph_typeof(obj); }
  27132. function ThemeGraph_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  27133. function ThemeGraph_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  27134. function ThemeGraph_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeGraph_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeGraph_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  27135. function ThemeGraph_get() { if (typeof Reflect !== "undefined" && Reflect.get) { ThemeGraph_get = Reflect.get.bind(); } else { ThemeGraph_get = function _get(target, property, receiver) { var base = ThemeGraph_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return ThemeGraph_get.apply(this, arguments); }
  27136. function ThemeGraph_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ThemeGraph_getPrototypeOf(object); if (object === null) break; } return object; }
  27137. function ThemeGraph_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) ThemeGraph_setPrototypeOf(subClass, superClass); }
  27138. function ThemeGraph_setPrototypeOf(o, p) { ThemeGraph_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ThemeGraph_setPrototypeOf(o, p); }
  27139. function ThemeGraph_createSuper(Derived) { var hasNativeReflectConstruct = ThemeGraph_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = ThemeGraph_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = ThemeGraph_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return ThemeGraph_possibleConstructorReturn(this, result); }; }
  27140. function ThemeGraph_possibleConstructorReturn(self, call) { if (call && (ThemeGraph_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return ThemeGraph_assertThisInitialized(self); }
  27141. function ThemeGraph_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  27142. function ThemeGraph_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  27143. function ThemeGraph_getPrototypeOf(o) { ThemeGraph_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ThemeGraph_getPrototypeOf(o); }
  27144. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  27145. * This program are made available under the terms of the Apache License, Version 2.0
  27146. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  27147. /**
  27148. * @class ThemeGraph
  27149. * @deprecatedclass SuperMap.ThemeGraph
  27150. * @category iServer Map Theme
  27151. * @classdesc 统计专题图类。
  27152. * @extends {CommonTheme}
  27153. * @param {Object} options - 参数。
  27154. * @param {Array.<ThemeGraphItem>} options.items - 统计专题图子项集合。
  27155. * @param {number} [options.barWidth=0] - 柱状专题图中每一个柱的宽度。
  27156. * @param {GraduatedMode} [options.graduatedMode=GraduatedMode.CONSTANT] - 统计图中地理要素的值与图表尺寸间的映射关系。
  27157. * @param {ThemeGraphAxes} [options.graphAxes] - 统计图中坐标轴样式相关信息。
  27158. * @param {ThemeGraphSize} [options.graphSize=0] - 统计符号的最大最小尺寸。
  27159. * @param {boolean} [options.graphSizeFixed=false] - 缩放地图时统计图符号是否固定大小。
  27160. * @param {ThemeGraphText} [options.graphText] - 统计图上的文字是否可见以及文字标注风格。
  27161. * @param {GraphAxesTextDisplayMode} [options.graphAxesTextDisplayMode=GraphAxesTextDisplayMode.NONE] - 统计专题图坐标轴文本显示模式。
  27162. * @param {ThemeGraphType} [options.graphType=ThemeGraphType.AREA] - 统计专题图类型。
  27163. * @param {Array.<number>} [options.memoryKeys] - 以内存数组方式制作专题图时的键数组。
  27164. * @param {boolean} [options.negativeDisplayed=false] - 专题图中是否显示属性为负值的数据。
  27165. * @param {ThemeOffset} [options.offset] - 统计图相对于要素内点的偏移量。
  27166. * @param {boolean} [options.overlapAvoided=true] - 统计图是否采用避让方式显示。
  27167. * @param {number} [options.roseAngle=0] - 统计图中玫瑰图或三维玫瑰图用于等分的角度。
  27168. * @param {number} [options.startAngle=0] - 饼状统计图扇形的起始角度。
  27169. * @usage
  27170. */
  27171. var ThemeGraph = /*#__PURE__*/function (_Theme) {
  27172. ThemeGraph_inherits(ThemeGraph, _Theme);
  27173. var _super = ThemeGraph_createSuper(ThemeGraph);
  27174. function ThemeGraph(options) {
  27175. var _this;
  27176. ThemeGraph_classCallCheck(this, ThemeGraph);
  27177. _this = _super.call(this, "GRAPH", options);
  27178. /**
  27179. * @member {number} [ThemeGraph.prototype.barWidth=0]
  27180. * @description 柱状专题图中每一个柱的宽度。使用地图坐标单位。
  27181. * 只有选择的统计图类型为柱状图(柱状图、三维柱状图、堆叠柱状图、三维堆叠柱状图)时,此项才可设置。
  27182. */
  27183. _this.barWidth = 0;
  27184. /**
  27185. * @member {GraduatedMode} [ThemeGraph.prototype.graduatedMode=GraduatedMode.CONSTANT]
  27186. * @description 统计图中地理要素的值与图表尺寸间的映射关系(常数、对数、平方根),即分级方式。
  27187. * 分级主要是为了减少制作统计专题图中数据大小之间的差异,使得统计图的视觉效果比较好,同时不同类别之间的比较也还是有意义的。
  27188. * 提供三种分级模式:常数、对数和平方根,对于有值为负数的字段,不可以采用对数和平方根的分级方式。不同的等级方式用于确定符号大小的数值是不相同的。
  27189. */
  27190. _this.graduatedMode = GraduatedMode.CONSTANT;
  27191. /**
  27192. * @member {ThemeGraphAxes} ThemeGraph.prototype.graphAxes
  27193. * @description 用于设置统计图中坐标轴样式相关信息,如坐标轴颜色、是否显示、坐标文本样式等。
  27194. */
  27195. _this.graphAxes = new ThemeGraphAxes();
  27196. /**
  27197. * @member {ThemeGraphSize} [ThemeGraph.prototype.graphSize=0]
  27198. * @description 用于设置统计符号的最大最小尺寸。
  27199. */
  27200. _this.graphSize = new ThemeGraphSize();
  27201. /**
  27202. * @member {boolean} [ThemeGraph.prototype.graphSizeFixed=false]
  27203. * @description 缩放地图时统计图符号是否固定大小。即统计图符号将随地图缩放。
  27204. */
  27205. _this.graphSizeFixed = false;
  27206. /**
  27207. * @member {ThemeGraphText} ThemeGraph.prototype.graphText
  27208. * @description 统计图上的文字是否可见以及文字标注风格。
  27209. */
  27210. _this.graphText = new ThemeGraphText();
  27211. /**
  27212. * @member {ThemeGraphType} [ThemeGraph.prototype.graphType=ThemeGraphType.AREA]
  27213. * @description 统计专题图类型。SuperMap 提供了多种类型的统计图,
  27214. * 分别为面积图、阶梯图、折线图、点状图、柱状图、三维柱状图、饼图、三维饼图、玫瑰图、三维玫瑰图、堆叠柱状图、三维堆叠柱状图、环状图。默认为面积图。
  27215. */
  27216. _this.graphType = ThemeGraphType.AREA;
  27217. /**
  27218. * @member {GraphAxesTextDisplayMode} [ThemeGraph.prototype.graphAxesTextDisplayMode=GraphAxesTextDisplayMode.NONE]
  27219. * @description 统计专题图坐标轴文本显示模式。
  27220. */
  27221. _this.graphAxesTextDisplayMode = GraphAxesTextDisplayMode.NONE;
  27222. /**
  27223. * @member {Array.<ThemeGraphItem>} ThemeGraph.prototype.items
  27224. * @description 统计专题图子项集合。
  27225. * 统计专题图可以基于多个变量,反映多种属性,即可以将多个专题变量的值绘制在一个统计图上。每一个专题变量对应的统计图即为一个专题图子项。
  27226. * 对于每个专题图子项可以为其设置标题、风格,甚至可以将该子项再制作成范围分段专题图。
  27227. */
  27228. _this.items = null;
  27229. /**
  27230. * @member {Array.<number>} ThemeGraph.prototype.memoryKeys
  27231. * @description 以内存数组方式制作专题图时的键数组。
  27232. * 键数组内的数值代表 SmID 值,它与 {@link ThemeGraphItem} 类中的值数组({@link ThemeGraphItem#memoryDoubleValues})要关联起来应用。
  27233. * 键数组中数值的个数必须要与值数组的数值个数一致。值数组中的值将代替原来的专题值来制作统计专题图。
  27234. * 目前所有的专题图都支持以内存数组的方式制作专题图,但统计专题图与其他专题图指定内存数组的方式不同,
  27235. * 统计专题图使用 memoryKeys 指定内存数组,而其他专题图则使用 memoryData 来指定内存数组。
  27236. * @example
  27237. * memoryKeys 的使用方法如下:
  27238. * function addThemeGraph() {
  27239. * removeTheme();
  27240. * //创建统计专题图对象,ThemeGraph 必设 items。
  27241. * //专题图参数 ThemeParameters 必设 theme(即以设置好的分段专题图对象)、dataSourceName 和 datasetName
  27242. * var style1 = new ServerStyle({
  27243. * fillForeColor: new ServerColor(92,73,234),
  27244. * lineWidth: 0.1
  27245. * }),
  27246. * style2 = new ServerStyle({
  27247. * fillForeColor: new ServerColor(211,111,240),
  27248. * lineWidth: 0.1
  27249. * }),
  27250. * item1 = new ThemeGraphItem({
  27251. * memoryDoubleValues:[1.18,0.95,0.37,1.31,0.8,1.5],
  27252. * caption: "1992-1995人口增长率",
  27253. * graphExpression: "Pop_Rate95",
  27254. * uniformStyle: style1
  27255. * }),
  27256. * item2 = new ThemeGraphItem({
  27257. * //以内存数组方式制作专题图时的值数组
  27258. * memoryDoubleValues:[2.71,0,0.74,3.1,2.2,3.5],
  27259. * caption: "1995-1999人口增长率", //专题图子项的名称
  27260. * graphExpression: "Pop_Rate99", //统计专题图的专题变量
  27261. * uniformStyle: style2 //统计专题图子项的显示风格
  27262. * }),
  27263. * themeGraph = new ThemeGraph({
  27264. * //以内存数组方式制作专题图时的键数组,键数组内的数值代表 SmID 值
  27265. * memoryKeys:[1,2,4,8,10,12],
  27266. * items: new Array(item1,item2),
  27267. * barWidth: 0.03,
  27268. * //统计图中地理要素的值与图表尺寸间的映射关系为平方根
  27269. * graduatedMode: GraduatedMode.SQUAREROOT,
  27270. * //graphAxes用于设置统计图中坐标轴样式相关信息
  27271. * graphAxes: new ThemeGraphAxes({
  27272. * axesDisplayed: true
  27273. * }),
  27274. * graphSize: new ThemeGraphSize({
  27275. * maxGraphSize: 1,
  27276. * minGraphSize: 0.35
  27277. * }),
  27278. * //统计图上的文字是否可见以及文字标注风格
  27279. * graphText: new ThemeGraphText({
  27280. * graphTextDisplayed: true,
  27281. * graphTextFormat: ThemeGraphTextFormat.VALUE,
  27282. * graphTextStyle: new ServerTextStyle({
  27283. * sizeFixed: true,
  27284. * fontHeight: 9,
  27285. * fontWidth: 5
  27286. * })
  27287. * }),
  27288. * //统计专题图类型为三维柱状图
  27289. * graphType: ThemeGraphType.BAR3D
  27290. * }),
  27291. * //专题图参数对象
  27292. * themeParameters = new ThemeParameters({
  27293. * themes: [themeGraph],
  27294. * dataSourceNames: ["Jingjin"],
  27295. * datasetNames: ["BaseMap_R"]
  27296. * }),
  27297. * //与服务端交互
  27298. * themeService=new ThemeService(url, {
  27299. * eventListeners: {
  27300. * "processCompleted": ThemeCompleted,
  27301. * "processFailed": themeFailed
  27302. * }
  27303. * });
  27304. * themeService.processAsync(themeParameters);
  27305. * }
  27306. */
  27307. _this.memoryKeys = null;
  27308. /**
  27309. * @member {boolean} [ThemeGraph.prototype.negativeDisplayed=false]
  27310. * @description 专题图中是否显示属性为负值的数据。true 表示显示;false 不显示。
  27311. */
  27312. _this.negativeDisplayed = false;
  27313. /**
  27314. * @member {ThemeOffset} ThemeGraph.prototype.offset
  27315. * @description 用于设置统计图相对于要素内点的偏移量。
  27316. */
  27317. _this.offset = new ThemeOffset();
  27318. /**
  27319. * @member {boolean} ThemeGraph.prototype.overlapAvoided
  27320. * @description 统计图是否采用避让方式显示。<br>
  27321. * 1.对数据集制作统计专题图:当统计图采用避让方式显示时,如果 overlapAvoided 为 true,则在统计图重叠度很大的情况下,
  27322. * 会出现无法完全避免统计图重叠的现象;如果 overlapAvoided 为 false,会过滤掉一些统计图,从而保证所有的统计图均不重叠。<br>
  27323. * 2.对数据集同时制作统计专题图和标签专题图:当统计图不显示子项文本时,标签专题图的标签即使和统计图重叠,两者也都可正常显示;
  27324. * 当统计图显示子项文本时,如果统计图中的子项文本和标签专题图中的标签不重叠,则两者均正常显示;如果重叠,则会过滤掉统计图的子项文本,只显示标签。
  27325. */
  27326. _this.overlapAvoided = true;
  27327. /**
  27328. * @member {number} [ThemeGraph.prototype.roseAngle=0]
  27329. * @description 统计图中玫瑰图或三维玫瑰图用于等分的角度,默认为 0 度,精确到 0.1 度。在角度为0或者大于 360 度的情况下均使用 360 度来等分制作统计图的字段数。
  27330. */
  27331. _this.roseAngle = 0;
  27332. /**
  27333. * @member {number} [ThemeGraph.prototype.startAngle=0]
  27334. * @description 饼状统计图扇形的起始角度。精确到 0.1 度,以水平方向为正向。只有选择的统计图类型为饼状图(饼图、三维饼图、玫瑰图、三维玫瑰图)时,此项才可设置。
  27335. */
  27336. _this.startAngle = 0;
  27337. if (options) {
  27338. Util_Util.extend(ThemeGraph_assertThisInitialized(_this), options);
  27339. }
  27340. _this.CLASS_NAME = "SuperMap.ThemeGraph";
  27341. return _this;
  27342. }
  27343. /**
  27344. * @function ThemeGraph.prototype.destroy
  27345. * @override
  27346. */
  27347. ThemeGraph_createClass(ThemeGraph, [{
  27348. key: "destroy",
  27349. value: function destroy() {
  27350. ThemeGraph_get(ThemeGraph_getPrototypeOf(ThemeGraph.prototype), "destroy", this).call(this);
  27351. var me = this;
  27352. me.barWidth = null;
  27353. me.graduatedMode = null;
  27354. if (me.graphAxes) {
  27355. me.graphAxes.destroy();
  27356. me.graphAxes = null;
  27357. }
  27358. if (me.graphSize) {
  27359. me.graphSize.destroy();
  27360. me.graphSize = null;
  27361. }
  27362. me.graphSizeFixed = null;
  27363. if (me.graphText) {
  27364. me.graphText.destroy();
  27365. me.graphText = null;
  27366. }
  27367. me.graphType = null;
  27368. if (me.items) {
  27369. for (var i = 0, items = me.items, len = items.length; i < len; i++) {
  27370. items[i].destroy();
  27371. }
  27372. me.items = null;
  27373. }
  27374. me.memoryKeys = null;
  27375. me.negativeDisplayed = null;
  27376. if (me.offset) {
  27377. me.offset.destroy();
  27378. me.offset = null;
  27379. }
  27380. me.overlapAvoided = null;
  27381. me.roseAngle = null;
  27382. me.startAngle = null;
  27383. me.graphAxesTextDisplayMode = null;
  27384. }
  27385. /**
  27386. * @function ThemeGraph.prototype.toJSON
  27387. * @description 将 ThemeGraph 对象转化为 JSON 字符串。
  27388. * @returns {string} 返回转换后的 JSON 字符串。
  27389. */
  27390. }, {
  27391. key: "toJSON",
  27392. value: function toJSON() {
  27393. return Util_Util.toJSON(this.toServerJSONObject());
  27394. }
  27395. /**
  27396. * @function ThemeGraph.prototype.toServerJSONObject
  27397. * @description 转换成对应的 JSON 格式对象。
  27398. * @returns {Object} 对应的 JSON 格式对象。
  27399. */
  27400. }, {
  27401. key: "toServerJSONObject",
  27402. value: function toServerJSONObject() {
  27403. var obj = {};
  27404. obj.type = this.type;
  27405. if (this.graphText) {
  27406. obj.graphTextDisplayed = this.graphText.graphTextDisplayed;
  27407. obj.graphTextFormat = this.graphText.graphTextFormat;
  27408. obj.graphTextStyle = this.graphText.graphTextStyle;
  27409. }
  27410. if (this.graphAxes) {
  27411. obj.axesColor = this.graphAxes.axesColor;
  27412. obj.axesDisplayed = this.graphAxes.axesDisplayed;
  27413. obj.axesGridDisplayed = this.graphAxes.axesGridDisplayed;
  27414. obj.axesTextDisplayed = this.graphAxes.axesTextDisplayed;
  27415. obj.axesTextStyle = this.graphAxes.axesTextStyle;
  27416. }
  27417. if (this.graphSize) {
  27418. obj.maxGraphSize = this.graphSize.maxGraphSize;
  27419. obj.minGraphSize = this.graphSize.minGraphSize;
  27420. }
  27421. if (this.offset) {
  27422. obj.offsetFixed = this.offset.offsetFixed;
  27423. obj.offsetX = this.offset.offsetX;
  27424. obj.offsetY = this.offset.offsetY;
  27425. }
  27426. obj.barWidth = this.barWidth;
  27427. obj.graduatedMode = this.graduatedMode;
  27428. obj.graphSizeFixed = this.graphSizeFixed;
  27429. obj.graphType = this.graphType;
  27430. obj.graphAxesTextDisplayMode = this.graphAxesTextDisplayMode;
  27431. obj.items = this.items;
  27432. obj.memoryKeys = this.memoryKeys;
  27433. obj.negativeDisplayed = this.negativeDisplayed;
  27434. obj.overlapAvoided = this.overlapAvoided;
  27435. obj.roseAngle = this.roseAngle;
  27436. obj.startAngle = this.startAngle;
  27437. return obj;
  27438. }
  27439. /**
  27440. * @function ThemeGraph.fromObj
  27441. * @description 从传入对象获取统计专题图类。
  27442. * @param {Object} obj - 传入对象。
  27443. * @returns {ThemeGraph} ThemeGraph 对象。
  27444. */
  27445. }], [{
  27446. key: "fromObj",
  27447. value: function fromObj(obj) {
  27448. var res = new ThemeGraph();
  27449. var itemsG = obj.items;
  27450. var len = itemsG ? itemsG.length : 0;
  27451. Util_Util.copy(res, obj);
  27452. res.items = [];
  27453. res.graphAxes = ThemeGraphAxes.fromObj(obj);
  27454. res.graphSize = ThemeGraphSize.fromObj(obj);
  27455. res.graphText = ThemeGraphText.fromObj(obj);
  27456. res.offset = ThemeOffset.fromObj(obj);
  27457. for (var i = 0; i < len; i++) {
  27458. res.items.push(ThemeGraphItem.fromObj(itemsG[i]));
  27459. }
  27460. return res;
  27461. }
  27462. }]);
  27463. return ThemeGraph;
  27464. }(Theme);
  27465. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeDotDensity.js
  27466. function ThemeDotDensity_typeof(obj) { "@babel/helpers - typeof"; return ThemeDotDensity_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, ThemeDotDensity_typeof(obj); }
  27467. function ThemeDotDensity_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  27468. function ThemeDotDensity_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  27469. function ThemeDotDensity_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeDotDensity_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeDotDensity_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  27470. function ThemeDotDensity_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) ThemeDotDensity_setPrototypeOf(subClass, superClass); }
  27471. function ThemeDotDensity_setPrototypeOf(o, p) { ThemeDotDensity_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ThemeDotDensity_setPrototypeOf(o, p); }
  27472. function ThemeDotDensity_createSuper(Derived) { var hasNativeReflectConstruct = ThemeDotDensity_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = ThemeDotDensity_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = ThemeDotDensity_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return ThemeDotDensity_possibleConstructorReturn(this, result); }; }
  27473. function ThemeDotDensity_possibleConstructorReturn(self, call) { if (call && (ThemeDotDensity_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return ThemeDotDensity_assertThisInitialized(self); }
  27474. function ThemeDotDensity_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  27475. function ThemeDotDensity_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  27476. function ThemeDotDensity_getPrototypeOf(o) { ThemeDotDensity_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ThemeDotDensity_getPrototypeOf(o); }
  27477. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  27478. * This program are made available under the terms of the Apache License, Version 2.0
  27479. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  27480. /**
  27481. * @class ThemeDotDensity
  27482. * @deprecatedclass SuperMap.ThemeDotDensity
  27483. * @category iServer Map Theme
  27484. * @classdesc 点密度专题图。点密度专题图用一定大小、形状相同的点表示现象分布范围、数量特征和分布密度。点的多少和所代表的意义由地图的内容确定。
  27485. * 点密度专题图利用图层的某一数值属性信息(专题值)映射为不同等级,每一级别使用不同数量或表现为密度的点符号来表示。
  27486. * 该专题值在各个分区内的分布情况,体现不同区域的相对数量差异。多用于具有数量特征的地图上,
  27487. * 比如表示不同地区的粮食产量、GDP、人口等的分级,主要针对区域或面状的要素,因而,点密度专题图适用于面数据集。
  27488. * 注意:点密度专题图中点的分布是随机的,并不代表实际的分布位置。即使在相关设置完全相同的情况下,
  27489. * 每次制作出的专题图,点的数量相同,但点的位置都有差异。
  27490. * @extends {CommonTheme}
  27491. * @param {Object} options - 参数。
  27492. * @param {string} options.dotExpression - 创建点密度专题图的字段或字段表达式。
  27493. * @param {ServerStyle} [options.style] - 点密度专题图中点的风格。
  27494. * @param {number} [options.value] - 专题图中每一个点所代表的数值。
  27495. * @param {ThemeMemoryData} [options.memoryData] - 专题图内存数据。
  27496. * @usage
  27497. */
  27498. var ThemeDotDensity = /*#__PURE__*/function (_Theme) {
  27499. ThemeDotDensity_inherits(ThemeDotDensity, _Theme);
  27500. var _super = ThemeDotDensity_createSuper(ThemeDotDensity);
  27501. function ThemeDotDensity(options) {
  27502. var _this;
  27503. ThemeDotDensity_classCallCheck(this, ThemeDotDensity);
  27504. _this = _super.call(this, "DOTDENSITY", options);
  27505. /**
  27506. * @member {string} ThemeDotDensity.prototype.dotExpression
  27507. * @description 创建点密度专题图的字段或字段表达式。点的数目或密集程度的来源。
  27508. */
  27509. _this.dotExpression = null;
  27510. /**
  27511. * @member {ServerStyle} ThemeDotDensity.prototype.style
  27512. * @description 点密度专题图中点的风格。
  27513. */
  27514. _this.style = new ServerStyle();
  27515. /**
  27516. * @member {number} ThemeDotDensity.prototype.value
  27517. * @description 专题图中每一个点所代表的数值。<br>
  27518. * 点值的确定与地图比例尺以及点的大小有关。地图比例尺越大,相应的图面范围也越大,
  27519. * 点相应就可以越多,此时点值就可以设置相对小一些。点形状越大,
  27520. * 点值相应就应该设置的小一些。点值过大或过小都是不合适的。
  27521. */
  27522. _this.value = null;
  27523. if (options) {
  27524. Util_Util.extend(ThemeDotDensity_assertThisInitialized(_this), options);
  27525. }
  27526. _this.CLASS_NAME = "SuperMap.ThemeDotDensity";
  27527. return _this;
  27528. }
  27529. /**
  27530. * @function ThemeDotDensity.prototype.destroy
  27531. * @description 释放资源,将引用资源的属性置空。
  27532. */
  27533. ThemeDotDensity_createClass(ThemeDotDensity, [{
  27534. key: "destroy",
  27535. value: function destroy() {
  27536. var me = this;
  27537. me.dotExpression = null;
  27538. me.value = null;
  27539. if (me.style) {
  27540. me.style.destroy();
  27541. me.style = null;
  27542. }
  27543. }
  27544. /**
  27545. * @function ThemeDotDensity.prototype.toServerJSONObject
  27546. * @description 转换成对应的 JSON 格式对象。
  27547. * @returns {Object} 对应的 JSON 格式对象。
  27548. */
  27549. }, {
  27550. key: "toServerJSONObject",
  27551. value: function toServerJSONObject() {
  27552. var obj = {};
  27553. obj = Util_Util.copyAttributes(obj, this);
  27554. if (obj.style) {
  27555. if (obj.style.toServerJSONObject) {
  27556. obj.style = obj.style.toServerJSONObject();
  27557. }
  27558. }
  27559. return obj;
  27560. }
  27561. /**
  27562. * @function ThemeDotDensity.fromObj
  27563. * @description 从传入对象获取点密度专题图中点的风格。
  27564. * @param {Object} obj - 传入对象。
  27565. * @returns {ThemeDotDensity} ThemeDotDensity 对象。
  27566. */
  27567. }], [{
  27568. key: "fromObj",
  27569. value: function fromObj(obj) {
  27570. if (!obj) {
  27571. return;
  27572. }
  27573. var res = new ThemeDotDensity();
  27574. Util_Util.copy(res, obj);
  27575. res.style = ServerStyle.fromJson(obj.style);
  27576. return res;
  27577. }
  27578. }]);
  27579. return ThemeDotDensity;
  27580. }(Theme);
  27581. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeGraduatedSymbolStyle.js
  27582. function ThemeGraduatedSymbolStyle_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  27583. function ThemeGraduatedSymbolStyle_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  27584. function ThemeGraduatedSymbolStyle_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeGraduatedSymbolStyle_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeGraduatedSymbolStyle_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  27585. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  27586. * This program are made available under the terms of the Apache License, Version 2.0
  27587. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  27588. /**
  27589. * @class ThemeGraduatedSymbolStyle
  27590. * @deprecatedclass SuperMap.ThemeGraduatedSymbolStyle
  27591. * @category iServer Map Theme
  27592. * @classdesc 等级符号专题图正负零值显示风格类。
  27593. * @param {Object} options - 参数。
  27594. * @param {boolean} [options.negativeDisplayed=false] - 是否显示负值。
  27595. * @param {ServerStyle} [options.negativeStyle] - 负值的等级符号风格。
  27596. * @param {ServerStyle} [options.positiveStyle] - 正值的等级符号风格。
  27597. * @param {boolean} [options.zeroDisplayed=false] - 是否显示 0 值。
  27598. * @param {ServerStyle} [options.zeroStyle] - 0 值的等级符号风格。
  27599. * @usage
  27600. */
  27601. var ThemeGraduatedSymbolStyle = /*#__PURE__*/function () {
  27602. function ThemeGraduatedSymbolStyle(options) {
  27603. ThemeGraduatedSymbolStyle_classCallCheck(this, ThemeGraduatedSymbolStyle);
  27604. /**
  27605. * @member {boolean} [ThemeGraduatedSymbolStyle.prototype.negativeDisplayed=false]
  27606. * @description 是否显示负值。
  27607. */
  27608. this.negativeDisplayed = false;
  27609. /**
  27610. * @member {ServerStyle} [ThemeGraduatedSymbolStyle.prototype.negativeStyle]
  27611. * @description 负值的等级符号风格。
  27612. */
  27613. this.negativeStyle = new ServerStyle();
  27614. /**
  27615. * @member {ServerStyle} [ThemeGraduatedSymbolStyle.prototype.positiveStyle]
  27616. * @description 正值的等级符号风格。
  27617. */
  27618. this.positiveStyle = new ServerStyle();
  27619. /**
  27620. * @member {boolean} [ThemeGraduatedSymbolStyle.prototype.zeroDisplayed=false]
  27621. * @description 是否显示 0 值。
  27622. */
  27623. this.zeroDisplayed = false;
  27624. /**
  27625. * @member {ServerStyle} ThemeGraduatedSymbolStyle.prototype.zeroStyle
  27626. * @description 0 值的等级符号风格。
  27627. */
  27628. this.zeroStyle = new ServerStyle();
  27629. if (options) {
  27630. Util_Util.extend(this, options);
  27631. }
  27632. this.CLASS_NAME = "SuperMap.ThemeGraduatedSymbolStyle";
  27633. }
  27634. /**
  27635. * @function ThemeGraduatedSymbolStyle.prototype.destroy
  27636. * @description 释放资源,将引用资源的属性置空。
  27637. */
  27638. ThemeGraduatedSymbolStyle_createClass(ThemeGraduatedSymbolStyle, [{
  27639. key: "destroy",
  27640. value: function destroy() {
  27641. var me = this;
  27642. me.negativeDisplayed = null;
  27643. me.negativeStyle = null;
  27644. me.positiveStyle = null;
  27645. me.zeroDisplayed = null;
  27646. me.zeroStyle = null;
  27647. }
  27648. /**
  27649. * @function ThemeGraduatedSymbolStyle.fromObj
  27650. * @description 从传入对象获取等级符号专题图正负零值显示风格类。
  27651. * @param {Object} obj - 传入对象。
  27652. * @returns {ThemeGraduatedSymbolStyle} ThemeGraduatedSymbolStyle 对象。
  27653. */
  27654. }], [{
  27655. key: "fromObj",
  27656. value: function fromObj(obj) {
  27657. if (!obj) {
  27658. return;
  27659. }
  27660. var res = new ThemeGraduatedSymbolStyle();
  27661. Util_Util.copy(res, obj);
  27662. res.negativeStyle = ServerStyle.fromJson(obj.negativeStyle);
  27663. res.positiveStyle = ServerStyle.fromJson(obj.positiveStyle);
  27664. res.zeroStyle = ServerStyle.fromJson(obj.zeroStyle);
  27665. return res;
  27666. }
  27667. }]);
  27668. return ThemeGraduatedSymbolStyle;
  27669. }();
  27670. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeGraduatedSymbol.js
  27671. function ThemeGraduatedSymbol_typeof(obj) { "@babel/helpers - typeof"; return ThemeGraduatedSymbol_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, ThemeGraduatedSymbol_typeof(obj); }
  27672. function ThemeGraduatedSymbol_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  27673. function ThemeGraduatedSymbol_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  27674. function ThemeGraduatedSymbol_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeGraduatedSymbol_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeGraduatedSymbol_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  27675. function ThemeGraduatedSymbol_get() { if (typeof Reflect !== "undefined" && Reflect.get) { ThemeGraduatedSymbol_get = Reflect.get.bind(); } else { ThemeGraduatedSymbol_get = function _get(target, property, receiver) { var base = ThemeGraduatedSymbol_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return ThemeGraduatedSymbol_get.apply(this, arguments); }
  27676. function ThemeGraduatedSymbol_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ThemeGraduatedSymbol_getPrototypeOf(object); if (object === null) break; } return object; }
  27677. function ThemeGraduatedSymbol_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) ThemeGraduatedSymbol_setPrototypeOf(subClass, superClass); }
  27678. function ThemeGraduatedSymbol_setPrototypeOf(o, p) { ThemeGraduatedSymbol_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ThemeGraduatedSymbol_setPrototypeOf(o, p); }
  27679. function ThemeGraduatedSymbol_createSuper(Derived) { var hasNativeReflectConstruct = ThemeGraduatedSymbol_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = ThemeGraduatedSymbol_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = ThemeGraduatedSymbol_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return ThemeGraduatedSymbol_possibleConstructorReturn(this, result); }; }
  27680. function ThemeGraduatedSymbol_possibleConstructorReturn(self, call) { if (call && (ThemeGraduatedSymbol_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return ThemeGraduatedSymbol_assertThisInitialized(self); }
  27681. function ThemeGraduatedSymbol_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  27682. function ThemeGraduatedSymbol_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  27683. function ThemeGraduatedSymbol_getPrototypeOf(o) { ThemeGraduatedSymbol_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ThemeGraduatedSymbol_getPrototypeOf(o); }
  27684. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  27685. * This program are made available under the terms of the Apache License, Version 2.0
  27686. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  27687. /**
  27688. * @class ThemeGraduatedSymbol
  27689. * @deprecatedclass SuperMap.ThemeGraduatedSymbol
  27690. * @category iServer Map Theme
  27691. * @classdesc 等级符号专题图。
  27692. * @extends {CommonTheme}
  27693. * @param {Object} options - 参数。
  27694. * @param {ThemeGraduatedSymbolStyle} options.style - 等级符号专题图正负零值显示风格类。
  27695. * @param {string} options.expression - 等级符号专题图的字段或字段表达式。
  27696. * @param {number} [options.baseValue=0] - 等级符号专题图的基准值,单位同专题变量的单位。
  27697. * @param {GraduatedMode} [options.graduatedMode=GraduatedMode.CONSTANT] - 等级符号专题图分级模式。
  27698. * @param {ThemeOffset} [options.offset] - 指定等级符号专题图中标记文本相对于要素内点的偏移量对象。
  27699. * @param {ThemeMemoryData} [options.memoryData] - 专题图内存数据。
  27700. * @usage
  27701. */
  27702. var ThemeGraduatedSymbol = /*#__PURE__*/function (_Theme) {
  27703. ThemeGraduatedSymbol_inherits(ThemeGraduatedSymbol, _Theme);
  27704. var _super = ThemeGraduatedSymbol_createSuper(ThemeGraduatedSymbol);
  27705. function ThemeGraduatedSymbol(options) {
  27706. var _this;
  27707. ThemeGraduatedSymbol_classCallCheck(this, ThemeGraduatedSymbol);
  27708. _this = _super.call(this, "GRADUATEDSYMBOL", options);
  27709. /**
  27710. * @member {number} [ThemeGraduatedSymbol.prototype.baseValue=0]
  27711. * @description 等级符号专题图的基准值,单位同专题变量的单位。<br>
  27712. * 依据此值系统会自动根据分级方式计算其余值对应的符号大小,每个符号的显示大小等于
  27713. * ThemeValueSection.positiveStyle(或 zeroStyle,negativeStyle).markerSize * value / basevalue,
  27714. * 其中 value 是 expression 所指定字段对应的值经过分级计算之后的值。默认值为0,建议通过多次尝试设置该值才能达到较好的显示效果。
  27715. */
  27716. _this.baseValue = 0;
  27717. /**
  27718. * @member {string} ThemeGraduatedSymbol.prototype.expression
  27719. * @description 用于创建等级符号专题图的字段或字段表达式,字段或字段表达式应为数值型。
  27720. */
  27721. _this.expression = null;
  27722. /**
  27723. * @member {GraduatedMode} [ThemeGraduatedSymbol.prototype.graduatedMode=GraduatedMode.CONSTANT]
  27724. * @description 等级符号专题图分级模式。<br>
  27725. * 分级主要是为了减少制作等级符号专题图中数据大小之间的差异。如果数据之间差距较大,则可以采用对数或者平方根的分级方式来进行,
  27726. * 这样就减少了数据之间的绝对大小的差异,使得等级符号图的视觉效果比较好,同时不同类别之间的比较也是有意义的。
  27727. * 有三种分级模式:常数、对数和平方根,对于有值为负数的字段,在用对数或平方根方式分级时,默认对负数取正。
  27728. * 不同的分级模式用于确定符号大小的数值是不相同的:常数按照字段的原始数据进行;对数则是对每条记录对应的专题变量取自然对数;
  27729. * 平方根则是对其取平方根,然后用最终得到的结果来确定其等级符号的大小。
  27730. */
  27731. _this.graduatedMode = GraduatedMode.CONSTAN;
  27732. /**
  27733. * @member {ThemeOffset} [ThemeGraduatedSymbol.prototype.offset]
  27734. * @description 用于设置等级符号图相对于要素内点的偏移量。
  27735. */
  27736. _this.offset = new ThemeOffset();
  27737. /**
  27738. * @member {ThemeGraduatedSymbolStyle} ThemeGraduatedSymbol.prototype.style
  27739. * @description 用于设置等级符号图正负和零值显示风格。
  27740. */
  27741. _this.style = new ThemeGraduatedSymbolStyle();
  27742. if (options) {
  27743. Util_Util.extend(ThemeGraduatedSymbol_assertThisInitialized(_this), options);
  27744. }
  27745. _this.CLASS_NAME = "SuperMap.ThemeGraduatedSymbol";
  27746. return _this;
  27747. }
  27748. /**
  27749. * @function ThemeGraduatedSymbol.prototype.destroy
  27750. * @description 释放资源,将引用资源的属性置空。
  27751. */
  27752. ThemeGraduatedSymbol_createClass(ThemeGraduatedSymbol, [{
  27753. key: "destroy",
  27754. value: function destroy() {
  27755. ThemeGraduatedSymbol_get(ThemeGraduatedSymbol_getPrototypeOf(ThemeGraduatedSymbol.prototype), "destroy", this).call(this);
  27756. var me = this;
  27757. me.expression = null;
  27758. me.graduatedMode = GraduatedMode.CONSTANT;
  27759. if (me.offset) {
  27760. me.offset.destroy();
  27761. me.offset = null;
  27762. }
  27763. if (me.style) {
  27764. me.style.destroy();
  27765. me.style = null;
  27766. }
  27767. }
  27768. /**
  27769. * @function ThemeGraduatedSymbol.prototype.toJSON
  27770. * @description 将 themeLabel 对象转化为 JSON 字符串。
  27771. * @returns {string} 返回转换后的 JSON 字符串。
  27772. */
  27773. }, {
  27774. key: "toJSON",
  27775. value: function toJSON() {
  27776. return Util_Util.toJSON(this.toServerJSONObject());
  27777. }
  27778. /**
  27779. * @function ThemeGraduatedSymbol.prototype.toServerJSONObject
  27780. * @description 转换成对应的 JSON 格式对象。
  27781. * @returns {Object} 对应的 JSON 格式对象。
  27782. */
  27783. }, {
  27784. key: "toServerJSONObject",
  27785. value: function toServerJSONObject() {
  27786. var obj = {};
  27787. obj.type = this.type;
  27788. obj.memoryData = this.memoryData;
  27789. obj.baseValue = this.baseValue;
  27790. obj.expression = this.expression;
  27791. obj.graduatedMode = this.graduatedMode;
  27792. if (this.offset) {
  27793. obj.offsetFixed = this.offset.offsetFixed;
  27794. obj.offsetX = this.offset.offsetX;
  27795. obj.offsetY = this.offset.offsetY;
  27796. }
  27797. if (this.style) {
  27798. obj.negativeStyle = this.style.negativeStyle;
  27799. obj.negativeDisplayed = this.style.negativeDisplayed;
  27800. obj.positiveStyle = this.style.positiveStyle;
  27801. obj.zeroDisplayed = this.style.zeroDisplayed;
  27802. obj.zeroStyle = this.style.zeroStyle;
  27803. }
  27804. return obj;
  27805. }
  27806. /**
  27807. * @function ThemeGraduatedSymbol.fromObj
  27808. * @description 从传入对象获取等级符号专题图。
  27809. * @param {Object} obj - 传入对象。
  27810. * @returns {ThemeGraduatedSymbol} 等级符号专题图对象。
  27811. */
  27812. }], [{
  27813. key: "fromObj",
  27814. value: function fromObj(obj) {
  27815. if (!obj) {
  27816. return;
  27817. }
  27818. var res = new ThemeGraduatedSymbol();
  27819. Util_Util.copy(res, obj);
  27820. res.offset = ThemeOffset.fromObj(obj);
  27821. res.style = ThemeGraduatedSymbolStyle.fromObj(obj);
  27822. return res;
  27823. }
  27824. }]);
  27825. return ThemeGraduatedSymbol;
  27826. }(Theme);
  27827. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeRangeItem.js
  27828. function ThemeRangeItem_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  27829. function ThemeRangeItem_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  27830. function ThemeRangeItem_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeRangeItem_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeRangeItem_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  27831. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  27832. * This program are made available under the terms of the Apache License, Version 2.0
  27833. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  27834. /**
  27835. * @class ThemeRangeItem
  27836. * @deprecatedclass SuperMap.ThemeRangeItem
  27837. * @category iServer Map Theme
  27838. * @classdesc 范围分段专题图子项类。在分段专题图中,字段值按照某种分段模式被分成多个范围段,
  27839. * 每个范围段即为一个子项,同一范围段的要素属于同一个分段专题图子项。
  27840. * 每个子项都有其分段起始值、终止值、名称和风格等。每个分段所表示的范围为[start, end)。
  27841. * @param {Object} options - 参数。
  27842. * @param {string} [options.caption] - 子项的标题。
  27843. * @param {number} [options.end=0] - 子项的终止值。
  27844. * @param {number} [options.start=0] - 子项的起始值。
  27845. * @param {ServerStyle} options.style - 子项的风格。
  27846. * @param {boolean} [options.visible=true] - 子项是否可见。
  27847. * @usage
  27848. */
  27849. var ThemeRangeItem = /*#__PURE__*/function () {
  27850. function ThemeRangeItem(options) {
  27851. ThemeRangeItem_classCallCheck(this, ThemeRangeItem);
  27852. /**
  27853. * @member {string} [ThemeRangeItem.prototype.caption]
  27854. * @description 分段专题图子项的标题。
  27855. */
  27856. this.caption = null;
  27857. /**
  27858. * @member {number} [ThemeRangeItem.prototype.end=0]
  27859. * @description 分段专题图子项的终止值,即该段专题值范围的最大值。<br>
  27860. * 如果该子项是分段中最后一个子项,则该终止值应大于分段字段(ThemeRange 类的 rangeExpression 属性)的最大值,若该终止值小于分段字段最大值,
  27861. * 则剩余部分由内部随机定义其颜色;如果不是最后一项,该终止值必须与其下一子项的起始值相同,否则系统抛出异常;
  27862. * 如果设置了范围分段模式和分段数,则会自动计算每段的范围 [start, end),故无需设置 [start, end);当然可以设置,那么结果就会按您设置的值对分段结果进行调整。
  27863. */
  27864. this.end = 0;
  27865. /**
  27866. * @member {number} [ThemeRangeItem.prototype.start=0]
  27867. * @description 分段专题图子项的起始值,即该段专题值范围的最小值。<br>
  27868. * 如果该子项是分段中第一个子项,那么该起始值就是分段的最小值;如果子项的序号大于等于 1 的时候,该起始值必须与前一子项的终止值相同,否则系统会抛出异常。
  27869. * 如果设置了范围分段模式和分段数,则会自动计算每段的范围 [start, end),故无需设置 [start, end);当然可以设置,那么结果就会按您设置的值对分段结果进行调整。
  27870. */
  27871. this.start = 0;
  27872. /**
  27873. * @member {ServerStyle} ThemeRangeItem.prototype.style
  27874. * @description 分段专题图子项的风格。
  27875. * 每一个分段专题图子项都对应一种显示风格。
  27876. */
  27877. this.style = new ServerStyle();
  27878. /**
  27879. * @member {boolean} [ThemeRangeItem.prototype.visible=true]
  27880. * @description 分段专题图子项是否可见。
  27881. */
  27882. this.visible = true;
  27883. if (options) {
  27884. Util_Util.extend(this, options);
  27885. }
  27886. this.CLASS_NAME = "SuperMap.ThemeRangeItem";
  27887. }
  27888. /**
  27889. * @function ThemeRangeItem.prototype.destroy
  27890. * @description 释放资源,将引用资源的属性置空。
  27891. */
  27892. ThemeRangeItem_createClass(ThemeRangeItem, [{
  27893. key: "destroy",
  27894. value: function destroy() {
  27895. var me = this;
  27896. me.caption = null;
  27897. me.end = null;
  27898. me.start = null;
  27899. if (me.style) {
  27900. me.style.destroy();
  27901. me.style = null;
  27902. }
  27903. me.visible = null;
  27904. }
  27905. /**
  27906. * @function ThemeRangeItem.prototypetoServerJSONObject
  27907. * @description 转换成对应的 JSON 格式对象。
  27908. * @returns {Object} 对应的 JSON 格式对象。
  27909. */
  27910. }, {
  27911. key: "toServerJSONObject",
  27912. value: function toServerJSONObject() {
  27913. var obj = {};
  27914. obj = Util_Util.copyAttributes(obj, this);
  27915. if (obj.style) {
  27916. if (obj.style.toServerJSONObject) {
  27917. obj.style = obj.style.toServerJSONObject();
  27918. }
  27919. }
  27920. return obj;
  27921. }
  27922. /**
  27923. * @function ThemeRangeItem.fromObj
  27924. * @description 从传入对象获取范围分段专题图子项类。
  27925. * @param {Object} obj - 传入对象。
  27926. * @returns {ThemeRangeItem} ThemeRangeItem 对象。
  27927. */
  27928. }], [{
  27929. key: "fromObj",
  27930. value: function fromObj(obj) {
  27931. if (!obj) {
  27932. return;
  27933. }
  27934. var res = new ThemeRangeItem();
  27935. Util_Util.copy(res, obj);
  27936. res.style = ServerStyle.fromJson(obj.style);
  27937. return res;
  27938. }
  27939. }]);
  27940. return ThemeRangeItem;
  27941. }();
  27942. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeRange.js
  27943. function ThemeRange_typeof(obj) { "@babel/helpers - typeof"; return ThemeRange_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, ThemeRange_typeof(obj); }
  27944. function ThemeRange_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  27945. function ThemeRange_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  27946. function ThemeRange_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeRange_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeRange_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  27947. function ThemeRange_get() { if (typeof Reflect !== "undefined" && Reflect.get) { ThemeRange_get = Reflect.get.bind(); } else { ThemeRange_get = function _get(target, property, receiver) { var base = ThemeRange_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return ThemeRange_get.apply(this, arguments); }
  27948. function ThemeRange_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ThemeRange_getPrototypeOf(object); if (object === null) break; } return object; }
  27949. function ThemeRange_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) ThemeRange_setPrototypeOf(subClass, superClass); }
  27950. function ThemeRange_setPrototypeOf(o, p) { ThemeRange_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ThemeRange_setPrototypeOf(o, p); }
  27951. function ThemeRange_createSuper(Derived) { var hasNativeReflectConstruct = ThemeRange_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = ThemeRange_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = ThemeRange_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return ThemeRange_possibleConstructorReturn(this, result); }; }
  27952. function ThemeRange_possibleConstructorReturn(self, call) { if (call && (ThemeRange_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return ThemeRange_assertThisInitialized(self); }
  27953. function ThemeRange_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  27954. function ThemeRange_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  27955. function ThemeRange_getPrototypeOf(o) { ThemeRange_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ThemeRange_getPrototypeOf(o); }
  27956. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  27957. * This program are made available under the terms of the Apache License, Version 2.0
  27958. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  27959. /**
  27960. * @class ThemeRange
  27961. * @deprecatedclass SuperMap.ThemeRange
  27962. * @category iServer Map Theme
  27963. * @classdesc 范围分段专题图。
  27964. * 范围分段专题图是按照指定的分段方法(如:等距离分段法)对字段的属性值进行分段,使用不同的颜色或符号(线型、填充)表示不同范围段落的属性值在整体上的分布情况,体现区域的差异。
  27965. * 在分段专题图中,专题值按照某种分段方式被分成多个范围段,要素根据各自的专题值被分配到其中一个范围段中,在同一个范围段中的要素使用相同的颜色,填充,符号等风格进行显示。
  27966. * 分段专题图所基于的专题变量必须为数值型,分段专题图一般用来反映连续分布现象的数量或程度特征,如降水量的分布,土壤侵蚀强度的分布等。
  27967. * @extends {CommonTheme}
  27968. * @param {Object} options - 参数。
  27969. * @param {Array.<ThemeRangeItem>} options.items - 子项数组。
  27970. * @param {string} options.rangeExpression - 分段字段表达式。
  27971. * @param {number} options.rangeParameter - 分段参数。
  27972. * @param {RangeMode} [options.rangeMode=RangeMode.EQUALINTERVAL] - 分段模式。
  27973. * @param {ColorGradientType} [options.colorGradientType=ColorGradientType.YELLOW_RED] - 渐变颜色枚举类。
  27974. * @param {ThemeMemoryData} [options.memoryData] - 专题图内存数据。
  27975. * @usage
  27976. */
  27977. var ThemeRange = /*#__PURE__*/function (_Theme) {
  27978. ThemeRange_inherits(ThemeRange, _Theme);
  27979. var _super = ThemeRange_createSuper(ThemeRange);
  27980. function ThemeRange(options) {
  27981. var _this;
  27982. ThemeRange_classCallCheck(this, ThemeRange);
  27983. _this = _super.call(this, "RANGE", options);
  27984. /**
  27985. * @member {string} ThemeRange.prototype.precision
  27986. * @description 精准度。
  27987. */
  27988. _this.precision = '1.0E-12';
  27989. /**
  27990. * @member {Array.<ThemeRangeItem>} ThemeRange.prototype.items
  27991. * @description 分段专题图子项数组。<br>
  27992. * 在分段专题图中,字段值按照某种分段模式被分成多个范围段,每个范围段即为一个子项,同一范围段的要素属于同一个分段专题图子项。
  27993. * 每个子项都有其分段起始值、终止值、名称和风格等。每个分段所表示的范围为 [start, end)。
  27994. * 如果设置了范围分段模式和分段数,则会自动计算每段的范围 [start, end),故无需设置 [start, end);当然可以设置,那么结果就会按照您设置的值对分段结果进行调整。
  27995. */
  27996. _this.items = null;
  27997. /**
  27998. * @member {string} ThemeRange.prototype.rangeExpression
  27999. * @description 分段字段表达式。<br>
  28000. * 由于范围分段专题图基于各种分段方法根据一定的距离进行分段,因而范围分段专题图所基于的字段值的数据类型必须为数值型。对于字段表达式,只能为数值型的字段间的运算。
  28001. */
  28002. _this.rangeExpression = null;
  28003. /**
  28004. * @member {RangeMode} [ThemeRange.prototype.rangeMode=RangeMode.EQUALINTERVAL]
  28005. * @description 分段专题图的分段模式。<br>
  28006. * 在分段专题图中,作为专题变量的字段或表达式的值按照某种分段方式被分成多个范围段。
  28007. * 目前 SuperMap 提供的分段方式包括:等距离分段法、平方根分段法、标准差分段法、对数分段法、等计数分段法和自定义距离法,
  28008. * 显然这些分段方法根据一定的距离进行分段,因而范围分段专题图所基于的专题变量必须为数值型。
  28009. */
  28010. _this.rangeMode = RangeMode.EQUALINTERVAL;
  28011. /**
  28012. * @member {number} ThemeRange.prototype.rangeParameter
  28013. * @description 分段参数。
  28014. * 当分段模式为等距离分段法,平方根分段,对数分段法,等计数分段法其中一种模式时,该参数用于设置分段个数;当分段模式为标准差分段法时,
  28015. * 该参数不起作用;当分段模式为自定义距离时,该参数用于设置自定义距离。
  28016. */
  28017. _this.rangeParameter = 0;
  28018. /**
  28019. * @member {ColorGradientType} [ThemeRange.prototype.colorGradientType=ColorGradientType.YELLOW_RED]
  28020. * @description 渐变颜色枚举类。<br>
  28021. * 渐变色是由起始色根据一定算法逐渐过渡到终止色的一种混合型颜色。
  28022. * 该类作为单值专题图参数类、分段专题图参数类的属性,负责设置单值专题图、分段专题图的配色方案,在默认情况下专题图所有子项会根据这个配色方案完成填充。但如果为某几个子项的风格进行单独设置后(设置了 {@link ThemeUniqueItem} 或 {@link ThemeRangeItem} 类中Style属性),
  28023. * 该配色方案对于这几个子项将不起作用。
  28024. */
  28025. _this.colorGradientType = ColorGradientType.YELLOW_RED;
  28026. if (options) {
  28027. Util_Util.extend(ThemeRange_assertThisInitialized(_this), options);
  28028. }
  28029. _this.CLASS_NAME = "SuperMap.ThemeRange";
  28030. return _this;
  28031. }
  28032. /**
  28033. * @function ThemeRange.prototype.destroy
  28034. * @override
  28035. */
  28036. ThemeRange_createClass(ThemeRange, [{
  28037. key: "destroy",
  28038. value: function destroy() {
  28039. ThemeRange_get(ThemeRange_getPrototypeOf(ThemeRange.prototype), "destroy", this).call(this);
  28040. var me = this;
  28041. if (me.items) {
  28042. if (me.items.length > 0) {
  28043. for (var item in me.items) {
  28044. me.items[item].destroy();
  28045. me.items[item] = null;
  28046. }
  28047. }
  28048. me.items = null;
  28049. }
  28050. me.rangeExpression = null;
  28051. me.rangeMode = null;
  28052. me.rangeParameter = null;
  28053. me.colorGradientType = null;
  28054. }
  28055. /**
  28056. * @function ThemeRange.fromObj
  28057. * @description 从传入对象获取范围分段专题图类。
  28058. * @param {Object} obj - 传入对象。
  28059. * @returns {ThemeRange} ThemeRange 对象。
  28060. */
  28061. }], [{
  28062. key: "fromObj",
  28063. value: function fromObj(obj) {
  28064. if (!obj) {
  28065. return;
  28066. }
  28067. var res = new ThemeRange();
  28068. Util_Util.copy(res, obj);
  28069. var itemsR = obj.items;
  28070. var len = itemsR ? itemsR.length : 0;
  28071. res.items = [];
  28072. for (var i = 0; i < len; i++) {
  28073. res.items.push(ThemeRangeItem.fromObj(itemsR[i]));
  28074. }
  28075. return res;
  28076. }
  28077. }]);
  28078. return ThemeRange;
  28079. }(Theme);
  28080. ;// CONCATENATED MODULE: ./src/common/iServer/UGCLayer.js
  28081. function UGCLayer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  28082. function UGCLayer_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  28083. function UGCLayer_createClass(Constructor, protoProps, staticProps) { if (protoProps) UGCLayer_defineProperties(Constructor.prototype, protoProps); if (staticProps) UGCLayer_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  28084. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  28085. * This program are made available under the terms of the Apache License, Version 2.0
  28086. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  28087. /**
  28088. * @class UGCLayer
  28089. * @deprecatedclass SuperMap.UGCLayer
  28090. * @category iServer Map Layer
  28091. * @classdesc SuperMap 图层类。
  28092. * @param {Object} options - 参数。
  28093. * @param {Bounds} options.bounds - 图层范围。
  28094. * @param {string} options.name - 图层的名称。
  28095. * @param {UGCLayerType} options.type - 图层类型。
  28096. * @param {string} [options.caption] - 图层的标题。
  28097. * @param {string} [options.description] - 图层的描述信息。
  28098. * @param {boolean} [options.queryable] - 图层中的对象是否可以查询。
  28099. * @param {boolean} [options.subUGCLayers] - 是否允许图层的符号大小随图缩放。
  28100. * @param {boolean} [options.visible=false] - 地图对象在同一范围内时,是否重叠显示。
  28101. * @usage
  28102. */
  28103. var UGCLayer = /*#__PURE__*/function () {
  28104. function UGCLayer(options) {
  28105. UGCLayer_classCallCheck(this, UGCLayer);
  28106. options = options || {};
  28107. /**
  28108. * @member {Bounds} UGCLayer.prototype.bounds
  28109. * @description 图层范围。
  28110. */
  28111. this.bounds = null;
  28112. /**
  28113. * @member {string} [UGCLayer.prototype.caption]
  28114. * @description 图层的标题。默认情况下图层的标题与图层的名称一致。在图例、图层控制列表中显示的图层名称就是该图层的标题值。
  28115. */
  28116. this.caption = null;
  28117. /**
  28118. * @member {string} UGCLayer.prototype.description
  28119. * @description 图层的描述信息。
  28120. */
  28121. this.description = null;
  28122. /**
  28123. * @member {string} UGCLayer.prototype.name
  28124. * @description 图层的名称。图层的名称在图层所在的地图中唯一标识此图层。该属性区分大小写。
  28125. */
  28126. this.name = null;
  28127. /**
  28128. * @member {boolean} UGCLayer.prototype.queryable
  28129. * @description 图层中的对象是否可以查询。
  28130. */
  28131. this.queryable = null;
  28132. /**
  28133. * @member {Array} UGCLayer.prototype.subLayers
  28134. * @description 子图层集。
  28135. */
  28136. this.subLayers = null;
  28137. /**
  28138. * @member {UGCLayerType} UGCLayer.prototype.type
  28139. * @description 图层类型。
  28140. */
  28141. this.type = null;
  28142. /**
  28143. * @member {boolean} UGCLayer.prototype.visible
  28144. * @description 地图对象在同一范围内时,是否重叠显示。
  28145. */
  28146. this.visible = null;
  28147. Util_Util.extend(this, options);
  28148. this.CLASS_NAME = "SuperMap.UGCLayer";
  28149. }
  28150. /**
  28151. * @function UGCLayer.prototype.destroy
  28152. * @description 释放资源,将引用资源的属性置空。
  28153. */
  28154. UGCLayer_createClass(UGCLayer, [{
  28155. key: "destroy",
  28156. value: function destroy() {
  28157. var me = this;
  28158. Util_Util.reset(me);
  28159. }
  28160. /**
  28161. * @function UGCLayer.prototype.fromJson
  28162. * @description 将服务端 JSON 对象转换成当前客户端对象。
  28163. * @param {Object} jsonObject - 要转换的 JSON 对象。
  28164. */
  28165. }, {
  28166. key: "fromJson",
  28167. value: function fromJson(jsonObject) {
  28168. jsonObject = jsonObject ? jsonObject : {};
  28169. Util_Util.extend(this, jsonObject);
  28170. var b = this.bounds;
  28171. if (b) {
  28172. this.bounds = new Bounds(b.leftBottom.x, b.leftBottom.y, b.rightTop.x, b.rightTop.y);
  28173. }
  28174. }
  28175. /**
  28176. * @function UGCLayer.prototype.toServerJSONObject
  28177. * @description 转换成对应的 JSON 格式对象。
  28178. * @returns {Object} 对应的 JSON 格式对象。
  28179. */
  28180. }, {
  28181. key: "toServerJSONObject",
  28182. value: function toServerJSONObject() {
  28183. var jsonObject = {};
  28184. jsonObject = Util_Util.copyAttributes(jsonObject, this);
  28185. if (jsonObject.bounds) {
  28186. if (jsonObject.bounds.toServerJSONObject) {
  28187. jsonObject.bounds = jsonObject.bounds.toServerJSONObject();
  28188. }
  28189. }
  28190. return jsonObject;
  28191. }
  28192. }]);
  28193. return UGCLayer;
  28194. }();
  28195. ;// CONCATENATED MODULE: ./src/common/iServer/UGCMapLayer.js
  28196. function UGCMapLayer_typeof(obj) { "@babel/helpers - typeof"; return UGCMapLayer_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, UGCMapLayer_typeof(obj); }
  28197. function UGCMapLayer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  28198. function UGCMapLayer_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  28199. function UGCMapLayer_createClass(Constructor, protoProps, staticProps) { if (protoProps) UGCMapLayer_defineProperties(Constructor.prototype, protoProps); if (staticProps) UGCMapLayer_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  28200. function UGCMapLayer_get() { if (typeof Reflect !== "undefined" && Reflect.get) { UGCMapLayer_get = Reflect.get.bind(); } else { UGCMapLayer_get = function _get(target, property, receiver) { var base = UGCMapLayer_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return UGCMapLayer_get.apply(this, arguments); }
  28201. function UGCMapLayer_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = UGCMapLayer_getPrototypeOf(object); if (object === null) break; } return object; }
  28202. function UGCMapLayer_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) UGCMapLayer_setPrototypeOf(subClass, superClass); }
  28203. function UGCMapLayer_setPrototypeOf(o, p) { UGCMapLayer_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return UGCMapLayer_setPrototypeOf(o, p); }
  28204. function UGCMapLayer_createSuper(Derived) { var hasNativeReflectConstruct = UGCMapLayer_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = UGCMapLayer_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = UGCMapLayer_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return UGCMapLayer_possibleConstructorReturn(this, result); }; }
  28205. function UGCMapLayer_possibleConstructorReturn(self, call) { if (call && (UGCMapLayer_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return UGCMapLayer_assertThisInitialized(self); }
  28206. function UGCMapLayer_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  28207. function UGCMapLayer_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  28208. function UGCMapLayer_getPrototypeOf(o) { UGCMapLayer_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return UGCMapLayer_getPrototypeOf(o); }
  28209. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  28210. * This program are made available under the terms of the Apache License, Version 2.0
  28211. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  28212. /**
  28213. * @class UGCMapLayer
  28214. * @deprecatedclass SuperMap.UGCMapLayer
  28215. * @category iServer Map Layer
  28216. * @classdesc SuperMap 地图图层类。
  28217. * @extends {UGCLayer}
  28218. * @param {Object} options - 可选参数。
  28219. * @param {boolean} [options.completeLineSymbolDisplayed] - 是否显示完整线型。
  28220. * @param {number} [options.maxScale] - 地图最大比例尺。
  28221. * @param {number} [options.minScale] - 地图最小比例尺。
  28222. * @param {number} [options.minVisibleGeometrySize] - 几何对象的最小可见大小,以像素为单位。
  28223. * @param {number} [options.opaqueRate] - 图层的不透明度。
  28224. * @param {boolean} [options.symbolScalable] - 是否允许图层的符号大小随图缩放。
  28225. * @param {number} [options.symbolScale] - 图层的符号缩放基准比例尺。
  28226. * @param {boolean} [options.overlapDisplayed=false] - 地图对象在同一范围内时,是否重叠显示。
  28227. * @param {OverlapDisplayedOptions} [options.overlapDisplayedOptions] - 地图的压盖过滤显示选项,当overlapDisplayed 为 false 时有效。
  28228. * @usage
  28229. */
  28230. var UGCMapLayer = /*#__PURE__*/function (_UGCLayer) {
  28231. UGCMapLayer_inherits(UGCMapLayer, _UGCLayer);
  28232. var _super = UGCMapLayer_createSuper(UGCMapLayer);
  28233. function UGCMapLayer(options) {
  28234. var _this;
  28235. UGCMapLayer_classCallCheck(this, UGCMapLayer);
  28236. options = options || {};
  28237. _this = _super.call(this, options);
  28238. /**
  28239. * @member {boolean} UGCMapLayer.prototype.completeLineSymbolDisplayed
  28240. * @description 是否显示完整线型。
  28241. */
  28242. _this.completeLineSymbolDisplayed = null;
  28243. /**
  28244. * @member {number} UGCMapLayer.prototype.maxScale
  28245. * @description 地图最大比例尺。
  28246. */
  28247. _this.maxScale = null;
  28248. /**
  28249. * @member {number} UGCMapLayer.prototype.minScale
  28250. * @description 地图最小比例尺。
  28251. */
  28252. _this.minScale = null;
  28253. /**
  28254. * @member {number} UGCMapLayer.prototype.minVisibleGeometrySize
  28255. * @description 几何对象的最小可见大小,以像素为单位。
  28256. */
  28257. _this.minVisibleGeometrySize = null;
  28258. /**
  28259. * @member {number} UGCMapLayer.prototype.opaqueRate
  28260. * @description 图层的不透明度。
  28261. */
  28262. _this.opaqueRate = null;
  28263. /**
  28264. * @member {boolean} UGCMapLayer.prototype.symbolScalable
  28265. * @description 是否允许图层的符号大小随图缩放。
  28266. */
  28267. _this.symbolScalable = null;
  28268. /**
  28269. * @member {number} UGCMapLayer.prototype.symbolScale
  28270. * @description 图层的符号缩放基准比例尺。
  28271. */
  28272. _this.symbolScale = null;
  28273. /**
  28274. * @member {boolean} [UGCMapLayer.prototype.overlapDisplayed=false]
  28275. * @description 地图对象在同一范围内时,是否重叠显示。
  28276. */
  28277. _this.overlapDisplayed = null;
  28278. /**
  28279. * @member {OverlapDisplayedOptions} UGCMapLayer.prototype.overlapDisplayedOptions
  28280. * @description 地图的压盖过滤显示选项,当 overlapDisplayed 为 false 时有效。
  28281. */
  28282. _this.overlapDisplayedOptions = null;
  28283. _this.CLASS_NAME = "SuperMap.UGCMapLayer";
  28284. return _this;
  28285. }
  28286. /**
  28287. * @function UGCMapLayer.prototype.destroy
  28288. * @override
  28289. */
  28290. UGCMapLayer_createClass(UGCMapLayer, [{
  28291. key: "destroy",
  28292. value: function destroy() {
  28293. UGCMapLayer_get(UGCMapLayer_getPrototypeOf(UGCMapLayer.prototype), "destroy", this).call(this);
  28294. Util_Util.reset(this);
  28295. }
  28296. /**
  28297. * @function UGCMapLayer.prototype.fromJson
  28298. * @description 将服务端 JSON 对象转换成当前客户端对象。
  28299. * @param {Object} jsonObject - 要转换的 JSON 对象。
  28300. */
  28301. }, {
  28302. key: "fromJson",
  28303. value: function fromJson(jsonObject) {
  28304. UGCMapLayer_get(UGCMapLayer_getPrototypeOf(UGCMapLayer.prototype), "fromJson", this).call(this, jsonObject);
  28305. }
  28306. /**
  28307. * @function UGCMapLayer.prototype.toServerJSONObject
  28308. * @description 转换成对应的 JSON 格式对象。
  28309. * @returns {Object} 对应的 JSON 格式对象。
  28310. */
  28311. }, {
  28312. key: "toServerJSONObject",
  28313. value: function toServerJSONObject() {
  28314. return UGCMapLayer_get(UGCMapLayer_getPrototypeOf(UGCMapLayer.prototype), "toServerJSONObject", this).call(this);
  28315. }
  28316. }]);
  28317. return UGCMapLayer;
  28318. }(UGCLayer);
  28319. ;// CONCATENATED MODULE: ./src/common/iServer/JoinItem.js
  28320. function JoinItem_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  28321. function JoinItem_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  28322. function JoinItem_createClass(Constructor, protoProps, staticProps) { if (protoProps) JoinItem_defineProperties(Constructor.prototype, protoProps); if (staticProps) JoinItem_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  28323. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  28324. * This program are made available under the terms of the Apache License, Version 2.0
  28325. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  28326. /**
  28327. * @class JoinItem
  28328. * @deprecatedclass SuperMap.JoinItem
  28329. * @category iServer Data FeatureResults
  28330. * @classdesc 连接信息类。
  28331. * 该类用于矢量数据集与外部表的连接。外部表可以为另一个矢量数据集(其中纯属性数据集中没有空间几何信息)所对应的 DBMS 表,也可以是用户自建的业务表。
  28332. * 需要注意的是,矢量数据集与外部表必须属于同一数据源。表之间的联系的建立有两种方式,一种是连接(join),一种是关联(link)。
  28333. * 连接,实际上是依据相同的字段将一个外部表追加到指定的表;而关联是基于一个相同的字段定义了两个表格之间的联系,但不是实际的追加。
  28334. * 用于连接两个表的字段的名称不一定相同,但类型必须一致。当两个表格之间建立了连接,通过对主表进行操作,可以对外部表进行查询,制作专题图以及分析等。
  28335. * 当两个表格之间是一对一或多对一的关系时,可以使用 join 连接。当为多对一的关系时,允许指定多个字段之间的关联。
  28336. *(注意:JoinItem 目前支持左连接和内连接,不支持全连接和右连接,UDB 引擎不支持内连接。并且用于建立连接的两个表必须在同一个数据源下。)
  28337. * @param {Object} options - 参数。
  28338. * @param {string} options.foreignTableName - 外部表的名称。
  28339. * @param {string} options.joinFilter - 矢量数据集与外部表之间的连接表达式,即设定两个表之间关联的字段。
  28340. * @param {JoinType} options.joinType - 两个表之间连接类型。
  28341. * @example 下面以 SQL 查询说明 joinItem 的使用方法:
  28342. *(start code)
  28343. * function queryBySQL() {
  28344. * // 设置与外部表的连接信息
  28345. * var joinItem = new JoinItem({
  28346. * foreignTableName: "foreignTable",
  28347. * joinFilter: "foreignTable.CONTINENT = Countries.CONTINENT",
  28348. * joinType: "LEFTJOIN"
  28349. * })
  28350. * var queryParam, queryBySQLParams, queryBySQLService;
  28351. * // 设置查询参数,在查询参数中添加joinItem关联条件信息
  28352. * queryParam = new FilterParameter({
  28353. * name: "Countries@World",
  28354. * joinItems: [joinItem]
  28355. * }),
  28356. * queryBySQLParams = new QueryBySQLParameters({
  28357. * queryParams: [queryParam]
  28358. * }),
  28359. * queryBySQLService = new QueryBySQLService(url, {
  28360. * eventListeners: { "processCompleted": processCompleted, "processFailed": processFailed}
  28361. * });
  28362. * queryBySQLService.processAsync(queryBySQLParams);
  28363. * }
  28364. * function processCompleted(queryEventArgs) {//todo}
  28365. * function processFailed(e) {//todo}
  28366. * (end)
  28367. * @usage
  28368. */
  28369. var JoinItem = /*#__PURE__*/function () {
  28370. function JoinItem(options) {
  28371. JoinItem_classCallCheck(this, JoinItem);
  28372. /**
  28373. * @member {string} JoinItem.prototype.foreignTableName
  28374. * @description 外部表的名称。
  28375. * 如果外部表的名称是以 “表名@数据源名” 命名方式,则该属性只需赋值表名。
  28376. * 例如:外部表 Name@changchun,Name 为表名,changchun 为数据源名称,则该属性的赋值应为:Name。
  28377. */
  28378. this.foreignTableName = null;
  28379. /**
  28380. * @member {string} JoinItem.prototype.joinFilter
  28381. * @description 矢量数据集与外部表之间的连接表达式,即设定两个表之间关联的字段。
  28382. * 例如,将房屋面数据集(Building)的 district 字段与房屋拥有者的纯属性数据集(Owner)的 region 字段相连接,
  28383. * 两个数据集对应的表名称分别为 Table_Building 和 Table_Owner,
  28384. * 则连接表达式为 Table_Building.district = Table_Owner.region。
  28385. * 当有多个字段相连接时,用 AND 将多个表达式相连。
  28386. */
  28387. this.joinFilter = null;
  28388. /**
  28389. * @member {JoinType} JoinItem.prototype.joinType
  28390. * @description 两个表之间连接类型。
  28391. * 连接类型决定了对两个表进行连接查询后返回的记录的情况。
  28392. */
  28393. this.joinType = null;
  28394. if (options) {
  28395. Util_Util.extend(this, options);
  28396. }
  28397. this.CLASS_NAME = "SuperMap.JoinItem";
  28398. }
  28399. /**
  28400. * @function JoinItem.prototype.destroy
  28401. * @description 释放资源,将引用资源的属性置空。
  28402. */
  28403. JoinItem_createClass(JoinItem, [{
  28404. key: "destroy",
  28405. value: function destroy() {
  28406. var me = this;
  28407. me.foreignTableName = null;
  28408. me.joinFilter = null;
  28409. me.joinType = null;
  28410. }
  28411. /**
  28412. * @function JoinItem.prototype.toServerJSONObject
  28413. * @description 转换成对应的 JSON 格式对象。
  28414. */
  28415. }, {
  28416. key: "toServerJSONObject",
  28417. value: function toServerJSONObject() {
  28418. var dataObj = {};
  28419. dataObj = Util_Util.copyAttributes(dataObj, this);
  28420. //joinFilter基本是个纯属性对象,这里不再做转换
  28421. return dataObj;
  28422. }
  28423. }]);
  28424. return JoinItem;
  28425. }();
  28426. ;// CONCATENATED MODULE: ./src/common/iServer/DatasetInfo.js
  28427. function DatasetInfo_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  28428. function DatasetInfo_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  28429. function DatasetInfo_createClass(Constructor, protoProps, staticProps) { if (protoProps) DatasetInfo_defineProperties(Constructor.prototype, protoProps); if (staticProps) DatasetInfo_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  28430. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  28431. * This program are made available under the terms of the Apache License, Version 2.0
  28432. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  28433. /**
  28434. * @class DatasetInfo
  28435. * @deprecatedclass SuperMap.DatasetInfo
  28436. * @category iServer Data Dataset
  28437. * @classdesc 数据集信息类。
  28438. * 数据集一般为存储在一起的相关数据的集合;根据数据类型的不同,分为矢量数据集、栅格数据集(griddataset)和
  28439. * 影像数据集(image dataset),以及为了处理特定问题而设计的数据集,如拓扑数据集,网络数据集等。
  28440. * 数据集是 GIS 数据组织的最小单位。其中矢量数据集是由同种类型空间要素组成的集合,
  28441. * 所以也可以称为要素集。根据要素的空间特征的不同,矢量数据集又分为点数据集,
  28442. * 线数据集,面数据集等,各矢量数据集是空间特征和性质相同的数据组织起来的集合。
  28443. * 目前版本支持的数据集主要有点数据集,线数据集,面数据集,文本数据集,复合数据集(CAD 数据集)、
  28444. * 网络数据集,栅格数据集(grid dataset)和影像数据集(image dataset)。
  28445. * @param {Object} options - 参数。
  28446. * @param {Bounds} [options.bounds] - 数据集范围。
  28447. * @param {string} [options.dataSourceName] - 数据源名称。
  28448. * @param {string} [options.description] - 数据集的描述信息。
  28449. * @param {string} [options.encodeType] - 数据集存储时的压缩编码方式。
  28450. * @param {boolean} [options.isReadOnly] - 数据集是否为只读。
  28451. * @param {string} options.name - 数据集名称。
  28452. * @param {Object} [options.prjCoordSys] - 数据集的投影信息。如:prjCoordSys={"epsgCode":3857}。
  28453. * @param {string} [options.tableName] - 表名。
  28454. * @param {string} options.type - 数据集类型。主要有点数据集,线数据集,面数据集,文本数据集,复合数据集(CAD 数据集)、网络数据集,栅格数据集(grid dataset)和影像数据集(image dataset)。
  28455. * @usage
  28456. */
  28457. var DatasetInfo = /*#__PURE__*/function () {
  28458. function DatasetInfo(options) {
  28459. DatasetInfo_classCallCheck(this, DatasetInfo);
  28460. options = options || {};
  28461. /**
  28462. * @member {Bounds} [DatasetInfo.prototype.bounds]
  28463. * @description 数据集范围,该字段只读。
  28464. */
  28465. this.bounds = null;
  28466. /**
  28467. * @member {string} [DatasetInfo.prototype.dataSourceName]
  28468. * @description 数据源名称,该字段只读。
  28469. */
  28470. this.dataSourceName = null;
  28471. /**
  28472. * @member {string} [DatasetInfo.prototype.description]
  28473. * @description 数据集的描述信息。
  28474. */
  28475. this.description = null;
  28476. /**
  28477. * @member {string} [DatasetInfo.prototype.encodeType]
  28478. * @description 数据集存储时的压缩编码方式,该字段只读。
  28479. */
  28480. this.encodeType = null;
  28481. /**
  28482. * @member {boolean} [DatasetInfo.prototype.isReadOnly]
  28483. * @description 数据集是否为只读。
  28484. */
  28485. this.isReadOnly = null;
  28486. /**
  28487. * @member {string} DatasetInfo.prototype.name
  28488. * @description 数据集名称,该字段必须且只读。
  28489. */
  28490. this.name = null;
  28491. /**
  28492. * @member {Object} [DatasetInfo.prototype.prjCoordSys]
  28493. * @description 数据集的投影信息。
  28494. */
  28495. this.prjCoordSys = null;
  28496. /**
  28497. * @member {string} [DatasetInfo.prototype.tableName]
  28498. * @description 表名,该字段只读。
  28499. */
  28500. this.tableName = null;
  28501. /**
  28502. * @member {string} DatasetInfo.prototype.type
  28503. * @description 数据集类型,该字段必设。主要有点数据集,线数据集,面数据集,文本数据集,复合数据集(CAD 数据集)、网络数据集,栅格数据集(grid dataset)和影像数据集(image dataset)。
  28504. */
  28505. this.type = null;
  28506. Util_Util.extend(this, options);
  28507. var b = this.bounds;
  28508. if (b) {
  28509. this.bounds = new Bounds(b.leftBottom.x, b.leftBottom.y, b.rightTop.x, b.rightTop.y);
  28510. }
  28511. this.CLASS_NAME = "SuperMap.DatasetInfo";
  28512. }
  28513. /**
  28514. * @function DatasetInfo.prototype.destroy
  28515. * @description 释放资源,将引用资源的属性置空。
  28516. */
  28517. DatasetInfo_createClass(DatasetInfo, [{
  28518. key: "destroy",
  28519. value: function destroy() {
  28520. Util_Util.reset(this);
  28521. }
  28522. /**
  28523. * @function DatasetInfo.prototype.toServerJSONObject
  28524. * @description 转换成对应的 JSON 格式对象。
  28525. * @returns {Object} JSON 对象。
  28526. */
  28527. }, {
  28528. key: "toServerJSONObject",
  28529. value: function toServerJSONObject() {
  28530. var dataObj = {};
  28531. dataObj = Util_Util.copyAttributes(dataObj, this);
  28532. if (dataObj.bounds) {
  28533. if (dataObj.bounds.toServerJSONObject) {
  28534. dataObj.bounds = dataObj.bounds.toServerJSONObject();
  28535. }
  28536. }
  28537. return dataObj;
  28538. }
  28539. }]);
  28540. return DatasetInfo;
  28541. }();
  28542. ;// CONCATENATED MODULE: ./src/common/iServer/UGCSubLayer.js
  28543. function UGCSubLayer_typeof(obj) { "@babel/helpers - typeof"; return UGCSubLayer_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, UGCSubLayer_typeof(obj); }
  28544. function UGCSubLayer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  28545. function UGCSubLayer_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  28546. function UGCSubLayer_createClass(Constructor, protoProps, staticProps) { if (protoProps) UGCSubLayer_defineProperties(Constructor.prototype, protoProps); if (staticProps) UGCSubLayer_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  28547. function UGCSubLayer_get() { if (typeof Reflect !== "undefined" && Reflect.get) { UGCSubLayer_get = Reflect.get.bind(); } else { UGCSubLayer_get = function _get(target, property, receiver) { var base = UGCSubLayer_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return UGCSubLayer_get.apply(this, arguments); }
  28548. function UGCSubLayer_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = UGCSubLayer_getPrototypeOf(object); if (object === null) break; } return object; }
  28549. function UGCSubLayer_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) UGCSubLayer_setPrototypeOf(subClass, superClass); }
  28550. function UGCSubLayer_setPrototypeOf(o, p) { UGCSubLayer_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return UGCSubLayer_setPrototypeOf(o, p); }
  28551. function UGCSubLayer_createSuper(Derived) { var hasNativeReflectConstruct = UGCSubLayer_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = UGCSubLayer_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = UGCSubLayer_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return UGCSubLayer_possibleConstructorReturn(this, result); }; }
  28552. function UGCSubLayer_possibleConstructorReturn(self, call) { if (call && (UGCSubLayer_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return UGCSubLayer_assertThisInitialized(self); }
  28553. function UGCSubLayer_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  28554. function UGCSubLayer_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  28555. function UGCSubLayer_getPrototypeOf(o) { UGCSubLayer_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return UGCSubLayer_getPrototypeOf(o); }
  28556. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  28557. * This program are made available under the terms of the Apache License, Version 2.0
  28558. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  28559. /**
  28560. * @class UGCSubLayer
  28561. * @deprecatedclass SuperMap.UGCSubLayer
  28562. * @category iServer Map Layer
  28563. * @classdesc 地图服务图层属性信息类。影像图层(Image)、专题图层(ServerTheme)、栅格图层(Grid)、矢量图层(Vector)等图层均继承该类。
  28564. * @extends {UGCMapLayer}
  28565. * @param {Object} options - 参数。
  28566. * @param {DatasetInfo} options.datasetInfo - 数据集信息。
  28567. * @param {string} [options.displayFilter] - 图层显示过滤条件。
  28568. * @param {JoinItem} [options.joinItems] - 连接信息类。
  28569. * @param {string} [options.representationField] - 存储制图表达信息的字段。
  28570. * @param {LayerType} [options.ugcLayerType] - 图层类型。
  28571. * @usage
  28572. */
  28573. var UGCSubLayer = /*#__PURE__*/function (_UGCMapLayer) {
  28574. UGCSubLayer_inherits(UGCSubLayer, _UGCMapLayer);
  28575. var _super = UGCSubLayer_createSuper(UGCSubLayer);
  28576. function UGCSubLayer(options) {
  28577. var _this;
  28578. UGCSubLayer_classCallCheck(this, UGCSubLayer);
  28579. options = options || {};
  28580. _this = _super.call(this, options);
  28581. /**
  28582. * @member {DatasetInfo} UGCSubLayer.prototype.datasetInfo
  28583. * @description 数据集信息。
  28584. */
  28585. _this.datasetInfo = null;
  28586. /**
  28587. * @member {string} UGCSubLayer.prototype.displayFilter
  28588. * @description 图层显示过滤条件。
  28589. */
  28590. _this.displayFilter = null;
  28591. /**
  28592. * @member {JoinItem} UGCSubLayer.prototype.joinItems
  28593. * @description 连接信息类。
  28594. */
  28595. _this.joinItems = null;
  28596. /**
  28597. * @member {string} UGCSubLayer.prototype.representationField
  28598. * @description 存储制图表达信息的字段。
  28599. */
  28600. _this.representationField = null;
  28601. /**
  28602. * @member {LayerType} UGCSubLayer.prototype.ugcLayerType
  28603. * @description 图层类型。
  28604. */
  28605. _this.ugcLayerType = null;
  28606. _this.CLASS_NAME = "SuperMap.UGCSubLayer";
  28607. return _this;
  28608. }
  28609. /**
  28610. * @function UGCSubLayer.prototype.fromJson
  28611. * @description 将服务端 JSON 对象转换成当前客户端对象。
  28612. * @param {Object} jsonObject - 要转换的 JSON 对象。
  28613. */
  28614. UGCSubLayer_createClass(UGCSubLayer, [{
  28615. key: "fromJson",
  28616. value: function fromJson(jsonObject) {
  28617. UGCSubLayer_get(UGCSubLayer_getPrototypeOf(UGCSubLayer.prototype), "fromJson", this).call(this, jsonObject);
  28618. if (this.datasetInfo) {
  28619. this.datasetInfo = new DatasetInfo(this.datasetInfo);
  28620. }
  28621. if (this.joinItems && this.joinItems.length) {
  28622. var newJoinItems = [];
  28623. for (var i = 0; i < this.joinItems.length; i++) {
  28624. newJoinItems[i] = new JoinItem(this.joinItems[i]);
  28625. }
  28626. this.joinItems = newJoinItems;
  28627. }
  28628. }
  28629. /**
  28630. * @function UGCSubLayer.prototype.destroy
  28631. * @override
  28632. */
  28633. }, {
  28634. key: "destroy",
  28635. value: function destroy() {
  28636. UGCSubLayer_get(UGCSubLayer_getPrototypeOf(UGCSubLayer.prototype), "destroy", this).call(this);
  28637. Util_Util.reset(this);
  28638. }
  28639. /**
  28640. * @function UGCSubLayer.prototype.toServerJSONObject
  28641. * @description 转换成对应的 JSON 格式对象。
  28642. * @returns {Object} 对应的 JSON 格式对象。
  28643. */
  28644. }, {
  28645. key: "toServerJSONObject",
  28646. value: function toServerJSONObject() {
  28647. var jsonObject = UGCSubLayer_get(UGCSubLayer_getPrototypeOf(UGCSubLayer.prototype), "toServerJSONObject", this).call(this);
  28648. if (jsonObject.joinItems) {
  28649. var joinItems = [];
  28650. for (var i = 0; i < jsonObject.joinItems.length; i++) {
  28651. if (jsonObject.joinItems[i].toServerJSONObject) {
  28652. joinItems[i] = jsonObject.joinItems[i].toServerJSONObject();
  28653. }
  28654. }
  28655. jsonObject.joinItems = joinItems;
  28656. }
  28657. if (jsonObject.datasetInfo) {
  28658. if (jsonObject.datasetInfo.toServerJSONObject) {
  28659. jsonObject.datasetInfo = jsonObject.datasetInfo.toServerJSONObject();
  28660. }
  28661. }
  28662. return jsonObject;
  28663. }
  28664. }]);
  28665. return UGCSubLayer;
  28666. }(UGCMapLayer);
  28667. ;// CONCATENATED MODULE: ./src/common/iServer/ServerTheme.js
  28668. function ServerTheme_typeof(obj) { "@babel/helpers - typeof"; return ServerTheme_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, ServerTheme_typeof(obj); }
  28669. function ServerTheme_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  28670. function ServerTheme_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  28671. function ServerTheme_createClass(Constructor, protoProps, staticProps) { if (protoProps) ServerTheme_defineProperties(Constructor.prototype, protoProps); if (staticProps) ServerTheme_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  28672. function ServerTheme_get() { if (typeof Reflect !== "undefined" && Reflect.get) { ServerTheme_get = Reflect.get.bind(); } else { ServerTheme_get = function _get(target, property, receiver) { var base = ServerTheme_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return ServerTheme_get.apply(this, arguments); }
  28673. function ServerTheme_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ServerTheme_getPrototypeOf(object); if (object === null) break; } return object; }
  28674. function ServerTheme_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) ServerTheme_setPrototypeOf(subClass, superClass); }
  28675. function ServerTheme_setPrototypeOf(o, p) { ServerTheme_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ServerTheme_setPrototypeOf(o, p); }
  28676. function ServerTheme_createSuper(Derived) { var hasNativeReflectConstruct = ServerTheme_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = ServerTheme_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = ServerTheme_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return ServerTheme_possibleConstructorReturn(this, result); }; }
  28677. function ServerTheme_possibleConstructorReturn(self, call) { if (call && (ServerTheme_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return ServerTheme_assertThisInitialized(self); }
  28678. function ServerTheme_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  28679. function ServerTheme_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  28680. function ServerTheme_getPrototypeOf(o) { ServerTheme_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ServerTheme_getPrototypeOf(o); }
  28681. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  28682. * This program are made available under the terms of the Apache License, Version 2.0
  28683. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  28684. /**
  28685. * @class ServerTheme
  28686. * @deprecatedclass SuperMap.ServerTheme
  28687. * @category iServer Map Theme
  28688. * @classdesc SuperMap 专题图图层类。
  28689. * @extends {UGCSubLayer}
  28690. * @param {CommonTheme} theme - 专题图对象。
  28691. * @param {LonLat} themeElementPosition - 专题图元素位置。
  28692. * @usage
  28693. */
  28694. var ServerTheme = /*#__PURE__*/function (_UGCSubLayer) {
  28695. ServerTheme_inherits(ServerTheme, _UGCSubLayer);
  28696. var _super = ServerTheme_createSuper(ServerTheme);
  28697. function ServerTheme(options) {
  28698. var _this;
  28699. ServerTheme_classCallCheck(this, ServerTheme);
  28700. options = options || {};
  28701. _this = _super.call(this, options);
  28702. /**
  28703. * @member {CommonTheme} ServerTheme.prototype.theme
  28704. * @description 专题图对象。
  28705. */
  28706. _this.theme = null;
  28707. /**
  28708. * @member {LonLat} ServerTheme.prototype.themeElementPosition
  28709. * @description 专题图元素位置。
  28710. */
  28711. _this.themeElementPosition = null;
  28712. _this.CLASS_NAME = "SuperMap.ServerTheme";
  28713. return _this;
  28714. }
  28715. /**
  28716. * @function ServerTheme.prototype.destroy
  28717. * @description 释放资源,将引用资源的属性置空。
  28718. * @override
  28719. */
  28720. ServerTheme_createClass(ServerTheme, [{
  28721. key: "destroy",
  28722. value: function destroy() {
  28723. ServerTheme_get(ServerTheme_getPrototypeOf(ServerTheme.prototype), "destroy", this).call(this);
  28724. Util_Util.reset(this);
  28725. }
  28726. /**
  28727. * @function ServerTheme.prototype.fromJson
  28728. * @description 将服务端 JSON 对象转换成当前客户端对象。
  28729. * @param {Object} jsonObject - 要转换的 JSON 对象。
  28730. */
  28731. }, {
  28732. key: "fromJson",
  28733. value: function fromJson(jsonObject) {
  28734. ServerTheme_get(ServerTheme_getPrototypeOf(ServerTheme.prototype), "fromJson", this).call(this, jsonObject);
  28735. var themeObj = this.theme;
  28736. var themeT = themeObj && themeObj.type;
  28737. switch (themeT) {
  28738. case 'LABEL':
  28739. this.theme = ThemeLabel.fromObj(themeObj);
  28740. break;
  28741. case 'UNIQUE':
  28742. this.theme = ThemeUnique.fromObj(themeObj);
  28743. break;
  28744. case 'GRAPH':
  28745. this.theme = ThemeGraph.fromObj(themeObj);
  28746. break;
  28747. case 'DOTDENSITY':
  28748. this.theme = ThemeDotDensity.fromObj(themeObj);
  28749. break;
  28750. case 'GRADUATEDSYMBOL':
  28751. this.theme = ThemeGraduatedSymbol.fromObj(themeObj);
  28752. break;
  28753. case 'RANGE':
  28754. this.theme = ThemeRange.fromObj(themeObj);
  28755. break;
  28756. default:
  28757. break;
  28758. }
  28759. if (this.themeElementPosition) {
  28760. //待测试
  28761. this.themeElementPosition = new LonLat(this.themeElementPosition.x, this.themeElementPosition.y);
  28762. }
  28763. }
  28764. /**
  28765. * @function ServerTheme.prototype.toServerJSONObject
  28766. * @description 转换成对应的 JSON 格式对象。
  28767. */
  28768. }, {
  28769. key: "toServerJSONObject",
  28770. value: function toServerJSONObject() {
  28771. //普通属性直接赋值
  28772. var jsonObject = ServerTheme_get(ServerTheme_getPrototypeOf(ServerTheme.prototype), "toServerJSONObject", this).call(this);
  28773. if (jsonObject.themeElementPosition) {
  28774. if (jsonObject.themeElementPosition.toServerJSONObject) {
  28775. jsonObject.themeElementPosition = jsonObject.themeElementPosition.toServerJSONObject();
  28776. }
  28777. }
  28778. if (jsonObject.theme) {
  28779. if (jsonObject.theme.toServerJSONObject) {
  28780. jsonObject.theme = jsonObject.theme.toServerJSONObject();
  28781. }
  28782. }
  28783. return jsonObject;
  28784. }
  28785. }]);
  28786. return ServerTheme;
  28787. }(UGCSubLayer);
  28788. ;// CONCATENATED MODULE: ./src/common/iServer/ColorDictionary.js
  28789. function ColorDictionary_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  28790. function ColorDictionary_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  28791. function ColorDictionary_createClass(Constructor, protoProps, staticProps) { if (protoProps) ColorDictionary_defineProperties(Constructor.prototype, protoProps); if (staticProps) ColorDictionary_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  28792. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  28793. * This program are made available under the terms of the Apache License, Version 2.0
  28794. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  28795. /**
  28796. * @class ColorDictionary
  28797. * @deprecatedclass SuperMap.ColorDictionary
  28798. * @category iServer Map Theme
  28799. * @classdesc 颜色对照表类。颜色对照表中的键名为具体的高程值,键值表示该高程值要显示的颜色。
  28800. * 对于栅格图层中高程值小于颜色对照表中高程最小值的点使用颜色对照表中高程最小值对应的颜色,
  28801. * 对于栅格图层中高程值大于颜色对照表中高程最大值的点使用颜色对照表中高程最大值对应的颜色,
  28802. * 对于栅格图层中高程值在颜色对照表中没有对应颜色的点,则查找颜色对照表中与当前高程值相邻的两个高程对应的颜色,
  28803. * 然后通过渐变运算要显示的颜色。如果设置了颜色对照表的话,则颜色表设置无效。
  28804. * @param {Object} options - 参数。
  28805. * @param {number} options.elevation - 高程值。
  28806. * @param {ServerColor} options.color - 服务端颜色类。
  28807. * @usage
  28808. */
  28809. var ColorDictionary = /*#__PURE__*/function () {
  28810. function ColorDictionary(options) {
  28811. ColorDictionary_classCallCheck(this, ColorDictionary);
  28812. options = options || {};
  28813. /**
  28814. * @member {number} ColorDictionary.prototype.elevation
  28815. * @description 高程值。
  28816. */
  28817. this.elevation = null;
  28818. /**
  28819. * @member {ServerColor} ColorDictionary.prototype.color
  28820. * @description 服务端颜色类。
  28821. */
  28822. this.color = null;
  28823. Util_Util.extend(this, options);
  28824. var me = this,
  28825. c = me.color;
  28826. if (c) {
  28827. me.color = new ServerColor(c.red, c.green, c.blue);
  28828. }
  28829. this.CLASS_NAME = "SuperMap.ColorDictionary";
  28830. }
  28831. /**
  28832. * @function ColorDictionary.prototype.destroy
  28833. * @description 释放资源,将引用资源的属性置空。
  28834. */
  28835. ColorDictionary_createClass(ColorDictionary, [{
  28836. key: "destroy",
  28837. value: function destroy() {
  28838. Util_Util.reset(this);
  28839. }
  28840. /**
  28841. * @function ColorDictionary.prototype.toServerJSONObject
  28842. * @description 转换成对应的 JSON 格式对象。
  28843. * @returns {Object} JSON 对象。
  28844. */
  28845. }, {
  28846. key: "toServerJSONObject",
  28847. value: function toServerJSONObject() {
  28848. var dataObj = {};
  28849. dataObj = Util_Util.copyAttributes(dataObj, this);
  28850. return dataObj;
  28851. }
  28852. }]);
  28853. return ColorDictionary;
  28854. }();
  28855. ;// CONCATENATED MODULE: ./src/common/iServer/Grid.js
  28856. function Grid_typeof(obj) { "@babel/helpers - typeof"; return Grid_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, Grid_typeof(obj); }
  28857. function Grid_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  28858. function Grid_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  28859. function Grid_createClass(Constructor, protoProps, staticProps) { if (protoProps) Grid_defineProperties(Constructor.prototype, protoProps); if (staticProps) Grid_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  28860. function Grid_get() { if (typeof Reflect !== "undefined" && Reflect.get) { Grid_get = Reflect.get.bind(); } else { Grid_get = function _get(target, property, receiver) { var base = Grid_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return Grid_get.apply(this, arguments); }
  28861. function Grid_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Grid_getPrototypeOf(object); if (object === null) break; } return object; }
  28862. function Grid_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) Grid_setPrototypeOf(subClass, superClass); }
  28863. function Grid_setPrototypeOf(o, p) { Grid_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Grid_setPrototypeOf(o, p); }
  28864. function Grid_createSuper(Derived) { var hasNativeReflectConstruct = Grid_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Grid_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Grid_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Grid_possibleConstructorReturn(this, result); }; }
  28865. function Grid_possibleConstructorReturn(self, call) { if (call && (Grid_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return Grid_assertThisInitialized(self); }
  28866. function Grid_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  28867. function Grid_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  28868. function Grid_getPrototypeOf(o) { Grid_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Grid_getPrototypeOf(o); }
  28869. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  28870. * This program are made available under the terms of the Apache License, Version 2.0
  28871. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  28872. /**
  28873. * @class Grid
  28874. * @deprecatedclass SuperMap.Grid
  28875. * @category iServer Map Layer
  28876. * @classdesc SuperMap 栅格图层类。
  28877. * @extends {UGCSubLayer}
  28878. * @param {Object} options - 可选参数。
  28879. * @param {Array.<Object>} [options.colorDictionary] - 颜色对照表对象。
  28880. * @param {number} [options.brightness] - Grid 图层的亮度。
  28881. * @param {ColorGradientType} [options.colorGradientType] - 颜色渐变枚举。
  28882. * @param {ServerColor} [options.colors] - 颜色表对象。
  28883. * @param {number} [options.contrast] - Grid 图层的对比度。
  28884. * @param {GridType} [options.gridType] - 格网类型。
  28885. * @param {number} [options.horizontalSpacing] - 格网水平间隔大小。
  28886. * @param {boolean} [options.sizeFixed] - 格网是否固定大小,如果不固定大小,则格网随着地图缩放。
  28887. * @param {ServerStyle} [options.solidStyle] - 格网实线的样式。
  28888. * @param {ServerColor} [options.specialColor] - 栅格数据集无值数据的颜色。
  28889. * @param {number} [options.specialValue] - 图层的特殊值。
  28890. * @param {boolean} [options.specialValueTransparent] - 图层的特殊值(specialValue)所处区域是否透明。
  28891. * @param {number} [options.verticalSpacing] - 格网垂直间隔大小。
  28892. * @usage
  28893. */
  28894. var Grid = /*#__PURE__*/function (_UGCSubLayer) {
  28895. Grid_inherits(Grid, _UGCSubLayer);
  28896. var _super = Grid_createSuper(Grid);
  28897. function Grid(options) {
  28898. var _this;
  28899. Grid_classCallCheck(this, Grid);
  28900. options = options || {};
  28901. _this = _super.call(this, options);
  28902. /**
  28903. * @member {Array.<ColorDictionary>} Grid.prototype.colorDictionarys
  28904. * @description 颜色对照表对象。
  28905. */
  28906. _this.colorDictionarys = null;
  28907. /**
  28908. * @member {number} Grid.prototype.brightness
  28909. * @description Grid 图层的亮度。
  28910. */
  28911. _this.brightness = null;
  28912. /**
  28913. * @member {ColorGradientType} Grid.prototype.colorGradientType
  28914. * @description 渐变颜色枚举值。
  28915. */
  28916. _this.colorGradientType = null;
  28917. /**
  28918. * @member {ServerColor} Grid.prototype.colors
  28919. * @description 颜色表对象。
  28920. */
  28921. _this.colors = null;
  28922. /**
  28923. * @member {number} Grid.prototype.contrast
  28924. * @description Grid 图层的对比度。
  28925. */
  28926. _this.contrast = null;
  28927. /**
  28928. * @member {ServerStyle} Grid.prototype.dashStyle
  28929. * @description 栅格数据集特殊值数据的颜色。
  28930. */
  28931. _this.dashStyle = null;
  28932. /**
  28933. * @member {GridType} Grid.prototype.gridType
  28934. * @description 格网类型。
  28935. */
  28936. _this.gridType = null;
  28937. /**
  28938. * @member {number} Grid.prototype.horizontalSpacing
  28939. * @description 格网水平间隔大小。
  28940. */
  28941. _this.horizontalSpacing = null;
  28942. /**
  28943. * @member {boolean} Grid.prototype.sizeFixed
  28944. * @description 格网是否固定大小,如果不固定大小,则格网随着地图缩放。
  28945. */
  28946. _this.sizeFixed = null;
  28947. /**
  28948. * @member {ServerStyle} Grid.prototype.solidStyle
  28949. * @description 格网实线的样式。
  28950. */
  28951. _this.solidStyle = null;
  28952. /**
  28953. * @member {ServerColor} Grid.prototype.specialColor
  28954. * @description 栅格数据集无值数据的颜色。
  28955. */
  28956. _this.specialColor = null;
  28957. /**
  28958. * @member {number} Grid.prototype.specialValue
  28959. * @description 图层的特殊值。
  28960. */
  28961. _this.specialValue = null;
  28962. /**
  28963. * @member {boolean} Grid.prototype.specialValueTransparent
  28964. * @description 图层的特殊值(specialValue)所处区域是否透明。
  28965. */
  28966. _this.specialValueTransparent = null;
  28967. /**
  28968. * @member {number} Grid.prototype.verticalSpacing
  28969. * @description 格网垂直间隔大小。
  28970. */
  28971. _this.verticalSpacing = null;
  28972. _this.CLASS_NAME = "SuperMap.Grid";
  28973. return _this;
  28974. }
  28975. /**
  28976. * @function Grid.prototype.destroy
  28977. * @description 释放资源,将引用资源的属性置空。
  28978. */
  28979. Grid_createClass(Grid, [{
  28980. key: "destroy",
  28981. value: function destroy() {
  28982. Grid_get(Grid_getPrototypeOf(Grid.prototype), "destroy", this).call(this);
  28983. Util_Util.reset(this);
  28984. }
  28985. /**
  28986. * @function Grid.prototype.fromJson
  28987. * @description 将服务端 JSON 对象转换成当前客户端对象。
  28988. * @param {Object} jsonObject - 要转换的 JSON 对象。
  28989. */
  28990. }, {
  28991. key: "fromJson",
  28992. value: function fromJson(jsonObject) {
  28993. Grid_get(Grid_getPrototypeOf(Grid.prototype), "fromJson", this).call(this, jsonObject);
  28994. if (this.specialColor) {
  28995. this.specialColor = new ServerColor(this.specialColor.red, this.specialColor.green, this.specialColor.blue);
  28996. }
  28997. if (this.colors) {
  28998. var colors = [],
  28999. color;
  29000. for (var i in this.colors) {
  29001. color = this.colors[i];
  29002. colors.push(new ServerColor(color.red, color.green, color.blue));
  29003. }
  29004. this.colors = colors;
  29005. }
  29006. if (this.dashStyle) {
  29007. this.dashStyle = new ServerStyle(this.dashStyle);
  29008. }
  29009. if (this.solidStyle) {
  29010. this.solidStyle = new ServerStyle(this.solidStyle);
  29011. }
  29012. if (this.colorDictionary) {
  29013. var colorDics = [],
  29014. colorDic;
  29015. for (var key in this.colorDictionary) {
  29016. colorDic = this.colorDictionary[key];
  29017. colorDics.push(new ColorDictionary({
  29018. elevation: key,
  29019. color: colorDic
  29020. }));
  29021. }
  29022. this.colorDictionarys = colorDics;
  29023. }
  29024. delete this.colorDictionary;
  29025. }
  29026. /**
  29027. * @function Grid.prototype.toServerJSONObject
  29028. * @description 转换成对应的 JSON 对象。
  29029. * @returns JSON 对象。
  29030. */
  29031. }, {
  29032. key: "toServerJSONObject",
  29033. value: function toServerJSONObject() {
  29034. var jsonObject = Grid_get(Grid_getPrototypeOf(Grid.prototype), "toServerJSONObject", this).call(this);
  29035. if (jsonObject.dashStyle) {
  29036. if (jsonObject.dashStyle.toServerJSONObject) {
  29037. jsonObject.dashStyle = jsonObject.dashStyle.toServerJSONObject();
  29038. }
  29039. }
  29040. if (jsonObject.solidStyle) {
  29041. if (jsonObject.solidStyle.toServerJSONObject) {
  29042. jsonObject.solidStyle = jsonObject.solidStyle.toServerJSONObject();
  29043. }
  29044. }
  29045. return jsonObject;
  29046. }
  29047. }]);
  29048. return Grid;
  29049. }(UGCSubLayer);
  29050. ;// CONCATENATED MODULE: ./src/common/iServer/Image.js
  29051. function Image_typeof(obj) { "@babel/helpers - typeof"; return Image_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, Image_typeof(obj); }
  29052. function Image_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  29053. function Image_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  29054. function Image_createClass(Constructor, protoProps, staticProps) { if (protoProps) Image_defineProperties(Constructor.prototype, protoProps); if (staticProps) Image_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  29055. function Image_get() { if (typeof Reflect !== "undefined" && Reflect.get) { Image_get = Reflect.get.bind(); } else { Image_get = function _get(target, property, receiver) { var base = Image_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return Image_get.apply(this, arguments); }
  29056. function Image_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Image_getPrototypeOf(object); if (object === null) break; } return object; }
  29057. function Image_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) Image_setPrototypeOf(subClass, superClass); }
  29058. function Image_setPrototypeOf(o, p) { Image_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Image_setPrototypeOf(o, p); }
  29059. function Image_createSuper(Derived) { var hasNativeReflectConstruct = Image_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Image_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Image_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Image_possibleConstructorReturn(this, result); }; }
  29060. function Image_possibleConstructorReturn(self, call) { if (call && (Image_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return Image_assertThisInitialized(self); }
  29061. function Image_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  29062. function Image_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  29063. function Image_getPrototypeOf(o) { Image_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Image_getPrototypeOf(o); }
  29064. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  29065. * This program are made available under the terms of the Apache License, Version 2.0
  29066. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  29067. /**
  29068. * @class UGCImage
  29069. * @deprecatedclass SuperMap.Image
  29070. * @category iServer Map Layer
  29071. * @classdesc SuperMap 影像图层类
  29072. * @extends {UGCSubLayer}
  29073. * @param {Object} options - 可选参数。
  29074. * @param {ColorSpaceType} [options.colorSpaceType] - 返回影像图层的色彩显示模式。
  29075. * @param {number} [options.brightness] - 影像图层的亮度。
  29076. * @param {Array.<number>} [options.displayBandIndexes] - 返回当前影像图层显示的波段索引。
  29077. * @param {number} [options.contrast] - 影像图层的对比度。
  29078. * @param {boolean} [options.transparent] - 是否背景透明。
  29079. * @param {ServerColor} [options.transparentColor] - 返回背景透明色。
  29080. * @param {number} [options.transparentColorTolerance] - 背景透明色容限。
  29081. * @usage
  29082. * @private
  29083. */
  29084. var UGCImage = /*#__PURE__*/function (_UGCSubLayer) {
  29085. Image_inherits(UGCImage, _UGCSubLayer);
  29086. var _super = Image_createSuper(UGCImage);
  29087. function UGCImage(options) {
  29088. var _this;
  29089. Image_classCallCheck(this, UGCImage);
  29090. options = options || {};
  29091. _this = _super.call(this, options);
  29092. /**
  29093. * @member {number} UGCImage.prototype.brightness
  29094. * @description 影像图层的亮度。
  29095. */
  29096. _this.brightness = null;
  29097. /**
  29098. * @member {ColorSpaceType} UGCImage.prototype.colorSpaceType
  29099. * @description 返回影像图层的色彩显示模式。
  29100. */
  29101. _this.colorSpaceType = null;
  29102. /**
  29103. * @member {number} UGCImage.prototype.contrast
  29104. * @description 影像图层的对比度。
  29105. */
  29106. _this.contrast = null;
  29107. /**
  29108. * @member {Array.<number>} UGCImage.prototype.displayBandIndexes
  29109. * @description 返回当前影像图层显示的波段索引。
  29110. */
  29111. _this.displayBandIndexes = null;
  29112. /**
  29113. * @member {boolean} UGCImage.prototype.transparent
  29114. * @description 是否背景透明。
  29115. */
  29116. _this.transparent = null;
  29117. /**
  29118. * @member {ServerColor} UGCImage.prototype.transparentColor
  29119. * @description 返回背景透明色。
  29120. */
  29121. _this.transparentColor = null;
  29122. /**
  29123. * @member {number} UGCImage.prototype.transparentColorTolerance
  29124. * @description 背景透明色容限。
  29125. */
  29126. _this.transparentColorTolerance = null;
  29127. _this.CLASS_NAME = "SuperMap.Image";
  29128. return _this;
  29129. }
  29130. /**
  29131. * @function UGCImage.prototype.destroy
  29132. * @override
  29133. */
  29134. Image_createClass(UGCImage, [{
  29135. key: "destroy",
  29136. value: function destroy() {
  29137. Image_get(Image_getPrototypeOf(UGCImage.prototype), "destroy", this).call(this);
  29138. Util_Util.reset(this);
  29139. }
  29140. /**
  29141. * @function UGCImage.prototype.fromJson
  29142. * @description 将服务端 JSON 对象转换成当前客户端对象。
  29143. * @param {Object} jsonObject - 要转换的 JSON 对象。
  29144. */
  29145. }, {
  29146. key: "fromJson",
  29147. value: function fromJson(jsonObject) {
  29148. Image_get(Image_getPrototypeOf(UGCImage.prototype), "fromJson", this).call(this, jsonObject);
  29149. if (this.transparentColor) {
  29150. this.transparentColor = new ServerColor(this.transparentColor.red, this.transparentColor.green, this.transparentColor.blue);
  29151. }
  29152. }
  29153. /**
  29154. * @function UGCImage.prototype.toServerJSONObject
  29155. * @description 转换成对应的 JSON 格式对象。
  29156. */
  29157. }, {
  29158. key: "toServerJSONObject",
  29159. value: function toServerJSONObject() {
  29160. return Image_get(Image_getPrototypeOf(UGCImage.prototype), "toServerJSONObject", this).call(this);
  29161. }
  29162. }]);
  29163. return UGCImage;
  29164. }(UGCSubLayer);
  29165. ;// CONCATENATED MODULE: ./src/common/iServer/Vector.js
  29166. function iServer_Vector_typeof(obj) { "@babel/helpers - typeof"; return iServer_Vector_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, iServer_Vector_typeof(obj); }
  29167. function iServer_Vector_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  29168. function iServer_Vector_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  29169. function iServer_Vector_createClass(Constructor, protoProps, staticProps) { if (protoProps) iServer_Vector_defineProperties(Constructor.prototype, protoProps); if (staticProps) iServer_Vector_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  29170. function iServer_Vector_get() { if (typeof Reflect !== "undefined" && Reflect.get) { iServer_Vector_get = Reflect.get.bind(); } else { iServer_Vector_get = function _get(target, property, receiver) { var base = iServer_Vector_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return iServer_Vector_get.apply(this, arguments); }
  29171. function iServer_Vector_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = iServer_Vector_getPrototypeOf(object); if (object === null) break; } return object; }
  29172. function iServer_Vector_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) iServer_Vector_setPrototypeOf(subClass, superClass); }
  29173. function iServer_Vector_setPrototypeOf(o, p) { iServer_Vector_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return iServer_Vector_setPrototypeOf(o, p); }
  29174. function iServer_Vector_createSuper(Derived) { var hasNativeReflectConstruct = iServer_Vector_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = iServer_Vector_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = iServer_Vector_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return iServer_Vector_possibleConstructorReturn(this, result); }; }
  29175. function iServer_Vector_possibleConstructorReturn(self, call) { if (call && (iServer_Vector_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return iServer_Vector_assertThisInitialized(self); }
  29176. function iServer_Vector_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  29177. function iServer_Vector_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  29178. function iServer_Vector_getPrototypeOf(o) { iServer_Vector_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return iServer_Vector_getPrototypeOf(o); }
  29179. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  29180. * This program are made available under the terms of the Apache License, Version 2.0
  29181. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  29182. /**
  29183. * @class Vector
  29184. * @deprecatedclass SuperMap.Vector
  29185. * @category iServer Map Layer
  29186. * @classdesc SuperMap 矢量图层类。
  29187. * @extends {UGCSubLayer}
  29188. * @param {Object} options - 可选参数。
  29189. * @param {ServerStyle} [options.style] - 矢量图层的风格。
  29190. * @usage
  29191. */
  29192. var Vector_Vector = /*#__PURE__*/function (_UGCSubLayer) {
  29193. iServer_Vector_inherits(Vector, _UGCSubLayer);
  29194. var _super = iServer_Vector_createSuper(Vector);
  29195. function Vector(options) {
  29196. var _this;
  29197. iServer_Vector_classCallCheck(this, Vector);
  29198. options = options || {};
  29199. _this = _super.call(this, options);
  29200. /**
  29201. * @member {ServerStyle} Vector.prototype.style
  29202. * @description 矢量图层的风格。
  29203. */
  29204. _this.style = null;
  29205. _this.CLASS_NAME = "SuperMap.Vector";
  29206. return _this;
  29207. }
  29208. /**
  29209. * @function Vector.prototype.destroy
  29210. * @description 销毁对象,将其属性置空。
  29211. * @override
  29212. */
  29213. iServer_Vector_createClass(Vector, [{
  29214. key: "destroy",
  29215. value: function destroy() {
  29216. iServer_Vector_get(iServer_Vector_getPrototypeOf(Vector.prototype), "destroy", this).call(this);
  29217. Util_Util.reset(this);
  29218. }
  29219. /**
  29220. * @function Vector.prototype.fromJson
  29221. * @description 将服务端 JSON 对象转换成当前客户端对象。
  29222. * @param {Object} jsonObject - 要转换的 JSON 对象。
  29223. */
  29224. }, {
  29225. key: "fromJson",
  29226. value: function fromJson(jsonObject) {
  29227. iServer_Vector_get(iServer_Vector_getPrototypeOf(Vector.prototype), "fromJson", this).call(this, jsonObject);
  29228. var sty = this.style;
  29229. if (sty) {
  29230. this.style = new ServerStyle(sty);
  29231. }
  29232. }
  29233. /**
  29234. * @function Vector.prototype.toServerJSONObject
  29235. * @description 转换成对应的 JSON 格式对象。
  29236. * @returns {Object} 对应的 JSON 格式对象
  29237. */
  29238. }, {
  29239. key: "toServerJSONObject",
  29240. value: function toServerJSONObject() {
  29241. var jsonObject = iServer_Vector_get(iServer_Vector_getPrototypeOf(Vector.prototype), "toServerJSONObject", this).call(this);
  29242. if (jsonObject.style) {
  29243. if (jsonObject.style.toServerJSONObject) {
  29244. jsonObject.style = jsonObject.style.toServerJSONObject();
  29245. }
  29246. }
  29247. return jsonObject;
  29248. }
  29249. }]);
  29250. return Vector;
  29251. }(UGCSubLayer);
  29252. ;// CONCATENATED MODULE: ./src/common/iServer/GetLayersInfoService.js
  29253. function GetLayersInfoService_typeof(obj) { "@babel/helpers - typeof"; return GetLayersInfoService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, GetLayersInfoService_typeof(obj); }
  29254. function GetLayersInfoService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  29255. function GetLayersInfoService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  29256. function GetLayersInfoService_createClass(Constructor, protoProps, staticProps) { if (protoProps) GetLayersInfoService_defineProperties(Constructor.prototype, protoProps); if (staticProps) GetLayersInfoService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  29257. function GetLayersInfoService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { GetLayersInfoService_get = Reflect.get.bind(); } else { GetLayersInfoService_get = function _get(target, property, receiver) { var base = GetLayersInfoService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return GetLayersInfoService_get.apply(this, arguments); }
  29258. function GetLayersInfoService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GetLayersInfoService_getPrototypeOf(object); if (object === null) break; } return object; }
  29259. function GetLayersInfoService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) GetLayersInfoService_setPrototypeOf(subClass, superClass); }
  29260. function GetLayersInfoService_setPrototypeOf(o, p) { GetLayersInfoService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GetLayersInfoService_setPrototypeOf(o, p); }
  29261. function GetLayersInfoService_createSuper(Derived) { var hasNativeReflectConstruct = GetLayersInfoService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = GetLayersInfoService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = GetLayersInfoService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return GetLayersInfoService_possibleConstructorReturn(this, result); }; }
  29262. function GetLayersInfoService_possibleConstructorReturn(self, call) { if (call && (GetLayersInfoService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return GetLayersInfoService_assertThisInitialized(self); }
  29263. function GetLayersInfoService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  29264. function GetLayersInfoService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  29265. function GetLayersInfoService_getPrototypeOf(o) { GetLayersInfoService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GetLayersInfoService_getPrototypeOf(o); }
  29266. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  29267. * This program are made available under the terms of the Apache License, Version 2.0
  29268. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  29269. /**
  29270. * @class GetLayersInfoService
  29271. * @deprecatedclass SuperMap.GetLayersInfoService
  29272. * @category iServer Map Layer
  29273. * @classdesc 获取图层信息服务类构造函数。
  29274. * @extends {CommonServiceBase}
  29275. * @param {string} url - 服务地址。请求地图服务,URL 应为:
  29276. * http://{服务器地址}:{服务端口号}/iserver/services/{地图服务名}/rest/maps/{地图名};
  29277. * 如 http://localhost:8090/iserver/services/map-world/rest/maps/World 。
  29278. * 如果查询临时图层的信息,请指定完成的url,包含临时图层ID信息,如:
  29279. * http://localhost:8090/iserver/services/map-world/rest/maps/World/tempLayersSet/resourceID
  29280. * @param {Object} options - 参数。
  29281. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  29282. * @param {DataFormat} [options.format=DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
  29283. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  29284. * @param {Object} [options.headers] - 请求头。
  29285. * @param {boolean} options.isTempLayers - 当前url对应的图层是否是临时图层。
  29286. * @usage
  29287. */
  29288. var GetLayersInfoService = /*#__PURE__*/function (_CommonServiceBase) {
  29289. GetLayersInfoService_inherits(GetLayersInfoService, _CommonServiceBase);
  29290. var _super = GetLayersInfoService_createSuper(GetLayersInfoService);
  29291. function GetLayersInfoService(url, options) {
  29292. var _this;
  29293. GetLayersInfoService_classCallCheck(this, GetLayersInfoService);
  29294. _this = _super.call(this, url, options);
  29295. /**
  29296. * @member {boolean} GetLayersInfoService.prototype.isTempLayers
  29297. * @description 当前url对应的图层是否是临时图层。
  29298. */
  29299. _this.isTempLayers = false;
  29300. if (options) {
  29301. Util_Util.extend(GetLayersInfoService_assertThisInitialized(_this), options);
  29302. }
  29303. _this.CLASS_NAME = "SuperMap.GetLayersInfoService";
  29304. return _this;
  29305. }
  29306. /**
  29307. * @function GetLayersInfoService.prototype.destroy
  29308. * @override
  29309. */
  29310. GetLayersInfoService_createClass(GetLayersInfoService, [{
  29311. key: "destroy",
  29312. value: function destroy() {
  29313. GetLayersInfoService_get(GetLayersInfoService_getPrototypeOf(GetLayersInfoService.prototype), "destroy", this).call(this);
  29314. Util_Util.reset(this);
  29315. }
  29316. /**
  29317. * @function GetLayersInfoService.prototype.processAsync
  29318. * @description 负责将客户端的更新参数传递到服务端。
  29319. */
  29320. }, {
  29321. key: "processAsync",
  29322. value: function processAsync() {
  29323. var me = this,
  29324. method = "GET";
  29325. if (!me.isTempLayers) {
  29326. me.url = Util_Util.urlPathAppend(me.url, 'layers');
  29327. }
  29328. me.request({
  29329. method: method,
  29330. params: null,
  29331. scope: me,
  29332. success: me.serviceProcessCompleted,
  29333. failure: me.serviceProcessFailed
  29334. });
  29335. }
  29336. /**
  29337. * @function GetLayersInfoService.prototype.serviceProcessCompleted
  29338. * @description 编辑完成,执行此方法。
  29339. * @param {Object} result - 服务器返回的结果对象。
  29340. */
  29341. }, {
  29342. key: "serviceProcessCompleted",
  29343. value: function serviceProcessCompleted(result, options) {
  29344. var me = this,
  29345. existRes,
  29346. layers,
  29347. len;
  29348. result = Util_Util.transformResult(result);
  29349. existRes = !!result && result.length > 0;
  29350. layers = existRes ? result[0].subLayers.layers : null;
  29351. len = layers ? layers.length : 0;
  29352. me.handleLayers(len, layers);
  29353. me.events.triggerEvent("processCompleted", {
  29354. result: result[0],
  29355. options: options
  29356. });
  29357. }
  29358. /**
  29359. * TODO 专题图时候可能会用到
  29360. * @function GetLayersInfoService.prototype.handleLayers
  29361. * @description 处理 iServer 新增图层组数据 (subLayers.layers 中可能还会含有 subLayers.layers)
  29362. * @param {number} len - subLayers.layers的长度
  29363. * @param {Array.<number>} layers - subLayers.layers的长度数组
  29364. */
  29365. }, {
  29366. key: "handleLayers",
  29367. value: function handleLayers(len, layers) {
  29368. var me = this,
  29369. tempLayer;
  29370. if (len) {
  29371. for (var i = 0; i < len; i++) {
  29372. if (layers[i].subLayers && layers[i].subLayers.layers && layers[i].subLayers.layers.length > 0) {
  29373. me.handleLayers(layers[i].subLayers.layers.length, layers[i].subLayers.layers);
  29374. } else {
  29375. var type = layers[i].ugcLayerType;
  29376. switch (type) {
  29377. case 'THEME':
  29378. tempLayer = new ServerTheme();
  29379. tempLayer.fromJson(layers[i]);
  29380. layers[i] = tempLayer;
  29381. break;
  29382. case 'GRID':
  29383. tempLayer = new Grid();
  29384. tempLayer.fromJson(layers[i]);
  29385. layers[i] = tempLayer;
  29386. break;
  29387. case 'IMAGE':
  29388. tempLayer = new UGCImage();
  29389. tempLayer.fromJson(layers[i]);
  29390. layers[i] = tempLayer;
  29391. break;
  29392. case 'VECTOR':
  29393. tempLayer = new Vector_Vector();
  29394. tempLayer.fromJson(layers[i]);
  29395. layers[i] = tempLayer;
  29396. break;
  29397. default:
  29398. break;
  29399. }
  29400. }
  29401. }
  29402. }
  29403. }
  29404. }]);
  29405. return GetLayersInfoService;
  29406. }(CommonServiceBase);
  29407. ;// CONCATENATED MODULE: ./src/common/iServer/SetLayerInfoService.js
  29408. function SetLayerInfoService_typeof(obj) { "@babel/helpers - typeof"; return SetLayerInfoService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, SetLayerInfoService_typeof(obj); }
  29409. function SetLayerInfoService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  29410. function SetLayerInfoService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  29411. function SetLayerInfoService_createClass(Constructor, protoProps, staticProps) { if (protoProps) SetLayerInfoService_defineProperties(Constructor.prototype, protoProps); if (staticProps) SetLayerInfoService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  29412. function SetLayerInfoService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { SetLayerInfoService_get = Reflect.get.bind(); } else { SetLayerInfoService_get = function _get(target, property, receiver) { var base = SetLayerInfoService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return SetLayerInfoService_get.apply(this, arguments); }
  29413. function SetLayerInfoService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SetLayerInfoService_getPrototypeOf(object); if (object === null) break; } return object; }
  29414. function SetLayerInfoService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) SetLayerInfoService_setPrototypeOf(subClass, superClass); }
  29415. function SetLayerInfoService_setPrototypeOf(o, p) { SetLayerInfoService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SetLayerInfoService_setPrototypeOf(o, p); }
  29416. function SetLayerInfoService_createSuper(Derived) { var hasNativeReflectConstruct = SetLayerInfoService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = SetLayerInfoService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = SetLayerInfoService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return SetLayerInfoService_possibleConstructorReturn(this, result); }; }
  29417. function SetLayerInfoService_possibleConstructorReturn(self, call) { if (call && (SetLayerInfoService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return SetLayerInfoService_assertThisInitialized(self); }
  29418. function SetLayerInfoService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  29419. function SetLayerInfoService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  29420. function SetLayerInfoService_getPrototypeOf(o) { SetLayerInfoService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SetLayerInfoService_getPrototypeOf(o); }
  29421. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  29422. * This program are made available under the terms of the Apache License, Version 2.0
  29423. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  29424. /**
  29425. * @class SetLayerInfoService
  29426. * @deprecatedclass SuperMap.SetLayerInfoService
  29427. * @category iServer Map TempLayersSet
  29428. * @classdesc 设置图层信息服务类。可以实现临时图层中子图层的修改
  29429. * 该类负责将图层设置参数传递到服务端,并获取服务端返回的结果信息。
  29430. * @extends {CommonServiceBase}
  29431. * @param {string} url - 服务地址。请求地图服务,URL 应为:
  29432. * http://{服务器地址}:{服务端口号}/iserver/services/{地图服务名}/rest/maps/{地图名}/tempLayersSet/{tempLayerID}/Rivers@World@@World";
  29433. * @param {Object} options - 参数。
  29434. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  29435. * @param {DataFormat} [options.format=DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
  29436. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  29437. * @param {Object} [options.headers] - 请求头。
  29438. * @usage
  29439. */
  29440. var SetLayerInfoService = /*#__PURE__*/function (_CommonServiceBase) {
  29441. SetLayerInfoService_inherits(SetLayerInfoService, _CommonServiceBase);
  29442. var _super = SetLayerInfoService_createSuper(SetLayerInfoService);
  29443. function SetLayerInfoService(url, options) {
  29444. var _this;
  29445. SetLayerInfoService_classCallCheck(this, SetLayerInfoService);
  29446. _this = _super.call(this, url, options);
  29447. if (options) {
  29448. Util_Util.extend(SetLayerInfoService_assertThisInitialized(_this), options);
  29449. }
  29450. _this.CLASS_NAME = "SuperMap.SetLayerInfoService";
  29451. return _this;
  29452. }
  29453. /**
  29454. * @override
  29455. */
  29456. SetLayerInfoService_createClass(SetLayerInfoService, [{
  29457. key: "destroy",
  29458. value: function destroy() {
  29459. SetLayerInfoService_get(SetLayerInfoService_getPrototypeOf(SetLayerInfoService.prototype), "destroy", this).call(this);
  29460. Util_Util.reset(this);
  29461. }
  29462. /**
  29463. * @function SetLayerInfoService.prototype.processAsync
  29464. * @description 负责将客户端的更新参数传递到服务端。
  29465. * @param {Object} params - 修改后的图层资源信息。
  29466. * 该参数可以使用获取图层信息服务<{@link GetLayersInfoService}>返回图层信息,解析结果result.subLayers.layers[i],然后对其属性进行修改来获取。
  29467. */
  29468. }, {
  29469. key: "processAsync",
  29470. value: function processAsync(params) {
  29471. if (!params) {
  29472. return;
  29473. }
  29474. var me = this;
  29475. var jsonParamsStr = Util_Util.toJSON(params);
  29476. me.request({
  29477. method: "PUT",
  29478. data: jsonParamsStr,
  29479. scope: me,
  29480. success: me.serviceProcessCompleted,
  29481. failure: me.serviceProcessFailed
  29482. });
  29483. }
  29484. }]);
  29485. return SetLayerInfoService;
  29486. }(CommonServiceBase);
  29487. ;// CONCATENATED MODULE: ./src/common/iServer/SetLayersInfoService.js
  29488. function SetLayersInfoService_typeof(obj) { "@babel/helpers - typeof"; return SetLayersInfoService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, SetLayersInfoService_typeof(obj); }
  29489. function SetLayersInfoService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  29490. function SetLayersInfoService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  29491. function SetLayersInfoService_createClass(Constructor, protoProps, staticProps) { if (protoProps) SetLayersInfoService_defineProperties(Constructor.prototype, protoProps); if (staticProps) SetLayersInfoService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  29492. function SetLayersInfoService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { SetLayersInfoService_get = Reflect.get.bind(); } else { SetLayersInfoService_get = function _get(target, property, receiver) { var base = SetLayersInfoService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return SetLayersInfoService_get.apply(this, arguments); }
  29493. function SetLayersInfoService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SetLayersInfoService_getPrototypeOf(object); if (object === null) break; } return object; }
  29494. function SetLayersInfoService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) SetLayersInfoService_setPrototypeOf(subClass, superClass); }
  29495. function SetLayersInfoService_setPrototypeOf(o, p) { SetLayersInfoService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SetLayersInfoService_setPrototypeOf(o, p); }
  29496. function SetLayersInfoService_createSuper(Derived) { var hasNativeReflectConstruct = SetLayersInfoService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = SetLayersInfoService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = SetLayersInfoService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return SetLayersInfoService_possibleConstructorReturn(this, result); }; }
  29497. function SetLayersInfoService_possibleConstructorReturn(self, call) { if (call && (SetLayersInfoService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return SetLayersInfoService_assertThisInitialized(self); }
  29498. function SetLayersInfoService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  29499. function SetLayersInfoService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  29500. function SetLayersInfoService_getPrototypeOf(o) { SetLayersInfoService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SetLayersInfoService_getPrototypeOf(o); }
  29501. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  29502. * This program are made available under the terms of the Apache License, Version 2.0
  29503. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  29504. /**
  29505. * @class SetLayersInfoService
  29506. * @deprecatedclass SuperMap.SetLayersInfoService
  29507. * @category iServer Map TempLayersSet
  29508. * @classdesc 设置图层信息服务类。可以实现创建新的临时图层和对现有临时图层的修改,
  29509. * 当 isTempLayers 为 false的时候执行创建临时图层。当 isTempLayers 为 ture 并且临时图层资源 resourceID 被设置有效时执行对临时图层的编辑。
  29510. * 该类负责将图层设置参数传递到服务端,并获取服务端返回的结果信息。
  29511. * @extends {CommonServiceBase}
  29512. * @param url - {string} 服务地址。请求地图服务,URL 应为:
  29513. * http://{服务器地址}:{服务端口号}/iserver/services/{地图服务名}/rest/maps/{地图名};
  29514. * @param {Object} options - 参数。
  29515. * @param {string} options.resourceID - 图层资源ID,临时图层的资源ID标记。
  29516. * @param {boolean} options.isTempLayers - 当前url对应的图层是否是临时图层。
  29517. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  29518. * @param {DataFormat} [options.format=DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
  29519. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  29520. * @param {Object} [options.headers] - 请求头。
  29521. * @usage
  29522. */
  29523. var SetLayersInfoService = /*#__PURE__*/function (_CommonServiceBase) {
  29524. SetLayersInfoService_inherits(SetLayersInfoService, _CommonServiceBase);
  29525. var _super = SetLayersInfoService_createSuper(SetLayersInfoService);
  29526. function SetLayersInfoService(url, options) {
  29527. var _this;
  29528. SetLayersInfoService_classCallCheck(this, SetLayersInfoService);
  29529. _this = _super.call(this, url, options);
  29530. /**
  29531. * @member {string} SetLayersInfoService.prototype.resourceID
  29532. * @description 图层资源ID,临时图层的资源ID标记。
  29533. */
  29534. _this.resourceID = null;
  29535. /**
  29536. * @function {boolean} SetLayersInfoService.prototype.isTempLayers
  29537. * @description 当前url对应的图层是否是临时图层。
  29538. */
  29539. _this.isTempLayers = false;
  29540. if (options) {
  29541. Util_Util.extend(SetLayersInfoService_assertThisInitialized(_this), options);
  29542. }
  29543. _this.CLASS_NAME = "SuperMap.SetLayersInfoService";
  29544. return _this;
  29545. }
  29546. /**
  29547. * @override
  29548. */
  29549. SetLayersInfoService_createClass(SetLayersInfoService, [{
  29550. key: "destroy",
  29551. value: function destroy() {
  29552. SetLayersInfoService_get(SetLayersInfoService_getPrototypeOf(SetLayersInfoService.prototype), "destroy", this).call(this);
  29553. Util_Util.reset(this);
  29554. }
  29555. /**
  29556. * @function SetLayersInfoService.prototype.processAsync
  29557. * @description 负责将客户端的更新参数传递到服务端。
  29558. * @param {Object} params - 修改后的图层资源信息。该参数可以使用获取图层信息服务 <{@link GetLayersInfoService}>返回图层信息,然后对其属性进行修改来获取。
  29559. */
  29560. }, {
  29561. key: "processAsync",
  29562. value: function processAsync(params) {
  29563. if (!params) {
  29564. return;
  29565. }
  29566. var jsonParams,
  29567. subLayers = [],
  29568. me = this,
  29569. method = "";
  29570. //创建临时图层和设置修改临时图层信息对应不同的资源URL
  29571. if (me.isTempLayers) {
  29572. me.url = Util_Util.urlPathAppend(me.url, "tempLayersSet/" + me.resourceID);
  29573. method = "PUT";
  29574. } else {
  29575. me.url = Util_Util.urlPathAppend(me.url, "tempLayersSet");
  29576. method = "POST";
  29577. }
  29578. if (!params.subLayers) {
  29579. params.subLayers = {
  29580. layers: []
  29581. };
  29582. }
  29583. if (!params.subLayers.layers) {
  29584. params.subLayers.layers = [];
  29585. }
  29586. var layers = params.subLayers.layers,
  29587. len = layers.length;
  29588. for (var i in layers) {
  29589. if (layers[i].ugcLayerType === "GRID") {
  29590. var colorDictionary = {};
  29591. var colorDics = layers[i].colorDictionarys;
  29592. for (var j in colorDics) {
  29593. var key = colorDics[j].elevation;
  29594. colorDictionary[key] = colorDics[j].color;
  29595. }
  29596. }
  29597. layers[i].colorDictionary = colorDictionary;
  29598. delete layers[i].colorDictionarys;
  29599. }
  29600. for (var _i2 = 0; _i2 < len; _i2++) {
  29601. if (layers[_i2].toJsonObject) {
  29602. //将图层信息转换成服务端能识别的简单json对象
  29603. subLayers.push(layers[_i2].toJsonObject());
  29604. } else {
  29605. subLayers.push(layers[_i2]);
  29606. }
  29607. }
  29608. jsonParams = Util_Util.extend(jsonParams, params);
  29609. jsonParams.subLayers = {
  29610. "layers": subLayers
  29611. };
  29612. jsonParams.object = null;
  29613. var jsonParamsStr = Util_Util.toJSON([jsonParams]);
  29614. me.request({
  29615. method: method,
  29616. data: jsonParamsStr,
  29617. scope: me,
  29618. success: me.serviceProcessCompleted,
  29619. failure: me.serviceProcessFailed
  29620. });
  29621. }
  29622. }]);
  29623. return SetLayersInfoService;
  29624. }(CommonServiceBase);
  29625. ;// CONCATENATED MODULE: ./src/common/iServer/SetLayerStatusParameters.js
  29626. function SetLayerStatusParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  29627. function SetLayerStatusParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  29628. function SetLayerStatusParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) SetLayerStatusParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) SetLayerStatusParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  29629. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  29630. * This program are made available under the terms of the Apache License, Version 2.0
  29631. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  29632. /**
  29633. * @class SetLayerStatusParameters
  29634. * @deprecatedclass SuperMap.SetLayerStatusParameters
  29635. * @category iServer Map TempLayersSet
  29636. * @classdesc 子图层显示控制参数类,该类存储了各子图层是否可见的状态。
  29637. * 注意在 SuperMap iClient 系列产品中所说的图层与 SuperMap Deskpro 的地图对应,子图层与 SuperMap Deskpro 的图层对应。
  29638. * @param {Object} options - 参数。
  29639. * @param {Array.<LayerStatus>} options.layerStatusList - 获取或设置图层可见状态({@link LayerStatus})集合,
  29640. * 集合中的每个 {@link LayerStatus} 对象代表一个子图层的可视状态。
  29641. * @param {number} [options.holdTime=15] - 获取或设置资源在服务端保存的时间。
  29642. * @param {string} [options.resourceID] - 获取或设置资源服务 ID。
  29643. * @usage
  29644. */
  29645. var SetLayerStatusParameters = /*#__PURE__*/function () {
  29646. function SetLayerStatusParameters(options) {
  29647. SetLayerStatusParameters_classCallCheck(this, SetLayerStatusParameters);
  29648. /**
  29649. * @member {Array.<LayerStatus>} SetLayerStatusParameters.prototype.layerStatusList
  29650. * @description 获取或设置图层可见状态({@link LayerStatus})集合,集合中的每个 {@link LayerStatus} 对象代表一个子图层的可视状态。
  29651. */
  29652. this.layerStatusList = [];
  29653. /**
  29654. * @member {number} [SetLayerStatusParameters.prototype.holdTime=15]
  29655. * @description 获取或设置资源在服务端保存的时间。单位为分钟。
  29656. */
  29657. this.holdTime = 15;
  29658. /**
  29659. * @member {string} SetLayerStatusParameters.prototype.resourceID
  29660. * @description 获取或设置资源服务ID。如果设置该参数则会在指定的 TempLayer 中进行图层的显示控制;
  29661. * 如果不设置该参数,则会首先创建一个 TempLayer ,然后在新创建的 TempLayer 中进行图层的显示控制。
  29662. */
  29663. this.resourceID = null;
  29664. if (options) {
  29665. Util_Util.extend(this, options);
  29666. }
  29667. }
  29668. /**
  29669. * @function SetLayerStatusParameters.prototype.destroy
  29670. * @description 释放资源,将引用资源的属性置空。
  29671. */
  29672. SetLayerStatusParameters_createClass(SetLayerStatusParameters, [{
  29673. key: "destroy",
  29674. value: function destroy() {
  29675. var me = this;
  29676. me.layerStatusList = null;
  29677. me.holdTime = null;
  29678. me.resourceID = null;
  29679. }
  29680. /**
  29681. * @function SetLayerStatusParameters.prototype.toJSON
  29682. * @description 生成 JSON。
  29683. * @returns {Object} 对应的 JSON 对象。
  29684. */
  29685. }, {
  29686. key: "toJSON",
  29687. value: function toJSON() {
  29688. var json = '{';
  29689. json += '"layers":[';
  29690. var v = [];
  29691. for (var i = 0, len = this.layerStatusList.length; i < len; i++) {
  29692. v.push(this.layerStatusList[i].toJSON());
  29693. }
  29694. json += v;
  29695. json += ']';
  29696. json += '}';
  29697. return json;
  29698. }
  29699. }]);
  29700. return SetLayerStatusParameters;
  29701. }();
  29702. ;// CONCATENATED MODULE: ./src/common/iServer/SetLayerStatusService.js
  29703. function SetLayerStatusService_typeof(obj) { "@babel/helpers - typeof"; return SetLayerStatusService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, SetLayerStatusService_typeof(obj); }
  29704. function SetLayerStatusService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  29705. function SetLayerStatusService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  29706. function SetLayerStatusService_createClass(Constructor, protoProps, staticProps) { if (protoProps) SetLayerStatusService_defineProperties(Constructor.prototype, protoProps); if (staticProps) SetLayerStatusService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  29707. function SetLayerStatusService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { SetLayerStatusService_get = Reflect.get.bind(); } else { SetLayerStatusService_get = function _get(target, property, receiver) { var base = SetLayerStatusService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return SetLayerStatusService_get.apply(this, arguments); }
  29708. function SetLayerStatusService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SetLayerStatusService_getPrototypeOf(object); if (object === null) break; } return object; }
  29709. function SetLayerStatusService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) SetLayerStatusService_setPrototypeOf(subClass, superClass); }
  29710. function SetLayerStatusService_setPrototypeOf(o, p) { SetLayerStatusService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SetLayerStatusService_setPrototypeOf(o, p); }
  29711. function SetLayerStatusService_createSuper(Derived) { var hasNativeReflectConstruct = SetLayerStatusService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = SetLayerStatusService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = SetLayerStatusService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return SetLayerStatusService_possibleConstructorReturn(this, result); }; }
  29712. function SetLayerStatusService_possibleConstructorReturn(self, call) { if (call && (SetLayerStatusService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return SetLayerStatusService_assertThisInitialized(self); }
  29713. function SetLayerStatusService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  29714. function SetLayerStatusService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  29715. function SetLayerStatusService_getPrototypeOf(o) { SetLayerStatusService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SetLayerStatusService_getPrototypeOf(o); }
  29716. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  29717. * This program are made available under the terms of the Apache License, Version 2.0
  29718. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  29719. /**
  29720. * @class SetLayerStatusService
  29721. * @deprecatedclass SuperMap.SetLayerStatusService
  29722. * @category iServer Map TempLayersSet
  29723. * @classdesc 子图层显示控制服务类。该类负责将子图层显示控制参数传递到服务端,并获取服务端返回的图层显示状态。
  29724. * 用户获取服务端返回的各子图层显示状态有两种方式:
  29725. * 一种是通过监听 SetLayerEvent.PROCESS_COMPLETE 事件;
  29726. * 一种是使用 AsyncResponder 类实现异步处理。
  29727. * @extends {CommonServiceBase}
  29728. * @param {string} url - 服务地址。请求地图服务,URL 应为:
  29729. * http://{服务器地址}:{服务端口号}/iserver/services/{地图服务名}/rest/maps/{地图名};
  29730. * @param {Object} options - 参数。
  29731. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  29732. * @param {DataFormat} [options.format=DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
  29733. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  29734. * @param {Object} [options.headers] - 请求头。
  29735. * @usage
  29736. */
  29737. var SetLayerStatusService = /*#__PURE__*/function (_CommonServiceBase) {
  29738. SetLayerStatusService_inherits(SetLayerStatusService, _CommonServiceBase);
  29739. var _super = SetLayerStatusService_createSuper(SetLayerStatusService);
  29740. function SetLayerStatusService(url, options) {
  29741. var _this;
  29742. SetLayerStatusService_classCallCheck(this, SetLayerStatusService);
  29743. _this = _super.call(this, url, options);
  29744. _this.lastparams = null;
  29745. _this.mapUrl = url;
  29746. if (options) {
  29747. Util_Util.extend(SetLayerStatusService_assertThisInitialized(_this), options);
  29748. }
  29749. _this.CLASS_NAME = "SuperMap.SetLayerStatusService";
  29750. return _this;
  29751. }
  29752. /**
  29753. * @override
  29754. */
  29755. SetLayerStatusService_createClass(SetLayerStatusService, [{
  29756. key: "destroy",
  29757. value: function destroy() {
  29758. SetLayerStatusService_get(SetLayerStatusService_getPrototypeOf(SetLayerStatusService.prototype), "destroy", this).call(this);
  29759. Util_Util.reset(this);
  29760. }
  29761. /**
  29762. * @function SetLayerStatusService.prototype.processAsync
  29763. * @description 负责将客户端的更新参数传递到服务端。
  29764. * @param {Object} params - 修改后的图层资源信息。该参数可以使用获取图层信息服务{@link SetLayerStatusParameters}
  29765. * 返回图层信息,然后对其属性进行修改来获取。
  29766. */
  29767. }, {
  29768. key: "processAsync",
  29769. value: function processAsync(params) {
  29770. if (!(params instanceof SetLayerStatusParameters)) {
  29771. return;
  29772. }
  29773. var me = this,
  29774. method = "POST";
  29775. me.url = me.mapUrl;
  29776. if (params.resourceID == null) {
  29777. me.url = Util_Util.urlPathAppend(me.url, 'tempLayersSet');
  29778. me.lastparams = params;
  29779. me.request({
  29780. method: method,
  29781. scope: me,
  29782. success: me.createTempLayerComplete,
  29783. failure: me.serviceProcessFailed
  29784. });
  29785. } else {
  29786. me.url = Util_Util.urlPathAppend(me.url, "tempLayersSet/" + params.resourceID);
  29787. me.url = Util_Util.urlAppend(me.url, "elementRemain=true&reference=" + params.resourceID + "&holdTime=" + params.holdTime.toString());
  29788. var jsonParameters = '[{';
  29789. jsonParameters += '"type":"UGC",';
  29790. if (params.layerStatusList != null && params.layerStatusList.length > 0) {
  29791. jsonParameters += '"subLayers":' + params.toJSON();
  29792. }
  29793. jsonParameters += ',"visible":' + true + ',';
  29794. jsonParameters += '"name":"' + this.getMapName(this.mapUrl) + '"';
  29795. jsonParameters += '}]';
  29796. me.request({
  29797. method: "PUT",
  29798. data: jsonParameters,
  29799. scope: me,
  29800. success: me.serviceProcessCompleted,
  29801. failure: me.serviceProcessFailed
  29802. });
  29803. }
  29804. }
  29805. /**
  29806. * @function SetLayerStatusService.prototype.createTempLayerComplete
  29807. * @description 设置完成,执行此方法。
  29808. * @param {Object} result - 服务器返回的结果对象,记录设置操作是否成功。
  29809. */
  29810. }, {
  29811. key: "createTempLayerComplete",
  29812. value: function createTempLayerComplete(result) {
  29813. var me = this;
  29814. result = Util_Util.transformResult(result);
  29815. if (result.succeed) {
  29816. me.lastparams.resourceID = result.newResourceID;
  29817. }
  29818. me.processAsync(me.lastparams);
  29819. }
  29820. /**
  29821. * @function SetLayerStatusService.prototype.getMapName
  29822. * @description 获取地图名称。
  29823. * @param {Object} url - 服务地址。
  29824. */
  29825. }, {
  29826. key: "getMapName",
  29827. value: function getMapName(url) {
  29828. var mapUrl = url;
  29829. if (mapUrl.charAt(mapUrl.length - 1) === "/") {
  29830. mapUrl = mapUrl.substr(0, mapUrl.length - 1);
  29831. }
  29832. var index = mapUrl.lastIndexOf("/");
  29833. var mapName = mapUrl.substring(index + 1, mapUrl.length);
  29834. return mapName;
  29835. }
  29836. /**
  29837. * @function SetLayerStatusService.prototype.setLayerCompleted
  29838. * @description 设置完成,执行此方法。
  29839. * @param {Object} result - 服务器返回的结果对象,记录设置操作是否成功。
  29840. */
  29841. }, {
  29842. key: "serviceProcessCompleted",
  29843. value: function serviceProcessCompleted(result, options) {
  29844. var me = this;
  29845. result = Util_Util.transformResult(result);
  29846. if (result != null && me.lastparams != null) {
  29847. result.newResourceID = me.lastparams.resourceID;
  29848. }
  29849. me.events.triggerEvent("processCompleted", {
  29850. result: result,
  29851. options: options
  29852. });
  29853. }
  29854. }]);
  29855. return SetLayerStatusService;
  29856. }(CommonServiceBase);
  29857. ;// CONCATENATED MODULE: ./src/common/iServer/LayerInfoService.js
  29858. function LayerInfoService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  29859. function LayerInfoService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  29860. function LayerInfoService_createClass(Constructor, protoProps, staticProps) { if (protoProps) LayerInfoService_defineProperties(Constructor.prototype, protoProps); if (staticProps) LayerInfoService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  29861. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  29862. * This program are made available under the terms of the Apache License, Version 2.0
  29863. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  29864. /**
  29865. * @class LayerInfoService
  29866. * @category iServer Map Layer
  29867. * @classdesc 图层信息服务类。
  29868. * @extends {ServiceBase}
  29869. * @example
  29870. * new LayerInfoService(url).getLayersInfo(function(result){
  29871. * //doSomething
  29872. * })
  29873. * @param {string} url - 服务地址。请求地图服务,URL 应为:
  29874. * http://{服务器地址}:{服务端口号}/iserver/services/{地图服务名}/rest/maps/{地图名}/tempLayersSet/{tempLayerID}/Rivers@World@@World"。
  29875. * @param {Object} options - 参数。
  29876. * @param {string} [options.proxy] - 服务代理地址。
  29877. * @param {boolean} [options.withCredentials=false] - 请求是否携带cookie。
  29878. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  29879. * @param {Object} [options.headers] - 请求头。
  29880. * @usage
  29881. */
  29882. var LayerInfoService_LayerInfoService = /*#__PURE__*/function () {
  29883. function LayerInfoService(url, options) {
  29884. LayerInfoService_classCallCheck(this, LayerInfoService);
  29885. this.url = url;
  29886. this.options = options || {};
  29887. }
  29888. /**
  29889. * @function LayerInfoService.prototype.getLayersInfo
  29890. * @description 获取图层信息服务。
  29891. * @param {RequestCallback} callback - 回调函数。
  29892. */
  29893. LayerInfoService_createClass(LayerInfoService, [{
  29894. key: "getLayersInfo",
  29895. value: function getLayersInfo(callback) {
  29896. var me = this;
  29897. var getLayersInfoService = new GetLayersInfoService(me.url, {
  29898. proxy: me.options.proxy,
  29899. withCredentials: me.options.withCredentials,
  29900. crossOrigin: me.options.crossOrigin,
  29901. headers: me.options.headers,
  29902. eventListeners: {
  29903. processCompleted: callback,
  29904. processFailed: callback
  29905. }
  29906. });
  29907. getLayersInfoService.processAsync();
  29908. }
  29909. /**
  29910. * @function LayerInfoService.prototype.setLayerInfo
  29911. * @description 设置图层信息服务。可以实现临时图层中子图层的修改。
  29912. * @param {SetLayerInfoParameters} params - 设置图层信息参数类。
  29913. * @param {RequestCallback} callback - 回调函数。
  29914. */
  29915. }, {
  29916. key: "setLayerInfo",
  29917. value: function setLayerInfo(params, callback) {
  29918. if (!params) {
  29919. return;
  29920. }
  29921. var me = this,
  29922. resourceID = params.resourceID,
  29923. tempLayerName = params.tempLayerName,
  29924. layerInfoParams = params.layerInfo;
  29925. if (!resourceID || !tempLayerName) {
  29926. return;
  29927. }
  29928. var url = Util_Util.urlPathAppend(me.url, "tempLayersSet/" + resourceID + "/" + tempLayerName);
  29929. var setLayerInfoService = new SetLayerInfoService(url, {
  29930. proxy: me.options.proxy,
  29931. withCredentials: me.options.withCredentials,
  29932. crossOrigin: me.options.crossOrigin,
  29933. headers: me.options.headers,
  29934. eventListeners: {
  29935. processCompleted: callback,
  29936. processFailed: callback
  29937. }
  29938. });
  29939. setLayerInfoService.processAsync(layerInfoParams);
  29940. }
  29941. /**
  29942. * @function LayerInfoService.prototype.setLayersInfo
  29943. * @description 设置图层信息服务。可以创建新的临时图层和修改现有的临时图层。
  29944. * @param {SetLayersInfoParameters} params - 设置图层信息参数类。
  29945. * @param {RequestCallback} callback - 回调函数。
  29946. */
  29947. }, {
  29948. key: "setLayersInfo",
  29949. value: function setLayersInfo(params, callback) {
  29950. if (!params) {
  29951. return;
  29952. }
  29953. var me = this,
  29954. resourceID = params.resourceID,
  29955. isTempLayers = params.isTempLayers ? params.isTempLayers : false,
  29956. layersInfo = params.layersInfo;
  29957. if (isTempLayers && !resourceID || !layersInfo) {
  29958. return;
  29959. }
  29960. var setLayersInfoService = new SetLayersInfoService(me.url, {
  29961. proxy: me.options.proxy,
  29962. withCredentials: me.options.withCredentials,
  29963. crossOrigin: me.options.crossOrigin,
  29964. headers: me.options.headers,
  29965. eventListeners: {
  29966. processCompleted: callback,
  29967. processFailed: callback
  29968. },
  29969. resourceID: resourceID,
  29970. isTempLayers: isTempLayers
  29971. });
  29972. setLayersInfoService.processAsync(layersInfo);
  29973. }
  29974. /**
  29975. * @function LayerInfoService.prototype.setLayerStatus
  29976. * @description 子图层显示控制服务。负责将子图层显示控制参数传递到服务端,并获取服务端返回的图层显示状态。
  29977. * @param {SetLayerStatusParameters} params - 子图层显示控制参数类。
  29978. * @param {RequestCallback} callback - 回调函数。
  29979. */
  29980. }, {
  29981. key: "setLayerStatus",
  29982. value: function setLayerStatus(params, callback) {
  29983. if (!params) {
  29984. return;
  29985. }
  29986. var me = this;
  29987. var setLayerStatusService = new SetLayerStatusService(me.url, {
  29988. proxy: me.options.proxy,
  29989. withCredentials: me.options.withCredentials,
  29990. crossOrigin: me.options.crossOrigin,
  29991. headers: me.options.headers,
  29992. eventListeners: {
  29993. processCompleted: callback,
  29994. processFailed: callback
  29995. }
  29996. });
  29997. setLayerStatusService.processAsync(params);
  29998. }
  29999. }]);
  30000. return LayerInfoService;
  30001. }();
  30002. ;// CONCATENATED MODULE: ./src/maplibregl/services/LayerInfoService.js
  30003. function LayerInfoService_typeof(obj) { "@babel/helpers - typeof"; return LayerInfoService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, LayerInfoService_typeof(obj); }
  30004. function services_LayerInfoService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  30005. function services_LayerInfoService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  30006. function services_LayerInfoService_createClass(Constructor, protoProps, staticProps) { if (protoProps) services_LayerInfoService_defineProperties(Constructor.prototype, protoProps); if (staticProps) services_LayerInfoService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  30007. function LayerInfoService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) LayerInfoService_setPrototypeOf(subClass, superClass); }
  30008. function LayerInfoService_setPrototypeOf(o, p) { LayerInfoService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return LayerInfoService_setPrototypeOf(o, p); }
  30009. function LayerInfoService_createSuper(Derived) { var hasNativeReflectConstruct = LayerInfoService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = LayerInfoService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = LayerInfoService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return LayerInfoService_possibleConstructorReturn(this, result); }; }
  30010. function LayerInfoService_possibleConstructorReturn(self, call) { if (call && (LayerInfoService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return LayerInfoService_assertThisInitialized(self); }
  30011. function LayerInfoService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  30012. function LayerInfoService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  30013. function LayerInfoService_getPrototypeOf(o) { LayerInfoService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return LayerInfoService_getPrototypeOf(o); }
  30014. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  30015. * This program are made available under the terms of the Apache License, Version 2.0
  30016. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  30017. /**
  30018. * @class LayerInfoService
  30019. * @category iServer Map Layer
  30020. * @classdesc 图层信息服务类。
  30021. * @version 11.1.0
  30022. * @modulecategory Services
  30023. * @extends {ServiceBase}
  30024. * @example
  30025. * new LayerInfoService(url).getLayersInfo(function(result){
  30026. * //doSomething
  30027. * })
  30028. * @param {string} url - 服务地址。请求地图服务,URL 应为:</br>
  30029. * http://{服务器地址}:{服务端口号}/iserver/services/{地图服务名}/rest/maps/{地图名}/tempLayersSet/{tempLayerID}/Rivers@World@@World"。
  30030. * @param {Object} options - 参数。
  30031. * @param {string} [options.proxy] - 服务代理地址。
  30032. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  30033. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  30034. * @param {Object} [options.headers] - 请求头。
  30035. * @usage
  30036. */
  30037. var LayerInfoService = /*#__PURE__*/function (_ServiceBase) {
  30038. LayerInfoService_inherits(LayerInfoService, _ServiceBase);
  30039. var _super = LayerInfoService_createSuper(LayerInfoService);
  30040. function LayerInfoService(url, options) {
  30041. var _this;
  30042. services_LayerInfoService_classCallCheck(this, LayerInfoService);
  30043. _this = _super.call(this, url, options);
  30044. _this._layerInfoService = new LayerInfoService_LayerInfoService(url, options);
  30045. return _this;
  30046. }
  30047. /**
  30048. * @function LayerInfoService.prototype.getLayersInfo
  30049. * @description 获取图层信息服务。
  30050. * @param {RequestCallback} callback - 回调函数。
  30051. * @returns {LayerInfoService} 返回图层信息类。
  30052. */
  30053. services_LayerInfoService_createClass(LayerInfoService, [{
  30054. key: "getLayersInfo",
  30055. value: function getLayersInfo(callback) {
  30056. this._layerInfoService.getLayersInfo(callback);
  30057. }
  30058. /**
  30059. * @function LayerInfoService.prototype.setLayerInfo
  30060. * @description 设置图层信息服务。可以实现临时图层中子图层的修改。
  30061. * @param {SetLayerInfoParameters} params - 设置图层信息参数类。
  30062. * @param {RequestCallback} callback - 回调函数。
  30063. */
  30064. }, {
  30065. key: "setLayerInfo",
  30066. value: function setLayerInfo(params, callback) {
  30067. this._layerInfoService.setLayerInfo(params, callback);
  30068. }
  30069. /**
  30070. * @function LayerInfoService.prototype.setLayersInfo
  30071. * @description 设置图层信息服务。可以实现创建新的临时图层和对现有临时图层的修改。
  30072. * @param {SetLayersInfoParameters} params - 设置图层信息参数类,包括临时图层。
  30073. * @param {RequestCallback} callback - 回调函数。
  30074. */
  30075. }, {
  30076. key: "setLayersInfo",
  30077. value: function setLayersInfo(params, callback) {
  30078. this._layerInfoService.setLayersInfo(params, callback);
  30079. }
  30080. /**
  30081. * @function LayerInfoService.prototype.setLayerStatus
  30082. * @description 子图层显示控制服务。负责将子图层显示控制参数传递到服务端,并获取服务端返回的图层显示状态。
  30083. * @param {SetLayerStatusParameters} params - 子图层显示控制参数类。
  30084. * @param {RequestCallback} callback 回调函数。
  30085. */
  30086. }, {
  30087. key: "setLayerStatus",
  30088. value: function setLayerStatus(params, callback) {
  30089. this._layerInfoService.setLayerStatus(params, callback);
  30090. }
  30091. }]);
  30092. return LayerInfoService;
  30093. }(ServiceBase);
  30094. ;// CONCATENATED MODULE: ./src/common/iServer/MapService.js
  30095. function MapService_typeof(obj) { "@babel/helpers - typeof"; return MapService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, MapService_typeof(obj); }
  30096. function MapService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  30097. function MapService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  30098. function MapService_createClass(Constructor, protoProps, staticProps) { if (protoProps) MapService_defineProperties(Constructor.prototype, protoProps); if (staticProps) MapService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  30099. function MapService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { MapService_get = Reflect.get.bind(); } else { MapService_get = function _get(target, property, receiver) { var base = MapService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return MapService_get.apply(this, arguments); }
  30100. function MapService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = MapService_getPrototypeOf(object); if (object === null) break; } return object; }
  30101. function MapService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) MapService_setPrototypeOf(subClass, superClass); }
  30102. function MapService_setPrototypeOf(o, p) { MapService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return MapService_setPrototypeOf(o, p); }
  30103. function MapService_createSuper(Derived) { var hasNativeReflectConstruct = MapService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = MapService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = MapService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return MapService_possibleConstructorReturn(this, result); }; }
  30104. function MapService_possibleConstructorReturn(self, call) { if (call && (MapService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return MapService_assertThisInitialized(self); }
  30105. function MapService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  30106. function MapService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  30107. function MapService_getPrototypeOf(o) { MapService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return MapService_getPrototypeOf(o); }
  30108. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  30109. * This program are made available under the terms of the Apache License, Version 2.0
  30110. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  30111. /**
  30112. * @class MapService
  30113. * @deprecatedclass SuperMap.MapService
  30114. * @category iServer Map
  30115. * @classdesc 地图信息服务类。
  30116. * @extends {CommonServiceBase}
  30117. * @example
  30118. * var myMapService = new MapService(url, {
  30119. * eventListeners:{
  30120. * "processCompleted": MapServiceCompleted,
  30121. * "processFailed": MapServiceFailed
  30122. * }
  30123. * });
  30124. *
  30125. * @param {string} url - 服务地址。如:http://localhost:8090/iserver/services/map-world/rest/maps/World+Map 。
  30126. * @param {Object} options - 参数。
  30127. * @param {Object} options.eventListeners - 事件监听器对象。有 processCompleted 属性可传入处理完成后的回调函数。processFailed 属性传入处理失败后的回调函数。
  30128. * @param {DataFormat} [options.format=DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
  30129. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  30130. * @param {Object} [options.headers] - 请求头。
  30131. * @usage
  30132. */
  30133. var MapService_MapService = /*#__PURE__*/function (_CommonServiceBase) {
  30134. MapService_inherits(MapService, _CommonServiceBase);
  30135. var _super = MapService_createSuper(MapService);
  30136. function MapService(url, options) {
  30137. var _this;
  30138. MapService_classCallCheck(this, MapService);
  30139. _this = _super.call(this, url, options);
  30140. /**
  30141. * @member {string} MapService.prototype.projection
  30142. * @description 根据投影参数获取地图状态信息。如"EPSG:4326"
  30143. */
  30144. _this.projection = null;
  30145. _this.CLASS_NAME = "SuperMap.MapService";
  30146. if (options) {
  30147. Util_Util.extend(MapService_assertThisInitialized(_this), options);
  30148. }
  30149. var me = MapService_assertThisInitialized(_this);
  30150. if (me.projection) {
  30151. var arr = me.projection.split(":");
  30152. if (arr instanceof Array) {
  30153. if (arr.length === 2) {
  30154. me.url = Util_Util.urlAppend(me.url, "prjCoordSys=".concat(encodeURIComponent("{\"epsgCode\":\"".concat(arr[1], "\"}"))));
  30155. }
  30156. if (arr.length === 1) {
  30157. me.url = Util_Util.urlAppend(me.url, "prjCoordSys=".concat(encodeURIComponent("{\"epsgCode\":\"".concat(arr[0], "\"}"))));
  30158. }
  30159. }
  30160. }
  30161. _this.eventCount = 0;
  30162. return _this;
  30163. }
  30164. /**
  30165. * @function destroy
  30166. * @description 释放资源,将引用的资源属性置空。
  30167. */
  30168. MapService_createClass(MapService, [{
  30169. key: "destroy",
  30170. value: function destroy() {
  30171. MapService_get(MapService_getPrototypeOf(MapService.prototype), "destroy", this).call(this);
  30172. var me = this;
  30173. if (me.events) {
  30174. me.events.un(me.eventListeners);
  30175. me.events.listeners = null;
  30176. me.events.destroy();
  30177. me.events = null;
  30178. me.eventListeners = null;
  30179. }
  30180. }
  30181. /**
  30182. * @function MapService.prototype.processAsync
  30183. * @description 负责将客户端的设置的参数传递到服务端,与服务端完成异步通讯。
  30184. */
  30185. }, {
  30186. key: "processAsync",
  30187. value: function processAsync(callback) {
  30188. var eventId = ++this.eventCount;
  30189. var eventListeners = {
  30190. scope: this,
  30191. processCompleted: function processCompleted(result) {
  30192. if (eventId === result.result.eventId && callback) {
  30193. delete result.result.eventId;
  30194. callback(result);
  30195. this.events && this.events.un(eventListeners);
  30196. return false;
  30197. }
  30198. },
  30199. processFailed: function processFailed(result) {
  30200. if ((eventId === result.error.eventId || eventId === result.eventId) && callback) {
  30201. callback(result);
  30202. this.events && this.events.un(eventListeners);
  30203. return false;
  30204. }
  30205. }
  30206. };
  30207. this.events.on(eventListeners);
  30208. var me = this;
  30209. me.request({
  30210. method: "GET",
  30211. scope: me,
  30212. success: function success(result, options) {
  30213. result.eventId = eventId;
  30214. this.serviceProcessCompleted(result, options);
  30215. },
  30216. failure: function failure(result, options) {
  30217. if (result.error) {
  30218. result.error.eventId = eventId;
  30219. }
  30220. result.eventId = eventId;
  30221. this.serviceProcessFailed(result, options);
  30222. }
  30223. });
  30224. }
  30225. /*
  30226. * Method: getMapStatusCompleted
  30227. * 获取地图状态完成,执行此方法。
  30228. *
  30229. * Parameters:
  30230. * {Object} result - 服务器返回的结果对象。
  30231. */
  30232. }, {
  30233. key: "serviceProcessCompleted",
  30234. value: function serviceProcessCompleted(result, options) {
  30235. var me = this;
  30236. result = Util_Util.transformResult(result);
  30237. var codeStatus = result.code >= 200 && result.code < 300 || result.code == 0 || result.code === 304;
  30238. var isCodeValid = result.code && codeStatus;
  30239. if (!result.code || isCodeValid) {
  30240. me.events && me.events.triggerEvent("processCompleted", {
  30241. result: result,
  30242. options: options
  30243. });
  30244. } else {
  30245. ////在没有token是返回的是200,但是其实是没有权限,所以这里也应该是触发失败事件
  30246. me.events.triggerEvent("processFailed", {
  30247. error: result,
  30248. options: options
  30249. });
  30250. }
  30251. }
  30252. }]);
  30253. return MapService;
  30254. }(CommonServiceBase);
  30255. ;// CONCATENATED MODULE: ./src/common/iServer/TilesetsService.js
  30256. function TilesetsService_typeof(obj) { "@babel/helpers - typeof"; return TilesetsService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, TilesetsService_typeof(obj); }
  30257. function TilesetsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  30258. function TilesetsService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  30259. function TilesetsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) TilesetsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) TilesetsService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  30260. function TilesetsService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { TilesetsService_get = Reflect.get.bind(); } else { TilesetsService_get = function _get(target, property, receiver) { var base = TilesetsService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return TilesetsService_get.apply(this, arguments); }
  30261. function TilesetsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = TilesetsService_getPrototypeOf(object); if (object === null) break; } return object; }
  30262. function TilesetsService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) TilesetsService_setPrototypeOf(subClass, superClass); }
  30263. function TilesetsService_setPrototypeOf(o, p) { TilesetsService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return TilesetsService_setPrototypeOf(o, p); }
  30264. function TilesetsService_createSuper(Derived) { var hasNativeReflectConstruct = TilesetsService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = TilesetsService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = TilesetsService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return TilesetsService_possibleConstructorReturn(this, result); }; }
  30265. function TilesetsService_possibleConstructorReturn(self, call) { if (call && (TilesetsService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return TilesetsService_assertThisInitialized(self); }
  30266. function TilesetsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  30267. function TilesetsService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  30268. function TilesetsService_getPrototypeOf(o) { TilesetsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return TilesetsService_getPrototypeOf(o); }
  30269. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  30270. * This program are made available under the terms of the Apache License, Version 2.0
  30271. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  30272. /**
  30273. * @class TilesetsService
  30274. * @deprecatedclass SuperMap.TilesetsService
  30275. * @category iServer Map Tilesets
  30276. * @classdesc 切片列表信息查询服务类;即查询切片地图服务的切片列表,返回切片集名称、地图切片元数据信息、切片版本集信息。
  30277. * @extends {CommonServiceBase}
  30278. * @param {string} url - 服务地址。URL 应为:
  30279. * http://{服务器地址}:{服务端口号}/iserver/services/{服务名}/rest/maps/map;
  30280. * 例如: "http://localhost:8090/iserver/services/test/rest/maps/tianlocal"。
  30281. * @param {Object} options - 参数。
  30282. * @param {Object} options.eventListeners - 事件监听器对象。有 processCompleted 属性可传入处理完成后的回调函数。processFailed 属性传入处理失败后的回调函数。
  30283. * @param {DataFormat} [options.format=DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
  30284. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  30285. * @param {Object} [options.headers] - 请求头。
  30286. * @usage
  30287. */
  30288. var TilesetsService = /*#__PURE__*/function (_CommonServiceBase) {
  30289. TilesetsService_inherits(TilesetsService, _CommonServiceBase);
  30290. var _super = TilesetsService_createSuper(TilesetsService);
  30291. function TilesetsService(url, options) {
  30292. var _this;
  30293. TilesetsService_classCallCheck(this, TilesetsService);
  30294. _this = _super.call(this, url, options);
  30295. _this.CLASS_NAME = "SuperMap.TilesetsService";
  30296. return _this;
  30297. }
  30298. /**
  30299. * @override
  30300. */
  30301. TilesetsService_createClass(TilesetsService, [{
  30302. key: "destroy",
  30303. value: function destroy() {
  30304. TilesetsService_get(TilesetsService_getPrototypeOf(TilesetsService.prototype), "destroy", this).call(this);
  30305. }
  30306. /**
  30307. * @function TilesetsService.prototype.processAsync
  30308. * @description 负责将客户端的查询参数传递到服务端。
  30309. */
  30310. }, {
  30311. key: "processAsync",
  30312. value: function processAsync() {
  30313. if (!this.url) {
  30314. return;
  30315. }
  30316. var me = this;
  30317. me.url = Util_Util.urlPathAppend(me.url, 'tilesets');
  30318. me.request({
  30319. method: "GET",
  30320. scope: me,
  30321. success: me.serviceProcessCompleted,
  30322. failure: me.serviceProcessFailed
  30323. });
  30324. }
  30325. }]);
  30326. return TilesetsService;
  30327. }(CommonServiceBase);
  30328. ;// CONCATENATED MODULE: ./src/maplibregl/services/MapService.js
  30329. function services_MapService_typeof(obj) { "@babel/helpers - typeof"; return services_MapService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, services_MapService_typeof(obj); }
  30330. function services_MapService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  30331. function services_MapService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  30332. function services_MapService_createClass(Constructor, protoProps, staticProps) { if (protoProps) services_MapService_defineProperties(Constructor.prototype, protoProps); if (staticProps) services_MapService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  30333. function services_MapService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) services_MapService_setPrototypeOf(subClass, superClass); }
  30334. function services_MapService_setPrototypeOf(o, p) { services_MapService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return services_MapService_setPrototypeOf(o, p); }
  30335. function services_MapService_createSuper(Derived) { var hasNativeReflectConstruct = services_MapService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = services_MapService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = services_MapService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return services_MapService_possibleConstructorReturn(this, result); }; }
  30336. function services_MapService_possibleConstructorReturn(self, call) { if (call && (services_MapService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return services_MapService_assertThisInitialized(self); }
  30337. function services_MapService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  30338. function services_MapService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  30339. function services_MapService_getPrototypeOf(o) { services_MapService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return services_MapService_getPrototypeOf(o); }
  30340. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  30341. * This program are made available under the terms of the Apache License, Version 2.0
  30342. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  30343. /**
  30344. * @class MapService
  30345. * @category iServer Map
  30346. * @classdesc 地图信息服务类。
  30347. * @version 11.1.0
  30348. * @modulecategory Services
  30349. * @extends {ServiceBase}
  30350. * @param {string} url - 服务地址。
  30351. * @param {Object} options - 参数。
  30352. * @param {string} [options.proxy] - 服务代理地址。
  30353. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  30354. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  30355. * @param {Object} [options.headers] - 请求头。
  30356. * @example
  30357. * new MapService(url)
  30358. * .getMapInfo(function(result){
  30359. * //doSomething
  30360. * })
  30361. * @usage
  30362. */
  30363. var MapService = /*#__PURE__*/function (_ServiceBase) {
  30364. services_MapService_inherits(MapService, _ServiceBase);
  30365. var _super = services_MapService_createSuper(MapService);
  30366. function MapService(url, options) {
  30367. services_MapService_classCallCheck(this, MapService);
  30368. return _super.call(this, url, options);
  30369. }
  30370. /**
  30371. * @function MapService.prototype.getMapInfo
  30372. * @description 地图信息查询服务。
  30373. * @param {RequestCallback} callback 回调函数。
  30374. * @returns {MapService} 获取服务信息。
  30375. */
  30376. services_MapService_createClass(MapService, [{
  30377. key: "getMapInfo",
  30378. value: function getMapInfo(callback) {
  30379. var me = this;
  30380. var getMapStatusService = new MapService_MapService(me.url, {
  30381. proxy: me.options.proxy,
  30382. withCredentials: me.options.withCredentials,
  30383. crossOrigin: me.options.crossOrigin,
  30384. headers: me.options.headers,
  30385. projection: me.options.projection
  30386. });
  30387. getMapStatusService.processAsync(callback);
  30388. }
  30389. /**
  30390. * @function MapService.prototype.getTilesets
  30391. * @description 切片列表信息查询服务。
  30392. * @param {RequestCallback} callback - 回调函数 。
  30393. * @returns {MapService} 获取服务信息。
  30394. */
  30395. }, {
  30396. key: "getTilesets",
  30397. value: function getTilesets(callback) {
  30398. var me = this;
  30399. var tilesetsService = new TilesetsService(me.url, {
  30400. proxy: me.options.proxy,
  30401. withCredentials: me.options.withCredentials,
  30402. crossOrigin: me.options.crossOrigin,
  30403. headers: me.options.headers,
  30404. eventListeners: {
  30405. scope: me,
  30406. processCompleted: callback,
  30407. processFailed: callback
  30408. }
  30409. });
  30410. tilesetsService.processAsync();
  30411. }
  30412. }]);
  30413. return MapService;
  30414. }(ServiceBase);
  30415. ;// CONCATENATED MODULE: ./src/common/iServer/MeasureParameters.js
  30416. function MeasureParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  30417. function MeasureParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  30418. function MeasureParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) MeasureParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) MeasureParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  30419. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  30420. * This program are made available under the terms of the Apache License, Version 2.0
  30421. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  30422. /**
  30423. * @class MeasureParameters
  30424. * @deprecatedclass SuperMap.MeasureParameters
  30425. * @category iServer Map Measure
  30426. * @classdesc 量算参数类。
  30427. * @param {GeoJSONObject} geometry - 要量算的几何对象。
  30428. * @param {Object} options - 可选参数。
  30429. * @param {Unit} [options.unit=Unit.METER] - 量算单位。
  30430. * @param {string} [options.prjCoordSys] - 用来指定该量算操作所使用的投影。
  30431. * @param {string} [options.distanceMode="Geodesic"] - 用来指定量算的方式为按球面长度 'Geodesic' 或者平面长度 'Planar' 来计算。
  30432. * @usage
  30433. */
  30434. var MeasureParameters = /*#__PURE__*/function () {
  30435. function MeasureParameters(geometry, options) {
  30436. MeasureParameters_classCallCheck(this, MeasureParameters);
  30437. if (!geometry) {
  30438. return;
  30439. }
  30440. /**
  30441. * @member {GeoJSONObject} MeasureParameters.prototype.geometry
  30442. * @description 要量算的几何对象。<br>
  30443. * 点类型可以是:{@link GeometryPoint}|{@link L.Marker}|{@link L.CircleMarker}|{@link L.Circle}|{@link L.GeoJSON}|{@link ol.geom.Point}|{@link ol.format.GeoJSON}|{@link GeoJSONObject}。<br>
  30444. * 线类型可以是:{@link GeometryLineString}|{@link GeometryLinearRing}|{@link L.Polyline}|{@link L.GeoJSON}|{@link ol.geom.LineString}|{@link ol.format.GeoJSON}|{@link GeoJSONObject}。<br>
  30445. * 面类型可以是:{@link GeometryPolygon}|{@link L.Polygon}|{@link L.GeoJSON}|{@link ol.geom.Polygon}|{@link ol.format.GeoJSON}|{@link GeoJSONObject}。
  30446. */
  30447. this.geometry = geometry;
  30448. /**
  30449. * @member {Unit} [MeasureParameters.prototype.unit=Unit.METER]
  30450. * @description 量算单位。即量算结果以米为单位。
  30451. */
  30452. this.unit = Unit.METER;
  30453. /**
  30454. * @member {string} [MeasureParameters.prototype.prjCoordSys]
  30455. * @description 用来指定该量算操作所使用的投影。
  30456. */
  30457. this.prjCoordSys = null;
  30458. /**
  30459. * @member {string} [MeasureParameters.prototype.distanceMode="Geodesic"]
  30460. * @description 用来指定量算的方式为按球面长度 'Geodesic' 或者平面长度 'Planar' 来计算。
  30461. * @example
  30462. * var param = new MeasureParameters(getmetry,{distanceMode:'Planar'});
  30463. */
  30464. this.distanceMode = null;
  30465. if (options) {
  30466. Util_Util.extend(this, options);
  30467. }
  30468. this.CLASS_NAME = "SuperMap.MeasureParameters";
  30469. }
  30470. /**
  30471. * @function MeasureParameters.prototype.destroy
  30472. * @description 释放资源,将引用资源的属性置空。
  30473. */
  30474. MeasureParameters_createClass(MeasureParameters, [{
  30475. key: "destroy",
  30476. value: function destroy() {
  30477. var me = this;
  30478. me.geometry = null;
  30479. me.unit = null;
  30480. me.prjCoordSys = null;
  30481. }
  30482. }]);
  30483. return MeasureParameters;
  30484. }();
  30485. ;// CONCATENATED MODULE: ./src/common/iServer/MeasureService.js
  30486. function MeasureService_typeof(obj) { "@babel/helpers - typeof"; return MeasureService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, MeasureService_typeof(obj); }
  30487. function MeasureService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  30488. function MeasureService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  30489. function MeasureService_createClass(Constructor, protoProps, staticProps) { if (protoProps) MeasureService_defineProperties(Constructor.prototype, protoProps); if (staticProps) MeasureService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  30490. function MeasureService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { MeasureService_get = Reflect.get.bind(); } else { MeasureService_get = function _get(target, property, receiver) { var base = MeasureService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return MeasureService_get.apply(this, arguments); }
  30491. function MeasureService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = MeasureService_getPrototypeOf(object); if (object === null) break; } return object; }
  30492. function MeasureService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) MeasureService_setPrototypeOf(subClass, superClass); }
  30493. function MeasureService_setPrototypeOf(o, p) { MeasureService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return MeasureService_setPrototypeOf(o, p); }
  30494. function MeasureService_createSuper(Derived) { var hasNativeReflectConstruct = MeasureService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = MeasureService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = MeasureService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return MeasureService_possibleConstructorReturn(this, result); }; }
  30495. function MeasureService_possibleConstructorReturn(self, call) { if (call && (MeasureService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return MeasureService_assertThisInitialized(self); }
  30496. function MeasureService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  30497. function MeasureService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  30498. function MeasureService_getPrototypeOf(o) { MeasureService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return MeasureService_getPrototypeOf(o); }
  30499. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  30500. * This program are made available under the terms of the Apache License, Version 2.0
  30501. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  30502. /**
  30503. * @class MeasureService
  30504. * @deprecatedclass SuperMap.MeasureService
  30505. * @category iServer Map Measure
  30506. * @classdesc 量算服务类。
  30507. * 该类负责将量算参数传递到服务端,并获取服务端返回的量算结果。
  30508. * @extends {CommonServiceBase}
  30509. * @example
  30510. * var myMeasuerService = new MeasureService(url, {
  30511. * measureMode: MeasureMode.DISTANCE,
  30512. * eventListeners:{
  30513. * "processCompleted": measureCompleted
  30514. * }
  30515. * });
  30516. * @param {string} url - 服务地址。如:http://localhost:8090/iserver/services/map-world/rest/maps/World+Map 。
  30517. * @param {Object} options - 参数。
  30518. * @param {Object} options.eventListeners - 事件监听器对象。有 processCompleted 属性可传入处理完成后的回调函数。processFailed 属性传入处理失败后的回调函数。
  30519. * @param {DataFormat} [options.format=DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
  30520. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  30521. * @param {Object} [options.headers] - 请求头。
  30522. * @param {MeasureMode} options.measureMode - 量算模式,包括距离量算模式和面积量算模式。
  30523. * @usage
  30524. */
  30525. var MeasureService_MeasureService = /*#__PURE__*/function (_CommonServiceBase) {
  30526. MeasureService_inherits(MeasureService, _CommonServiceBase);
  30527. var _super = MeasureService_createSuper(MeasureService);
  30528. function MeasureService(url, options) {
  30529. var _this;
  30530. MeasureService_classCallCheck(this, MeasureService);
  30531. _this = _super.call(this, url, options);
  30532. /**
  30533. * @member {MeasureMode} [MeasureService.prototype.measureMode=MeasureMode.DISTANCE]
  30534. * @description 量算模式,包括距离量算模式和面积量算模式。
  30535. */
  30536. _this.measureMode = MeasureMode.DISTANCE;
  30537. if (options) {
  30538. Util_Util.extend(MeasureService_assertThisInitialized(_this), options);
  30539. }
  30540. _this.eventCount = 0;
  30541. _this.CLASS_NAME = "SuperMap.MeasureService";
  30542. return _this;
  30543. }
  30544. /**
  30545. * @override
  30546. */
  30547. MeasureService_createClass(MeasureService, [{
  30548. key: "destroy",
  30549. value: function destroy() {
  30550. MeasureService_get(MeasureService_getPrototypeOf(MeasureService.prototype), "destroy", this).call(this);
  30551. var me = this;
  30552. me.measureMode = null;
  30553. }
  30554. /**
  30555. * @function MeasureService.prototype.processAsync
  30556. * @description 负责将客户端的量算参数传递到服务端。
  30557. * @param {MeasureParameters} params - 量算参数。
  30558. */
  30559. }, {
  30560. key: "processAsync",
  30561. value: function processAsync(params, callback) {
  30562. if (!(params instanceof MeasureParameters)) {
  30563. return;
  30564. }
  30565. var eventId = ++this.eventCount;
  30566. var eventListeners = {
  30567. scope: this,
  30568. processCompleted: function processCompleted(result) {
  30569. if (eventId === result.result.eventId && callback) {
  30570. delete result.result.eventId;
  30571. callback(result);
  30572. this.events && this.events.un(eventListeners);
  30573. return false;
  30574. }
  30575. },
  30576. processFailed: function processFailed(result) {
  30577. if ((eventId === result.error.eventId || eventId === result.eventId) && callback) {
  30578. callback(result);
  30579. this.events && this.events.un(eventListeners);
  30580. return false;
  30581. }
  30582. }
  30583. };
  30584. this.events.on(eventListeners);
  30585. var me = this,
  30586. geometry = params.geometry,
  30587. pointsCount = 0,
  30588. point2ds = null;
  30589. if (!geometry) {
  30590. return;
  30591. }
  30592. me.url = Util_Util.urlPathAppend(me.url, me.measureMode === MeasureMode.AREA ? 'area' : 'distance');
  30593. var serverGeometry = ServerGeometry.fromGeometry(geometry);
  30594. if (!serverGeometry) {
  30595. return;
  30596. }
  30597. pointsCount = serverGeometry.parts[0];
  30598. point2ds = serverGeometry.points.splice(0, pointsCount);
  30599. var prjCoordSysTemp, prjCodeTemp, paramsTemp;
  30600. if (params.prjCoordSys) {
  30601. if (MeasureService_typeof(params.prjCoordSys) === "object") {
  30602. prjCodeTemp = params.prjCoordSys.projCode;
  30603. prjCoordSysTemp = '{"epsgCode"' + prjCodeTemp.substring(prjCodeTemp.indexOf(":"), prjCodeTemp.length) + "}";
  30604. } else if (typeof params.prjCoordSys === "string") {
  30605. prjCoordSysTemp = '{"epsgCode"' + params.prjCoordSys.substring(params.prjCoordSys.indexOf(":"), params.prjCoordSys.length) + "}";
  30606. }
  30607. paramsTemp = {
  30608. "point2Ds": Util_Util.toJSON(point2ds),
  30609. "unit": params.unit,
  30610. "prjCoordSys": prjCoordSysTemp,
  30611. "distanceMode": params.distanceMode || 'Geodesic'
  30612. };
  30613. } else {
  30614. paramsTemp = {
  30615. "point2Ds": Util_Util.toJSON(point2ds),
  30616. "unit": params.unit,
  30617. "distanceMode": params.distanceMode || 'Geodesic'
  30618. };
  30619. }
  30620. me.request({
  30621. method: "GET",
  30622. params: paramsTemp,
  30623. scope: me,
  30624. success: function success(result, options) {
  30625. result.eventId = eventId;
  30626. this.serviceProcessCompleted(result, options);
  30627. },
  30628. failure: function failure(result, options) {
  30629. if (result.error) {
  30630. result.error.eventId = eventId;
  30631. }
  30632. result.eventId = eventId;
  30633. this.serviceProcessFailed(result, options);
  30634. }
  30635. });
  30636. }
  30637. }]);
  30638. return MeasureService;
  30639. }(CommonServiceBase);
  30640. ;// CONCATENATED MODULE: ./src/maplibregl/services/MeasureService.js
  30641. function services_MeasureService_typeof(obj) { "@babel/helpers - typeof"; return services_MeasureService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, services_MeasureService_typeof(obj); }
  30642. function services_MeasureService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  30643. function services_MeasureService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  30644. function services_MeasureService_createClass(Constructor, protoProps, staticProps) { if (protoProps) services_MeasureService_defineProperties(Constructor.prototype, protoProps); if (staticProps) services_MeasureService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  30645. function services_MeasureService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) services_MeasureService_setPrototypeOf(subClass, superClass); }
  30646. function services_MeasureService_setPrototypeOf(o, p) { services_MeasureService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return services_MeasureService_setPrototypeOf(o, p); }
  30647. function services_MeasureService_createSuper(Derived) { var hasNativeReflectConstruct = services_MeasureService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = services_MeasureService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = services_MeasureService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return services_MeasureService_possibleConstructorReturn(this, result); }; }
  30648. function services_MeasureService_possibleConstructorReturn(self, call) { if (call && (services_MeasureService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return services_MeasureService_assertThisInitialized(self); }
  30649. function services_MeasureService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  30650. function services_MeasureService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  30651. function services_MeasureService_getPrototypeOf(o) { services_MeasureService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return services_MeasureService_getPrototypeOf(o); }
  30652. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  30653. * This program are made available under the terms of the Apache License, Version 2.0
  30654. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  30655. /**
  30656. * @class MeasureService
  30657. * @category iServer Map Measure
  30658. * @classdesc 量算服务类。
  30659. * @version 11.1.0
  30660. * @modulecategory Services
  30661. * @extends {ServiceBase}
  30662. * @param {string} url - 服务地址。如:http://localhost:8090/iserver/services/map-world/rest/maps/World+Map。
  30663. * @param {Object} options - 参数。
  30664. * @param {string} [options.proxy] - 服务代理地址。
  30665. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  30666. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  30667. * @param {Object} [options.headers] - 请求头。
  30668. * @param {MeasureMode} [options.measureMode=MeasureMode.DISTANCE] - 量算模式,包括距离量算模式和面积量算模式。
  30669. * @usage
  30670. */
  30671. var MeasureService = /*#__PURE__*/function (_ServiceBase) {
  30672. services_MeasureService_inherits(MeasureService, _ServiceBase);
  30673. var _super = services_MeasureService_createSuper(MeasureService);
  30674. function MeasureService(url, options) {
  30675. services_MeasureService_classCallCheck(this, MeasureService);
  30676. return _super.call(this, url, options);
  30677. }
  30678. /**
  30679. * @function MeasureService.prototype.measureDistance
  30680. * @description 距离量算。
  30681. * @param {MeasureParameters} params - 量算参数类。
  30682. * @param {RequestCallback} callback 回调函数。
  30683. */
  30684. services_MeasureService_createClass(MeasureService, [{
  30685. key: "measureDistance",
  30686. value: function measureDistance(params, callback) {
  30687. this.measure(params, 'DISTANCE', callback);
  30688. }
  30689. /**
  30690. * @function MeasureService.prototype.measureArea
  30691. * @description 面积量算。
  30692. * @param {MeasureParameters} params - 量算参数类。
  30693. * @param {RequestCallback} callback 回调函数。
  30694. */
  30695. }, {
  30696. key: "measureArea",
  30697. value: function measureArea(params, callback) {
  30698. this.measure(params, 'AREA', callback);
  30699. }
  30700. /**
  30701. * @function MeasureService.prototype.measure
  30702. * @description 量算。
  30703. * @param {MeasureParameters} params - 量算参数类。
  30704. * @param {string} type - 量算类型。
  30705. * @param {RequestCallback} callback - 回调函数。
  30706. * @returns {MeasureService} 量算服务。
  30707. */
  30708. }, {
  30709. key: "measure",
  30710. value: function measure(params, type, callback) {
  30711. var me = this;
  30712. var measureService = new MeasureService_MeasureService(me.url, {
  30713. proxy: me.options.proxy,
  30714. withCredentials: me.options.withCredentials,
  30715. crossOrigin: me.options.crossOrigin,
  30716. headers: me.options.headers,
  30717. measureMode: type
  30718. });
  30719. measureService.processAsync(me._processParam(params), callback);
  30720. }
  30721. }, {
  30722. key: "_processParam",
  30723. value: function _processParam(params) {
  30724. if (params && !(params.geometry instanceof Geometry_Geometry)) {
  30725. params.geometry = core_Util_Util.toSuperMapGeometry(params.geometry);
  30726. }
  30727. return params;
  30728. }
  30729. }]);
  30730. return MeasureService;
  30731. }(ServiceBase);
  30732. ;// CONCATENATED MODULE: ./src/common/iServer/NetworkAnalystServiceBase.js
  30733. function NetworkAnalystServiceBase_typeof(obj) { "@babel/helpers - typeof"; return NetworkAnalystServiceBase_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, NetworkAnalystServiceBase_typeof(obj); }
  30734. function NetworkAnalystServiceBase_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  30735. function NetworkAnalystServiceBase_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  30736. function NetworkAnalystServiceBase_createClass(Constructor, protoProps, staticProps) { if (protoProps) NetworkAnalystServiceBase_defineProperties(Constructor.prototype, protoProps); if (staticProps) NetworkAnalystServiceBase_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  30737. function NetworkAnalystServiceBase_get() { if (typeof Reflect !== "undefined" && Reflect.get) { NetworkAnalystServiceBase_get = Reflect.get.bind(); } else { NetworkAnalystServiceBase_get = function _get(target, property, receiver) { var base = NetworkAnalystServiceBase_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return NetworkAnalystServiceBase_get.apply(this, arguments); }
  30738. function NetworkAnalystServiceBase_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = NetworkAnalystServiceBase_getPrototypeOf(object); if (object === null) break; } return object; }
  30739. function NetworkAnalystServiceBase_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) NetworkAnalystServiceBase_setPrototypeOf(subClass, superClass); }
  30740. function NetworkAnalystServiceBase_setPrototypeOf(o, p) { NetworkAnalystServiceBase_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return NetworkAnalystServiceBase_setPrototypeOf(o, p); }
  30741. function NetworkAnalystServiceBase_createSuper(Derived) { var hasNativeReflectConstruct = NetworkAnalystServiceBase_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = NetworkAnalystServiceBase_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = NetworkAnalystServiceBase_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return NetworkAnalystServiceBase_possibleConstructorReturn(this, result); }; }
  30742. function NetworkAnalystServiceBase_possibleConstructorReturn(self, call) { if (call && (NetworkAnalystServiceBase_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return NetworkAnalystServiceBase_assertThisInitialized(self); }
  30743. function NetworkAnalystServiceBase_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  30744. function NetworkAnalystServiceBase_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  30745. function NetworkAnalystServiceBase_getPrototypeOf(o) { NetworkAnalystServiceBase_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return NetworkAnalystServiceBase_getPrototypeOf(o); }
  30746. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  30747. * This program are made available under the terms of the Apache License, Version 2.0
  30748. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  30749. /**
  30750. * @class NetworkAnalystServiceBase
  30751. * @deprecatedclass SuperMap.NetworkAnalystServiceBase
  30752. * @category iServer Core
  30753. * @classdesc 网络分析服务基类。
  30754. * @extends {CommonServiceBase}
  30755. * @param {string} url - 服务地址。
  30756. * @param {Object} options - 可选参数。
  30757. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  30758. * @param {Object} [options.headers] - 请求头。
  30759. * @usage
  30760. */
  30761. var NetworkAnalystServiceBase = /*#__PURE__*/function (_CommonServiceBase) {
  30762. NetworkAnalystServiceBase_inherits(NetworkAnalystServiceBase, _CommonServiceBase);
  30763. var _super = NetworkAnalystServiceBase_createSuper(NetworkAnalystServiceBase);
  30764. function NetworkAnalystServiceBase(url, options) {
  30765. var _this;
  30766. NetworkAnalystServiceBase_classCallCheck(this, NetworkAnalystServiceBase);
  30767. _this = _super.call(this, url, options);
  30768. /**
  30769. * @member {DataFormat} [NetworkAnalystServiceBase.prototype.format=DataFormat.GEOJSON]
  30770. * @description 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式,参数格式为 "ISERVER","GEOJSON"
  30771. */
  30772. _this.format = DataFormat.GEOJSON;
  30773. _this.CLASS_NAME = "SuperMap.NetworkAnalystServiceBase";
  30774. return _this;
  30775. }
  30776. /**
  30777. * @function NetworkAnalystServiceBase.prototype.destroy
  30778. * @description 释放资源,将引用的资源属性置空。
  30779. */
  30780. NetworkAnalystServiceBase_createClass(NetworkAnalystServiceBase, [{
  30781. key: "destroy",
  30782. value: function destroy() {
  30783. NetworkAnalystServiceBase_get(NetworkAnalystServiceBase_getPrototypeOf(NetworkAnalystServiceBase.prototype), "destroy", this).call(this);
  30784. this.format = null;
  30785. }
  30786. /**
  30787. * @function NetworkAnalystServiceBase.prototype.serviceProcessCompleted
  30788. * @description 分析完成,执行此方法。
  30789. * @param {Object} result - 服务器返回的结果对象。
  30790. */
  30791. }, {
  30792. key: "serviceProcessCompleted",
  30793. value: function serviceProcessCompleted(result, options) {
  30794. var me = this,
  30795. analystResult;
  30796. result = Util_Util.transformResult(result);
  30797. if (result && me.format === DataFormat.GEOJSON && typeof me.toGeoJSONResult === 'function') {
  30798. analystResult = me.toGeoJSONResult(result);
  30799. }
  30800. if (!analystResult) {
  30801. analystResult = result;
  30802. }
  30803. me.events.triggerEvent("processCompleted", {
  30804. result: analystResult,
  30805. options: options
  30806. });
  30807. }
  30808. /**
  30809. * @function NetworkAnalystServiceBase.prototype.toGeoJSONResult
  30810. * @description 将含有 geometry 的数据转换为 GeoJSON 格式。只处理结果中的路由,由子类实现。
  30811. * @param {Object} result - 服务器返回的结果对象。
  30812. * @returns {GeoJSONObject} GeoJSON 对象。
  30813. */
  30814. }, {
  30815. key: "toGeoJSONResult",
  30816. value: function toGeoJSONResult(result) {
  30817. // eslint-disable-line no-unused-vars
  30818. return null;
  30819. }
  30820. }]);
  30821. return NetworkAnalystServiceBase;
  30822. }(CommonServiceBase);
  30823. ;// CONCATENATED MODULE: ./src/common/iServer/BurstPipelineAnalystParameters.js
  30824. function BurstPipelineAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  30825. function BurstPipelineAnalystParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  30826. function BurstPipelineAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) BurstPipelineAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) BurstPipelineAnalystParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  30827. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  30828. * This program are made available under the terms of the Apache License, Version 2.0
  30829. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  30830. /**
  30831. * @class BurstPipelineAnalystParameters
  30832. * @deprecatedclass SuperMap.BurstPipelineAnalystParameters
  30833. * @category iServer NetworkAnalyst BurstAnalyse
  30834. * @classdesc 爆管分析参数类。
  30835. * @param {Object} options - 参数。
  30836. * @param {Array.<number>} options.sourceNodeIDs - 指定的设施点 ID 数组。
  30837. * @param {number} [options.edgeID] - 指定的弧段ID,edgeID 与 nodeID 必须指定一个。
  30838. * @param {number} [options.nodeID] - 指定的结点ID,edgeID 与 nodeID 必须指定一个。
  30839. * @param {boolean} [options.isUncertainDirectionValid=false] - 指定不确定流向是否有效。
  30840. * @usage
  30841. */
  30842. var BurstPipelineAnalystParameters = /*#__PURE__*/function () {
  30843. function BurstPipelineAnalystParameters(options) {
  30844. BurstPipelineAnalystParameters_classCallCheck(this, BurstPipelineAnalystParameters);
  30845. var me = this;
  30846. /**
  30847. * @member {Array.<number>} BurstPipelineAnalystParameters.prototype.sourceNodeIDs
  30848. * @description 指定的设施点 ID 数组。
  30849. */
  30850. this.sourceNodeIDs = null;
  30851. /**
  30852. * @member {number} [BurstPipelineAnalystParameters.prototype.edgeID]
  30853. * @description 指定的弧段 ID,edgeID 与 nodeID 必须指定一个。
  30854. */
  30855. this.edgeID = null;
  30856. /**
  30857. * @member {number} [BurstPipelineAnalystParameters.prototype.nodeID]
  30858. * @description 指定的结点 ID,edgeID 与 nodeID 必须指定一个。
  30859. */
  30860. this.nodeID = null;
  30861. /**
  30862. * @member {boolean} [BurstPipelineAnalystParameters.prototype.isUncertainDirectionValid=false]
  30863. * @description 指定不确定流向是否有效。
  30864. * 指定为 true,表示不确定流向有效,遇到不确定流向时分析继续进行。
  30865. * 指定为 false,表示不确定流向无效,遇到不确定流向将停止在该方向上继续查找。
  30866. */
  30867. this.isUncertainDirectionValid = false;
  30868. Util_Util.extend(me, options);
  30869. this.CLASS_NAME = "SuperMap.BurstPipelineAnalystParameters";
  30870. }
  30871. /**
  30872. * @function BurstPipelineAnalystParameters.prototype.destroy
  30873. * @description 释放资源,将引用资源的属性置空。
  30874. */
  30875. BurstPipelineAnalystParameters_createClass(BurstPipelineAnalystParameters, [{
  30876. key: "destroy",
  30877. value: function destroy() {
  30878. var me = this;
  30879. me.sourceNodeIDs = null;
  30880. me.edgeID = null;
  30881. me.nodeID = null;
  30882. me.isUncertainDirectionValid = null;
  30883. }
  30884. }]);
  30885. return BurstPipelineAnalystParameters;
  30886. }();
  30887. ;// CONCATENATED MODULE: ./src/common/iServer/BurstPipelineAnalystService.js
  30888. function BurstPipelineAnalystService_typeof(obj) { "@babel/helpers - typeof"; return BurstPipelineAnalystService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, BurstPipelineAnalystService_typeof(obj); }
  30889. function BurstPipelineAnalystService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  30890. function BurstPipelineAnalystService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  30891. function BurstPipelineAnalystService_createClass(Constructor, protoProps, staticProps) { if (protoProps) BurstPipelineAnalystService_defineProperties(Constructor.prototype, protoProps); if (staticProps) BurstPipelineAnalystService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  30892. function BurstPipelineAnalystService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { BurstPipelineAnalystService_get = Reflect.get.bind(); } else { BurstPipelineAnalystService_get = function _get(target, property, receiver) { var base = BurstPipelineAnalystService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return BurstPipelineAnalystService_get.apply(this, arguments); }
  30893. function BurstPipelineAnalystService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = BurstPipelineAnalystService_getPrototypeOf(object); if (object === null) break; } return object; }
  30894. function BurstPipelineAnalystService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) BurstPipelineAnalystService_setPrototypeOf(subClass, superClass); }
  30895. function BurstPipelineAnalystService_setPrototypeOf(o, p) { BurstPipelineAnalystService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return BurstPipelineAnalystService_setPrototypeOf(o, p); }
  30896. function BurstPipelineAnalystService_createSuper(Derived) { var hasNativeReflectConstruct = BurstPipelineAnalystService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = BurstPipelineAnalystService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = BurstPipelineAnalystService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return BurstPipelineAnalystService_possibleConstructorReturn(this, result); }; }
  30897. function BurstPipelineAnalystService_possibleConstructorReturn(self, call) { if (call && (BurstPipelineAnalystService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return BurstPipelineAnalystService_assertThisInitialized(self); }
  30898. function BurstPipelineAnalystService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  30899. function BurstPipelineAnalystService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  30900. function BurstPipelineAnalystService_getPrototypeOf(o) { BurstPipelineAnalystService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return BurstPipelineAnalystService_getPrototypeOf(o); }
  30901. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  30902. * This program are made available under the terms of the Apache License, Version 2.0
  30903. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  30904. /**
  30905. * @class BurstPipelineAnalystService
  30906. * @deprecatedclass SuperMap.BurstPipelineAnalystService
  30907. * @category iServer NetworkAnalyst BurstAnalyse
  30908. * @classdesc 爆管分析服务类。即将给定弧段或节点作为爆管点来进行分析,返回关键结点 ID 数组、普通结点 ID 数组及其上下游弧段 ID 数组。
  30909. * @extends {NetworkAnalystServiceBase}
  30910. * @param {string} url - 网络分析服务地址。请求网络分析服务,URL应为:
  30911. * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源},
  30912. * 例如: "http://localhost:8090/iserver/services/test/rest/networkanalyst/WaterNet@FacilityNet"。
  30913. * @param {Object} options - 参数。
  30914. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  30915. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  30916. * @param {Object} [options.headers] - 请求头。
  30917. * @usage
  30918. */
  30919. var BurstPipelineAnalystService = /*#__PURE__*/function (_NetworkAnalystServic) {
  30920. BurstPipelineAnalystService_inherits(BurstPipelineAnalystService, _NetworkAnalystServic);
  30921. var _super = BurstPipelineAnalystService_createSuper(BurstPipelineAnalystService);
  30922. function BurstPipelineAnalystService(url, options) {
  30923. var _this;
  30924. BurstPipelineAnalystService_classCallCheck(this, BurstPipelineAnalystService);
  30925. _this = _super.call(this, url, options);
  30926. _this.CLASS_NAME = "SuperMap.BurstPipelineAnalystService";
  30927. return _this;
  30928. }
  30929. /**
  30930. * @function BurstPipelineAnalystService.prototype.destroy
  30931. * @override
  30932. */
  30933. BurstPipelineAnalystService_createClass(BurstPipelineAnalystService, [{
  30934. key: "destroy",
  30935. value: function destroy() {
  30936. BurstPipelineAnalystService_get(BurstPipelineAnalystService_getPrototypeOf(BurstPipelineAnalystService.prototype), "destroy", this).call(this);
  30937. }
  30938. /**
  30939. * @function BurstPipelineAnalystService.prototype.processAsync
  30940. * @description 负责将客户端的查询参数传递到服务端。
  30941. * @params {BurstPipelineAnalystParameters} params - 爆管分析参数类
  30942. */
  30943. }, {
  30944. key: "processAsync",
  30945. value: function processAsync(params) {
  30946. if (!(params instanceof BurstPipelineAnalystParameters)) {
  30947. return null;
  30948. }
  30949. var me = this,
  30950. jsonObject;
  30951. me.url = Util_Util.urlPathAppend(me.url, 'burstAnalyse');
  30952. jsonObject = {
  30953. sourceNodeIDs: params.sourceNodeIDs,
  30954. isUncertainDirectionValid: params.isUncertainDirectionValid
  30955. };
  30956. //必传参数不正确,就终止
  30957. if (params.edgeID !== null && params.nodeID !== null) {
  30958. throw new Error('edgeID and nodeID cannot be null at the same time.');
  30959. }
  30960. if (params.edgeID === null && params.nodeID === null) {
  30961. throw new Error('edgeID and nodeID cannot be null at the same time.');
  30962. }
  30963. if (params.edgeID !== null) {
  30964. jsonObject.edgeID = params.edgeID;
  30965. } else {
  30966. jsonObject.nodeID = params.nodeID;
  30967. }
  30968. me.request({
  30969. method: "GET",
  30970. params: jsonObject,
  30971. scope: me,
  30972. success: me.serviceProcessCompleted,
  30973. failure: me.serviceProcessFailed
  30974. });
  30975. }
  30976. }]);
  30977. return BurstPipelineAnalystService;
  30978. }(NetworkAnalystServiceBase);
  30979. ;// CONCATENATED MODULE: ./src/common/iServer/TransportationAnalystResultSetting.js
  30980. function TransportationAnalystResultSetting_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  30981. function TransportationAnalystResultSetting_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  30982. function TransportationAnalystResultSetting_createClass(Constructor, protoProps, staticProps) { if (protoProps) TransportationAnalystResultSetting_defineProperties(Constructor.prototype, protoProps); if (staticProps) TransportationAnalystResultSetting_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  30983. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  30984. * This program are made available under the terms of the Apache License, Version 2.0
  30985. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  30986. /**
  30987. * @class TransportationAnalystResultSetting
  30988. * @deprecatedclass SuperMap.TransportationAnalystResultSetting
  30989. * @category iServer NetworkAnalyst
  30990. * @classdesc 交通网络分析结果参数类。通过该类设置交通网络分析返回的结果,包括是否返回图片、是否返回弧段空间信息、是否返回结点空间信息等。
  30991. * @param {Object} options - 可选参数。
  30992. * @param {boolean} [options.returnEdgeFeatures=false] - 是否在分析结果中包含弧段要素集合。
  30993. * @param {boolean} [options.returnEdgeGeometry=false] - 返回的弧段要素集合中是否包含几何对象信息。
  30994. * @param {boolean} [options.returnEdgeIDs=false] - 返回结果中是否包含经过弧段 ID 集合。
  30995. * @param {boolean} [options.returnNodeFeatures=false] - 是否在分析结果中包含结点要素集合。
  30996. * @param {boolean} [options.returnNodeGeometry=false] - 返回的结点要素集合中是否包含几何对象信息。
  30997. * @param {boolean} [options.returnNodeIDs=false] - 返回结果中是否包含经过结点 ID 集合。
  30998. * @param {boolean} [options.returnPathGuides=false] - 返回分析结果中是否包含行驶导引集合。
  30999. * @param {boolean} [options.returnRoutes=false] - 返回分析结果中是否包含路由对象的集合。
  31000. * @usage
  31001. */
  31002. var TransportationAnalystResultSetting = /*#__PURE__*/function () {
  31003. function TransportationAnalystResultSetting(options) {
  31004. TransportationAnalystResultSetting_classCallCheck(this, TransportationAnalystResultSetting);
  31005. if (!options) {
  31006. return;
  31007. }
  31008. /**
  31009. * @member {boolean} TransportationAnalystResultSetting.prototype.returnEdgeFeatures
  31010. * @description 是否在分析结果中包含弧段要素集合。弧段要素包括弧段的空间信息和属性信息。
  31011. */
  31012. this.returnEdgeFeatures = false;
  31013. /**
  31014. * @member {boolean} [TransportationAnalystResultSetting.prototype.returnEdgeGeometry=false]
  31015. * @description 返回的弧段要素集合中是否包含几何对象信息。
  31016. */
  31017. this.returnEdgeGeometry = false;
  31018. /**
  31019. * @member {boolean} [TransportationAnalystResultSetting.prototype.returnEdgeIDs=false]
  31020. * @description 返回结果中是否包含经过弧段 ID 集合。
  31021. */
  31022. this.returnEdgeIDs = false;
  31023. /**
  31024. * @member {boolean} [TransportationAnalystResultSetting.prototype.returnNodeFeatures=false]
  31025. * @description 是否在分析结果中包含结点要素集合。
  31026. * 结点要素包括结点的空间信息和属性信息。其中返回的结点要素是否包含空间信息可通过 returnNodeGeometry 字段设置。
  31027. */
  31028. this.returnNodeFeatures = false;
  31029. /**
  31030. * @member {boolean} [TransportationAnalystResultSetting.prototype.returnNodeGeometry=false]
  31031. * @description 返回的结点要素集合中是否包含几何对象信息。
  31032. */
  31033. this.returnNodeGeometry = false;
  31034. /**
  31035. * @member {boolean} [TransportationAnalystResultSetting.prototype.returnNodeIDs=false]
  31036. * @description 返回结果中是否包含经过结点 ID 集合。
  31037. */
  31038. this.returnNodeIDs = false;
  31039. /**
  31040. * @member {boolean} TransportationAnalystResultSetting.prototype.returnPathGuides
  31041. * @description 返回分析结果中是否包含行驶导引集合。
  31042. */
  31043. this.returnPathGuides = false;
  31044. /**
  31045. * @member {boolean} TransportationAnalystResultSetting.prototype.returnRoutes
  31046. * @description 返回分析结果中是否包含路由对象的集合。
  31047. */
  31048. this.returnRoutes = false;
  31049. Util_Util.extend(this, options);
  31050. this.CLASS_NAME = "SuperMap.TransportationAnalystResultSetting";
  31051. }
  31052. /**
  31053. * @function TransportationAnalystResultSetting.prototype.destroy
  31054. * @description 释放资源,将引用资源的属性置空。
  31055. */
  31056. TransportationAnalystResultSetting_createClass(TransportationAnalystResultSetting, [{
  31057. key: "destroy",
  31058. value: function destroy() {
  31059. var me = this;
  31060. me.returnEdgeFeatures = null;
  31061. me.returnEdgeGeometry = null;
  31062. me.returnEdgeIDs = null;
  31063. me.returnNodeFeatures = null;
  31064. me.returnNodeGeometry = null;
  31065. me.returnNodeIDs = null;
  31066. me.returnPathGuides = null;
  31067. me.returnRoutes = null;
  31068. }
  31069. }]);
  31070. return TransportationAnalystResultSetting;
  31071. }();
  31072. ;// CONCATENATED MODULE: ./src/common/iServer/TransportationAnalystParameter.js
  31073. function TransportationAnalystParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  31074. function TransportationAnalystParameter_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  31075. function TransportationAnalystParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) TransportationAnalystParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) TransportationAnalystParameter_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  31076. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  31077. * This program are made available under the terms of the Apache License, Version 2.0
  31078. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  31079. /**
  31080. * @class TransportationAnalystParameter
  31081. * @deprecatedclass SuperMap.TransportationAnalystParameter
  31082. * @category iServer NetworkAnalyst
  31083. * @classdesc 交通网络分析通用参数类。该类主要用来提供交通网络分析所需的通用参数。
  31084. * 通过本类可以设置障碍边、障碍点、权值字段信息的名称标识、转向权值字段等信息,还可以对分析结果包含的内容进行一些设置。
  31085. * @param {Object} options - 参数。
  31086. * @param {Array.<number>} options.barrierEdgeIDs - 网络分析中障碍弧段的 ID 数组。
  31087. * @param {Array.<number>} options.barrierNodeIDs - 网络分析中障碍点的 ID 数组。
  31088. * @param {string} options.turnWeightField - 转向权重字段的名称。
  31089. * @param {TransportationAnalystResultSetting} options.resultSetting - 分析结果返回内容。
  31090. * @param {Array.<GeometryPoint|L.Point|L.LatLng|ol.geom.Point|mapboxgl.LngLat|mapboxgl.Point|Array.<number>>} [options.barrierPoints] - 网络分析中 Point2D 类型的障碍点数组。
  31091. * @param {string} [options.weightFieldName] - 阻力字段的名称。
  31092. * @usage
  31093. */
  31094. var TransportationAnalystParameter = /*#__PURE__*/function () {
  31095. function TransportationAnalystParameter(options) {
  31096. TransportationAnalystParameter_classCallCheck(this, TransportationAnalystParameter);
  31097. if (!options) {
  31098. return;
  31099. }
  31100. /**
  31101. * @member {Array.<number>} TransportationAnalystParameter.prototype.barrierEdgeIDs
  31102. * @description 网络分析中障碍弧段的 ID 数组。弧段设置为障碍边之后,表示双向都不通。
  31103. */
  31104. this.barrierEdgeIDs = null;
  31105. /**
  31106. * @member {Array.<number>} TransportationAnalystParameter.prototype.barrierNodeIDs
  31107. * @description 网络分析中障碍点的 ID 数组。结点设置为障碍点之后,表示任何方向都不能通过此结点。
  31108. */
  31109. this.barrierNodeIDs = null;
  31110. /**
  31111. * @member {Array.<GeometryPoint|L.Point|L.LatLng|ol.geom.Point|mapboxgl.LngLat|mapboxgl.Point|Array.<number>>} TransportationAnalystParameter.prototype.barrierPoints
  31112. * @description 网络分析中 Point2D 类型的障碍点数组。障碍点表示任何方向都不能通过此点。</br>
  31113. * 当各网络分析参数类中的 isAnalyzeById 属性设置为 false 时,该属性才生效。
  31114. */
  31115. this.barrierPoints = null;
  31116. /**
  31117. * @member {string} [TransportationAnalystParameter.prototype.weightFieldName]
  31118. * @description 阻力字段的名称,标识了进行网络分析时所使用的阻力字段,例如表示时间、长度等的字段都可以用作阻力字段。
  31119. * 该字段默值为服务器发布的所有耗费字段的第一个字段。
  31120. */
  31121. this.weightFieldName = null;
  31122. /**
  31123. * @member {string} TransportationAnalystParameter.prototype.turnWeightField
  31124. * @description 转向权重字段的名称。
  31125. */
  31126. this.turnWeightField = null;
  31127. /**
  31128. * @member {TransportationAnalystResultSetting} TransportationAnalystParameter.prototype.resultSetting
  31129. * @description 分析结果返回内容。
  31130. */
  31131. this.resultSetting = new TransportationAnalystResultSetting();
  31132. Util_Util.extend(this, options);
  31133. this.CLASS_NAME = "SuperMap.TransportationAnalystParameter";
  31134. }
  31135. /**
  31136. * @function TransportationAnalystParameter.prototype.destroy
  31137. * @description 释放资源,将引用资源的属性置空。
  31138. */
  31139. TransportationAnalystParameter_createClass(TransportationAnalystParameter, [{
  31140. key: "destroy",
  31141. value: function destroy() {
  31142. var me = this;
  31143. me.barrierEdgeIDs = null;
  31144. me.barrierNodeIDs = null;
  31145. me.weightFieldName = null;
  31146. me.turnWeightField = null;
  31147. if (me.resultSetting) {
  31148. me.resultSetting.destroy();
  31149. me.resultSetting = null;
  31150. }
  31151. if (me.barrierPoints && me.barrierPoints.length) {
  31152. for (var i in me.barrierPoints) {
  31153. me.barrierPoints[i].destroy();
  31154. }
  31155. }
  31156. me.barrierPoints = null;
  31157. }
  31158. }]);
  31159. return TransportationAnalystParameter;
  31160. }();
  31161. ;// CONCATENATED MODULE: ./src/common/iServer/ComputeWeightMatrixParameters.js
  31162. function ComputeWeightMatrixParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  31163. function ComputeWeightMatrixParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  31164. function ComputeWeightMatrixParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) ComputeWeightMatrixParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) ComputeWeightMatrixParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  31165. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  31166. * This program are made available under the terms of the Apache License, Version 2.0
  31167. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  31168. /**
  31169. * @class ComputeWeightMatrixParameters
  31170. * @deprecatedclass SuperMap.ComputeWeightMatrixParameters
  31171. * @category iServer NetworkAnalyst WeightMatrix
  31172. * @classdesc 耗费矩阵分析参数类。根据交通网络分析参数中的耗费字段返回一个耗费矩阵。该矩阵是一个二维数组,用来存储任意两点间的资源消耗。
  31173. * @param {Object} options - 参数。
  31174. * @param {boolean} [options.isAnalyzeById=false] - 是否通过节点 ID 指定路径分析的结点。
  31175. * @param {Array.<GeometryPoint|L.LatLng|L.Point|ol.geom.Point|mapboxgl.LngLat|Array.<number>>} options.nodes - 要计算耗费矩阵的点数组。
  31176. * @param {TransportationAnalystParameter} [options.parameter] - 交通网络分析通用参数。
  31177. * @usage
  31178. */
  31179. var ComputeWeightMatrixParameters = /*#__PURE__*/function () {
  31180. function ComputeWeightMatrixParameters(options) {
  31181. ComputeWeightMatrixParameters_classCallCheck(this, ComputeWeightMatrixParameters);
  31182. /**
  31183. * @member {boolean} [ComputeWeightMatrixParameters.prototype.isAnalyzeById=false]
  31184. * @description 是否通过节点 ID 指定路径分析的结点,即通过坐标点指定。
  31185. */
  31186. this.isAnalyzeById = false;
  31187. /**
  31188. * @member {Array.<GeometryPoint|L.LatLng|L.Point|ol.geom.Point|mapboxgl.LngLat|Array.<number>>} ComputeWeightMatrixParameters.prototype.nodes
  31189. * @description 要计算耗费矩阵的点数组。
  31190. * 当 {@link ComputeWeightMatrixParameters.isAnalyzeById} = false 时,nodes 应为点的坐标数组;
  31191. * 当 {@link ComputeWeightMatrixParameters.isAnalyzeById} = true 时,nodes 应为点的 ID 数组。
  31192. */
  31193. this.nodes = null;
  31194. /**
  31195. * @member {TransportationAnalystParameter} ComputeWeightMatrixParameters.prototype.parameter
  31196. * @description 交通网络分析通用参数。
  31197. */
  31198. this.parameter = new TransportationAnalystParameter();
  31199. Util_Util.extend(this, options);
  31200. this.CLASS_NAME = "SuperMap.ComputeWeightMatrixParameters";
  31201. }
  31202. /**
  31203. * @function ComputeWeightMatrixParameters.prototype.destroy
  31204. * @description 释放资源,将引用资源的属性置空。
  31205. */
  31206. ComputeWeightMatrixParameters_createClass(ComputeWeightMatrixParameters, [{
  31207. key: "destroy",
  31208. value: function destroy() {
  31209. var me = this;
  31210. me.isAnalyzeById = null;
  31211. me.nodes = null;
  31212. if (me.parameter) {
  31213. me.parameter.destroy();
  31214. me.parameter = null;
  31215. }
  31216. }
  31217. }]);
  31218. return ComputeWeightMatrixParameters;
  31219. }();
  31220. ;// CONCATENATED MODULE: ./src/common/iServer/ComputeWeightMatrixService.js
  31221. function ComputeWeightMatrixService_typeof(obj) { "@babel/helpers - typeof"; return ComputeWeightMatrixService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, ComputeWeightMatrixService_typeof(obj); }
  31222. function ComputeWeightMatrixService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  31223. function ComputeWeightMatrixService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  31224. function ComputeWeightMatrixService_createClass(Constructor, protoProps, staticProps) { if (protoProps) ComputeWeightMatrixService_defineProperties(Constructor.prototype, protoProps); if (staticProps) ComputeWeightMatrixService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  31225. function ComputeWeightMatrixService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { ComputeWeightMatrixService_get = Reflect.get.bind(); } else { ComputeWeightMatrixService_get = function _get(target, property, receiver) { var base = ComputeWeightMatrixService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return ComputeWeightMatrixService_get.apply(this, arguments); }
  31226. function ComputeWeightMatrixService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ComputeWeightMatrixService_getPrototypeOf(object); if (object === null) break; } return object; }
  31227. function ComputeWeightMatrixService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) ComputeWeightMatrixService_setPrototypeOf(subClass, superClass); }
  31228. function ComputeWeightMatrixService_setPrototypeOf(o, p) { ComputeWeightMatrixService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ComputeWeightMatrixService_setPrototypeOf(o, p); }
  31229. function ComputeWeightMatrixService_createSuper(Derived) { var hasNativeReflectConstruct = ComputeWeightMatrixService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = ComputeWeightMatrixService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = ComputeWeightMatrixService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return ComputeWeightMatrixService_possibleConstructorReturn(this, result); }; }
  31230. function ComputeWeightMatrixService_possibleConstructorReturn(self, call) { if (call && (ComputeWeightMatrixService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return ComputeWeightMatrixService_assertThisInitialized(self); }
  31231. function ComputeWeightMatrixService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  31232. function ComputeWeightMatrixService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  31233. function ComputeWeightMatrixService_getPrototypeOf(o) { ComputeWeightMatrixService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ComputeWeightMatrixService_getPrototypeOf(o); }
  31234. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  31235. * This program are made available under the terms of the Apache License, Version 2.0
  31236. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  31237. /**
  31238. * @class ComputeWeightMatrixService
  31239. * @deprecatedclass SuperMap.ComputeWeightMatrixService
  31240. * @category iServer NetworkAnalyst WeightMatrix
  31241. * @classdesc 耗费矩阵分析服务类。
  31242. * 耗费矩阵是根据交通网络分析参数中的耗费字段来计算一个二维数组,
  31243. * 用来存储指定的任意两点间的资源消耗。
  31244. * 耗费矩阵分析结果通过该类支持的事件的监听函数参数获取
  31245. * @extends {NetworkAnalystServiceBase}
  31246. * @example
  31247. * var mycomputeWeightMatrixService = new ComputeWeightMatrixService(url,{
  31248. * eventListeners: {
  31249. * "processCompleted": computeWeightMatrixCompleted,
  31250. * "processFailed": computeWeightMatrixnError
  31251. * }
  31252. * });
  31253. * @param {string} url - 耗费矩阵分析服务地址。请求服务的URL应为:
  31254. * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};
  31255. * 例如:"http://localhost:8090/iserver/services/components-rest/rest/networkanalyst/RoadNet@Changchun"。
  31256. * @param {Object} options - 参数。
  31257. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  31258. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  31259. * @param {Object} [options.headers] - 请求头。
  31260. * @usage
  31261. */
  31262. var ComputeWeightMatrixService = /*#__PURE__*/function (_NetworkAnalystServic) {
  31263. ComputeWeightMatrixService_inherits(ComputeWeightMatrixService, _NetworkAnalystServic);
  31264. var _super = ComputeWeightMatrixService_createSuper(ComputeWeightMatrixService);
  31265. function ComputeWeightMatrixService(url, options) {
  31266. var _this;
  31267. ComputeWeightMatrixService_classCallCheck(this, ComputeWeightMatrixService);
  31268. _this = _super.call(this, url, options);
  31269. _this.CLASS_NAME = "SuperMap.ComputeWeightMatrixService";
  31270. return _this;
  31271. }
  31272. /**
  31273. * @function ComputeWeightMatrixService.prototype.destroy
  31274. * @override
  31275. */
  31276. ComputeWeightMatrixService_createClass(ComputeWeightMatrixService, [{
  31277. key: "destroy",
  31278. value: function destroy() {
  31279. ComputeWeightMatrixService_get(ComputeWeightMatrixService_getPrototypeOf(ComputeWeightMatrixService.prototype), "destroy", this).call(this);
  31280. }
  31281. /**
  31282. * @function ComputeWeightMatrixService.prototype.processAsync
  31283. * @description 负责将客户端的查询参数传递到服务端。
  31284. * @param {ComputeWeightMatrixParameters} params - 耗费矩阵分析参数类
  31285. */
  31286. }, {
  31287. key: "processAsync",
  31288. value: function processAsync(params) {
  31289. if (!(params instanceof ComputeWeightMatrixParameters)) {
  31290. return;
  31291. }
  31292. var me = this,
  31293. jsonObject;
  31294. me.url = Util_Util.urlPathAppend(me.url, 'weightmatrix');
  31295. jsonObject = {
  31296. parameter: Util_Util.toJSON(params.parameter),
  31297. nodes: me.getJson(params.isAnalyzeById, params.nodes)
  31298. };
  31299. me.request({
  31300. method: "GET",
  31301. params: jsonObject,
  31302. scope: me,
  31303. success: me.serviceProcessCompleted,
  31304. failure: me.serviceProcessFailed
  31305. });
  31306. }
  31307. /**
  31308. * @function ComputeWeightMatrixService.prototype.getJson
  31309. * @description 将对象转化为JSON字符串。
  31310. * @param {boolean} isAnalyzeById - 是否通过id分析
  31311. * @param {Array.<ComputeWeightMatrixParameters>} params - 分析参数数组
  31312. * @returns {string} 转化后的JSON字符串。
  31313. */
  31314. }, {
  31315. key: "getJson",
  31316. value: function getJson(isAnalyzeById, params) {
  31317. var jsonString = "[",
  31318. len = params ? params.length : 0;
  31319. if (isAnalyzeById === false) {
  31320. for (var i = 0; i < len; i++) {
  31321. if (i > 0) {
  31322. jsonString += ",";
  31323. }
  31324. jsonString += '{"x":' + params[i].x + ',"y":' + params[i].y + '}';
  31325. }
  31326. } else if (isAnalyzeById === true) {
  31327. for (var _i2 = 0; _i2 < len; _i2++) {
  31328. if (_i2 > 0) {
  31329. jsonString += ",";
  31330. }
  31331. jsonString += params[_i2];
  31332. }
  31333. }
  31334. jsonString += ']';
  31335. return jsonString;
  31336. }
  31337. }]);
  31338. return ComputeWeightMatrixService;
  31339. }(NetworkAnalystServiceBase);
  31340. ;// CONCATENATED MODULE: ./src/common/iServer/FacilityAnalystStreamParameters.js
  31341. function FacilityAnalystStreamParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  31342. function FacilityAnalystStreamParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  31343. function FacilityAnalystStreamParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) FacilityAnalystStreamParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) FacilityAnalystStreamParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  31344. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  31345. * This program are made available under the terms of the Apache License, Version 2.0
  31346. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  31347. /**
  31348. * @class FacilityAnalystStreamParameters
  31349. * @deprecatedclass SuperMap.FacilityAnalystStreamParameters
  31350. * @category iServer NetworkAnalyst UpstreamCirticalFaclilities
  31351. * @classdesc 上游/下游关键设施查找资源参数类。
  31352. * @param {Object} options - 参数。
  31353. * @param {Array.<number>} options.sourceNodeIDs - 指定的设施点 ID 数组。
  31354. * @param {number} options.queryType - 分析类型,只能是 0 (上游关键设施查询) 或者是 1(下游关键设施查询)。
  31355. * @param {number} [options.edgeID] - 指定的弧段 ID,edgeID 与 nodeID 必须指定一个。
  31356. * @param {number} [options.nodeID] - 指定的结点 ID,edgeID 与 nodeID 必须指定一个。
  31357. * @param {boolean} [options.isUncertainDirectionValid=false] - 指定不确定流向是否有效。
  31358. * @usage
  31359. */
  31360. var FacilityAnalystStreamParameters = /*#__PURE__*/function () {
  31361. function FacilityAnalystStreamParameters(options) {
  31362. FacilityAnalystStreamParameters_classCallCheck(this, FacilityAnalystStreamParameters);
  31363. /**
  31364. * @member {Array.<number>} [FacilityAnalystStreamParameters.prototype.sourceNodeIDs]
  31365. * @description 指定的设施点 ID 数组。
  31366. */
  31367. this.sourceNodeIDs = null;
  31368. /**
  31369. * @member {number} [FacilityAnalystStreamParameters.prototype.edgeID]
  31370. * @description 指定的弧段 ID,edgeID 与 nodeID 必须指定一个。
  31371. */
  31372. this.edgeID = null;
  31373. /**
  31374. * @member {number} [FacilityAnalystStreamParameters.prototype.nodeID]
  31375. * @description 指定的结点 ID,edgeID 与 nodeID 必须指定一个。
  31376. */
  31377. this.nodeID = null;
  31378. /**
  31379. * @member {boolean} [FacilityAnalystStreamParameters.prototype.isUncertainDirectionValid=false]
  31380. * @description 指定不确定流向是否有效。指定为 true,表示不确定流向有效,遇到不确定流向时分析继续进行;
  31381. * 指定为 false,表示不确定流向无效,遇到不确定流向将停止在该方向上继续查找。
  31382. */
  31383. this.isUncertainDirectionValid = false;
  31384. /**
  31385. * @member {number} FacilityAnalystStreamParameters.prototype.queryType
  31386. * @description 分析类型,只能是 0 (上游关键设施查询) 或者是 1(下游关键设施查询)。
  31387. */
  31388. this.queryType = null;
  31389. Util_Util.extend(this, options);
  31390. this.CLASS_NAME = "SuperMap.FacilityAnalystStreamParameters";
  31391. }
  31392. /**
  31393. * @function FacilityAnalystStreamParameters.prototype.destroy
  31394. * @description 释放资源,将引用资源的属性置空。
  31395. */
  31396. FacilityAnalystStreamParameters_createClass(FacilityAnalystStreamParameters, [{
  31397. key: "destroy",
  31398. value: function destroy() {
  31399. var me = this;
  31400. me.edgeID = null;
  31401. me.nodeID = null;
  31402. me.weightName = null;
  31403. me.isUncertainDirectionValid = null;
  31404. me.type = null;
  31405. }
  31406. }]);
  31407. return FacilityAnalystStreamParameters;
  31408. }();
  31409. ;// CONCATENATED MODULE: ./src/common/iServer/FacilityAnalystStreamService.js
  31410. function FacilityAnalystStreamService_typeof(obj) { "@babel/helpers - typeof"; return FacilityAnalystStreamService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, FacilityAnalystStreamService_typeof(obj); }
  31411. function FacilityAnalystStreamService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  31412. function FacilityAnalystStreamService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  31413. function FacilityAnalystStreamService_createClass(Constructor, protoProps, staticProps) { if (protoProps) FacilityAnalystStreamService_defineProperties(Constructor.prototype, protoProps); if (staticProps) FacilityAnalystStreamService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  31414. function FacilityAnalystStreamService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { FacilityAnalystStreamService_get = Reflect.get.bind(); } else { FacilityAnalystStreamService_get = function _get(target, property, receiver) { var base = FacilityAnalystStreamService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return FacilityAnalystStreamService_get.apply(this, arguments); }
  31415. function FacilityAnalystStreamService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FacilityAnalystStreamService_getPrototypeOf(object); if (object === null) break; } return object; }
  31416. function FacilityAnalystStreamService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) FacilityAnalystStreamService_setPrototypeOf(subClass, superClass); }
  31417. function FacilityAnalystStreamService_setPrototypeOf(o, p) { FacilityAnalystStreamService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FacilityAnalystStreamService_setPrototypeOf(o, p); }
  31418. function FacilityAnalystStreamService_createSuper(Derived) { var hasNativeReflectConstruct = FacilityAnalystStreamService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = FacilityAnalystStreamService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = FacilityAnalystStreamService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return FacilityAnalystStreamService_possibleConstructorReturn(this, result); }; }
  31419. function FacilityAnalystStreamService_possibleConstructorReturn(self, call) { if (call && (FacilityAnalystStreamService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return FacilityAnalystStreamService_assertThisInitialized(self); }
  31420. function FacilityAnalystStreamService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  31421. function FacilityAnalystStreamService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  31422. function FacilityAnalystStreamService_getPrototypeOf(o) { FacilityAnalystStreamService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FacilityAnalystStreamService_getPrototypeOf(o); }
  31423. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  31424. * This program are made available under the terms of the Apache License, Version 2.0
  31425. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  31426. /**
  31427. * @class FacilityAnalystStreamService
  31428. * @deprecatedclass SuperMap.FacilityAnalystStreamService
  31429. * @category iServer NetworkAnalyst UpstreamCirticalFaclilities
  31430. * @classdesc 上游/下游 关键设施查找资源服务类:即查找给定弧段或节点的上游/下游中的关键设施结点,返回关键结点 ID 数组及其下游弧段 ID 数组。
  31431. * @extends NetworkAnalystServiceBase
  31432. * @param {string} url - 服务地址。请求网络分析服务,URL应为:
  31433. * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};
  31434. * 例如: "http://localhost:8090/iserver/services/test/rest/networkanalyst/WaterNet@FacilityNet";
  31435. * @param {Object} options - 参数。
  31436. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  31437. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  31438. * @param {Object} [options.headers] - 请求头。
  31439. * @usage
  31440. */
  31441. var FacilityAnalystStreamService = /*#__PURE__*/function (_NetworkAnalystServic) {
  31442. FacilityAnalystStreamService_inherits(FacilityAnalystStreamService, _NetworkAnalystServic);
  31443. var _super = FacilityAnalystStreamService_createSuper(FacilityAnalystStreamService);
  31444. function FacilityAnalystStreamService(url, options) {
  31445. var _this;
  31446. FacilityAnalystStreamService_classCallCheck(this, FacilityAnalystStreamService);
  31447. _this = _super.call(this, url, options);
  31448. _this.CLASS_NAME = "SuperMap.FacilityAnalystStreamService";
  31449. return _this;
  31450. }
  31451. /**
  31452. * @function FacilityAnalystStreamService.prototype.destroy
  31453. * @override
  31454. */
  31455. FacilityAnalystStreamService_createClass(FacilityAnalystStreamService, [{
  31456. key: "destroy",
  31457. value: function destroy() {
  31458. FacilityAnalystStreamService_get(FacilityAnalystStreamService_getPrototypeOf(FacilityAnalystStreamService.prototype), "destroy", this).call(this);
  31459. }
  31460. /**
  31461. * @function FacilityAnalystStreamService.prototype.processAsync
  31462. * @description 负责将客户端的查询参数传递到服务端。
  31463. * @param {FacilityAnalystStreamParameters} params - 上游/下游关键设施查找资源参数类。
  31464. */
  31465. }, {
  31466. key: "processAsync",
  31467. value: function processAsync(params) {
  31468. if (!(params instanceof FacilityAnalystStreamParameters)) {
  31469. return;
  31470. }
  31471. var me = this,
  31472. jsonObject;
  31473. //URL 通过参数类型来判断是 上游 还是下游 查询
  31474. if (params.queryType === 0) {
  31475. me.url = Util_Util.urlPathAppend(me.url, 'upstreamcirticalfaclilities');
  31476. } else if (params.queryType === 1) {
  31477. me.url = Util_Util.urlPathAppend(me.url, 'downstreamcirticalfaclilities');
  31478. } else {
  31479. return;
  31480. }
  31481. jsonObject = {
  31482. sourceNodeIDs: params.sourceNodeIDs,
  31483. isUncertainDirectionValid: params.isUncertainDirectionValid
  31484. };
  31485. if (params.edgeID !== null && params.nodeID !== null) {
  31486. return;
  31487. }
  31488. if (params.edgeID === null && params.nodeID === null) {
  31489. return;
  31490. }
  31491. if (params.edgeID !== null) {
  31492. jsonObject.edgeID = params.edgeID;
  31493. } else {
  31494. jsonObject.nodeID = params.nodeID;
  31495. }
  31496. me.request({
  31497. method: "GET",
  31498. params: jsonObject,
  31499. scope: me,
  31500. success: me.serviceProcessCompleted,
  31501. failure: me.serviceProcessFailed
  31502. });
  31503. }
  31504. }]);
  31505. return FacilityAnalystStreamService;
  31506. }(NetworkAnalystServiceBase);
  31507. ;// CONCATENATED MODULE: ./src/common/iServer/FindClosestFacilitiesParameters.js
  31508. function FindClosestFacilitiesParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  31509. function FindClosestFacilitiesParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  31510. function FindClosestFacilitiesParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) FindClosestFacilitiesParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) FindClosestFacilitiesParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  31511. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  31512. * This program are made available under the terms of the Apache License, Version 2.0
  31513. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  31514. /**
  31515. * @class FindClosestFacilitiesParameters
  31516. * @deprecatedclass SuperMap.FindClosestFacilitiesParameters
  31517. * @category iServer NetworkAnalyst ClosestFacility
  31518. * @classdesc 最近设施分析参数类。
  31519. * @param {Object} options - 参数。
  31520. * @param {GeometryPoint|L.LatLng|L.Point|ol.geom.Point|mapboxgl.LngLat|mapboxgl.Point|Array.<number>} options.event - 事件点,一般为需要获得服务设施服务的事件位置。
  31521. * @param {Array.<GeometryPoint|L.LatLng|L.Point|ol.geom.Point|mapboxgl.LngLat|mapboxgl.Point|Array.<number>>} options.facilities - 设施点集合,一般为提供服务的服务设施位置。
  31522. * @param {number} [options.expectFacilityCount=1] - 要查找的设施点数量。
  31523. * @param {boolean} [options.fromEvent=false] - 是否从事件点到设施点进行查找。
  31524. * @param {boolean} [options.isAnalyzeById=false] - 事件点和设施点是否通过节点 ID 号来指定。
  31525. * @param {number} [options.maxWeight=0] - 权值的最大限值。单位与该类中 parameter 字段(交通网络分析通用参数)中设置的耗费字段一致。
  31526. * @param {TransportationAnalystParameter} [options.parameter] - 交通网络分析通用参数。
  31527. * @usage
  31528. */
  31529. var FindClosestFacilitiesParameters = /*#__PURE__*/function () {
  31530. function FindClosestFacilitiesParameters(options) {
  31531. FindClosestFacilitiesParameters_classCallCheck(this, FindClosestFacilitiesParameters);
  31532. /**
  31533. * @member {GeometryPoint|L.LatLng|L.Point|ol.geom.Point|mapboxgl.LngLat|mapboxgl.Point|Array.<number>} FindClosestFacilitiesParameters.prototype.event
  31534. * @description 事件点,一般为需要获得服务设施服务的事件位置。
  31535. * 可以通过两种方式赋予事件点:当该类中字段 isAnalyzeById = true 时,应输入事件点 ID 号;当 isAnalyzeById = false 时,应输入事件点坐标。
  31536. */
  31537. this.event = null;
  31538. /**
  31539. * @member {number} [FindClosestFacilitiesParameters.prototype.expectFacilityCount=1]
  31540. * @description 要查找的设施点数量。
  31541. */
  31542. this.expectFacilityCount = 1;
  31543. /**
  31544. * @member {Array.<GeometryPoint|L.LatLng|L.Point|ol.geom.Point|mapboxgl.LngLat|mapboxgl.Point|Array.<number>>} [FindClosestFacilitiesParameters.prototype.facilities=false]
  31545. * @description 设施点集合,一般为提供服务的服务设施位置。
  31546. * 可以通过两种方式赋予设施点:当该类中字段 isAnalyzeById = true 时,应输入设施点 ID 号;当 isAnalyzeById = false 时,应输入设施点坐标。
  31547. */
  31548. this.facilities = null;
  31549. /**
  31550. * @member {boolean} [FindClosestFacilitiesParameters.prototype.fromEvent=false]
  31551. * @description 是否从事件点到设施点进行查找。最近设施分析主要是通过设施点和事件点之间最优的路线来分析在一定范围内哪个或哪些设施与事件点有最优路线的关系。
  31552. * 这个行走线路是通过网络图层进行网络分析算法计算出来的两点间的最优路线。由于存在从 A 点到 B 点与从 B 点到 A 点的耗费不一样的情况,因此起止点不同可能会得到不同的最优路线。因此在进行最近设施分析之前,需要设置获取的最优路线的方向,即是以事件点作为起点到最近设施点的方向分析,还是以最近设施点为起点到事件点的方向分析。如果需要以事件点作为起点到设施点方向进行查找,设置该字段值为 true;设置为 false,表示从设施点到事件点进行查找。
  31553. */
  31554. this.fromEvent = false;
  31555. /**
  31556. * @member {boolean} [FindClosestFacilitiesParameters.prototype.isAnalyzeById=false]
  31557. * @description 事件点和设施点是否通过节点 ID 号来指定,设置为 false,表示通过坐标点指定事件点和设施点。
  31558. */
  31559. this.isAnalyzeById = false;
  31560. /**
  31561. * @member {number} [FindClosestFacilitiesParameters.prototype.maxWeight=0]
  31562. * @description 权值的最大限值。单位与该类中 parameter 字段(交通网络分析通用参数)中设置的耗费字段一致。
  31563. * 例如事件发生点是一起交通事故,要求查找在 10 分钟内能到达的最近医院,超过 10 分钟能到达的都不予考虑。
  31564. * 那么需要将网络分析参数中 parameter.weightFieldName 设置为表示时间的字段,然后设置查找范围的半径值为10。
  31565. */
  31566. this.maxWeight = 0;
  31567. /**
  31568. * @member {TransportationAnalystParameter} [FindClosestFacilitiesParameters.prototype.parameter]
  31569. * @description 交通网络分析通用参数。通过本类可以设置障碍边、障碍点、权值字段信息的名称标识、转向权值字段等信息。
  31570. * 它为 TransportationAnalystParameter 类型,虽然为可选参数,但是如果不设置其中的 resultSetting 字段,
  31571. * 则返回结果空间信息等都为空。
  31572. */
  31573. this.parameter = new TransportationAnalystParameter();
  31574. Util_Util.extend(this, options);
  31575. this.CLASS_NAME = "SuperMap.FindClosestFacilitiesParameters";
  31576. }
  31577. /**
  31578. * @function FindClosestFacilitiesParameters.prototype.destroy
  31579. * @description 释放资源,将引用资源的属性置空。
  31580. */
  31581. FindClosestFacilitiesParameters_createClass(FindClosestFacilitiesParameters, [{
  31582. key: "destroy",
  31583. value: function destroy() {
  31584. var me = this;
  31585. me.event = null;
  31586. me.expectFacilityCount = null;
  31587. me.facilities = null;
  31588. me.fromEvent = null;
  31589. me.isAnalyzeById = null;
  31590. me.maxWeight = null;
  31591. if (me.parameter) {
  31592. me.parameter.destroy();
  31593. me.parameter = null;
  31594. }
  31595. }
  31596. }]);
  31597. return FindClosestFacilitiesParameters;
  31598. }();
  31599. ;// CONCATENATED MODULE: ./src/common/iServer/FindClosestFacilitiesService.js
  31600. function FindClosestFacilitiesService_typeof(obj) { "@babel/helpers - typeof"; return FindClosestFacilitiesService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, FindClosestFacilitiesService_typeof(obj); }
  31601. function FindClosestFacilitiesService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  31602. function FindClosestFacilitiesService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  31603. function FindClosestFacilitiesService_createClass(Constructor, protoProps, staticProps) { if (protoProps) FindClosestFacilitiesService_defineProperties(Constructor.prototype, protoProps); if (staticProps) FindClosestFacilitiesService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  31604. function FindClosestFacilitiesService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { FindClosestFacilitiesService_get = Reflect.get.bind(); } else { FindClosestFacilitiesService_get = function _get(target, property, receiver) { var base = FindClosestFacilitiesService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return FindClosestFacilitiesService_get.apply(this, arguments); }
  31605. function FindClosestFacilitiesService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FindClosestFacilitiesService_getPrototypeOf(object); if (object === null) break; } return object; }
  31606. function FindClosestFacilitiesService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) FindClosestFacilitiesService_setPrototypeOf(subClass, superClass); }
  31607. function FindClosestFacilitiesService_setPrototypeOf(o, p) { FindClosestFacilitiesService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FindClosestFacilitiesService_setPrototypeOf(o, p); }
  31608. function FindClosestFacilitiesService_createSuper(Derived) { var hasNativeReflectConstruct = FindClosestFacilitiesService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = FindClosestFacilitiesService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = FindClosestFacilitiesService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return FindClosestFacilitiesService_possibleConstructorReturn(this, result); }; }
  31609. function FindClosestFacilitiesService_possibleConstructorReturn(self, call) { if (call && (FindClosestFacilitiesService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return FindClosestFacilitiesService_assertThisInitialized(self); }
  31610. function FindClosestFacilitiesService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  31611. function FindClosestFacilitiesService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  31612. function FindClosestFacilitiesService_getPrototypeOf(o) { FindClosestFacilitiesService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FindClosestFacilitiesService_getPrototypeOf(o); }
  31613. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  31614. * This program are made available under the terms of the Apache License, Version 2.0
  31615. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  31616. /**
  31617. * @class FindClosestFacilitiesService
  31618. * @deprecatedclass SuperMap.FindClosestFacilitiesService
  31619. * @category iServer NetworkAnalyst ClosestFacility
  31620. * @classdesc 最近设施分析服务类。
  31621. * 最近设施分析是指在网络上给定一个事件点和一组设施点,
  31622. * 查找从事件点到设施点(或从设施点到事件点)以最小耗费能到达的最佳路径。
  31623. * 该类负责将客户端指定的最近设施分析参数传递给服务端,并接收服务端返回的结果数据。
  31624. * 最近设施分析结果通过该类支持的事件的监听函数参数获取
  31625. * @extends {NetworkAnalystServiceBase}
  31626. * @example
  31627. * var myfindClosestFacilitiesService = new FindClosestFacilitiesService(url, {
  31628. * eventListeners: {
  31629. * "processCompleted": findClosestFacilitiesCompleted,
  31630. * "processFailed": findClosestFacilitiesError
  31631. * }
  31632. * });
  31633. * @param {string} url - 服务地址。请求网络分析服务,URL应为:
  31634. * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};
  31635. * 例如:"http://localhost:8090/iserver/services/components-rest/rest/networkanalyst/RoadNet@Changchun"。
  31636. * @param {Object} options - 参数。
  31637. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  31638. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  31639. * @param {Object} [options.headers] - 请求头。
  31640. * @usage
  31641. */
  31642. var FindClosestFacilitiesService = /*#__PURE__*/function (_NetworkAnalystServic) {
  31643. FindClosestFacilitiesService_inherits(FindClosestFacilitiesService, _NetworkAnalystServic);
  31644. var _super = FindClosestFacilitiesService_createSuper(FindClosestFacilitiesService);
  31645. function FindClosestFacilitiesService(url, options) {
  31646. var _this;
  31647. FindClosestFacilitiesService_classCallCheck(this, FindClosestFacilitiesService);
  31648. _this = _super.call(this, url, options);
  31649. _this.CLASS_NAME = "SuperMap.FindClosestFacilitiesService";
  31650. return _this;
  31651. }
  31652. /**
  31653. * @function FindClosestFacilitiesService.prototype.destroy
  31654. * @override
  31655. */
  31656. FindClosestFacilitiesService_createClass(FindClosestFacilitiesService, [{
  31657. key: "destroy",
  31658. value: function destroy() {
  31659. FindClosestFacilitiesService_get(FindClosestFacilitiesService_getPrototypeOf(FindClosestFacilitiesService.prototype), "destroy", this).call(this);
  31660. }
  31661. /**
  31662. * @function FindClosestFacilitiesService.prototype.processAsync
  31663. * @description 负责将客户端的查询参数传递到服务端。
  31664. * @param {FindClosestFacilitiesParameters} params - 最近设施分析服务参数类
  31665. */
  31666. }, {
  31667. key: "processAsync",
  31668. value: function processAsync(params) {
  31669. if (!(params instanceof FindClosestFacilitiesParameters)) {
  31670. return;
  31671. }
  31672. var me = this,
  31673. jsonObject;
  31674. me.url = Util_Util.urlPathAppend(me.url, 'closestfacility');
  31675. jsonObject = {
  31676. expectFacilityCount: params.expectFacilityCount,
  31677. fromEvent: params.fromEvent,
  31678. maxWeight: params.maxWeight,
  31679. parameter: Util_Util.toJSON(params.parameter),
  31680. event: Util_Util.toJSON(params.event),
  31681. facilities: me.getJson(params.isAnalyzeById, params.facilities)
  31682. };
  31683. me.request({
  31684. method: "GET",
  31685. params: jsonObject,
  31686. scope: me,
  31687. success: me.serviceProcessCompleted,
  31688. failure: me.serviceProcessFailed
  31689. });
  31690. }
  31691. /**
  31692. * @function FindClosestFacilitiesService.prototype.getJson
  31693. * @description 将对象转化为JSON字符串。
  31694. * @param {boolean} isAnalyzeById - 是否通过ID来分析
  31695. * @param {Array.<Object>} params - 分析参数数组
  31696. * @returns {Object} 转化后的JSON字符串。
  31697. */
  31698. }, {
  31699. key: "getJson",
  31700. value: function getJson(isAnalyzeById, params) {
  31701. var jsonString = "[",
  31702. len = params ? params.length : 0;
  31703. if (isAnalyzeById === false) {
  31704. for (var i = 0; i < len; i++) {
  31705. if (i > 0) {
  31706. jsonString += ",";
  31707. }
  31708. jsonString += '{"x":' + params[i].x + ',"y":' + params[i].y + '}';
  31709. }
  31710. } else if (isAnalyzeById === true) {
  31711. for (var _i2 = 0; _i2 < len; _i2++) {
  31712. if (_i2 > 0) {
  31713. jsonString += ",";
  31714. }
  31715. jsonString += params[_i2];
  31716. }
  31717. }
  31718. jsonString += ']';
  31719. return jsonString;
  31720. }
  31721. /**
  31722. * @function FindClosestFacilitiesService.prototype.toGeoJSONResult
  31723. * @description 将含有 geometry 的数据转换为 GeoJSON 格式。
  31724. * @param {Object} result - 服务器返回的结果对象。
  31725. */
  31726. }, {
  31727. key: "toGeoJSONResult",
  31728. value: function toGeoJSONResult(result) {
  31729. if (!result || !result.facilityPathList) {
  31730. return result;
  31731. }
  31732. var geoJSONFormat = new GeoJSON();
  31733. result.facilityPathList.map(function (path) {
  31734. if (path.route) {
  31735. path.route = geoJSONFormat.toGeoJSON(path.route);
  31736. }
  31737. if (path.pathGuideItems) {
  31738. path.pathGuideItems = geoJSONFormat.toGeoJSON(path.pathGuideItems);
  31739. }
  31740. if (path.edgeFeatures) {
  31741. path.edgeFeatures = geoJSONFormat.toGeoJSON(path.edgeFeatures);
  31742. }
  31743. if (path.nodeFeatures) {
  31744. path.nodeFeatures = geoJSONFormat.toGeoJSON(path.nodeFeatures);
  31745. }
  31746. return path;
  31747. });
  31748. return result;
  31749. }
  31750. }]);
  31751. return FindClosestFacilitiesService;
  31752. }(NetworkAnalystServiceBase);
  31753. ;// CONCATENATED MODULE: ./src/common/iServer/FindLocationParameters.js
  31754. function FindLocationParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  31755. function FindLocationParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  31756. function FindLocationParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) FindLocationParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) FindLocationParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  31757. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  31758. * This program are made available under the terms of the Apache License, Version 2.0
  31759. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  31760. /**
  31761. * @class FindLocationParameters
  31762. * @deprecatedclass SuperMap.FindLocationParameters
  31763. * @category iServer NetworkAnalyst Location
  31764. * @classdesc 选址分区分析参数类。
  31765. * @param {Object} options - 参数。
  31766. * @param {string} options.turnWeightField - 转向权值字段的名称。
  31767. * @param {string} options.weightName - 阻力字段的名称,标识了进行网络分析时所使用的阻力字段。
  31768. * @param {Array.<SupplyCenter>} options.supplyCenters - 资源供给中心集合。
  31769. * @param {number} [options.expectedSupplyCenterCount=1] - 期望用于最终设施选址的资源供给中心数量。
  31770. * @param {boolean} [options.isFromCenter=false] - 是否从中心点开始分配资源。
  31771. * @usage
  31772. */
  31773. var FindLocationParameters = /*#__PURE__*/function () {
  31774. function FindLocationParameters(options) {
  31775. FindLocationParameters_classCallCheck(this, FindLocationParameters);
  31776. /**
  31777. * @member {number} [FindLocationParameters.prototype.expectedSupplyCenterCount=1]
  31778. * @description 期望用于最终设施选址的资源供给中心数量。
  31779. * 当输入值为 0 时,最终设施选址的资源供给中心数量默认为覆盖分析区域内的所需最少的供给中心数。
  31780. */
  31781. this.expectedSupplyCenterCount = null;
  31782. /**
  31783. * @member {boolean} [FindLocationParameters.prototype.isFromCenter=false]
  31784. * @description 是否从中心点开始分配资源。
  31785. * 由于网路数据中的弧段具有正反阻力,即弧段的正向阻力值与其反向阻力值可能不同,
  31786. * 因此,在进行分析时,从资源供给中心开始分配资源到需求点与从需求点向资源供给中心分配这两种分配形式下,所得的分析结果会不同。
  31787. */
  31788. this.isFromCenter = false;
  31789. /**
  31790. * @member {Array.<SupplyCenter>} FindLocationParameters.prototype.supplyCenters
  31791. * @description 资源供给中心集合。
  31792. * 资源供给中心是提供资源和服务的设施,对应于网络结点,
  31793. * 资源供给中心的相关信息包括资源量、最大阻力值、资源供给中心类型,资源供给中心在网络中所处结点的 ID 等,以便在进行选址分区分析时使用。
  31794. */
  31795. this.supplyCenters = null;
  31796. /**
  31797. * @member {string} FindLocationParameters.prototype.turnWeightField
  31798. * @description 转向权值字段的名称。
  31799. */
  31800. this.turnWeightField = null;
  31801. /**
  31802. * @member {string} FindLocationParameters.prototype.weightName
  31803. * @description 阻力字段的名称,标识了进行网络分析时所使用的阻力字段。
  31804. */
  31805. this.weightName = null;
  31806. Util_Util.extend(this, options);
  31807. this.CLASS_NAME = "SuperMap.FindLocationParameters";
  31808. }
  31809. /**
  31810. * @function FindLocationParameters.prototype.destroy
  31811. * @description 释放资源,将引用资源的属性置空。
  31812. */
  31813. FindLocationParameters_createClass(FindLocationParameters, [{
  31814. key: "destroy",
  31815. value: function destroy() {
  31816. var me = this;
  31817. me.expectedSupplyCenterCount = null;
  31818. me.isFromCenter = null;
  31819. me.turnWeightField = null;
  31820. me.weightName = null;
  31821. if (me.supplyCenters) {
  31822. for (var i = 0, supplyCenters = me.supplyCenters, len = supplyCenters.length; i < len; i++) {
  31823. supplyCenters[i].destroy();
  31824. }
  31825. me.supplyCenters = null;
  31826. }
  31827. }
  31828. }]);
  31829. return FindLocationParameters;
  31830. }();
  31831. ;// CONCATENATED MODULE: ./src/common/iServer/FindLocationService.js
  31832. function FindLocationService_typeof(obj) { "@babel/helpers - typeof"; return FindLocationService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, FindLocationService_typeof(obj); }
  31833. function FindLocationService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  31834. function FindLocationService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  31835. function FindLocationService_createClass(Constructor, protoProps, staticProps) { if (protoProps) FindLocationService_defineProperties(Constructor.prototype, protoProps); if (staticProps) FindLocationService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  31836. function FindLocationService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { FindLocationService_get = Reflect.get.bind(); } else { FindLocationService_get = function _get(target, property, receiver) { var base = FindLocationService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return FindLocationService_get.apply(this, arguments); }
  31837. function FindLocationService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FindLocationService_getPrototypeOf(object); if (object === null) break; } return object; }
  31838. function FindLocationService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) FindLocationService_setPrototypeOf(subClass, superClass); }
  31839. function FindLocationService_setPrototypeOf(o, p) { FindLocationService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FindLocationService_setPrototypeOf(o, p); }
  31840. function FindLocationService_createSuper(Derived) { var hasNativeReflectConstruct = FindLocationService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = FindLocationService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = FindLocationService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return FindLocationService_possibleConstructorReturn(this, result); }; }
  31841. function FindLocationService_possibleConstructorReturn(self, call) { if (call && (FindLocationService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return FindLocationService_assertThisInitialized(self); }
  31842. function FindLocationService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  31843. function FindLocationService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  31844. function FindLocationService_getPrototypeOf(o) { FindLocationService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FindLocationService_getPrototypeOf(o); }
  31845. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  31846. * This program are made available under the terms of the Apache License, Version 2.0
  31847. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  31848. /**
  31849. * @class FindLocationService
  31850. * @deprecatedclass SuperMap.FindLocationService
  31851. * @category iServer NetworkAnalyst Location
  31852. * @classdesc 选址分区分析服务类。
  31853. * 选址分区分析是为了确定一个或多个待建设施的最佳或最优位置,使得设施可以用一种最经济有效的方式为需求方提供服务或者商品。
  31854. * 选址分区不仅仅是一个选址过程,还要将需求点的需求分配到相应的新建设施的服务区中,因此称之为选址与分区。
  31855. * 选址分区分析结果通过该类支持的事件的监听函数参数获取
  31856. * @extends {NetworkAnalystServiceBase}
  31857. * @example
  31858. * (start code)
  31859. * var findLocationService = new FindLocationService(url, {
  31860. * eventListeners: {
  31861. * "processCompleted": findLocationCompleted,
  31862. * "processFailed": findLocationError
  31863. * }
  31864. * });
  31865. * (end)
  31866. * @param {string} url - 服务地址。
  31867. * 如 http://localhost:8090/iserver/services/transportationanalyst-sample/rest/networkanalyst/RoadNet@Changchun 。
  31868. * @param {Object} options - 参数。
  31869. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  31870. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  31871. * @param {Object} [options.headers] - 请求头。
  31872. * @usage
  31873. */
  31874. var FindLocationService = /*#__PURE__*/function (_NetworkAnalystServic) {
  31875. FindLocationService_inherits(FindLocationService, _NetworkAnalystServic);
  31876. var _super = FindLocationService_createSuper(FindLocationService);
  31877. function FindLocationService(url, options) {
  31878. var _this;
  31879. FindLocationService_classCallCheck(this, FindLocationService);
  31880. _this = _super.call(this, url, options);
  31881. _this.CLASS_NAME = "SuperMap.FindLocationService";
  31882. return _this;
  31883. }
  31884. /**
  31885. * @function FindLocationService.prototype.destroy
  31886. * @override
  31887. */
  31888. FindLocationService_createClass(FindLocationService, [{
  31889. key: "destroy",
  31890. value: function destroy() {
  31891. FindLocationService_get(FindLocationService_getPrototypeOf(FindLocationService.prototype), "destroy", this).call(this);
  31892. }
  31893. /**
  31894. * @function FindLocationService.prototype.processAsync
  31895. * @description 负责将客户端的查询参数传递到服务端。
  31896. * @param {FindLocationParameters} params - 选址分区分析服务参数类
  31897. */
  31898. }, {
  31899. key: "processAsync",
  31900. value: function processAsync(params) {
  31901. if (!(params instanceof FindLocationParameters)) {
  31902. return;
  31903. }
  31904. var me = this,
  31905. jsonObject;
  31906. me.url = Util_Util.urlPathAppend(me.url, 'location');
  31907. jsonObject = {
  31908. isFromCenter: params.isFromCenter,
  31909. expectedSupplyCenterCount: params.expectedSupplyCenterCount,
  31910. weightName: params.weightName,
  31911. turnWeightField: params.turnWeightField,
  31912. returnEdgeFeature: true,
  31913. returnEdgeGeometry: true,
  31914. returnNodeFeature: true,
  31915. mapParameter: Util_Util.toJSON(params.mapParameter),
  31916. supplyCenters: me.getCentersJson(params.supplyCenters)
  31917. };
  31918. me.request({
  31919. method: "GET",
  31920. params: jsonObject,
  31921. scope: me,
  31922. success: me.serviceProcessCompleted,
  31923. failure: me.serviceProcessFailed
  31924. });
  31925. }
  31926. /**
  31927. * @function FindLocationService.prototype.getCentersJson
  31928. * @description 将数组对象转化为JSON字符串。
  31929. * @param {Array} params - 需要转换的参数
  31930. * @returns {string} 转化后的JSON字符串。
  31931. */
  31932. }, {
  31933. key: "getCentersJson",
  31934. value: function getCentersJson(params) {
  31935. var json = "[",
  31936. len = params ? params.length : 0;
  31937. for (var i = 0; i < len; i++) {
  31938. if (i > 0) {
  31939. json += ",";
  31940. }
  31941. json += Util_Util.toJSON(params[i]);
  31942. }
  31943. json += "]";
  31944. return json;
  31945. }
  31946. /**
  31947. * @function FindLocationService.prototype.toGeoJSONResult
  31948. * @description 将含有 geometry 的数据转换为 GeoJSON 格式。
  31949. * @param {Object} result - 服务器返回的结果对象。
  31950. */
  31951. }, {
  31952. key: "toGeoJSONResult",
  31953. value: function toGeoJSONResult(result) {
  31954. if (!result) {
  31955. return null;
  31956. }
  31957. var geoJSONFormat = new GeoJSON();
  31958. if (result.demandResults) {
  31959. result.demandResults = geoJSONFormat.toGeoJSON(result.demandResults);
  31960. }
  31961. if (result.supplyResults) {
  31962. result.supplyResults = geoJSONFormat.toGeoJSON(result.supplyResults);
  31963. }
  31964. return result;
  31965. }
  31966. }]);
  31967. return FindLocationService;
  31968. }(NetworkAnalystServiceBase);
  31969. ;// CONCATENATED MODULE: ./src/common/iServer/FindMTSPPathsParameters.js
  31970. function FindMTSPPathsParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  31971. function FindMTSPPathsParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  31972. function FindMTSPPathsParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) FindMTSPPathsParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) FindMTSPPathsParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  31973. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  31974. * This program are made available under the terms of the Apache License, Version 2.0
  31975. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  31976. /**
  31977. * @class FindMTSPPathsParameters
  31978. * @deprecatedclass SuperMap.FindMTSPPathsParameters
  31979. * @category iServer NetworkAnalyst MTSPPath
  31980. * @classdesc 多旅行商分析参数类。
  31981. * @param {Object} options - 参数。
  31982. * @param {Array.<GeometryPoint|L.LatLng|L.Point|ol.geom.Point|mapboxgl.LngLat|mapboxgl.Point|Array.<number>>} options.centers - 配送中心集合。
  31983. * @param {Array.<GeometryPoint|L.LatLng|L.Point|ol.geom.Point|mapboxgl.LngLat|mapboxgl.Point|Array.<number>>} options.nodes - 配送目标集合。
  31984. * @param {boolean} [options.hasLeastTotalCost=false] - 配送模式是否为总花费最小方案。
  31985. * @param {boolean} [options.isAnalyzeById=false] - 是否通过节点 ID 号来指定配送中心点和配送目的点,即通过坐标点指定。
  31986. * @param {TransportationAnalystParameter} [options.parameter] - 交通网络分析通用参数。
  31987. * @usage
  31988. */
  31989. var FindMTSPPathsParameters = /*#__PURE__*/function () {
  31990. function FindMTSPPathsParameters(options) {
  31991. FindMTSPPathsParameters_classCallCheck(this, FindMTSPPathsParameters);
  31992. /**
  31993. * @member {Array.<GeometryPoint|L.LatLng|L.Point|ol.geom.Point|mapboxgl.LngLat|mapboxgl.Point|Array.<number>>} FindMTSPPathsParameters.prototype.centers
  31994. * @description 配送中心集合。
  31995. * 当 FindMTSPPathsParameters.isAnalyzeById = false 时,centers 应为点的坐标数组;
  31996. * 当 FindMTSPPathsParameters.isAnalyzeById = true 时,centers 应为点的 ID 数组。
  31997. */
  31998. this.centers = null;
  31999. /**
  32000. * @member {boolean} [FindMTSPPathsParameters.prototype.hasLeastTotalCost=false]
  32001. * @description 配送模式是否为总花费最小方案。
  32002. * 若为 true,则按照总花费最小的模式进行配送,此时可能会出现某几个配送中心点配送的花费较多而其他配送中心点的花费很少的情况。
  32003. * 若为 false,则为局部最优,此方案会控制每个配送中心点的花费,使各个中心点花费相对平均,此时总花费不一定最小。
  32004. */
  32005. this.hasLeastTotalCost = false;
  32006. /**
  32007. * @member {boolean} [FindMTSPPathsParameters.prototype.isAnalyzeById=false]
  32008. * @description 是否通过节点 ID 号来指定配送中心点和配送目的点,即通过坐标点指定。
  32009. */
  32010. this.isAnalyzeById = false;
  32011. /**
  32012. * @member {Array.<GeometryPoint|L.LatLng|L.Point|ol.geom.Point|mapboxgl.LngLat|mapboxgl.Point|Array.<number>>} FindMTSPPathsParameters.prototype.nodes
  32013. * @description 配送目标集合。
  32014. * 当 FindMTSPPathsParameters.isAnalyzeById = false 时,nodes 应为点的坐标数组;
  32015. * 当 FindMTSPPathsParameters.isAnalyzeById = true 时,nodes 应为点的 ID 数组。
  32016. */
  32017. this.nodes = null;
  32018. /**
  32019. * @member {TransportationAnalystParameter} [FindMTSPPathsParameters.prototype.parameter]
  32020. * @description 交通网络分析通用参数。
  32021. * 通过本类可以设置障碍边、障碍点、权值字段信息的名称标识、转向权值字段等信息。
  32022. * TransportationAnalystParameter 类型,它虽然为可选参数,但是如果不设置其中的 resultSetting 字段,则返回结果空间信息等都为空。
  32023. */
  32024. this.parameter = new TransportationAnalystParameter();
  32025. Util_Util.extend(this, options);
  32026. this.CLASS_NAME = "SuperMap.FindMTSPPathsParameters";
  32027. }
  32028. /**
  32029. * @function FindMTSPPathsParameters.prototype.destroy
  32030. * @description 释放资源,将引用资源的属性置空。
  32031. */
  32032. FindMTSPPathsParameters_createClass(FindMTSPPathsParameters, [{
  32033. key: "destroy",
  32034. value: function destroy() {
  32035. var me = this;
  32036. me.centers = null;
  32037. me.hasLeastTotalCost = null;
  32038. me.isAnalyzeById = null;
  32039. me.nodes = null;
  32040. me.maxWeight = null;
  32041. if (me.parameter) {
  32042. me.parameter.destroy();
  32043. me.parameter = null;
  32044. }
  32045. }
  32046. }]);
  32047. return FindMTSPPathsParameters;
  32048. }();
  32049. ;// CONCATENATED MODULE: ./src/common/iServer/FindMTSPPathsService.js
  32050. function FindMTSPPathsService_typeof(obj) { "@babel/helpers - typeof"; return FindMTSPPathsService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, FindMTSPPathsService_typeof(obj); }
  32051. function FindMTSPPathsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  32052. function FindMTSPPathsService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  32053. function FindMTSPPathsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) FindMTSPPathsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) FindMTSPPathsService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  32054. function FindMTSPPathsService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { FindMTSPPathsService_get = Reflect.get.bind(); } else { FindMTSPPathsService_get = function _get(target, property, receiver) { var base = FindMTSPPathsService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return FindMTSPPathsService_get.apply(this, arguments); }
  32055. function FindMTSPPathsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FindMTSPPathsService_getPrototypeOf(object); if (object === null) break; } return object; }
  32056. function FindMTSPPathsService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) FindMTSPPathsService_setPrototypeOf(subClass, superClass); }
  32057. function FindMTSPPathsService_setPrototypeOf(o, p) { FindMTSPPathsService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FindMTSPPathsService_setPrototypeOf(o, p); }
  32058. function FindMTSPPathsService_createSuper(Derived) { var hasNativeReflectConstruct = FindMTSPPathsService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = FindMTSPPathsService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = FindMTSPPathsService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return FindMTSPPathsService_possibleConstructorReturn(this, result); }; }
  32059. function FindMTSPPathsService_possibleConstructorReturn(self, call) { if (call && (FindMTSPPathsService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return FindMTSPPathsService_assertThisInitialized(self); }
  32060. function FindMTSPPathsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  32061. function FindMTSPPathsService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  32062. function FindMTSPPathsService_getPrototypeOf(o) { FindMTSPPathsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FindMTSPPathsService_getPrototypeOf(o); }
  32063. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  32064. * This program are made available under the terms of the Apache License, Version 2.0
  32065. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  32066. /**
  32067. * @class FindMTSPPathsService
  32068. * @deprecatedclass SuperMap.FindMTSPPathsService
  32069. * @category iServer NetworkAnalyst MTSPPath
  32070. * @classdesc 多旅行商分析服务类
  32071. * 多旅行商分析也称为物流配送,是指在网络数据集中,给定 M 个配送中心点和 N 个配送目的地(M,N 为大于零的整数)。
  32072. * 查找经济有效的配送路径,并给出相应的行走路线。
  32073. * 物流配送功能就是解决如何合理分配配送次序和送货路线,使配送总花费达到最小或每个配送中心的花费达到最小。
  32074. * 该类负责将客户端指定的多旅行商分析参数传递给服务端,并接收服务端返回的结果数据。
  32075. * 多旅行商分析结果通过该类支持的事件的监听函数参数获取。
  32076. * @extends {NetworkAnalystServiceBase}
  32077. * @example
  32078. * var myFindMTSPPathsService = new FindMTSPPathsService(url, {
  32079. * eventListeners: {
  32080. * "processCompleted": findMTSPPathsCompleted,
  32081. * "processFailed": findMTSPPathsError
  32082. * }
  32083. * });
  32084. * @param {string} url - 服务地址。请求网络分析服务,URL应为:
  32085. * http://{服务器地址}:{服务端口号}/iserver/services/网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};
  32086. * 例如:"http://localhost:8090/iserver/services/components-rest/rest/networkanalyst/RoadNet@Changchun"。
  32087. * @param {Object} options - 互服务时所需可选参数。如:
  32088. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  32089. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  32090. * @param {Object} [options.headers] - 请求头。
  32091. * @usage
  32092. */
  32093. var FindMTSPPathsService = /*#__PURE__*/function (_NetworkAnalystServic) {
  32094. FindMTSPPathsService_inherits(FindMTSPPathsService, _NetworkAnalystServic);
  32095. var _super = FindMTSPPathsService_createSuper(FindMTSPPathsService);
  32096. function FindMTSPPathsService(url, options) {
  32097. var _this;
  32098. FindMTSPPathsService_classCallCheck(this, FindMTSPPathsService);
  32099. _this = _super.call(this, url, options);
  32100. _this.CLASS_NAME = "SuperMap.FindMTSPPathsService";
  32101. return _this;
  32102. }
  32103. /**
  32104. * @function FindMTSPPathsService.prototype.destroy
  32105. * @override
  32106. */
  32107. FindMTSPPathsService_createClass(FindMTSPPathsService, [{
  32108. key: "destroy",
  32109. value: function destroy() {
  32110. FindMTSPPathsService_get(FindMTSPPathsService_getPrototypeOf(FindMTSPPathsService.prototype), "destroy", this).call(this);
  32111. }
  32112. /**
  32113. * @function FindMTSPPathsService..prototype.processAsync
  32114. * @description 负责将客户端的查询参数传递到服务端。
  32115. * @param {FindMTSPPathsParameters} params - 多旅行商分析服务参数类
  32116. */
  32117. }, {
  32118. key: "processAsync",
  32119. value: function processAsync(params) {
  32120. if (!(params instanceof FindMTSPPathsParameters)) {
  32121. return;
  32122. }
  32123. var me = this,
  32124. jsonObject,
  32125. //end = me.url.substr(me.url.length - 1, 1),
  32126. centers = me.getJson(params.isAnalyzeById, params.centers),
  32127. nodes = me.getJson(params.isAnalyzeById, params.nodes);
  32128. me.url = Util_Util.urlPathAppend(me.url, 'mtsppath');
  32129. jsonObject = {
  32130. centers: centers,
  32131. nodes: nodes,
  32132. parameter: Util_Util.toJSON(params.parameter),
  32133. hasLeastTotalCost: params.hasLeastTotalCost
  32134. };
  32135. me.request({
  32136. method: "GET",
  32137. params: jsonObject,
  32138. scope: me,
  32139. success: me.serviceProcessCompleted,
  32140. failure: me.serviceProcessFailed
  32141. });
  32142. }
  32143. /**
  32144. * @function FindMTSPPathsService.prototype.getJson
  32145. * @description 将对象转化为JSON字符串。
  32146. * @param {boolean} isAnalyzeById - 是否通过id分析
  32147. * @param {Array} params - 需要转换的数字
  32148. * @returns {Object} 转化后的JSON字符串。
  32149. */
  32150. }, {
  32151. key: "getJson",
  32152. value: function getJson(isAnalyzeById, params) {
  32153. var jsonString = "[",
  32154. len = params ? params.length : 0;
  32155. if (isAnalyzeById === false) {
  32156. for (var i = 0; i < len; i++) {
  32157. if (i > 0) {
  32158. jsonString += ",";
  32159. }
  32160. jsonString += '{"x":' + params[i].x + ',"y":' + params[i].y + '}';
  32161. }
  32162. } else if (isAnalyzeById === true) {
  32163. for (var _i2 = 0; _i2 < len; _i2++) {
  32164. if (_i2 > 0) {
  32165. jsonString += ",";
  32166. }
  32167. jsonString += params[_i2];
  32168. }
  32169. }
  32170. jsonString += ']';
  32171. return jsonString;
  32172. }
  32173. /**
  32174. * @function FindMTSPPathsService.prototype.toGeoJSONResult
  32175. * @description 将含有 geometry 的数据转换为 GeoJSON 格式。
  32176. * @param {Object} result - 服务器返回的结果对象。
  32177. */
  32178. }, {
  32179. key: "toGeoJSONResult",
  32180. value: function toGeoJSONResult(result) {
  32181. if (!result || !result.pathList) {
  32182. return null;
  32183. }
  32184. var geoJSONFormat = new GeoJSON();
  32185. result.pathList.map(function (path) {
  32186. if (path.route) {
  32187. path.route = geoJSONFormat.toGeoJSON(path.route);
  32188. }
  32189. if (path.pathGuideItems) {
  32190. path.pathGuideItems = geoJSONFormat.toGeoJSON(path.pathGuideItems);
  32191. }
  32192. if (path.edgeFeatures) {
  32193. path.edgeFeatures = geoJSONFormat.toGeoJSON(path.edgeFeatures);
  32194. }
  32195. if (path.nodeFeatures) {
  32196. path.nodeFeatures = geoJSONFormat.toGeoJSON(path.nodeFeatures);
  32197. }
  32198. return path;
  32199. });
  32200. return result;
  32201. }
  32202. }]);
  32203. return FindMTSPPathsService;
  32204. }(NetworkAnalystServiceBase);
  32205. ;// CONCATENATED MODULE: ./src/common/iServer/FindPathParameters.js
  32206. function FindPathParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  32207. function FindPathParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  32208. function FindPathParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) FindPathParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) FindPathParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  32209. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  32210. * This program are made available under the terms of the Apache License, Version 2.0
  32211. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  32212. /**
  32213. * @class FindPathParameters
  32214. * @deprecatedclass SuperMap.FindPathParameters
  32215. * @category iServer NetworkAnalyst Path
  32216. * @classdesc 最佳路径分析参数类。最佳路径是在网络数据集中指定一些结点,按照顺序访问结点从而求解起止点之间阻抗最小的路径。
  32217. * 例如如果要顺序访问 1、2、3、4 四个结点,则需要分别找到1、2结点间的最佳路径 R1—2,2、3 间的最佳路径 R2—3 和 3、4 结点间的最佳路径 R3—4,
  32218. * 顺序访问 1、2、3、4 四个结点的最佳路径就是 R = R1—2 + R2—3 + R3—4。
  32219. * 阻抗就是指从一点到另一点的耗费,在实际应用中我们可以将距离、时间、花费等作为阻抗条件。
  32220. * 阻抗最小也就可以理解为从一点到另一点距离最短、时间最少、花费最低等。当两点间距离最短时为最短路径,它是最佳路径问题的一个特例。
  32221. * 阻抗值通过 {@link TransportationAnalystParameter#weightFieldName}设置。
  32222. * 计算最佳路径除了受阻抗影响外,还受转向字段的影响。转向值通过 {@link TransportationAnalystParameter#turnWeightField} 设置。
  32223. *
  32224. * @param {Object} options - 参数。
  32225. * @param {Array.<GeometryPoint|L.LatLng|L.Point|ol.geom.Point|mapboxgl.LngLat|mapboxgl.Point|Array.<number>>} options.nodes - 最佳路径分析经过的结点或设施点数组。该字段至少包含两个点。
  32226. * @param {boolean} [options.isAnalyzeById=false] - 是否通过节点 ID 指定路径分析的结点。
  32227. * @param {boolean} [options.hasLeastEdgeCount=false] - 是否按照弧段数最少的进行最佳路径分析。
  32228. * @param {TransportationAnalystParameter} [options.parameter] - 交通网络分析通用参数。
  32229. * @usage
  32230. */
  32231. var FindPathParameters = /*#__PURE__*/function () {
  32232. function FindPathParameters(options) {
  32233. FindPathParameters_classCallCheck(this, FindPathParameters);
  32234. /**
  32235. * @member {boolean} [FindPathParameters.prototype.isAnalyzeById=false]
  32236. * @description 是否通过节点 ID 指定路径分析的结点。
  32237. * 指定路径分析经过的结点或设施点有两种方式:输入结点 ID 号或直接输入点坐标。
  32238. * 当该字段为 true 时,表示通过结点 ID 指定途经点,即 FindPathParameters.nodes = [ID1,ID2,...];
  32239. * 反之表示通过结点坐标指定途经点,即 FindPathParameters.nodes = [{x1,y1},{x2,y2},...] 。
  32240. */
  32241. this.isAnalyzeById = false;
  32242. /**
  32243. * @member {boolean} [FindPathParameters.prototype.hasLeastEdgeCount=false]
  32244. * @description 是否按照弧段数最少的进行最佳路径分析。
  32245. * true 表示按照弧段数最少进行分析,返回弧段数最少的路径中一个阻抗最小的最佳路径;
  32246. * false 表示直接返回阻抗最小的路径,而不考虑弧段的多少。
  32247. */
  32248. this.hasLeastEdgeCount = null;
  32249. /**
  32250. * @member {Array.<GeometryPoint|L.LatLng|L.Point|ol.geom.Point|mapboxgl.LngLat|mapboxgl.Point|Array.<number>>} FindPathParameters.prototype.nodes
  32251. * @description 最佳路径分析经过的结点或设施点数组,必设字段。该字段至少包含两个点。
  32252. * 当 FindPathParameters.isAnalyzeById = false 时,nodes 应为点的坐标数组;
  32253. * 当 FindPathParameters.isAnalyzeById = true 时,nodes 应为点的 ID 数组。
  32254. */
  32255. this.nodes = null;
  32256. /**
  32257. * @member {TransportationAnalystParameter} FindPathParameters.prototype.parameter
  32258. * @description 交通网络分析通用参数。
  32259. */
  32260. this.parameter = new TransportationAnalystParameter();
  32261. Util_Util.extend(this, options);
  32262. this.CLASS_NAME = "SuperMap.FindPathParameters";
  32263. }
  32264. /**
  32265. * @function FindPathParameters.prototype.destroy
  32266. * @description 释放资源,将引用资源的属性置空。
  32267. */
  32268. FindPathParameters_createClass(FindPathParameters, [{
  32269. key: "destroy",
  32270. value: function destroy() {
  32271. var me = this;
  32272. me.isAnalyzeById = null;
  32273. me.hasLeastEdgeCount = null;
  32274. me.nodes = null;
  32275. if (me.parameter) {
  32276. me.parameter.destroy();
  32277. me.parameter = null;
  32278. }
  32279. }
  32280. }]);
  32281. return FindPathParameters;
  32282. }();
  32283. ;// CONCATENATED MODULE: ./src/common/iServer/FindPathService.js
  32284. function FindPathService_typeof(obj) { "@babel/helpers - typeof"; return FindPathService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, FindPathService_typeof(obj); }
  32285. function FindPathService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  32286. function FindPathService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  32287. function FindPathService_createClass(Constructor, protoProps, staticProps) { if (protoProps) FindPathService_defineProperties(Constructor.prototype, protoProps); if (staticProps) FindPathService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  32288. function FindPathService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { FindPathService_get = Reflect.get.bind(); } else { FindPathService_get = function _get(target, property, receiver) { var base = FindPathService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return FindPathService_get.apply(this, arguments); }
  32289. function FindPathService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FindPathService_getPrototypeOf(object); if (object === null) break; } return object; }
  32290. function FindPathService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) FindPathService_setPrototypeOf(subClass, superClass); }
  32291. function FindPathService_setPrototypeOf(o, p) { FindPathService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FindPathService_setPrototypeOf(o, p); }
  32292. function FindPathService_createSuper(Derived) { var hasNativeReflectConstruct = FindPathService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = FindPathService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = FindPathService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return FindPathService_possibleConstructorReturn(this, result); }; }
  32293. function FindPathService_possibleConstructorReturn(self, call) { if (call && (FindPathService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return FindPathService_assertThisInitialized(self); }
  32294. function FindPathService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  32295. function FindPathService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  32296. function FindPathService_getPrototypeOf(o) { FindPathService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FindPathService_getPrototypeOf(o); }
  32297. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  32298. * This program are made available under the terms of the Apache License, Version 2.0
  32299. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  32300. /**
  32301. * @class FindPathService
  32302. * @deprecatedclass SuperMap.FindPathService
  32303. * @category iServer NetworkAnalyst Path
  32304. * @classdesc 最佳路径分析服务类。
  32305. * 最佳路径是在网络数据集中指定一些节点,按照节点的选择顺序,
  32306. * 顺序访问这些节点从而求解起止点之间阻抗最小的路经。
  32307. * 该类负责将客户端指定的最佳路径分析参数传递给服务端,并接收服务端返回的结果数据。
  32308. * 最佳路径分析结果通过该类支持的事件的监听函数参数获取
  32309. * @extends {NetworkAnalystServiceBase}
  32310. * @example
  32311. * var myFindPathService = new FindPathService(url, {
  32312. * eventListeners: {
  32313. * "processCompleted": findPathCompleted,
  32314. * "processFailed": findPathError
  32315. * }
  32316. * });
  32317. * @param {string} url - 服务地址。请求网络分析服务,URL应为:
  32318. * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};
  32319. * 例如:"http://localhost:8090/iserver/services/components-rest/rest/networkanalyst/RoadNet@Changchun"。
  32320. * @param {Object} options - 参数。
  32321. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  32322. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  32323. * @param {Object} [options.headers] - 请求头。
  32324. * @usage
  32325. */
  32326. var FindPathService = /*#__PURE__*/function (_NetworkAnalystServic) {
  32327. FindPathService_inherits(FindPathService, _NetworkAnalystServic);
  32328. var _super = FindPathService_createSuper(FindPathService);
  32329. function FindPathService(url, options) {
  32330. var _this;
  32331. FindPathService_classCallCheck(this, FindPathService);
  32332. _this = _super.call(this, url, options);
  32333. _this.CLASS_NAME = "SuperMap.FindPathService";
  32334. return _this;
  32335. }
  32336. /**
  32337. * @function FindPathService.prototype.destroy
  32338. * @override
  32339. */
  32340. FindPathService_createClass(FindPathService, [{
  32341. key: "destroy",
  32342. value: function destroy() {
  32343. FindPathService_get(FindPathService_getPrototypeOf(FindPathService.prototype), "destroy", this).call(this);
  32344. }
  32345. /**
  32346. * @function FindPathService.prototype.processAsync
  32347. * @description 负责将客户端的查询参数传递到服务端。
  32348. * @param {FindPathParameters} params - 最佳路径分析服务参数类
  32349. */
  32350. }, {
  32351. key: "processAsync",
  32352. value: function processAsync(params) {
  32353. if (!(params instanceof FindPathParameters)) {
  32354. return;
  32355. }
  32356. var me = this,
  32357. jsonObject;
  32358. me.url = Util_Util.urlPathAppend(me.url, 'path');
  32359. jsonObject = {
  32360. hasLeastEdgeCount: params.hasLeastEdgeCount,
  32361. parameter: Util_Util.toJSON(params.parameter),
  32362. nodes: me.getJson(params.isAnalyzeById, params.nodes)
  32363. };
  32364. me.request({
  32365. method: "GET",
  32366. params: jsonObject,
  32367. scope: me,
  32368. success: me.serviceProcessCompleted,
  32369. failure: me.serviceProcessFailed
  32370. });
  32371. }
  32372. /**
  32373. * @function FindPathService.prototype.getJson
  32374. * @description 将对象转化为JSON字符串。
  32375. * @param {boolean} isAnalyzeById - 是否通过id分析
  32376. * @param {Array} params - 需要转换的数字
  32377. * @returns {Object} 转化后的JSON字符串。
  32378. */
  32379. }, {
  32380. key: "getJson",
  32381. value: function getJson(isAnalyzeById, params) {
  32382. var jsonString = "[",
  32383. len = params ? params.length : 0;
  32384. if (isAnalyzeById === false) {
  32385. for (var i = 0; i < len; i++) {
  32386. if (i > 0) {
  32387. jsonString += ",";
  32388. }
  32389. jsonString += '{"x":' + params[i].x + ',"y":' + params[i].y + '}';
  32390. }
  32391. } else if (isAnalyzeById === true) {
  32392. for (var _i2 = 0; _i2 < len; _i2++) {
  32393. if (_i2 > 0) {
  32394. jsonString += ",";
  32395. }
  32396. jsonString += params[_i2];
  32397. }
  32398. }
  32399. jsonString += ']';
  32400. return jsonString;
  32401. }
  32402. /**
  32403. * @function FindMTSPPathsService.prototype.toGeoJSONResult
  32404. * @description 将含有 geometry 的数据转换为 GeoJSON 格式。
  32405. * @param {Object} result - 服务器返回的结果对象。
  32406. */
  32407. }, {
  32408. key: "toGeoJSONResult",
  32409. value: function toGeoJSONResult(result) {
  32410. if (!result || !result.pathList || result.pathList.length < 1) {
  32411. return null;
  32412. }
  32413. var geoJSONFormat = new GeoJSON();
  32414. result.pathList.forEach(function (path) {
  32415. if (path.route) {
  32416. path.route = geoJSONFormat.toGeoJSON(path.route);
  32417. }
  32418. if (path.pathGuideItems) {
  32419. path.pathGuideItems = geoJSONFormat.toGeoJSON(path.pathGuideItems);
  32420. }
  32421. if (path.edgeFeatures) {
  32422. path.edgeFeatures = geoJSONFormat.toGeoJSON(path.edgeFeatures);
  32423. }
  32424. if (path.nodeFeatures) {
  32425. path.nodeFeatures = geoJSONFormat.toGeoJSON(path.nodeFeatures);
  32426. }
  32427. });
  32428. return result;
  32429. }
  32430. }]);
  32431. return FindPathService;
  32432. }(NetworkAnalystServiceBase);
  32433. ;// CONCATENATED MODULE: ./src/common/iServer/FindServiceAreasParameters.js
  32434. function FindServiceAreasParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  32435. function FindServiceAreasParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  32436. function FindServiceAreasParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) FindServiceAreasParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) FindServiceAreasParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  32437. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  32438. * This program are made available under the terms of the Apache License, Version 2.0
  32439. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  32440. /**
  32441. * @class FindServiceAreasParameters
  32442. * @deprecatedclass SuperMap.FindServiceAreasParameters
  32443. * @category iServer NetworkAnalyst ServiceArea
  32444. * @classdesc 服务区分析参数类。
  32445. * 服务区分析是以指定服务站点为中心,在一定服务范围内查找网络上服务站点能够提供服务的区域范围。
  32446. * 例如:计算某快餐店能够在30分钟内送达快餐的区域。
  32447. * @param {Object} options - 参数。
  32448. * @param {Array.<number>} options.weights - 每个服务站点提供服务的阻力半径,超过这个阻力半径的区域不予考虑,其单位与阻力字段一致。
  32449. * @param {Array.<GeometryPoint|L.LatLng|L.Point|ol.geom.Point|mapboxgl.LngLat|mapboxgl.Point|Array.<number>>} options.centers - 服务站点数组。
  32450. * @param {boolean} [options.isAnalyzeById=false] - 是否通过节点 ID 指定路径分析的结点。
  32451. * @param {boolean} [options.isCenterMutuallyExclusive=false] - 是否中心点互斥。
  32452. * @param {boolean} [options.isFromCenter=false] - 是否从中心点开始分析。
  32453. * @param {TransportationAnalystParameter} [options.parameter] - 交通网络分析通用参数。
  32454. * @usage
  32455. */
  32456. var FindServiceAreasParameters = /*#__PURE__*/function () {
  32457. function FindServiceAreasParameters(options) {
  32458. FindServiceAreasParameters_classCallCheck(this, FindServiceAreasParameters);
  32459. /**
  32460. * @member {boolean} [FindServiceAreasParameters.prototype.isAnalyzeById=false]
  32461. * @description 是否通过节点 ID 指定路径分析的结点。
  32462. * 指定路径分析经过的结点或设施点有两种方式:输入结点 ID 号或直接输入点坐标。
  32463. * 当该字段为 true 时,表示通过结点 ID 指定途经点,即 FindServiceAreasParameters.centers = [ID1,ID2,...];
  32464. * 反之表示通过结点坐标指定途经点,即 FindServiceAreasParameters.centers = [{x1,y1},{x2,y2},...]。
  32465. */
  32466. this.isAnalyzeById = false;
  32467. /**
  32468. * @member {boolean} [FindServiceAreasParameters.prototype.isCenterMutuallyExclusive=false]
  32469. * @description 是否中心点互斥,即按照中心点的距离进行判断是否要进行互斥处理。
  32470. * 若分析出的服务区有重叠的部分,则通过设置该参数进行互斥处理。
  32471. */
  32472. this.isCenterMutuallyExclusive = false;
  32473. /**
  32474. * @member {Array.<GeometryPoint|L.LatLng|L.Point|ol.geom.Point|mapboxgl.LngLat|mapboxgl.Point|Array.<number>>} FindServiceAreasParameters.prototype.centers
  32475. * @description 服务站点数组。
  32476. * 当该类的 iSAnalyzeById = true 时,通过结点 ID 号指定服务站点;当 iSAnalyzeById = false 时,通过点坐标指定服务站点。
  32477. */
  32478. this.centers = null;
  32479. /**
  32480. * @member {boolean} [FindServiceAreasParameters.prototype.isFromCenter=false]
  32481. * @description 是否从中心点开始分析。
  32482. * 从中心点开始分析和不从中心点开始分析,体现了服务中心和需要该服务的需求地的关系模式。
  32483. * 从中心点开始分析,是一个服务中心向服务需求地提供服务;
  32484. * 而不从中心点开始分析,是一个服务需求地主动到服务中心获得服务。
  32485. */
  32486. this.isFromCenter = false;
  32487. /**
  32488. * APIProperty: weights
  32489. * @member {Array.<number>} FindServiceAreasParameters.prototype.weights
  32490. * @description 每个服务站点提供服务的阻力半径,即超过这个阻力半径的区域不予考虑,其单位与阻力字段一致。
  32491. * 该字段为一个数组,数组长度跟服务中心个数一致,按照索引顺序与站点一一对应,每个元素表示了在对每个服务中心进行服务区分析时,所用的服务半径。
  32492. */
  32493. this.weights = null;
  32494. /**
  32495. * @member {TransportationAnalystParameter} FindServiceAreasParameters.prototype.parameter
  32496. * @description 交通网络分析通用参数。
  32497. */
  32498. this.parameter = new TransportationAnalystParameter();
  32499. Util_Util.extend(this, options);
  32500. this.CLASS_NAME = "SuperMap.FindServiceAreasParameters";
  32501. }
  32502. /**
  32503. * @function FindServiceAreasParameters.prototype.destroy
  32504. * @description 释放资源,将引用资源的属性置空。
  32505. */
  32506. FindServiceAreasParameters_createClass(FindServiceAreasParameters, [{
  32507. key: "destroy",
  32508. value: function destroy() {
  32509. var me = this;
  32510. me.isAnalyzeById = null;
  32511. me.isCenterMutuallyExclusive = null;
  32512. me.centers = null;
  32513. me.isFromCenter = null;
  32514. me.weights = null;
  32515. if (me.parameter) {
  32516. me.parameter.destroy();
  32517. me.parameter = null;
  32518. }
  32519. }
  32520. }]);
  32521. return FindServiceAreasParameters;
  32522. }();
  32523. ;// CONCATENATED MODULE: ./src/common/iServer/FindServiceAreasService.js
  32524. function FindServiceAreasService_typeof(obj) { "@babel/helpers - typeof"; return FindServiceAreasService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, FindServiceAreasService_typeof(obj); }
  32525. function FindServiceAreasService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  32526. function FindServiceAreasService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  32527. function FindServiceAreasService_createClass(Constructor, protoProps, staticProps) { if (protoProps) FindServiceAreasService_defineProperties(Constructor.prototype, protoProps); if (staticProps) FindServiceAreasService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  32528. function FindServiceAreasService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { FindServiceAreasService_get = Reflect.get.bind(); } else { FindServiceAreasService_get = function _get(target, property, receiver) { var base = FindServiceAreasService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return FindServiceAreasService_get.apply(this, arguments); }
  32529. function FindServiceAreasService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FindServiceAreasService_getPrototypeOf(object); if (object === null) break; } return object; }
  32530. function FindServiceAreasService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) FindServiceAreasService_setPrototypeOf(subClass, superClass); }
  32531. function FindServiceAreasService_setPrototypeOf(o, p) { FindServiceAreasService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FindServiceAreasService_setPrototypeOf(o, p); }
  32532. function FindServiceAreasService_createSuper(Derived) { var hasNativeReflectConstruct = FindServiceAreasService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = FindServiceAreasService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = FindServiceAreasService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return FindServiceAreasService_possibleConstructorReturn(this, result); }; }
  32533. function FindServiceAreasService_possibleConstructorReturn(self, call) { if (call && (FindServiceAreasService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return FindServiceAreasService_assertThisInitialized(self); }
  32534. function FindServiceAreasService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  32535. function FindServiceAreasService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  32536. function FindServiceAreasService_getPrototypeOf(o) { FindServiceAreasService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FindServiceAreasService_getPrototypeOf(o); }
  32537. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  32538. * This program are made available under the terms of the Apache License, Version 2.0
  32539. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  32540. /**
  32541. * @class FindServiceAreasService
  32542. * @deprecatedclass SuperMap.FindServiceAreasService
  32543. * @category iServer NetworkAnalyst ServiceArea
  32544. * @classdesc 服务区分析服务类。
  32545. * 服务区分析是以指定服务站点为中心,
  32546. * 在一定服务范围内查找网络上服务站点能够提供服务的区域范围。
  32547. * 该类负责将客户端指定的服务区分析参数传递给服务端,并接收服务端返回的结果数据。
  32548. * 服务区分析结果通过该类支持的事件的监听函数参数获取
  32549. * @extends {NetworkAnalystServiceBase}
  32550. * @example
  32551. * var myFindServiceAreasService = new FindServiceAreasService(url, {
  32552. * eventListeners: {
  32553. * "processCompleted": findServiceAreasCompleted,
  32554. * "processFailed": findServiceAreasError
  32555. * }
  32556. * });
  32557. * @param {string} url - 服务地址。请求网络分析服务,URL应为:
  32558. * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};
  32559. * 例如:"http://localhost:8090/iserver/services/components-rest/rest/networkanalyst/RoadNet@Changchun"。
  32560. * @param {Object} options - 互服务时所需可选参数。如:
  32561. * @param {Object} options.eventListeners - 需要被注册的监听器对象
  32562. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  32563. * @param {Object} [options.headers] - 请求头。
  32564. * @usage
  32565. */
  32566. var FindServiceAreasService = /*#__PURE__*/function (_NetworkAnalystServic) {
  32567. FindServiceAreasService_inherits(FindServiceAreasService, _NetworkAnalystServic);
  32568. var _super = FindServiceAreasService_createSuper(FindServiceAreasService);
  32569. function FindServiceAreasService(url, options) {
  32570. var _this;
  32571. FindServiceAreasService_classCallCheck(this, FindServiceAreasService);
  32572. _this = _super.call(this, url, options);
  32573. _this.CLASS_NAME = "SuperMap.FindServiceAreasService";
  32574. return _this;
  32575. }
  32576. /**
  32577. * @function FindServiceAreasService.prototype.destroy
  32578. * @override
  32579. */
  32580. FindServiceAreasService_createClass(FindServiceAreasService, [{
  32581. key: "destroy",
  32582. value: function destroy() {
  32583. FindServiceAreasService_get(FindServiceAreasService_getPrototypeOf(FindServiceAreasService.prototype), "destroy", this).call(this);
  32584. }
  32585. /**
  32586. * @function FindServiceAreasService.prototype.processAsync
  32587. * @description 负责将客户端的查询参数传递到服务端。
  32588. * @param {FindServiceAreasParameters} params - 服务区分析服务参数类
  32589. */
  32590. }, {
  32591. key: "processAsync",
  32592. value: function processAsync(params) {
  32593. if (!(params instanceof FindServiceAreasParameters)) {
  32594. return;
  32595. }
  32596. var me = this,
  32597. jsonObject;
  32598. me.url = Util_Util.urlPathAppend(me.url, 'servicearea');
  32599. jsonObject = {
  32600. isFromCenter: params.isFromCenter,
  32601. isCenterMutuallyExclusive: params.isCenterMutuallyExclusive,
  32602. parameter: Util_Util.toJSON(params.parameter),
  32603. centers: me.getJson(params.isAnalyzeById, params.centers),
  32604. weights: me.getJson(true, params.weights)
  32605. };
  32606. me.request({
  32607. method: "GET",
  32608. params: jsonObject,
  32609. scope: me,
  32610. success: me.serviceProcessCompleted,
  32611. failure: me.serviceProcessFailed
  32612. });
  32613. }
  32614. /**
  32615. * @function FindServiceAreasService.prototype.getJson
  32616. * @description 将对象转化为JSON字符串。
  32617. * @param {boolean} isAnalyzeById - 是否通过id分析
  32618. * @param {Array} params - 需要转换的数字
  32619. * @returns {Object} 转化后的JSON字符串。
  32620. */
  32621. }, {
  32622. key: "getJson",
  32623. value: function getJson(isAnalyzeById, params) {
  32624. var jsonString = "[",
  32625. len = params ? params.length : 0;
  32626. if (isAnalyzeById === false) {
  32627. for (var i = 0; i < len; i++) {
  32628. if (i > 0) {
  32629. jsonString += ",";
  32630. }
  32631. jsonString += '{"x":' + params[i].x + ',"y":' + params[i].y + '}';
  32632. }
  32633. } else if (isAnalyzeById === true) {
  32634. for (var _i2 = 0; _i2 < len; _i2++) {
  32635. if (_i2 > 0) {
  32636. jsonString += ",";
  32637. }
  32638. jsonString += params[_i2];
  32639. }
  32640. }
  32641. jsonString += ']';
  32642. return jsonString;
  32643. }
  32644. /**
  32645. * @function FindServiceAreasService.prototype.toGeoJSONResult
  32646. * @description 将含有 geometry 的数据转换为 GeoJSON 格式。
  32647. * @param {Object} result - 服务器返回的结果对象。
  32648. */
  32649. }, {
  32650. key: "toGeoJSONResult",
  32651. value: function toGeoJSONResult(result) {
  32652. if (!result || !result.serviceAreaList) {
  32653. return result;
  32654. }
  32655. var geoJSONFormat = new GeoJSON();
  32656. result.serviceAreaList.map(function (serviceArea) {
  32657. if (serviceArea.serviceRegion) {
  32658. serviceArea.serviceRegion = geoJSONFormat.toGeoJSON(serviceArea.serviceRegion);
  32659. }
  32660. if (serviceArea.edgeFeatures) {
  32661. serviceArea.edgeFeatures = geoJSONFormat.toGeoJSON(serviceArea.edgeFeatures);
  32662. }
  32663. if (serviceArea.nodeFeatures) {
  32664. serviceArea.nodeFeatures = geoJSONFormat.toGeoJSON(serviceArea.nodeFeatures);
  32665. }
  32666. if (serviceArea.routes) {
  32667. serviceArea.routes = geoJSONFormat.toGeoJSON(serviceArea.routes);
  32668. }
  32669. return serviceArea;
  32670. });
  32671. return result;
  32672. }
  32673. }]);
  32674. return FindServiceAreasService;
  32675. }(NetworkAnalystServiceBase);
  32676. ;// CONCATENATED MODULE: ./src/common/iServer/FindTSPPathsParameters.js
  32677. function FindTSPPathsParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  32678. function FindTSPPathsParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  32679. function FindTSPPathsParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) FindTSPPathsParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) FindTSPPathsParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  32680. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  32681. * This program are made available under the terms of the Apache License, Version 2.0
  32682. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  32683. /**
  32684. * @class FindTSPPathsParameters
  32685. * @deprecatedclass SuperMap.FindTSPPathsParameters
  32686. * @category iServer NetworkAnalyst TSPPath
  32687. * @classdesc 旅行商分析参数类。
  32688. * 旅行商分析是路径分析的一种,它从起点开始(默认为用户指定的第一点)查找能够遍历所有途经点且花费最小的路径。
  32689. * 旅行商分析也可以指定到达的终点,这时查找从起点能够遍历所有途经点最后到达终点,且花费最小的路径。
  32690. * 旅行商分析和最佳路径分析都是在网络中寻找遍历所有站点的最经济的路径,区别是在遍历网络所有站点的过程中对结点访问顺序不同。
  32691. * 最佳路径分析必须按照指定顺序对站点进行访问,而旅行商分析是无序的路径分析。
  32692. * @param {Object} options - 参数。
  32693. * @param {boolean} [options.endNodeAssigned=false] - 是否指定终止点,将指定的途经点的最后一个点作为终止点。true 表示指定终止点,则旅行商必须最后一个访问终止点。
  32694. * @param {boolean} [options.isAnalyzeById=false] - 是否通过节点 ID 号来指定配送中心点和配送目的点。
  32695. * @param {Array.<GeometryPoint|L.LatLng|L.Point|ol.geom.Point|mapboxgl.LngLat|mapboxgl.Point|Array.<number>>} options.nodes - 配送目标集合。
  32696. * @param {TransportationAnalystParameter} [options.parameter] - 交通网络分析通用参数。
  32697. * @usage
  32698. */
  32699. var FindTSPPathsParameters = /*#__PURE__*/function () {
  32700. function FindTSPPathsParameters(options) {
  32701. FindTSPPathsParameters_classCallCheck(this, FindTSPPathsParameters);
  32702. /**
  32703. * @member {boolean} [FindTSPPathsParameters.prototype.endNodeAssigned=false]
  32704. * @description 是否指定终止点,将指定的途经点的最后一个点作为终止点。
  32705. * true 表示指定终止点,则旅行商必须最后一个访问终止点。
  32706. */
  32707. this.endNodeAssigned = false;
  32708. /**
  32709. * @member {boolean} [FindTSPPathsParameters.prototype.isAnalyzeById=false]
  32710. * @description 是否通过节点 ID 号来指定途经点。
  32711. */
  32712. this.isAnalyzeById = false;
  32713. /**
  32714. * @member {Array.<GeometryPoint|L.LatLng|L.Point|ol.geom.Point|mapboxgl.LngLat|mapboxgl.Point|Array.<number>>} FindTSPPathsParameters.prototype.nodes
  32715. * @description 旅行商分析途经点数组。
  32716. * 当 FindTSPPathsParameters.isAnalyzeById = false 时,nodes 应为点的坐标数组;
  32717. * 当 FindTSPPathsParameters.isAnalyzeById = true 时,nodes 应为点的 ID 数组。
  32718. */
  32719. this.nodes = null;
  32720. /**
  32721. * @member {TransportationAnalystParameter} [FindTSPPathsParameters.prototype.parameter]
  32722. * @description 交通网络分析通用参数。通过本类可以设置障碍边、障碍点、权值字段信息的名称标识、转向权值字段等信息。
  32723. * TransportationAnalystParameter 类型,它虽然为可选参数,但是如果不设置其中的 resultSetting
  32724. * 字段,则返回结果空间信息等都为空。
  32725. */
  32726. this.parameter = new TransportationAnalystParameter();
  32727. Util_Util.extend(this, options);
  32728. this.CLASS_NAME = "SuperMap.FindTSPPathsParameters";
  32729. }
  32730. /**
  32731. * @function FindTSPPathsParameters.prototype.destroy
  32732. * @description 释放资源,将引用资源的属性置空。
  32733. */
  32734. FindTSPPathsParameters_createClass(FindTSPPathsParameters, [{
  32735. key: "destroy",
  32736. value: function destroy() {
  32737. var me = this;
  32738. me.endNodeAssigned = null;
  32739. me.isAnalyzeById = null;
  32740. me.nodes = null;
  32741. if (me.parameter) {
  32742. me.parameter.destroy();
  32743. me.parameter = null;
  32744. }
  32745. }
  32746. }]);
  32747. return FindTSPPathsParameters;
  32748. }();
  32749. ;// CONCATENATED MODULE: ./src/common/iServer/FindTSPPathsService.js
  32750. function FindTSPPathsService_typeof(obj) { "@babel/helpers - typeof"; return FindTSPPathsService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, FindTSPPathsService_typeof(obj); }
  32751. function FindTSPPathsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  32752. function FindTSPPathsService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  32753. function FindTSPPathsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) FindTSPPathsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) FindTSPPathsService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  32754. function FindTSPPathsService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { FindTSPPathsService_get = Reflect.get.bind(); } else { FindTSPPathsService_get = function _get(target, property, receiver) { var base = FindTSPPathsService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return FindTSPPathsService_get.apply(this, arguments); }
  32755. function FindTSPPathsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FindTSPPathsService_getPrototypeOf(object); if (object === null) break; } return object; }
  32756. function FindTSPPathsService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) FindTSPPathsService_setPrototypeOf(subClass, superClass); }
  32757. function FindTSPPathsService_setPrototypeOf(o, p) { FindTSPPathsService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FindTSPPathsService_setPrototypeOf(o, p); }
  32758. function FindTSPPathsService_createSuper(Derived) { var hasNativeReflectConstruct = FindTSPPathsService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = FindTSPPathsService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = FindTSPPathsService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return FindTSPPathsService_possibleConstructorReturn(this, result); }; }
  32759. function FindTSPPathsService_possibleConstructorReturn(self, call) { if (call && (FindTSPPathsService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return FindTSPPathsService_assertThisInitialized(self); }
  32760. function FindTSPPathsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  32761. function FindTSPPathsService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  32762. function FindTSPPathsService_getPrototypeOf(o) { FindTSPPathsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FindTSPPathsService_getPrototypeOf(o); }
  32763. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  32764. * This program are made available under the terms of the Apache License, Version 2.0
  32765. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  32766. /**
  32767. * @class FindTSPPathsService
  32768. * @deprecatedclass SuperMap.FindTSPPathsService
  32769. * @category iServer NetworkAnalyst TSPPath
  32770. * @classdesc 旅行商分析服务类
  32771. * 旅行商分析是路径分析的一种,它从起点开始(默认为用户指定的第一点)查找能够遍历所有途经点且花费最小的路径。
  32772. * 旅行商分析也可以指定到达的终点,这时查找从起点能够遍历所有途经点最后到达终点,且花费最小的路径。
  32773. * 该类负责将客户端指定的旅行商分析参数传递给服务端,并接收服务端返回的结果数据。
  32774. * 旅行商分析结果通过该类支持的事件的监听函数参数获取
  32775. * @extends {NetworkAnalystServiceBase}
  32776. * @example
  32777. * (start code)
  32778. * var myFindTSPPathsService = new FindTSPPathsService(url, {
  32779. * eventListeners: {
  32780. * "processCompleted": findTSPPathsCompleted,
  32781. * "processFailed": findTSPPathsError
  32782. * }
  32783. * });
  32784. * (end)
  32785. * @param {string} url - 网络分析服务地址。请求网络分析服务,URL应为:
  32786. * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};
  32787. * 例如:"http://localhost:8090/iserver/services/components-rest/rest/networkanalyst/RoadNet@Changchun"。
  32788. * @param {Object} options - 参数。
  32789. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  32790. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  32791. * @param {Object} [options.headers] - 请求头。
  32792. * @usage
  32793. */
  32794. var FindTSPPathsService = /*#__PURE__*/function (_NetworkAnalystServic) {
  32795. FindTSPPathsService_inherits(FindTSPPathsService, _NetworkAnalystServic);
  32796. var _super = FindTSPPathsService_createSuper(FindTSPPathsService);
  32797. function FindTSPPathsService(url, options) {
  32798. var _this;
  32799. FindTSPPathsService_classCallCheck(this, FindTSPPathsService);
  32800. _this = _super.call(this, url, options);
  32801. _this.CLASS_NAME = "SuperMap.FindTSPPathsService";
  32802. return _this;
  32803. }
  32804. /**
  32805. * @function FindTSPPathsService.prototype.destroy
  32806. * @override
  32807. */
  32808. FindTSPPathsService_createClass(FindTSPPathsService, [{
  32809. key: "destroy",
  32810. value: function destroy() {
  32811. FindTSPPathsService_get(FindTSPPathsService_getPrototypeOf(FindTSPPathsService.prototype), "destroy", this).call(this);
  32812. }
  32813. /**
  32814. * @function FindTSPPathsService.prototype.processAsync
  32815. * @description 负责将客户端的查询参数传递到服务端。
  32816. * @param {FindTSPPathsParameters} params - 旅行商分析服务参数类。
  32817. */
  32818. }, {
  32819. key: "processAsync",
  32820. value: function processAsync(params) {
  32821. if (!(params instanceof FindTSPPathsParameters)) {
  32822. return;
  32823. }
  32824. var me = this,
  32825. jsonObject;
  32826. me.url = Util_Util.urlPathAppend(me.url, 'tsppath');
  32827. jsonObject = {
  32828. parameter: Util_Util.toJSON(params.parameter),
  32829. endNodeAssigned: params.endNodeAssigned,
  32830. nodes: me.getNodesJson(params)
  32831. };
  32832. me.request({
  32833. method: "GET",
  32834. params: jsonObject,
  32835. scope: me,
  32836. success: me.serviceProcessCompleted,
  32837. failure: me.serviceProcessFailed
  32838. });
  32839. }
  32840. /**
  32841. * @function FindTSPPathsService.prototype.getNodesJson
  32842. * @description 将节点对象转化为JSON字符串。
  32843. * @param {FindTSPPathsParameters} params - 旅行商分析服务参数类。
  32844. * @returns {string} 转化后的JSON字符串。
  32845. */
  32846. }, {
  32847. key: "getNodesJson",
  32848. value: function getNodesJson(params) {
  32849. var jsonParameters = "",
  32850. nodesString,
  32851. i,
  32852. len,
  32853. nodes;
  32854. if (params.isAnalyzeById === false) {
  32855. for (nodesString = "[", i = 0, nodes = params.nodes, len = nodes.length; i < len; i++) {
  32856. if (i > 0) {
  32857. nodesString += ",";
  32858. }
  32859. nodesString += '{"x":' + nodes[i].x + ',"y":' + nodes[i].y + '}';
  32860. }
  32861. nodesString += ']';
  32862. jsonParameters += nodesString;
  32863. } else if (params.isAnalyzeById === true) {
  32864. var nodeIDsString = "[",
  32865. _nodes = params.nodes,
  32866. _len = _nodes.length;
  32867. for (var _i2 = 0; _i2 < _len; _i2++) {
  32868. if (_i2 > 0) {
  32869. nodeIDsString += ",";
  32870. }
  32871. nodeIDsString += _nodes[_i2];
  32872. }
  32873. nodeIDsString += ']';
  32874. jsonParameters += nodeIDsString;
  32875. }
  32876. return jsonParameters;
  32877. }
  32878. /**
  32879. * @function FindTSPPathsService.prototype.toGeoJSONResult
  32880. * @description 将含有 geometry 的数据转换为 GeoJSON 格式。
  32881. * @param {Object} result - 服务器返回的结果对象。
  32882. */
  32883. }, {
  32884. key: "toGeoJSONResult",
  32885. value: function toGeoJSONResult(result) {
  32886. if (!result || !result.tspPathList) {
  32887. return null;
  32888. }
  32889. var geoJSONFormat = new GeoJSON();
  32890. result.tspPathList.forEach(function (path) {
  32891. if (path.route) {
  32892. path.route = geoJSONFormat.toGeoJSON(path.route);
  32893. }
  32894. if (path.pathGuideItems) {
  32895. path.pathGuideItems = geoJSONFormat.toGeoJSON(path.pathGuideItems);
  32896. }
  32897. if (path.edgeFeatures) {
  32898. path.edgeFeatures = geoJSONFormat.toGeoJSON(path.edgeFeatures);
  32899. }
  32900. if (path.nodeFeatures) {
  32901. path.nodeFeatures = geoJSONFormat.toGeoJSON(path.nodeFeatures);
  32902. }
  32903. });
  32904. return result;
  32905. }
  32906. }]);
  32907. return FindTSPPathsService;
  32908. }(NetworkAnalystServiceBase);
  32909. ;// CONCATENATED MODULE: ./src/common/iServer/UpdateEdgeWeightParameters.js
  32910. function UpdateEdgeWeightParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  32911. function UpdateEdgeWeightParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  32912. function UpdateEdgeWeightParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) UpdateEdgeWeightParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) UpdateEdgeWeightParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  32913. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  32914. * This program are made available under the terms of the Apache License, Version 2.0
  32915. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  32916. /**
  32917. * @class UpdateEdgeWeightParameters
  32918. * @deprecatedclass SuperMap.UpdateEdgeWeightParameters
  32919. * @category iServer NetworkAnalyst EdgeWeight
  32920. * @classdesc 边的耗费权重更新服务参数类。
  32921. * @param {Object} options - 参数。
  32922. * @param {string} options.edgeId - 所在边的 ID。
  32923. * @param {string} options.fromNodeId - 起始转向点的 ID。
  32924. * @param {string} options.toNodeId - 终止转向点的 ID。
  32925. * @param {string} options.weightField - 边的耗费字段。
  32926. * @param {string} options.edgeWeight - 耗费权重。
  32927. * @usage
  32928. */
  32929. var UpdateEdgeWeightParameters = /*#__PURE__*/function () {
  32930. function UpdateEdgeWeightParameters(options) {
  32931. UpdateEdgeWeightParameters_classCallCheck(this, UpdateEdgeWeightParameters);
  32932. if (!options) {
  32933. return;
  32934. }
  32935. /**
  32936. * @member {string} UpdateEdgeWeightParameters.prototype.edgeId
  32937. * @description 所在边的 ID。
  32938. */
  32939. this.edgeId = "";
  32940. /**
  32941. * @member {string} UpdateEdgeWeightParameters.prototype.fromNodeId
  32942. * @description 起始转向点的 ID。
  32943. */
  32944. this.fromNodeId = "";
  32945. /**
  32946. * @member {string} UpdateEdgeWeightParameters.prototype.toNodeId
  32947. * @description 终止转向点的 ID。
  32948. */
  32949. this.toNodeId = "";
  32950. /**
  32951. * @member {string} UpdateEdgeWeightParameters.prototype.weightField
  32952. * @description 边的耗费字段。
  32953. */
  32954. this.weightField = "";
  32955. /**
  32956. * @member {string} UpdateEdgeWeightParameters.prototype.edgeWeight
  32957. * @description 耗费权重。
  32958. */
  32959. this.edgeWeight = "";
  32960. Util_Util.extend(this, options);
  32961. this.CLASS_NAME = "SuperMap.UpdateEdgeWeightParameters";
  32962. }
  32963. /**
  32964. * @function UpdateEdgeWeightParameters.prototype.destroy
  32965. * @description 释放资源,将引用资源的属性置空。
  32966. */
  32967. UpdateEdgeWeightParameters_createClass(UpdateEdgeWeightParameters, [{
  32968. key: "destroy",
  32969. value: function destroy() {
  32970. this.edgeId = null;
  32971. this.fromNodeId = null;
  32972. this.toNodeId = null;
  32973. this.weightField = null;
  32974. this.edgeWeight = null;
  32975. }
  32976. }]);
  32977. return UpdateEdgeWeightParameters;
  32978. }();
  32979. ;// CONCATENATED MODULE: ./src/common/iServer/UpdateEdgeWeightService.js
  32980. function UpdateEdgeWeightService_typeof(obj) { "@babel/helpers - typeof"; return UpdateEdgeWeightService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, UpdateEdgeWeightService_typeof(obj); }
  32981. function UpdateEdgeWeightService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  32982. function UpdateEdgeWeightService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  32983. function UpdateEdgeWeightService_createClass(Constructor, protoProps, staticProps) { if (protoProps) UpdateEdgeWeightService_defineProperties(Constructor.prototype, protoProps); if (staticProps) UpdateEdgeWeightService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  32984. function UpdateEdgeWeightService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { UpdateEdgeWeightService_get = Reflect.get.bind(); } else { UpdateEdgeWeightService_get = function _get(target, property, receiver) { var base = UpdateEdgeWeightService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return UpdateEdgeWeightService_get.apply(this, arguments); }
  32985. function UpdateEdgeWeightService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = UpdateEdgeWeightService_getPrototypeOf(object); if (object === null) break; } return object; }
  32986. function UpdateEdgeWeightService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) UpdateEdgeWeightService_setPrototypeOf(subClass, superClass); }
  32987. function UpdateEdgeWeightService_setPrototypeOf(o, p) { UpdateEdgeWeightService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return UpdateEdgeWeightService_setPrototypeOf(o, p); }
  32988. function UpdateEdgeWeightService_createSuper(Derived) { var hasNativeReflectConstruct = UpdateEdgeWeightService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = UpdateEdgeWeightService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = UpdateEdgeWeightService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return UpdateEdgeWeightService_possibleConstructorReturn(this, result); }; }
  32989. function UpdateEdgeWeightService_possibleConstructorReturn(self, call) { if (call && (UpdateEdgeWeightService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return UpdateEdgeWeightService_assertThisInitialized(self); }
  32990. function UpdateEdgeWeightService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  32991. function UpdateEdgeWeightService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  32992. function UpdateEdgeWeightService_getPrototypeOf(o) { UpdateEdgeWeightService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return UpdateEdgeWeightService_getPrototypeOf(o); }
  32993. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  32994. * This program are made available under the terms of the Apache License, Version 2.0
  32995. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  32996. /**
  32997. * @class UpdateEdgeWeightService
  32998. * @deprecatedclass SuperMap.UpdateEdgeWeightService
  32999. * @category iServer NetworkAnalyst EdgeWeight
  33000. * @classdesc 更新边的边的耗费权重服务
  33001. * @extends {NetworkAnalystServiceBase}
  33002. * @example
  33003. *(start code)
  33004. * var updateEdgeWeightService = new UpdateEdgeWeightService(url, {
  33005. * eventListeners: {
  33006. * "processCompleted": UpdateEdgeWeightCompleted,
  33007. * "processFailed": UpdateEdgeWeightError
  33008. * }
  33009. * });
  33010. * (end)
  33011. * @param {string} url - 服务地址。如:http://localhost:8090/iserver/services/transportationanalyst-sample/rest/networkanalyst/RoadNet@Changchun 。
  33012. * @param {Object} options - 参数。
  33013. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  33014. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  33015. * @param {Object} [options.headers] - 请求头。
  33016. * @usage
  33017. */
  33018. var UpdateEdgeWeightService = /*#__PURE__*/function (_NetworkAnalystServic) {
  33019. UpdateEdgeWeightService_inherits(UpdateEdgeWeightService, _NetworkAnalystServic);
  33020. var _super = UpdateEdgeWeightService_createSuper(UpdateEdgeWeightService);
  33021. function UpdateEdgeWeightService(url, options) {
  33022. var _this;
  33023. UpdateEdgeWeightService_classCallCheck(this, UpdateEdgeWeightService);
  33024. _this = _super.call(this, url, options);
  33025. _this.CLASS_NAME = "SuperMap.UpdateEdgeWeightService";
  33026. return _this;
  33027. }
  33028. /**
  33029. * @override
  33030. */
  33031. UpdateEdgeWeightService_createClass(UpdateEdgeWeightService, [{
  33032. key: "destroy",
  33033. value: function destroy() {
  33034. UpdateEdgeWeightService_get(UpdateEdgeWeightService_getPrototypeOf(UpdateEdgeWeightService.prototype), "destroy", this).call(this);
  33035. }
  33036. /**
  33037. * @function UpdateEdgeWeightService.prototype.processAsync
  33038. * @description 开始异步执行边的边的耗费权重的更新
  33039. * @param {UpdateEdgeWeightParameters} params - 边的耗费权重更新服务参数类
  33040. * @example
  33041. * (code)
  33042. * var updateEdgeWeightParam=new SuperMapUpdateEdgeWeightParameters({
  33043. * edgeId:"20",
  33044. * fromNodeId:"26",
  33045. * toNodeId:"109",
  33046. * weightField:"time",
  33047. * edgeWeight:"25"
  33048. * });
  33049. * updateEdgeWeightService.processAsync(updateEdgeWeightParam);
  33050. * (end)
  33051. */
  33052. }, {
  33053. key: "processAsync",
  33054. value: function processAsync(params) {
  33055. if (!(params instanceof UpdateEdgeWeightParameters)) {
  33056. return;
  33057. }
  33058. var me = this;
  33059. var paramStr = me.parse(params);
  33060. me.url = Util_Util.urlPathAppend(me.url, paramStr);
  33061. var data = params.edgeWeight ? params.edgeWeight : null;
  33062. me.request({
  33063. method: "PUT",
  33064. scope: me,
  33065. data: data,
  33066. success: me.serviceProcessCompleted,
  33067. failure: me.serviceProcessFailed
  33068. });
  33069. }
  33070. /**
  33071. * @function UpdateEdgeWeightService.prototype.parse
  33072. * @description 将更新服务参数解析为用‘/’做分隔的字符串
  33073. */
  33074. }, {
  33075. key: "parse",
  33076. value: function parse(params) {
  33077. if (!params) {
  33078. return;
  33079. }
  33080. var paramStr = "";
  33081. for (var attr in params) {
  33082. if (params[attr] === "" || params[attr] === "edgeWeight") {
  33083. continue;
  33084. }
  33085. switch (attr) {
  33086. case "edgeId":
  33087. paramStr += "/edgeweight/" + params[attr];
  33088. break;
  33089. case "fromNodeId":
  33090. paramStr += "/fromnode/" + params[attr];
  33091. break;
  33092. case "toNodeId":
  33093. paramStr += "/tonode/" + params[attr];
  33094. break;
  33095. case "weightField":
  33096. paramStr += "/weightfield/" + params[attr];
  33097. break;
  33098. default:
  33099. break;
  33100. }
  33101. }
  33102. return paramStr;
  33103. }
  33104. }]);
  33105. return UpdateEdgeWeightService;
  33106. }(NetworkAnalystServiceBase);
  33107. ;// CONCATENATED MODULE: ./src/common/iServer/UpdateTurnNodeWeightParameters.js
  33108. function UpdateTurnNodeWeightParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  33109. function UpdateTurnNodeWeightParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  33110. function UpdateTurnNodeWeightParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) UpdateTurnNodeWeightParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) UpdateTurnNodeWeightParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  33111. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  33112. * This program are made available under the terms of the Apache License, Version 2.0
  33113. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  33114. /**
  33115. * @class UpdateTurnNodeWeightParameters
  33116. * @deprecatedclass SuperMap.UpdateTurnNodeWeightParameters
  33117. * @category iServer NetworkAnalyst TurnNodeWeight
  33118. * @classdesc 转向耗费权重更新服务参数类。
  33119. * @param {Object} options - 参数。
  33120. * @param {string} options.nodeId - 转向结点的 ID。
  33121. * @param {string} options.fromEdgeId - 起始边的 ID。
  33122. * @param {string} options.toEdgeId - 终止边的 ID。
  33123. * @param {string} options.weightField - 转向结点的耗费字段。
  33124. * @param {string} options.turnNodeWeight - 耗费权重。
  33125. * @usage
  33126. */
  33127. var UpdateTurnNodeWeightParameters = /*#__PURE__*/function () {
  33128. function UpdateTurnNodeWeightParameters(options) {
  33129. UpdateTurnNodeWeightParameters_classCallCheck(this, UpdateTurnNodeWeightParameters);
  33130. if (!options) {
  33131. return;
  33132. }
  33133. /**
  33134. * @member {string} UpdateTurnNodeWeightParameters.prototype.nodeId
  33135. * @description 转向结点的 ID。
  33136. */
  33137. this.nodeId = "";
  33138. /**
  33139. * @member {string} UpdateTurnNodeWeightParameters.prototype.fromEdgeId
  33140. * @description 起始边的 ID。
  33141. */
  33142. this.fromEdgeId = "";
  33143. /**
  33144. * @member {string} UpdateTurnNodeWeightParameters.prototype.toEdgeId
  33145. * @description 终止边的 ID。
  33146. */
  33147. this.toEdgeId = "";
  33148. /**
  33149. * @member {string} UpdateTurnNodeWeightParameters.prototype.weightField
  33150. * @description 转向结点的耗费字段。
  33151. */
  33152. this.weightField = "";
  33153. /**
  33154. * @member {string} UpdateTurnNodeWeightParameters.prototype.turnNodeWeight
  33155. * @description 耗费权重。
  33156. */
  33157. this.turnNodeWeight = "";
  33158. Util_Util.extend(this, options);
  33159. this.CLASS_NAME = "SuperMap.UpdateTurnNodeWeightParameters";
  33160. }
  33161. /**
  33162. * @function UpdateTurnNodeWeightParameters.prototype.destroy
  33163. * @description 释放资源,将引用资源的属性置空。
  33164. */
  33165. UpdateTurnNodeWeightParameters_createClass(UpdateTurnNodeWeightParameters, [{
  33166. key: "destroy",
  33167. value: function destroy() {
  33168. this.nodeId = null;
  33169. this.fromEdgeId = null;
  33170. this.toEdgeId = null;
  33171. this.weightField = null;
  33172. this.turnNodeWeight = null;
  33173. }
  33174. }]);
  33175. return UpdateTurnNodeWeightParameters;
  33176. }();
  33177. ;// CONCATENATED MODULE: ./src/common/iServer/UpdateTurnNodeWeightService.js
  33178. function UpdateTurnNodeWeightService_typeof(obj) { "@babel/helpers - typeof"; return UpdateTurnNodeWeightService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, UpdateTurnNodeWeightService_typeof(obj); }
  33179. function UpdateTurnNodeWeightService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  33180. function UpdateTurnNodeWeightService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  33181. function UpdateTurnNodeWeightService_createClass(Constructor, protoProps, staticProps) { if (protoProps) UpdateTurnNodeWeightService_defineProperties(Constructor.prototype, protoProps); if (staticProps) UpdateTurnNodeWeightService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  33182. function UpdateTurnNodeWeightService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { UpdateTurnNodeWeightService_get = Reflect.get.bind(); } else { UpdateTurnNodeWeightService_get = function _get(target, property, receiver) { var base = UpdateTurnNodeWeightService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return UpdateTurnNodeWeightService_get.apply(this, arguments); }
  33183. function UpdateTurnNodeWeightService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = UpdateTurnNodeWeightService_getPrototypeOf(object); if (object === null) break; } return object; }
  33184. function UpdateTurnNodeWeightService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) UpdateTurnNodeWeightService_setPrototypeOf(subClass, superClass); }
  33185. function UpdateTurnNodeWeightService_setPrototypeOf(o, p) { UpdateTurnNodeWeightService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return UpdateTurnNodeWeightService_setPrototypeOf(o, p); }
  33186. function UpdateTurnNodeWeightService_createSuper(Derived) { var hasNativeReflectConstruct = UpdateTurnNodeWeightService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = UpdateTurnNodeWeightService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = UpdateTurnNodeWeightService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return UpdateTurnNodeWeightService_possibleConstructorReturn(this, result); }; }
  33187. function UpdateTurnNodeWeightService_possibleConstructorReturn(self, call) { if (call && (UpdateTurnNodeWeightService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return UpdateTurnNodeWeightService_assertThisInitialized(self); }
  33188. function UpdateTurnNodeWeightService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  33189. function UpdateTurnNodeWeightService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  33190. function UpdateTurnNodeWeightService_getPrototypeOf(o) { UpdateTurnNodeWeightService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return UpdateTurnNodeWeightService_getPrototypeOf(o); }
  33191. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  33192. * This program are made available under the terms of the Apache License, Version 2.0
  33193. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  33194. /**
  33195. * @class UpdateTurnNodeWeightService
  33196. * @deprecatedclass SuperMap.UpdateTurnNodeWeightService
  33197. * @category iServer NetworkAnalyst TurnNodeWeight
  33198. * @classdesc 转向耗费权重更新服务类
  33199. * @extends {NetworkAnalystServiceBase}
  33200. * @example
  33201. * var UpdateTurnNodeWeightService = new UpdateTurnNodeWeightService(url, {
  33202. * eventListeners: {
  33203. * "processCompleted": UpdateTurnNodeWeightCompleted,
  33204. * "processFailed": UpdateTurnNodeWeightError
  33205. * }
  33206. * });
  33207. * @param {string} url - 服务地址。如:
  33208. * http://localhost:8090/iserver/services/transportationanalyst-sample/rest/networkanalyst/RoadNet@Changchun 。
  33209. * @param {Object} options - 参数。
  33210. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  33211. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  33212. * @param {Object} [options.headers] - 请求头。
  33213. * @usage
  33214. */
  33215. var UpdateTurnNodeWeightService = /*#__PURE__*/function (_NetworkAnalystServic) {
  33216. UpdateTurnNodeWeightService_inherits(UpdateTurnNodeWeightService, _NetworkAnalystServic);
  33217. var _super = UpdateTurnNodeWeightService_createSuper(UpdateTurnNodeWeightService);
  33218. function UpdateTurnNodeWeightService(url, options) {
  33219. var _this;
  33220. UpdateTurnNodeWeightService_classCallCheck(this, UpdateTurnNodeWeightService);
  33221. _this = _super.call(this, url, options);
  33222. _this.CLASS_NAME = "SuperMap.UpdateTurnNodeWeightService";
  33223. return _this;
  33224. }
  33225. /**
  33226. * @override
  33227. */
  33228. UpdateTurnNodeWeightService_createClass(UpdateTurnNodeWeightService, [{
  33229. key: "destroy",
  33230. value: function destroy() {
  33231. UpdateTurnNodeWeightService_get(UpdateTurnNodeWeightService_getPrototypeOf(UpdateTurnNodeWeightService.prototype), "destroy", this).call(this);
  33232. }
  33233. /**
  33234. * @function UpdateTurnNodeWeightService.prototype.processAsync
  33235. * @description 开始异步执行转向耗费权重的更新
  33236. * @param {UpdateTurnNodeWeightParameters} params - 转向耗费权重更新服务参数类
  33237. * @example
  33238. * (code)
  33239. * var updateTurnNodeWeightParam=new UpdateTurnNodeWeightParameters({
  33240. * nodeId:"106",
  33241. * fromEdgeId:"6508",
  33242. * toEdgeId:"6504",
  33243. * weightField:"TurnCost",
  33244. * turnNodeWeight:"50"
  33245. * });
  33246. * updateTurnNodeWeightService.processAsync(updateTurnNodeWeightParam);
  33247. * (end)
  33248. **/
  33249. }, {
  33250. key: "processAsync",
  33251. value: function processAsync(params) {
  33252. if (!(params instanceof UpdateTurnNodeWeightParameters)) {
  33253. return;
  33254. }
  33255. var me = this;
  33256. var paramStr = me.parse(params);
  33257. me.url = Util_Util.urlPathAppend(me.url, paramStr);
  33258. var data = params.turnNodeWeight ? params.turnNodeWeight : null;
  33259. me.request({
  33260. method: "PUT",
  33261. scope: me,
  33262. data: data,
  33263. success: me.serviceProcessCompleted,
  33264. failure: me.serviceProcessFailed
  33265. });
  33266. }
  33267. /**
  33268. * @function UpdateTurnNodeWeightService.prototype.parse
  33269. * @description 将更新服务参数解析为用‘/’做分隔的字符串
  33270. */
  33271. }, {
  33272. key: "parse",
  33273. value: function parse(params) {
  33274. if (!params) {
  33275. return;
  33276. }
  33277. var paramStr = "";
  33278. for (var attr in params) {
  33279. if (params[attr] === "" || params[attr] === "turnNodeWeight") {
  33280. continue;
  33281. }
  33282. switch (attr) {
  33283. case "nodeId":
  33284. paramStr += "/turnnodeweight/" + params[attr];
  33285. break;
  33286. case "fromEdgeId":
  33287. paramStr += "/fromedge/" + params[attr];
  33288. break;
  33289. case "toEdgeId":
  33290. paramStr += "/toedge/" + params[attr];
  33291. break;
  33292. case "weightField":
  33293. paramStr += "/weightfield/" + params[attr];
  33294. break;
  33295. default:
  33296. break;
  33297. }
  33298. }
  33299. return paramStr;
  33300. }
  33301. }]);
  33302. return UpdateTurnNodeWeightService;
  33303. }(NetworkAnalystServiceBase);
  33304. ;// CONCATENATED MODULE: ./src/common/iServer/NetworkAnalystService.js
  33305. function NetworkAnalystService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  33306. function NetworkAnalystService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  33307. function NetworkAnalystService_createClass(Constructor, protoProps, staticProps) { if (protoProps) NetworkAnalystService_defineProperties(Constructor.prototype, protoProps); if (staticProps) NetworkAnalystService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  33308. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  33309. * This program are made available under the terms of the Apache License, Version 2.0
  33310. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  33311. /**
  33312. * @class NetworkAnalystService
  33313. * @category iServer NetworkAnalyst
  33314. * @classdesc 网络分析服务类。
  33315. * @extends {ServiceBase}
  33316. * @example
  33317. * new NetworkAnalystService(url)
  33318. * .findPath(params,function(result){
  33319. * //doSomething
  33320. * })
  33321. * @param {string} url - 服务地址。请求网络分析服务,URL应为:</br>
  33322. * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源}。
  33323. * 例如: "http://localhost:8090/iserver/services/test/rest/networkanalyst/WaterNet@FacilityNet"。
  33324. * @param {Object} options - 参数。
  33325. * @param {string} [options.proxy] - 服务代理地址。
  33326. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  33327. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  33328. * @param {Object} [options.headers] - 请求头。
  33329. * @usage
  33330. */
  33331. var NetworkAnalystService_NetworkAnalystService = /*#__PURE__*/function () {
  33332. function NetworkAnalystService(url, options) {
  33333. NetworkAnalystService_classCallCheck(this, NetworkAnalystService);
  33334. this.url = url;
  33335. this.options = options || {};
  33336. }
  33337. /**
  33338. * @function NetworkAnalystService.prototype.burstPipelineAnalyst
  33339. * @description 爆管分析服务:即将给定弧段或节点作为爆管点来进行分析,返回关键结点 ID 数组,普通结点 ID 数组及其上下游弧段 ID 数组。
  33340. * @param {BurstPipelineAnalystParameters} params - 爆管分析服务参数类。
  33341. * @param {RequestCallback} callback 回调函数。
  33342. */
  33343. NetworkAnalystService_createClass(NetworkAnalystService, [{
  33344. key: "burstPipelineAnalyst",
  33345. value: function burstPipelineAnalyst(params, callback) {
  33346. var me = this;
  33347. var burstPipelineAnalystService = new BurstPipelineAnalystService(me.url, {
  33348. proxy: me.options.proxy,
  33349. withCredentials: me.options.withCredentials,
  33350. crossOrigin: me.options.crossOrigin,
  33351. headers: me.options.headers,
  33352. eventListeners: {
  33353. scope: me,
  33354. processCompleted: callback,
  33355. processFailed: callback
  33356. }
  33357. });
  33358. burstPipelineAnalystService.processAsync(params);
  33359. }
  33360. /**
  33361. * @function NetworkAnalystService.prototype.computeWeightMatrix
  33362. * @description 耗费矩阵分析服务:根据交通网络分析参数中的耗费字段返回一个耗费矩阵。该矩阵是一个二维数组,用来存储任意两点间的资源消耗。
  33363. * @param {ComputeWeightMatrixParameters} params - 耗费矩阵分析服务参数类。
  33364. * @param {RequestCallback} callback - 回调函数。
  33365. */
  33366. }, {
  33367. key: "computeWeightMatrix",
  33368. value: function computeWeightMatrix(params, callback) {
  33369. var me = this;
  33370. var computeWeightMatrixService = new ComputeWeightMatrixService(me.url, {
  33371. proxy: me.options.proxy,
  33372. withCredentials: me.options.withCredentials,
  33373. crossOrigin: me.options.crossOrigin,
  33374. headers: me.options.headers,
  33375. eventListeners: {
  33376. scope: me,
  33377. processCompleted: callback,
  33378. processFailed: callback
  33379. }
  33380. });
  33381. computeWeightMatrixService.processAsync(params);
  33382. }
  33383. /**
  33384. * @function NetworkAnalystService.prototype.findClosestFacilities
  33385. * @description 最近设施分析服务:指在网络上给定一个事件点和一组设施点,查找从事件点到设施点(或从设施点到事件点)以最小耗费能到达的最佳路径。
  33386. * @param {FindClosestFacilitiesParameters} params - 最近设施分析服务参数类。
  33387. * @param {RequestCallback} callback 回调函数。
  33388. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  33389. */
  33390. }, {
  33391. key: "findClosestFacilities",
  33392. value: function findClosestFacilities(params, callback, resultFormat) {
  33393. var me = this;
  33394. var findClosestFacilitiesService = new FindClosestFacilitiesService(me.url, {
  33395. proxy: me.options.proxy,
  33396. withCredentials: me.options.withCredentials,
  33397. crossOrigin: me.options.crossOrigin,
  33398. headers: me.options.headers,
  33399. eventListeners: {
  33400. scope: me,
  33401. processCompleted: callback,
  33402. processFailed: callback
  33403. },
  33404. format: me._processFormat(resultFormat)
  33405. });
  33406. findClosestFacilitiesService.processAsync(params);
  33407. }
  33408. /**
  33409. * @function NetworkAnalystService.prototype.streamFacilityAnalyst
  33410. * @description 上游/下游 关键设施查找资源服务:查找给定弧段或节点的上游/下游中的关键设施结点,返回关键结点 ID 数组及其下游弧段 ID 数组。
  33411. * @param {FacilityAnalystStreamParameters} params - 上游/下游 关键设施查找资源服务参数类。
  33412. * @param {RequestCallback} callback 回调函数。
  33413. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  33414. */
  33415. }, {
  33416. key: "streamFacilityAnalyst",
  33417. value: function streamFacilityAnalyst(params, callback, resultFormat) {
  33418. var me = this;
  33419. var facilityAnalystStreamService = new FacilityAnalystStreamService(me.url, {
  33420. proxy: me.options.proxy,
  33421. withCredentials: me.options.withCredentials,
  33422. crossOrigin: me.options.crossOrigin,
  33423. headers: me.options.headers,
  33424. eventListeners: {
  33425. scope: me,
  33426. processCompleted: callback,
  33427. processFailed: callback
  33428. },
  33429. format: me._processFormat(resultFormat)
  33430. });
  33431. facilityAnalystStreamService.processAsync(params);
  33432. }
  33433. /**
  33434. * @function NetworkAnalystService.prototype.findLocation
  33435. * @description 选址分区分析服务:确定一个或多个待建设施的最佳或最优位置。
  33436. * @param {FindLocationParameters} params - 选址分区分析服务参数类。
  33437. * @param {RequestCallback} callback 回调函数。
  33438. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  33439. */
  33440. }, {
  33441. key: "findLocation",
  33442. value: function findLocation(params, callback, resultFormat) {
  33443. var me = this;
  33444. var findLocationService = new FindLocationService(me.url, {
  33445. proxy: me.options.proxy,
  33446. withCredentials: me.options.withCredentials,
  33447. crossOrigin: me.options.crossOrigin,
  33448. headers: me.options.headers,
  33449. eventListeners: {
  33450. scope: me,
  33451. processCompleted: callback,
  33452. processFailed: callback
  33453. },
  33454. format: me._processFormat(resultFormat)
  33455. });
  33456. findLocationService.processAsync(params);
  33457. }
  33458. /**
  33459. * @function NetworkAnalystService.prototype.findPath
  33460. * @description 最佳路径分析服务:在网络数据集中指定一些节点,按照节点的选择顺序,顺序访问这些节点从而求解起止点之间阻抗最小的路经。
  33461. * @param {FindPathParameters} params - 最佳路径分析服务参数类。
  33462. * @param {RequestCallback} callback - 回调函数。
  33463. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  33464. */
  33465. }, {
  33466. key: "findPath",
  33467. value: function findPath(params, callback, resultFormat) {
  33468. var me = this;
  33469. var findPathService = new FindPathService(me.url, {
  33470. proxy: me.options.proxy,
  33471. withCredentials: me.options.withCredentials,
  33472. crossOrigin: me.options.crossOrigin,
  33473. headers: me.options.headers,
  33474. eventListeners: {
  33475. scope: me,
  33476. processCompleted: callback,
  33477. processFailed: callback
  33478. },
  33479. format: me._processFormat(resultFormat)
  33480. });
  33481. findPathService.processAsync(params);
  33482. }
  33483. /**
  33484. * @function NetworkAnalystService.prototype.findTSPPaths
  33485. * @description 旅行商分析服务:路径分析的一种,它从起点开始(默认为用户指定的第一点)查找能够遍历所有途经点且花费最小的路径。
  33486. * @param {FindTSPPathsParameters} params - 旅行商分析服务参数类。
  33487. * @param {RequestCallback} callback - 回调函数。
  33488. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  33489. */
  33490. }, {
  33491. key: "findTSPPaths",
  33492. value: function findTSPPaths(params, callback, resultFormat) {
  33493. var me = this;
  33494. var findTSPPathsService = new FindTSPPathsService(me.url, {
  33495. proxy: me.options.proxy,
  33496. withCredentials: me.options.withCredentials,
  33497. crossOrigin: me.options.crossOrigin,
  33498. headers: me.options.headers,
  33499. eventListeners: {
  33500. scope: me,
  33501. processCompleted: callback,
  33502. processFailed: callback
  33503. },
  33504. format: me._processFormat(resultFormat)
  33505. });
  33506. findTSPPathsService.processAsync(params);
  33507. }
  33508. /**
  33509. * @function NetworkAnalystService.prototype.findMTSPPaths
  33510. * @description 多旅行商分析服务:也称为物流配送,是指在网络数据集中,给定 M 个配送中心点和 N 个配送目的地(M,N 为大于零的整数)。查找经济有效的配送路径,并给出相应的行走路线。
  33511. * @param {FindMTSPPathsParameters} params - 多旅行商分析服务参数类。
  33512. * @param {RequestCallback} callback - 回调函数。
  33513. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  33514. */
  33515. }, {
  33516. key: "findMTSPPaths",
  33517. value: function findMTSPPaths(params, callback, resultFormat) {
  33518. var me = this;
  33519. var findMTSPPathsService = new FindMTSPPathsService(me.url, {
  33520. proxy: me.options.proxy,
  33521. withCredentials: me.options.withCredentials,
  33522. crossOrigin: me.options.crossOrigin,
  33523. headers: me.options.headers,
  33524. eventListeners: {
  33525. scope: me,
  33526. processCompleted: callback,
  33527. processFailed: callback
  33528. },
  33529. format: me._processFormat(resultFormat)
  33530. });
  33531. findMTSPPathsService.processAsync(params);
  33532. }
  33533. /**
  33534. * @function NetworkAnalystService.prototype.findServiceAreas
  33535. * @description 服务区分析服务:以指定服务站点为中心,在一定服务范围内查找网络上服务站点能够提供服务的区域范围。
  33536. * @param {FindServiceAreasParameters} params - 服务区分析服务参数类。
  33537. * @param {RequestCallback} callback 回调函数。
  33538. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  33539. */
  33540. }, {
  33541. key: "findServiceAreas",
  33542. value: function findServiceAreas(params, callback, resultFormat) {
  33543. var me = this;
  33544. var findServiceAreasService = new FindServiceAreasService(me.url, {
  33545. proxy: me.options.proxy,
  33546. withCredentials: me.options.withCredentials,
  33547. crossOrigin: me.options.crossOrigin,
  33548. headers: me.options.headers,
  33549. eventListeners: {
  33550. scope: me,
  33551. processCompleted: callback,
  33552. processFailed: callback
  33553. },
  33554. format: me._processFormat(resultFormat)
  33555. });
  33556. findServiceAreasService.processAsync(params);
  33557. }
  33558. /**
  33559. * @function NetworkAnalystService.prototype.updateEdgeWeight
  33560. * @description 更新边的耗费权重服务。
  33561. * @param {UpdateEdgeWeightParameters} params - 更新边的耗费权重服务参数类。
  33562. * @param {RequestCallback} callback 回调函数。
  33563. */
  33564. }, {
  33565. key: "updateEdgeWeight",
  33566. value: function updateEdgeWeight(params, callback) {
  33567. var me = this;
  33568. var updateEdgeWeightService = new UpdateEdgeWeightService(me.url, {
  33569. proxy: me.options.proxy,
  33570. withCredentials: me.options.withCredentials,
  33571. crossOrigin: me.options.crossOrigin,
  33572. headers: me.options.headers,
  33573. eventListeners: {
  33574. scope: me,
  33575. processCompleted: callback,
  33576. processFailed: callback
  33577. }
  33578. });
  33579. updateEdgeWeightService.processAsync(params);
  33580. }
  33581. /**
  33582. * @function NetworkAnalystService.prototype.updateTurnNodeWeight
  33583. * @description 转向耗费权重更新服务。
  33584. * @param {UpdateTurnNodeWeightParameters} params - 转向耗费权重更新服务参数类。
  33585. * @param {RequestCallback} callback - 回调函数。
  33586. */
  33587. }, {
  33588. key: "updateTurnNodeWeight",
  33589. value: function updateTurnNodeWeight(params, callback) {
  33590. var me = this;
  33591. var updateTurnNodeWeightService = new UpdateTurnNodeWeightService(me.url, {
  33592. proxy: me.options.proxy,
  33593. withCredentials: me.options.withCredentials,
  33594. crossOrigin: me.options.crossOrigin,
  33595. headers: me.options.headers,
  33596. eventListeners: {
  33597. scope: me,
  33598. processCompleted: callback,
  33599. processFailed: callback
  33600. }
  33601. });
  33602. updateTurnNodeWeightService.processAsync(params);
  33603. }
  33604. }, {
  33605. key: "_processFormat",
  33606. value: function _processFormat(resultFormat) {
  33607. return resultFormat ? resultFormat : DataFormat.GEOJSON;
  33608. }
  33609. }]);
  33610. return NetworkAnalystService;
  33611. }();
  33612. ;// CONCATENATED MODULE: ./src/maplibregl/services/NetworkAnalystService.js
  33613. function NetworkAnalystService_typeof(obj) { "@babel/helpers - typeof"; return NetworkAnalystService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, NetworkAnalystService_typeof(obj); }
  33614. function services_NetworkAnalystService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  33615. function services_NetworkAnalystService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  33616. function services_NetworkAnalystService_createClass(Constructor, protoProps, staticProps) { if (protoProps) services_NetworkAnalystService_defineProperties(Constructor.prototype, protoProps); if (staticProps) services_NetworkAnalystService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  33617. function NetworkAnalystService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) NetworkAnalystService_setPrototypeOf(subClass, superClass); }
  33618. function NetworkAnalystService_setPrototypeOf(o, p) { NetworkAnalystService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return NetworkAnalystService_setPrototypeOf(o, p); }
  33619. function NetworkAnalystService_createSuper(Derived) { var hasNativeReflectConstruct = NetworkAnalystService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = NetworkAnalystService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = NetworkAnalystService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return NetworkAnalystService_possibleConstructorReturn(this, result); }; }
  33620. function NetworkAnalystService_possibleConstructorReturn(self, call) { if (call && (NetworkAnalystService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return NetworkAnalystService_assertThisInitialized(self); }
  33621. function NetworkAnalystService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  33622. function NetworkAnalystService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  33623. function NetworkAnalystService_getPrototypeOf(o) { NetworkAnalystService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return NetworkAnalystService_getPrototypeOf(o); }
  33624. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  33625. * This program are made available under the terms of the Apache License, Version 2.0
  33626. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  33627. /**
  33628. * @class NetworkAnalystService
  33629. * @category iServer NetworkAnalyst
  33630. * @classdesc 网络分析服务类。
  33631. * @version 11.1.0
  33632. * @modulecategory Services
  33633. * @extends {ServiceBase}
  33634. * @example
  33635. * new NetworkAnalystService(url)
  33636. * .findPath(params,function(result){
  33637. * //doSomething
  33638. * })
  33639. * @param {string} url - 服务地址。请求网络分析服务,URL应为:</br>
  33640. * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源}。
  33641. * 例如: "http://localhost:8090/iserver/services/test/rest/networkanalyst/WaterNet@FacilityNet"。
  33642. * @param {Object} options - 参数。
  33643. * @param {string} [options.proxy] - 服务代理地址。
  33644. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  33645. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  33646. * @param {Object} [options.headers] - 请求头。
  33647. * @usage
  33648. */
  33649. var NetworkAnalystService = /*#__PURE__*/function (_ServiceBase) {
  33650. NetworkAnalystService_inherits(NetworkAnalystService, _ServiceBase);
  33651. var _super = NetworkAnalystService_createSuper(NetworkAnalystService);
  33652. function NetworkAnalystService(url, options) {
  33653. var _this;
  33654. services_NetworkAnalystService_classCallCheck(this, NetworkAnalystService);
  33655. _this = _super.call(this, url, options);
  33656. _this._networkAnalystService = new NetworkAnalystService_NetworkAnalystService(url, options);
  33657. return _this;
  33658. }
  33659. /**
  33660. * @function NetworkAnalystService.prototype.burstPipelineAnalyst
  33661. * @description 爆管分析服务:即将给定弧段或节点作为爆管点来进行分析,返回关键结点 ID 数组,普通结点 ID 数组及其上下游弧段 ID 数组。
  33662. * @param {BurstPipelineAnalystParameters} params - 爆管分析服务参数类。
  33663. * @param {RequestCallback} callback 回调函数。
  33664. */
  33665. services_NetworkAnalystService_createClass(NetworkAnalystService, [{
  33666. key: "burstPipelineAnalyst",
  33667. value: function burstPipelineAnalyst(params, callback) {
  33668. params = this._processParams(params);
  33669. this._networkAnalystService.burstPipelineAnalyst(params, callback);
  33670. }
  33671. /**
  33672. * @function NetworkAnalystService.prototype.computeWeightMatrix
  33673. * @description 耗费矩阵分析服务:根据交通网络分析参数中的耗费字段返回一个耗费矩阵。该矩阵是一个二维数组,用来存储任意两点间的资源消耗。
  33674. * @param {ComputeWeightMatrixParameters} params - 耗费矩阵分析服务参数类。
  33675. * @param {RequestCallback} callback - 回调函数。
  33676. */
  33677. }, {
  33678. key: "computeWeightMatrix",
  33679. value: function computeWeightMatrix(params, callback) {
  33680. params = this._processParams(params);
  33681. this._networkAnalystService.computeWeightMatrix(params, callback);
  33682. }
  33683. /**
  33684. * @function NetworkAnalystService.prototype.findClosestFacilities
  33685. * @description 最近设施分析服务:指在网络上给定一个事件点和一组设施点,查找从事件点到设施点(或从设施点到事件点)以最小耗费能到达的最佳路径。
  33686. * @param {FindClosestFacilitiesParameters} params - 最近设施分析服务参数类。
  33687. * @param {RequestCallback} callback 回调函数。
  33688. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  33689. */
  33690. }, {
  33691. key: "findClosestFacilities",
  33692. value: function findClosestFacilities(params, callback, resultFormat) {
  33693. params = this._processParams(params);
  33694. this._networkAnalystService.findClosestFacilities(params, callback, resultFormat);
  33695. }
  33696. /**
  33697. * @function NetworkAnalystService.prototype.streamFacilityAnalyst
  33698. * @description 上游/下游 关键设施查找资源服务:查找给定弧段或节点的上游/下游中的关键设施结点,返回关键结点 ID 数组及其下游弧段 ID 数组。
  33699. * @param {FacilityAnalystStreamParameters} params - 上游/下游 关键设施查找资源服务参数类。
  33700. * @param {RequestCallback} callback 回调函数。
  33701. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  33702. */
  33703. }, {
  33704. key: "streamFacilityAnalyst",
  33705. value: function streamFacilityAnalyst(params, callback, resultFormat) {
  33706. params = this._processParams(params);
  33707. this._networkAnalystService.streamFacilityAnalyst(params, callback, resultFormat);
  33708. }
  33709. /**
  33710. * @function NetworkAnalystService.prototype.findLocation
  33711. * @description 选址分区分析服务:确定一个或多个待建设施的最佳或最优位置。
  33712. * @param {FindLocationParameters} params - 选址分区分析服务参数类。
  33713. * @param {RequestCallback} callback 回调函数。
  33714. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  33715. */
  33716. }, {
  33717. key: "findLocation",
  33718. value: function findLocation(params, callback, resultFormat) {
  33719. params = this._processParams(params);
  33720. this._networkAnalystService.findLocation(params, callback, resultFormat);
  33721. }
  33722. /**
  33723. * @function NetworkAnalystService.prototype.findPath
  33724. * @description 最佳路径分析服务:在网络数据集中指定一些节点,按照节点的选择顺序,顺序访问这些节点从而求解起止点之间阻抗最小的路经。
  33725. * @param {FindPathParameters} params - 最佳路径分析服务参数类。
  33726. * @param {RequestCallback} callback - 回调函数。
  33727. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  33728. */
  33729. }, {
  33730. key: "findPath",
  33731. value: function findPath(params, callback, resultFormat) {
  33732. params = this._processParams(params);
  33733. this._networkAnalystService.findPath(params, callback, resultFormat);
  33734. }
  33735. /**
  33736. * @function NetworkAnalystService.prototype.findTSPPaths
  33737. * @description 旅行商分析服务:路径分析的一种,它从起点开始(默认为用户指定的第一点)查找能够遍历所有途经点且花费最小的路径。
  33738. * @param {FindTSPPathsParameters} params - 旅行商分析服务参数类。
  33739. * @param {RequestCallback} callback - 回调函数。
  33740. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  33741. */
  33742. }, {
  33743. key: "findTSPPaths",
  33744. value: function findTSPPaths(params, callback, resultFormat) {
  33745. params = this._processParams(params);
  33746. this._networkAnalystService.findTSPPaths(params, callback, resultFormat);
  33747. }
  33748. /**
  33749. * @function NetworkAnalystService.prototype.findMTSPPaths
  33750. * @description 多旅行商分析服务:也称为物流配送,是指在网络数据集中,给定 M 个配送中心点和 N 个配送目的地(M,N 为大于零的整数)。查找经济有效的配送路径,并给出相应的行走路线。
  33751. * @param {FindMTSPPathsParameters} params - 多旅行商分析服务参数类。
  33752. * @param {RequestCallback} callback - 回调函数。
  33753. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  33754. */
  33755. }, {
  33756. key: "findMTSPPaths",
  33757. value: function findMTSPPaths(params, callback, resultFormat) {
  33758. params = this._processParams(params);
  33759. this._networkAnalystService.findMTSPPaths(params, callback, resultFormat);
  33760. }
  33761. /**
  33762. * @function NetworkAnalystService.prototype.findServiceAreas
  33763. * @description 服务区分析服务:以指定服务站点为中心,在一定服务范围内查找网络上服务站点能够提供服务的区域范围。
  33764. * @param {FindServiceAreasParameters} params - 服务区分析服务参数类。
  33765. * @param {RequestCallback} callback 回调函数。
  33766. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  33767. */
  33768. }, {
  33769. key: "findServiceAreas",
  33770. value: function findServiceAreas(params, callback, resultFormat) {
  33771. params = this._processParams(params);
  33772. this._networkAnalystService.findServiceAreas(params, callback, resultFormat);
  33773. }
  33774. /**
  33775. * @function NetworkAnalystService.prototype.updateEdgeWeight
  33776. * @description 更新边的耗费权重服务。
  33777. * @param {UpdateEdgeWeightParameters} params - 更新边的耗费权重服务参数类。
  33778. * @param {RequestCallback} callback 回调函数。
  33779. */
  33780. }, {
  33781. key: "updateEdgeWeight",
  33782. value: function updateEdgeWeight(params, callback) {
  33783. this._networkAnalystService.updateEdgeWeight(params, callback);
  33784. }
  33785. /**
  33786. * @function NetworkAnalystService.prototype.updateTurnNodeWeight
  33787. * @description 转向耗费权重更新服务。
  33788. * @param {UpdateTurnNodeWeightParameters} params - 转向耗费权重更新服务参数类。
  33789. * @param {RequestCallback} callback - 回调函数。
  33790. */
  33791. }, {
  33792. key: "updateTurnNodeWeight",
  33793. value: function updateTurnNodeWeight(params, callback) {
  33794. this._networkAnalystService.updateTurnNodeWeight(params, callback);
  33795. }
  33796. /**
  33797. * @description 所有 Point 考虑 MapLibreGL.lnglat、MapLibreGL.Point、[]三种形式。
  33798. * @param {Object} params - 待转换参数。
  33799. * @returns {Object}
  33800. * @private
  33801. */
  33802. }, {
  33803. key: "_processParams",
  33804. value: function _processParams(params) {
  33805. if (!params) {
  33806. return {};
  33807. }
  33808. var me = this;
  33809. if (params.centers && core_Util_Util.isArray(params.centers)) {
  33810. params.centers.map(function (point, key) {
  33811. params.centers[key] = me._toPointObject(point);
  33812. return params.centers[key];
  33813. });
  33814. }
  33815. if (params.nodes && core_Util_Util.isArray(params.nodes)) {
  33816. params.nodes.map(function (point, key) {
  33817. params.nodes[key] = me._toPointObject(point);
  33818. return params.nodes[key];
  33819. });
  33820. }
  33821. if (params.event) {
  33822. params.event = me._toPointObject(params.event);
  33823. }
  33824. if (params.facilities && core_Util_Util.isArray(params.facilities)) {
  33825. params.facilities.map(function (point, key) {
  33826. params.facilities[key] = me._toPointObject(point);
  33827. return params.facilities[key];
  33828. });
  33829. }
  33830. if (params.parameter && params.parameter.barrierPoints) {
  33831. var barrierPoints = params.parameter.barrierPoints;
  33832. if (core_Util_Util.isArray(barrierPoints)) {
  33833. barrierPoints.map(function (point, key) {
  33834. params.parameter[key] = me._toPointObject(point);
  33835. return params.parameter.barrierPoints[key];
  33836. });
  33837. } else {
  33838. params.parameter.barrierPoints = [barrierPoints instanceof (external_maplibregl_default()).LngLat ? {
  33839. x: barrierPoints.lng,
  33840. y: barrierPoints.lat
  33841. } : barrierPoints];
  33842. }
  33843. }
  33844. return params;
  33845. }
  33846. }, {
  33847. key: "_toPointObject",
  33848. value: function _toPointObject(point) {
  33849. if (core_Util_Util.isArray(point)) {
  33850. return {
  33851. x: point[0],
  33852. y: point[1]
  33853. };
  33854. }
  33855. if (point instanceof (external_maplibregl_default()).LngLat) {
  33856. return {
  33857. x: point.lng,
  33858. y: point.lat
  33859. };
  33860. }
  33861. return point instanceof (external_maplibregl_default()).Point ? {
  33862. x: point.x,
  33863. y: point.y
  33864. } : point;
  33865. }
  33866. }, {
  33867. key: "_processFormat",
  33868. value: function _processFormat(resultFormat) {
  33869. return resultFormat ? resultFormat : DataFormat.GEOJSON;
  33870. }
  33871. }]);
  33872. return NetworkAnalystService;
  33873. }(ServiceBase);
  33874. ;// CONCATENATED MODULE: ./src/common/iServer/FacilityAnalyst3DParameters.js
  33875. function FacilityAnalyst3DParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  33876. function FacilityAnalyst3DParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  33877. function FacilityAnalyst3DParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) FacilityAnalyst3DParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) FacilityAnalyst3DParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  33878. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  33879. * This program are made available under the terms of the Apache License, Version 2.0
  33880. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  33881. /**
  33882. * @class FacilityAnalyst3DParameters
  33883. * @deprecatedclass SuperMap.FacilityAnalyst3DParameters
  33884. * @category iServer FacilityAnalyst3D
  33885. * @classdesc 最近设施分析参数基类。最近设施分析是指在网络上给定一个事件点和一组设施点,查找从事件点到设施点(或从设施点到事件点)以最小耗费能到达的最佳路径。
  33886. * 设施点一般为学校、超市、加油站等服务设施;事件点为需要服务设施的事件位置。例如事件发生点是一起交通事故,要求查找在 10 分钟内能到达的最近医院,
  33887. * 超过 10 分钟能到达的都不予考虑。此例中,事故发生地即是一个事件点,周边的医院则是设施点。最近设施查找实际上也是一种路径分析,因此对路径分析起作用的障碍边、障碍点、转向表、耗费等属性在最近设施分析时同样可设置。
  33888. * @param {Object} options - 参数。
  33889. * @param {string} options.weightName - 指定的权值字段信息对象的名称。
  33890. * @param {number} [options.edgeID] - 指定的弧段 ID,edgeID 与 nodeID 必须指定一个。
  33891. * @param {number} [options.nodeID] - 指定的结点 ID,edgeID 与 nodeID 必须指定一个。
  33892. * @param {boolean} [options.isUncertainDirectionValid=false] - 指定不确定流向是否有效。指定为 true,表示不确定流向有效,遇到不确定流向时分析继续进行;
  33893. * 指定为 false,表示不确定流向无效,遇到不确定流向将停止在该方向上继续查找。
  33894. * @usage
  33895. */
  33896. var FacilityAnalyst3DParameters = /*#__PURE__*/function () {
  33897. function FacilityAnalyst3DParameters(options) {
  33898. FacilityAnalyst3DParameters_classCallCheck(this, FacilityAnalyst3DParameters);
  33899. /**
  33900. * @member {number} [FacilityAnalyst3DParameters.prototype.edgeID]
  33901. * @description 指定的弧段 ID,edgeID 与 nodeID 必须指定一个。
  33902. */
  33903. this.edgeID = null;
  33904. /**
  33905. * @member {number} [FacilityAnalyst3DParameters.prototype.nodeID]
  33906. * @description 指定的结点 ID,edgeID 与 nodeID 必须指定一个。
  33907. */
  33908. this.nodeID = null;
  33909. /**
  33910. * @member {string} FacilityAnalyst3DParameters.prototype.weightName
  33911. * @description 指定的权值字段信息对象的名称。
  33912. */
  33913. this.weightName = null;
  33914. /**
  33915. * @member {boolean} [FacilityAnalyst3DParameters.prototype.isUncertainDirectionValid=false]
  33916. * @description 指定不确定流向是否有效。指定为 true,表示不确定流向有效,遇到不确定流向时分析继续进行;
  33917. * 指定为 false,表示不确定流向无效,遇到不确定流向将停止在该方向上继续查找。
  33918. */
  33919. this.isUncertainDirectionValid = false;
  33920. Util_Util.extend(this, options);
  33921. this.CLASS_NAME = "SuperMap.FacilityAnalyst3DParameters";
  33922. }
  33923. /**
  33924. * @function FacilityAnalyst3DParameters.prototype.destroy
  33925. * @description 释放资源,将资源的属性置空。
  33926. */
  33927. FacilityAnalyst3DParameters_createClass(FacilityAnalyst3DParameters, [{
  33928. key: "destroy",
  33929. value: function destroy() {
  33930. var me = this;
  33931. me.edgeID = null;
  33932. me.nodeID = null;
  33933. me.weightName = null;
  33934. me.isUncertainDirectionValid = null;
  33935. }
  33936. }]);
  33937. return FacilityAnalyst3DParameters;
  33938. }();
  33939. ;// CONCATENATED MODULE: ./src/common/iServer/FacilityAnalystSinks3DParameters.js
  33940. function FacilityAnalystSinks3DParameters_typeof(obj) { "@babel/helpers - typeof"; return FacilityAnalystSinks3DParameters_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, FacilityAnalystSinks3DParameters_typeof(obj); }
  33941. function FacilityAnalystSinks3DParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  33942. function FacilityAnalystSinks3DParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  33943. function FacilityAnalystSinks3DParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) FacilityAnalystSinks3DParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) FacilityAnalystSinks3DParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  33944. function FacilityAnalystSinks3DParameters_get() { if (typeof Reflect !== "undefined" && Reflect.get) { FacilityAnalystSinks3DParameters_get = Reflect.get.bind(); } else { FacilityAnalystSinks3DParameters_get = function _get(target, property, receiver) { var base = FacilityAnalystSinks3DParameters_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return FacilityAnalystSinks3DParameters_get.apply(this, arguments); }
  33945. function FacilityAnalystSinks3DParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FacilityAnalystSinks3DParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  33946. function FacilityAnalystSinks3DParameters_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) FacilityAnalystSinks3DParameters_setPrototypeOf(subClass, superClass); }
  33947. function FacilityAnalystSinks3DParameters_setPrototypeOf(o, p) { FacilityAnalystSinks3DParameters_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FacilityAnalystSinks3DParameters_setPrototypeOf(o, p); }
  33948. function FacilityAnalystSinks3DParameters_createSuper(Derived) { var hasNativeReflectConstruct = FacilityAnalystSinks3DParameters_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = FacilityAnalystSinks3DParameters_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = FacilityAnalystSinks3DParameters_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return FacilityAnalystSinks3DParameters_possibleConstructorReturn(this, result); }; }
  33949. function FacilityAnalystSinks3DParameters_possibleConstructorReturn(self, call) { if (call && (FacilityAnalystSinks3DParameters_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return FacilityAnalystSinks3DParameters_assertThisInitialized(self); }
  33950. function FacilityAnalystSinks3DParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  33951. function FacilityAnalystSinks3DParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  33952. function FacilityAnalystSinks3DParameters_getPrototypeOf(o) { FacilityAnalystSinks3DParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FacilityAnalystSinks3DParameters_getPrototypeOf(o); }
  33953. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  33954. * This program are made available under the terms of the Apache License, Version 2.0
  33955. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  33956. /**
  33957. * @class FacilityAnalystSinks3DParameters
  33958. * @deprecatedclass SuperMap.FacilityAnalystSinks3DParameters
  33959. * @category iServer FacilityAnalyst3D Sinks
  33960. * @classdesc 最近设施分析参数类(汇查找资源)。最近设施分析是指在网络上给定一个事件点和一组设施点,查找从事件点到设施点(或从设施点到事件点)以最小耗费能到达的最佳路径。
  33961. * 设施点一般为学校、超市、加油站等服务设施;事件点为需要服务设施的事件位置。例如事件发生点是一起交通事故,要求查找在10分钟内能到达的最近医院,超过10分钟能到达的都不予考虑。此例中,事故发生地即是一个事件点,周边的医院则是设施点。最近设施查找实际上也是一种路径分析,因此对路径分析起作用的障碍边、障碍点、转向表、耗费等属性在最近设施分析时同样可设置。
  33962. * @extends {FacilityAnalyst3DParameters}
  33963. * @param {Object} options - 参数。
  33964. * @param {string} options.weightName - 指定的权值字段信息对象的名称。
  33965. * @param {number} [options.edgeID] - 指定的弧段 ID,edgeID 与 nodeID 必须指定一个。
  33966. * @param {number} [options.nodeID] - 指定的结点 ID,edgeID 与 nodeID 必须指定一个。
  33967. * @param {boolean} [options.isUncertainDirectionValid=false] - 指定不确定流向是否有效。指定为 true,表示不确定流向有效,遇到不确定流向时分析继续进行;
  33968. * 指定为 false,表示不确定流向无效,遇到不确定流向将停止在该方向上继续查找。
  33969. * @usage
  33970. */
  33971. var FacilityAnalystSinks3DParameters = /*#__PURE__*/function (_FacilityAnalyst3DPar) {
  33972. FacilityAnalystSinks3DParameters_inherits(FacilityAnalystSinks3DParameters, _FacilityAnalyst3DPar);
  33973. var _super = FacilityAnalystSinks3DParameters_createSuper(FacilityAnalystSinks3DParameters);
  33974. function FacilityAnalystSinks3DParameters(options) {
  33975. var _this;
  33976. FacilityAnalystSinks3DParameters_classCallCheck(this, FacilityAnalystSinks3DParameters);
  33977. _this = _super.call(this, options);
  33978. _this.CLASS_NAME = "SuperMap.FacilityAnalystSinks3DParameters";
  33979. return _this;
  33980. }
  33981. /**
  33982. * @function FacilityAnalystSinks3DParameters.prototype.destroy
  33983. * @override
  33984. */
  33985. FacilityAnalystSinks3DParameters_createClass(FacilityAnalystSinks3DParameters, [{
  33986. key: "destroy",
  33987. value: function destroy() {
  33988. FacilityAnalystSinks3DParameters_get(FacilityAnalystSinks3DParameters_getPrototypeOf(FacilityAnalystSinks3DParameters.prototype), "destroy", this).call(this);
  33989. }
  33990. }]);
  33991. return FacilityAnalystSinks3DParameters;
  33992. }(FacilityAnalyst3DParameters);
  33993. ;// CONCATENATED MODULE: ./src/common/iServer/FacilityAnalystSinks3DService.js
  33994. function FacilityAnalystSinks3DService_typeof(obj) { "@babel/helpers - typeof"; return FacilityAnalystSinks3DService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, FacilityAnalystSinks3DService_typeof(obj); }
  33995. function FacilityAnalystSinks3DService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  33996. function FacilityAnalystSinks3DService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  33997. function FacilityAnalystSinks3DService_createClass(Constructor, protoProps, staticProps) { if (protoProps) FacilityAnalystSinks3DService_defineProperties(Constructor.prototype, protoProps); if (staticProps) FacilityAnalystSinks3DService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  33998. function FacilityAnalystSinks3DService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) FacilityAnalystSinks3DService_setPrototypeOf(subClass, superClass); }
  33999. function FacilityAnalystSinks3DService_setPrototypeOf(o, p) { FacilityAnalystSinks3DService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FacilityAnalystSinks3DService_setPrototypeOf(o, p); }
  34000. function FacilityAnalystSinks3DService_createSuper(Derived) { var hasNativeReflectConstruct = FacilityAnalystSinks3DService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = FacilityAnalystSinks3DService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = FacilityAnalystSinks3DService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return FacilityAnalystSinks3DService_possibleConstructorReturn(this, result); }; }
  34001. function FacilityAnalystSinks3DService_possibleConstructorReturn(self, call) { if (call && (FacilityAnalystSinks3DService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return FacilityAnalystSinks3DService_assertThisInitialized(self); }
  34002. function FacilityAnalystSinks3DService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  34003. function FacilityAnalystSinks3DService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  34004. function FacilityAnalystSinks3DService_getPrototypeOf(o) { FacilityAnalystSinks3DService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FacilityAnalystSinks3DService_getPrototypeOf(o); }
  34005. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  34006. * This program are made available under the terms of the Apache License, Version 2.0
  34007. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  34008. /**
  34009. * @class FacilityAnalystSinks3DService
  34010. * @deprecatedclass SuperMap.FacilityAnalystSinks3DService
  34011. * @category iServer FacilityAnalyst3D Sinks
  34012. * @classdesc 最近设施分析服务类(汇查找资源)<br>
  34013. * 最近设施分析是指在网络上给定一个事件点和一组设施点,
  34014. * 查找从事件点到设施点(或从设施点到事件点)以最小耗费能到达的最佳路径。
  34015. * 该类负责将客户端指定的最近设施分析参数传递给服务端,并接收服务端返回的结果数据。
  34016. * 最近设施分析结果通过该类支持的事件的监听函数参数获取
  34017. * @extends {CommonServiceBase}
  34018. * @example
  34019. * var myFacilityAnalystSinks3DService = new FacilityAnalystSinks3DService(url, {
  34020. * eventListeners: {
  34021. * "processCompleted": facilityAnalystSinks3DCompleted,
  34022. * "processFailed": facilityAnalystSinks3DError
  34023. * }
  34024. * });
  34025. * @param {string} url - 网络分析服务地址。请求网络分析服务,URL应为:<br>
  34026. * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};<br>
  34027. * 例如:"http://localhost:8090/iserver/services/components-rest/rest/networkanalyst/RoadNet@Changchun"。<br>
  34028. * @param {Object} options - 参数。
  34029. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  34030. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  34031. * @param {Object} [options.headers] - 请求头。
  34032. * @usage
  34033. */
  34034. var FacilityAnalystSinks3DService = /*#__PURE__*/function (_CommonServiceBase) {
  34035. FacilityAnalystSinks3DService_inherits(FacilityAnalystSinks3DService, _CommonServiceBase);
  34036. var _super = FacilityAnalystSinks3DService_createSuper(FacilityAnalystSinks3DService);
  34037. function FacilityAnalystSinks3DService(url, options) {
  34038. var _this;
  34039. FacilityAnalystSinks3DService_classCallCheck(this, FacilityAnalystSinks3DService);
  34040. _this = _super.call(this, url, options);
  34041. _this.CLASS_NAME = "SuperMap.FacilityAnalystSinks3DService";
  34042. return _this;
  34043. }
  34044. /**
  34045. * @function FacilityAnalystSinks3DService.prototype.destroy
  34046. * @override
  34047. */
  34048. FacilityAnalystSinks3DService_createClass(FacilityAnalystSinks3DService, [{
  34049. key: "destroy",
  34050. value: function destroy() {
  34051. CommonServiceBase.prototype.destroy.apply(this, arguments);
  34052. }
  34053. /**
  34054. * @function FacilityAnalystSinks3DService.prototype.processAsync
  34055. * @description 负责将客户端的查询参数传递到服务端。
  34056. * @param {FacilityAnalystSinks3DParameters} params - 最近设施分析参数类(汇查找资源)
  34057. */
  34058. }, {
  34059. key: "processAsync",
  34060. value: function processAsync(params) {
  34061. if (!(params instanceof FacilityAnalystSinks3DParameters)) {
  34062. return;
  34063. }
  34064. var me = this,
  34065. jsonObject;
  34066. me.url = Util_Util.urlPathAppend(me.url, 'sinks');
  34067. jsonObject = {
  34068. edgeID: params.edgeID,
  34069. nodeID: params.nodeID,
  34070. weightName: params.weightName,
  34071. isUncertainDirectionValid: params.isUncertainDirectionValid
  34072. };
  34073. me.request({
  34074. method: "GET",
  34075. params: jsonObject,
  34076. scope: me,
  34077. success: me.serviceProcessCompleted,
  34078. failure: me.serviceProcessFailed
  34079. });
  34080. }
  34081. }]);
  34082. return FacilityAnalystSinks3DService;
  34083. }(CommonServiceBase);
  34084. ;// CONCATENATED MODULE: ./src/common/iServer/FacilityAnalystSources3DParameters.js
  34085. function FacilityAnalystSources3DParameters_typeof(obj) { "@babel/helpers - typeof"; return FacilityAnalystSources3DParameters_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, FacilityAnalystSources3DParameters_typeof(obj); }
  34086. function FacilityAnalystSources3DParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  34087. function FacilityAnalystSources3DParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  34088. function FacilityAnalystSources3DParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) FacilityAnalystSources3DParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) FacilityAnalystSources3DParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  34089. function FacilityAnalystSources3DParameters_get() { if (typeof Reflect !== "undefined" && Reflect.get) { FacilityAnalystSources3DParameters_get = Reflect.get.bind(); } else { FacilityAnalystSources3DParameters_get = function _get(target, property, receiver) { var base = FacilityAnalystSources3DParameters_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return FacilityAnalystSources3DParameters_get.apply(this, arguments); }
  34090. function FacilityAnalystSources3DParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FacilityAnalystSources3DParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  34091. function FacilityAnalystSources3DParameters_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) FacilityAnalystSources3DParameters_setPrototypeOf(subClass, superClass); }
  34092. function FacilityAnalystSources3DParameters_setPrototypeOf(o, p) { FacilityAnalystSources3DParameters_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FacilityAnalystSources3DParameters_setPrototypeOf(o, p); }
  34093. function FacilityAnalystSources3DParameters_createSuper(Derived) { var hasNativeReflectConstruct = FacilityAnalystSources3DParameters_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = FacilityAnalystSources3DParameters_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = FacilityAnalystSources3DParameters_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return FacilityAnalystSources3DParameters_possibleConstructorReturn(this, result); }; }
  34094. function FacilityAnalystSources3DParameters_possibleConstructorReturn(self, call) { if (call && (FacilityAnalystSources3DParameters_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return FacilityAnalystSources3DParameters_assertThisInitialized(self); }
  34095. function FacilityAnalystSources3DParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  34096. function FacilityAnalystSources3DParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  34097. function FacilityAnalystSources3DParameters_getPrototypeOf(o) { FacilityAnalystSources3DParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FacilityAnalystSources3DParameters_getPrototypeOf(o); }
  34098. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  34099. * This program are made available under the terms of the Apache License, Version 2.0
  34100. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  34101. /**
  34102. * @class FacilityAnalystSources3DParameters
  34103. * @deprecatedclass SuperMap.FacilityAnalystSources3DParameters
  34104. * @category iServer FacilityAnalyst3D Sources
  34105. * @classdesc 最近设施分析参数类(源查找资源)。最近设施分析是指在网络上给定一个事件点和一组设施点,查找从事件点到设施点(或从设施点到事件点)以最小耗费能到达的最佳路径。
  34106. * 设施点一般为学校、超市、加油站等服务设施;事件点为需要服务设施的事件位置。例如事件发生点是一起交通事故,要求查找在10分钟内能到达的最近医院,超过10分钟能到达的都不予考虑。此例中,事故发生地即是一个事件点,周边的医院则是设施点。最近设施查找实际上也是一种路径分析,因此对路径分析起作用的障碍边、障碍点、转向表、耗费等属性在最近设施分析时同样可设置。
  34107. * @extends {FacilityAnalyst3DParameters}
  34108. * @param {Object} options - 参数。
  34109. * @param {string} options.weightName - 指定的权值字段信息对象的名称。
  34110. * @param {number} [options.edgeID] - 指定的弧段 ID,edgeID 与 nodeID 必须指定一个。
  34111. * @param {number} [options.nodeID] - 指定的结点 ID,edgeID 与 nodeID 必须指定一个。
  34112. * @param {boolean} [options.isUncertainDirectionValid=false] - 指定不确定流向是否有效。指定为 true,表示不确定流向有效,遇到不确定流向时分析继续进行;
  34113. * 指定为 false,表示不确定流向无效,遇到不确定流向将停止在该方向上继续查找。
  34114. * @usage
  34115. */
  34116. var FacilityAnalystSources3DParameters = /*#__PURE__*/function (_FacilityAnalyst3DPar) {
  34117. FacilityAnalystSources3DParameters_inherits(FacilityAnalystSources3DParameters, _FacilityAnalyst3DPar);
  34118. var _super = FacilityAnalystSources3DParameters_createSuper(FacilityAnalystSources3DParameters);
  34119. function FacilityAnalystSources3DParameters(options) {
  34120. var _this;
  34121. FacilityAnalystSources3DParameters_classCallCheck(this, FacilityAnalystSources3DParameters);
  34122. _this = _super.call(this, options);
  34123. _this.CLASS_NAME = "SuperMap.FacilityAnalystSources3DParameters";
  34124. return _this;
  34125. }
  34126. /**
  34127. * @function FacilityAnalystSources3DParameters.prototype.destroy
  34128. * @override
  34129. */
  34130. FacilityAnalystSources3DParameters_createClass(FacilityAnalystSources3DParameters, [{
  34131. key: "destroy",
  34132. value: function destroy() {
  34133. FacilityAnalystSources3DParameters_get(FacilityAnalystSources3DParameters_getPrototypeOf(FacilityAnalystSources3DParameters.prototype), "destroy", this).call(this);
  34134. }
  34135. }]);
  34136. return FacilityAnalystSources3DParameters;
  34137. }(FacilityAnalyst3DParameters);
  34138. ;// CONCATENATED MODULE: ./src/common/iServer/FacilityAnalystSources3DService.js
  34139. function FacilityAnalystSources3DService_typeof(obj) { "@babel/helpers - typeof"; return FacilityAnalystSources3DService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, FacilityAnalystSources3DService_typeof(obj); }
  34140. function FacilityAnalystSources3DService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  34141. function FacilityAnalystSources3DService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  34142. function FacilityAnalystSources3DService_createClass(Constructor, protoProps, staticProps) { if (protoProps) FacilityAnalystSources3DService_defineProperties(Constructor.prototype, protoProps); if (staticProps) FacilityAnalystSources3DService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  34143. function FacilityAnalystSources3DService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { FacilityAnalystSources3DService_get = Reflect.get.bind(); } else { FacilityAnalystSources3DService_get = function _get(target, property, receiver) { var base = FacilityAnalystSources3DService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return FacilityAnalystSources3DService_get.apply(this, arguments); }
  34144. function FacilityAnalystSources3DService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FacilityAnalystSources3DService_getPrototypeOf(object); if (object === null) break; } return object; }
  34145. function FacilityAnalystSources3DService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) FacilityAnalystSources3DService_setPrototypeOf(subClass, superClass); }
  34146. function FacilityAnalystSources3DService_setPrototypeOf(o, p) { FacilityAnalystSources3DService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FacilityAnalystSources3DService_setPrototypeOf(o, p); }
  34147. function FacilityAnalystSources3DService_createSuper(Derived) { var hasNativeReflectConstruct = FacilityAnalystSources3DService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = FacilityAnalystSources3DService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = FacilityAnalystSources3DService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return FacilityAnalystSources3DService_possibleConstructorReturn(this, result); }; }
  34148. function FacilityAnalystSources3DService_possibleConstructorReturn(self, call) { if (call && (FacilityAnalystSources3DService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return FacilityAnalystSources3DService_assertThisInitialized(self); }
  34149. function FacilityAnalystSources3DService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  34150. function FacilityAnalystSources3DService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  34151. function FacilityAnalystSources3DService_getPrototypeOf(o) { FacilityAnalystSources3DService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FacilityAnalystSources3DService_getPrototypeOf(o); }
  34152. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  34153. * This program are made available under the terms of the Apache License, Version 2.0
  34154. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  34155. /**
  34156. * @class FacilityAnalystSources3DService
  34157. * @deprecatedclass SuperMap.FacilityAnalystSources3DService
  34158. * @category iServer FacilityAnalyst3D Sources
  34159. * @classdesc 最近设施分析服务类(源查找资源)
  34160. * 最近设施分析是指在网络上给定一个事件点和一组设施点,
  34161. * 查找从事件点到设施点(或从设施点到事件点)以最小耗费能到达的最佳路径。
  34162. * 该类负责将客户端指定的最近设施分析参数传递给服务端,并接收服务端返回的结果数据。
  34163. * 最近设施分析结果通过该类支持的事件的监听函数参数获取。
  34164. * @extends {CommonServiceBase}
  34165. * @param {string} url - 服务地址。请求网络分析服务,URL应为:
  34166. * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};
  34167. * 例如:"http://localhost:8090/iserver/services/components-rest/rest/networkanalyst/RoadNet@Changchun"。
  34168. * @param {Object} options - 参数。
  34169. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  34170. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  34171. * @param {Object} [options.headers] - 请求头。
  34172. * @usage
  34173. */
  34174. var FacilityAnalystSources3DService = /*#__PURE__*/function (_CommonServiceBase) {
  34175. FacilityAnalystSources3DService_inherits(FacilityAnalystSources3DService, _CommonServiceBase);
  34176. var _super = FacilityAnalystSources3DService_createSuper(FacilityAnalystSources3DService);
  34177. function FacilityAnalystSources3DService(url, options) {
  34178. var _this;
  34179. FacilityAnalystSources3DService_classCallCheck(this, FacilityAnalystSources3DService);
  34180. _this = _super.call(this, url, options);
  34181. _this.CLASS_NAME = "SuperMap.FacilityAnalystSources3DService";
  34182. return _this;
  34183. }
  34184. /**
  34185. * @function FacilityAnalystSources3DService.prototype.destroy
  34186. * @override
  34187. */
  34188. FacilityAnalystSources3DService_createClass(FacilityAnalystSources3DService, [{
  34189. key: "destroy",
  34190. value: function destroy() {
  34191. FacilityAnalystSources3DService_get(FacilityAnalystSources3DService_getPrototypeOf(FacilityAnalystSources3DService.prototype), "destroy", this).call(this);
  34192. }
  34193. /**
  34194. * @function FacilityAnalystSources3DService.prototype.processAsync
  34195. * @description 负责将客户端的查询参数传递到服务端。
  34196. * @param {FacilityAnalystSources3DParameters} params - 最近设施分析参数类(源查找资源)
  34197. */
  34198. }, {
  34199. key: "processAsync",
  34200. value: function processAsync(params) {
  34201. if (!(params instanceof FacilityAnalystSources3DParameters)) {
  34202. return;
  34203. }
  34204. var me = this,
  34205. jsonObject;
  34206. me.url = Util_Util.urlPathAppend(me.url, 'sources');
  34207. jsonObject = {
  34208. edgeID: params.edgeID,
  34209. nodeID: params.nodeID,
  34210. weightName: params.weightName,
  34211. isUncertainDirectionValid: params.isUncertainDirectionValid
  34212. };
  34213. me.request({
  34214. method: "GET",
  34215. params: jsonObject,
  34216. scope: me,
  34217. success: me.serviceProcessCompleted,
  34218. failure: me.serviceProcessFailed
  34219. });
  34220. }
  34221. }]);
  34222. return FacilityAnalystSources3DService;
  34223. }(CommonServiceBase);
  34224. ;// CONCATENATED MODULE: ./src/common/iServer/FacilityAnalystTraceup3DParameters.js
  34225. function FacilityAnalystTraceup3DParameters_typeof(obj) { "@babel/helpers - typeof"; return FacilityAnalystTraceup3DParameters_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, FacilityAnalystTraceup3DParameters_typeof(obj); }
  34226. function FacilityAnalystTraceup3DParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  34227. function FacilityAnalystTraceup3DParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  34228. function FacilityAnalystTraceup3DParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) FacilityAnalystTraceup3DParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) FacilityAnalystTraceup3DParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  34229. function FacilityAnalystTraceup3DParameters_get() { if (typeof Reflect !== "undefined" && Reflect.get) { FacilityAnalystTraceup3DParameters_get = Reflect.get.bind(); } else { FacilityAnalystTraceup3DParameters_get = function _get(target, property, receiver) { var base = FacilityAnalystTraceup3DParameters_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return FacilityAnalystTraceup3DParameters_get.apply(this, arguments); }
  34230. function FacilityAnalystTraceup3DParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FacilityAnalystTraceup3DParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  34231. function FacilityAnalystTraceup3DParameters_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) FacilityAnalystTraceup3DParameters_setPrototypeOf(subClass, superClass); }
  34232. function FacilityAnalystTraceup3DParameters_setPrototypeOf(o, p) { FacilityAnalystTraceup3DParameters_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FacilityAnalystTraceup3DParameters_setPrototypeOf(o, p); }
  34233. function FacilityAnalystTraceup3DParameters_createSuper(Derived) { var hasNativeReflectConstruct = FacilityAnalystTraceup3DParameters_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = FacilityAnalystTraceup3DParameters_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = FacilityAnalystTraceup3DParameters_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return FacilityAnalystTraceup3DParameters_possibleConstructorReturn(this, result); }; }
  34234. function FacilityAnalystTraceup3DParameters_possibleConstructorReturn(self, call) { if (call && (FacilityAnalystTraceup3DParameters_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return FacilityAnalystTraceup3DParameters_assertThisInitialized(self); }
  34235. function FacilityAnalystTraceup3DParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  34236. function FacilityAnalystTraceup3DParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  34237. function FacilityAnalystTraceup3DParameters_getPrototypeOf(o) { FacilityAnalystTraceup3DParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FacilityAnalystTraceup3DParameters_getPrototypeOf(o); }
  34238. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  34239. * This program are made available under the terms of the Apache License, Version 2.0
  34240. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  34241. /**
  34242. * @class FacilityAnalystTraceup3DParameters
  34243. * @deprecatedclass SuperMap.FacilityAnalystTraceup3DParameters
  34244. * @category iServer FacilityAnalyst3D TraceUpResult
  34245. * @classdesc 上游追踪资源参数类。
  34246. * @extends {FacilityAnalyst3DParameters}
  34247. * @param {Object} options - 参数。
  34248. * @param {string} options.weightName - 指定的权值字段信息对象的名称。
  34249. * @param {number} [options.edgeID] - 指定的弧段ID,edgeID 与 nodeID 必须指定一个。
  34250. * @param {number} [options.nodeID] - 指定的结点ID,edgeID 与 nodeID 必须指定一个。
  34251. * @param {boolean} [options.isUncertainDirectionValid=false] - 指定不确定流向是否有效。指定为 true,表示不确定流向有效,遇到不确定流向时分析继续进行;
  34252. * 指定为 false,表示不确定流向无效,遇到不确定流向将停止在该方向上继续查找。
  34253. * @usage
  34254. */
  34255. var FacilityAnalystTraceup3DParameters = /*#__PURE__*/function (_FacilityAnalyst3DPar) {
  34256. FacilityAnalystTraceup3DParameters_inherits(FacilityAnalystTraceup3DParameters, _FacilityAnalyst3DPar);
  34257. var _super = FacilityAnalystTraceup3DParameters_createSuper(FacilityAnalystTraceup3DParameters);
  34258. function FacilityAnalystTraceup3DParameters(options) {
  34259. var _this;
  34260. FacilityAnalystTraceup3DParameters_classCallCheck(this, FacilityAnalystTraceup3DParameters);
  34261. _this = _super.call(this, options);
  34262. _this.CLASS_NAME = "SuperMap.FacilityAnalystTraceup3DParameters";
  34263. return _this;
  34264. }
  34265. /**
  34266. * @function FacilityAnalystTraceup3DParameters.prototype.destroy
  34267. * @override
  34268. */
  34269. FacilityAnalystTraceup3DParameters_createClass(FacilityAnalystTraceup3DParameters, [{
  34270. key: "destroy",
  34271. value: function destroy() {
  34272. FacilityAnalystTraceup3DParameters_get(FacilityAnalystTraceup3DParameters_getPrototypeOf(FacilityAnalystTraceup3DParameters.prototype), "destroy", this).call(this);
  34273. }
  34274. }]);
  34275. return FacilityAnalystTraceup3DParameters;
  34276. }(FacilityAnalyst3DParameters);
  34277. ;// CONCATENATED MODULE: ./src/common/iServer/FacilityAnalystTraceup3DService.js
  34278. function FacilityAnalystTraceup3DService_typeof(obj) { "@babel/helpers - typeof"; return FacilityAnalystTraceup3DService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, FacilityAnalystTraceup3DService_typeof(obj); }
  34279. function FacilityAnalystTraceup3DService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  34280. function FacilityAnalystTraceup3DService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  34281. function FacilityAnalystTraceup3DService_createClass(Constructor, protoProps, staticProps) { if (protoProps) FacilityAnalystTraceup3DService_defineProperties(Constructor.prototype, protoProps); if (staticProps) FacilityAnalystTraceup3DService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  34282. function FacilityAnalystTraceup3DService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { FacilityAnalystTraceup3DService_get = Reflect.get.bind(); } else { FacilityAnalystTraceup3DService_get = function _get(target, property, receiver) { var base = FacilityAnalystTraceup3DService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return FacilityAnalystTraceup3DService_get.apply(this, arguments); }
  34283. function FacilityAnalystTraceup3DService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FacilityAnalystTraceup3DService_getPrototypeOf(object); if (object === null) break; } return object; }
  34284. function FacilityAnalystTraceup3DService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) FacilityAnalystTraceup3DService_setPrototypeOf(subClass, superClass); }
  34285. function FacilityAnalystTraceup3DService_setPrototypeOf(o, p) { FacilityAnalystTraceup3DService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FacilityAnalystTraceup3DService_setPrototypeOf(o, p); }
  34286. function FacilityAnalystTraceup3DService_createSuper(Derived) { var hasNativeReflectConstruct = FacilityAnalystTraceup3DService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = FacilityAnalystTraceup3DService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = FacilityAnalystTraceup3DService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return FacilityAnalystTraceup3DService_possibleConstructorReturn(this, result); }; }
  34287. function FacilityAnalystTraceup3DService_possibleConstructorReturn(self, call) { if (call && (FacilityAnalystTraceup3DService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return FacilityAnalystTraceup3DService_assertThisInitialized(self); }
  34288. function FacilityAnalystTraceup3DService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  34289. function FacilityAnalystTraceup3DService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  34290. function FacilityAnalystTraceup3DService_getPrototypeOf(o) { FacilityAnalystTraceup3DService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FacilityAnalystTraceup3DService_getPrototypeOf(o); }
  34291. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  34292. * This program are made available under the terms of the Apache License, Version 2.0
  34293. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  34294. /**
  34295. * @class FacilityAnalystTraceup3DService
  34296. * @deprecatedclass SuperMap.FacilityAnalystTraceup3DService
  34297. * @category iServer FacilityAnalyst3D TraceUpResult
  34298. * @classdesc 上游追踪资源服务类
  34299. * @extends {CommonServiceBase}
  34300. * @param {string} url - 服务地址。请求网络分析服务,URL应为:
  34301. * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};
  34302. * 例如:"http://localhost:8090/iserver/services/components-rest/rest/networkanalyst/RoadNet@Changchun"。
  34303. * @param {Object} options - 参数。
  34304. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  34305. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  34306. * @param {Object} [options.headers] - 请求头。
  34307. * @usage
  34308. */
  34309. var FacilityAnalystTraceup3DService = /*#__PURE__*/function (_CommonServiceBase) {
  34310. FacilityAnalystTraceup3DService_inherits(FacilityAnalystTraceup3DService, _CommonServiceBase);
  34311. var _super = FacilityAnalystTraceup3DService_createSuper(FacilityAnalystTraceup3DService);
  34312. function FacilityAnalystTraceup3DService(url, options) {
  34313. var _this;
  34314. FacilityAnalystTraceup3DService_classCallCheck(this, FacilityAnalystTraceup3DService);
  34315. _this = _super.call(this, url, options);
  34316. _this.CLASS_NAME = "SuperMap.FacilityAnalystTraceup3DService";
  34317. return _this;
  34318. }
  34319. /**
  34320. * @function FacilityAnalystTraceup3DService.prototype.destroy
  34321. * @override
  34322. */
  34323. FacilityAnalystTraceup3DService_createClass(FacilityAnalystTraceup3DService, [{
  34324. key: "destroy",
  34325. value: function destroy() {
  34326. FacilityAnalystTraceup3DService_get(FacilityAnalystTraceup3DService_getPrototypeOf(FacilityAnalystTraceup3DService.prototype), "destroy", this).call(this);
  34327. }
  34328. /**
  34329. * @function FacilityAnalystTraceup3DService.prototype.processAsync
  34330. * @description 负责将客户端的查询参数传递到服务端。
  34331. * @param {FacilityAnalystTraceup3DParameters} params - 上游追踪资源参数类
  34332. */
  34333. }, {
  34334. key: "processAsync",
  34335. value: function processAsync(params) {
  34336. if (!(params instanceof FacilityAnalystTraceup3DParameters)) {
  34337. return;
  34338. }
  34339. var me = this,
  34340. jsonObject;
  34341. me.url = Util_Util.urlPathAppend(me.url, 'traceupresult');
  34342. jsonObject = {
  34343. edgeID: params.edgeID,
  34344. nodeID: params.nodeID,
  34345. weightName: params.weightName,
  34346. isUncertainDirectionValid: params.isUncertainDirectionValid
  34347. };
  34348. me.request({
  34349. method: "GET",
  34350. params: jsonObject,
  34351. scope: me,
  34352. success: me.serviceProcessCompleted,
  34353. failure: me.serviceProcessFailed
  34354. });
  34355. }
  34356. }]);
  34357. return FacilityAnalystTraceup3DService;
  34358. }(CommonServiceBase);
  34359. ;// CONCATENATED MODULE: ./src/common/iServer/FacilityAnalystTracedown3DParameters.js
  34360. function FacilityAnalystTracedown3DParameters_typeof(obj) { "@babel/helpers - typeof"; return FacilityAnalystTracedown3DParameters_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, FacilityAnalystTracedown3DParameters_typeof(obj); }
  34361. function FacilityAnalystTracedown3DParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  34362. function FacilityAnalystTracedown3DParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  34363. function FacilityAnalystTracedown3DParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) FacilityAnalystTracedown3DParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) FacilityAnalystTracedown3DParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  34364. function FacilityAnalystTracedown3DParameters_get() { if (typeof Reflect !== "undefined" && Reflect.get) { FacilityAnalystTracedown3DParameters_get = Reflect.get.bind(); } else { FacilityAnalystTracedown3DParameters_get = function _get(target, property, receiver) { var base = FacilityAnalystTracedown3DParameters_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return FacilityAnalystTracedown3DParameters_get.apply(this, arguments); }
  34365. function FacilityAnalystTracedown3DParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FacilityAnalystTracedown3DParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  34366. function FacilityAnalystTracedown3DParameters_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) FacilityAnalystTracedown3DParameters_setPrototypeOf(subClass, superClass); }
  34367. function FacilityAnalystTracedown3DParameters_setPrototypeOf(o, p) { FacilityAnalystTracedown3DParameters_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FacilityAnalystTracedown3DParameters_setPrototypeOf(o, p); }
  34368. function FacilityAnalystTracedown3DParameters_createSuper(Derived) { var hasNativeReflectConstruct = FacilityAnalystTracedown3DParameters_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = FacilityAnalystTracedown3DParameters_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = FacilityAnalystTracedown3DParameters_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return FacilityAnalystTracedown3DParameters_possibleConstructorReturn(this, result); }; }
  34369. function FacilityAnalystTracedown3DParameters_possibleConstructorReturn(self, call) { if (call && (FacilityAnalystTracedown3DParameters_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return FacilityAnalystTracedown3DParameters_assertThisInitialized(self); }
  34370. function FacilityAnalystTracedown3DParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  34371. function FacilityAnalystTracedown3DParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  34372. function FacilityAnalystTracedown3DParameters_getPrototypeOf(o) { FacilityAnalystTracedown3DParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FacilityAnalystTracedown3DParameters_getPrototypeOf(o); }
  34373. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  34374. * This program are made available under the terms of the Apache License, Version 2.0
  34375. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  34376. /**
  34377. * @class FacilityAnalystTracedown3DParameters
  34378. * @deprecatedclass SuperMap.FacilityAnalystTracedown3DParameters
  34379. * @category iServer FacilityAnalyst3D TraceDownResult
  34380. * @classdesc 下游追踪资源参数类。
  34381. * @extends {FacilityAnalyst3DParameters}
  34382. * @param {Object} options - 参数。
  34383. * @param {string} options.weightName - 指定的权值字段信息对象的名称。
  34384. * @param {number} [options.edgeID] - 指定的弧段 ID,edgeID 与 nodeID 必须指定一个。
  34385. * @param {number} [options.nodeID] - 指定的结点 ID,edgeID 与 nodeID 必须指定一个。
  34386. * @param {boolean} [options.isUncertainDirectionValid=false] - 指定不确定流向是否有效。指定为 true,表示不确定流向有效,遇到不确定流向时分析继续进行;
  34387. * 指定为 false,表示不确定流向无效,遇到不确定流向将停止在该方向上继续查找。
  34388. * @usage
  34389. */
  34390. var FacilityAnalystTracedown3DParameters = /*#__PURE__*/function (_FacilityAnalyst3DPar) {
  34391. FacilityAnalystTracedown3DParameters_inherits(FacilityAnalystTracedown3DParameters, _FacilityAnalyst3DPar);
  34392. var _super = FacilityAnalystTracedown3DParameters_createSuper(FacilityAnalystTracedown3DParameters);
  34393. function FacilityAnalystTracedown3DParameters(options) {
  34394. var _this;
  34395. FacilityAnalystTracedown3DParameters_classCallCheck(this, FacilityAnalystTracedown3DParameters);
  34396. _this = _super.call(this, options);
  34397. _this.CLASS_NAME = "SuperMap.FacilityAnalystTracedown3DParameters";
  34398. return _this;
  34399. }
  34400. /**
  34401. * @function FacilityAnalystTracedown3DParameters.prototype.destroy
  34402. * @override
  34403. */
  34404. FacilityAnalystTracedown3DParameters_createClass(FacilityAnalystTracedown3DParameters, [{
  34405. key: "destroy",
  34406. value: function destroy() {
  34407. FacilityAnalystTracedown3DParameters_get(FacilityAnalystTracedown3DParameters_getPrototypeOf(FacilityAnalystTracedown3DParameters.prototype), "destroy", this).call(this);
  34408. }
  34409. }]);
  34410. return FacilityAnalystTracedown3DParameters;
  34411. }(FacilityAnalyst3DParameters);
  34412. ;// CONCATENATED MODULE: ./src/common/iServer/FacilityAnalystTracedown3DService.js
  34413. function FacilityAnalystTracedown3DService_typeof(obj) { "@babel/helpers - typeof"; return FacilityAnalystTracedown3DService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, FacilityAnalystTracedown3DService_typeof(obj); }
  34414. function FacilityAnalystTracedown3DService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  34415. function FacilityAnalystTracedown3DService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  34416. function FacilityAnalystTracedown3DService_createClass(Constructor, protoProps, staticProps) { if (protoProps) FacilityAnalystTracedown3DService_defineProperties(Constructor.prototype, protoProps); if (staticProps) FacilityAnalystTracedown3DService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  34417. function FacilityAnalystTracedown3DService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { FacilityAnalystTracedown3DService_get = Reflect.get.bind(); } else { FacilityAnalystTracedown3DService_get = function _get(target, property, receiver) { var base = FacilityAnalystTracedown3DService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return FacilityAnalystTracedown3DService_get.apply(this, arguments); }
  34418. function FacilityAnalystTracedown3DService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FacilityAnalystTracedown3DService_getPrototypeOf(object); if (object === null) break; } return object; }
  34419. function FacilityAnalystTracedown3DService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) FacilityAnalystTracedown3DService_setPrototypeOf(subClass, superClass); }
  34420. function FacilityAnalystTracedown3DService_setPrototypeOf(o, p) { FacilityAnalystTracedown3DService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FacilityAnalystTracedown3DService_setPrototypeOf(o, p); }
  34421. function FacilityAnalystTracedown3DService_createSuper(Derived) { var hasNativeReflectConstruct = FacilityAnalystTracedown3DService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = FacilityAnalystTracedown3DService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = FacilityAnalystTracedown3DService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return FacilityAnalystTracedown3DService_possibleConstructorReturn(this, result); }; }
  34422. function FacilityAnalystTracedown3DService_possibleConstructorReturn(self, call) { if (call && (FacilityAnalystTracedown3DService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return FacilityAnalystTracedown3DService_assertThisInitialized(self); }
  34423. function FacilityAnalystTracedown3DService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  34424. function FacilityAnalystTracedown3DService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  34425. function FacilityAnalystTracedown3DService_getPrototypeOf(o) { FacilityAnalystTracedown3DService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FacilityAnalystTracedown3DService_getPrototypeOf(o); }
  34426. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  34427. * This program are made available under the terms of the Apache License, Version 2.0
  34428. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  34429. /**
  34430. * @class FacilityAnalystTracedown3DService
  34431. * @deprecatedclass SuperMap.FacilityAnalystTracedown3DService
  34432. * @category iServer FacilityAnalyst3D TraceDownResult
  34433. * @classdesc 下游追踪资源服务类
  34434. * @extends {CommonServiceBase}
  34435. * @param {string} url - 服务地址。请求网络分析服务,URL应为:
  34436. * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};
  34437. * 例如:"http://localhost:8090/iserver/services/components-rest/rest/networkanalyst/RoadNet@Changchun"。
  34438. * @param {Object} options - 参数。
  34439. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  34440. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  34441. * @param {Object} [options.headers] - 请求头。
  34442. * @usage
  34443. */
  34444. var FacilityAnalystTracedown3DService = /*#__PURE__*/function (_CommonServiceBase) {
  34445. FacilityAnalystTracedown3DService_inherits(FacilityAnalystTracedown3DService, _CommonServiceBase);
  34446. var _super = FacilityAnalystTracedown3DService_createSuper(FacilityAnalystTracedown3DService);
  34447. function FacilityAnalystTracedown3DService(url, options) {
  34448. var _this;
  34449. FacilityAnalystTracedown3DService_classCallCheck(this, FacilityAnalystTracedown3DService);
  34450. _this = _super.call(this, url, options);
  34451. _this.CLASS_NAME = "SuperMap.FacilityAnalystTracedown3DService";
  34452. return _this;
  34453. }
  34454. /**
  34455. * @function FacilityAnalystTracedown3DService.prototype.destroy
  34456. * @override
  34457. */
  34458. FacilityAnalystTracedown3DService_createClass(FacilityAnalystTracedown3DService, [{
  34459. key: "destroy",
  34460. value: function destroy() {
  34461. FacilityAnalystTracedown3DService_get(FacilityAnalystTracedown3DService_getPrototypeOf(FacilityAnalystTracedown3DService.prototype), "destroy", this).call(this);
  34462. }
  34463. /**
  34464. * @function FacilityAnalystTracedown3DService.prototype.processAsync
  34465. * @description 负责将客户端的查询参数传递到服务端。
  34466. * @param {FacilityAnalystTracedown3DParameters} params - 下游追踪资源参数类。
  34467. */
  34468. }, {
  34469. key: "processAsync",
  34470. value: function processAsync(params) {
  34471. if (!(params instanceof FacilityAnalystTracedown3DParameters)) {
  34472. return;
  34473. }
  34474. var me = this,
  34475. jsonObject;
  34476. me.url = Util_Util.urlPathAppend(me.url, 'tracedownresult');
  34477. jsonObject = {
  34478. edgeID: params.edgeID,
  34479. nodeID: params.nodeID,
  34480. weightName: params.weightName,
  34481. isUncertainDirectionValid: params.isUncertainDirectionValid
  34482. };
  34483. me.request({
  34484. method: "GET",
  34485. params: jsonObject,
  34486. scope: me,
  34487. success: me.serviceProcessCompleted,
  34488. failure: me.serviceProcessFailed
  34489. });
  34490. }
  34491. }]);
  34492. return FacilityAnalystTracedown3DService;
  34493. }(CommonServiceBase);
  34494. ;// CONCATENATED MODULE: ./src/common/iServer/FacilityAnalystUpstream3DParameters.js
  34495. function FacilityAnalystUpstream3DParameters_typeof(obj) { "@babel/helpers - typeof"; return FacilityAnalystUpstream3DParameters_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, FacilityAnalystUpstream3DParameters_typeof(obj); }
  34496. function FacilityAnalystUpstream3DParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  34497. function FacilityAnalystUpstream3DParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  34498. function FacilityAnalystUpstream3DParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) FacilityAnalystUpstream3DParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) FacilityAnalystUpstream3DParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  34499. function FacilityAnalystUpstream3DParameters_get() { if (typeof Reflect !== "undefined" && Reflect.get) { FacilityAnalystUpstream3DParameters_get = Reflect.get.bind(); } else { FacilityAnalystUpstream3DParameters_get = function _get(target, property, receiver) { var base = FacilityAnalystUpstream3DParameters_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return FacilityAnalystUpstream3DParameters_get.apply(this, arguments); }
  34500. function FacilityAnalystUpstream3DParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FacilityAnalystUpstream3DParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  34501. function FacilityAnalystUpstream3DParameters_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) FacilityAnalystUpstream3DParameters_setPrototypeOf(subClass, superClass); }
  34502. function FacilityAnalystUpstream3DParameters_setPrototypeOf(o, p) { FacilityAnalystUpstream3DParameters_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FacilityAnalystUpstream3DParameters_setPrototypeOf(o, p); }
  34503. function FacilityAnalystUpstream3DParameters_createSuper(Derived) { var hasNativeReflectConstruct = FacilityAnalystUpstream3DParameters_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = FacilityAnalystUpstream3DParameters_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = FacilityAnalystUpstream3DParameters_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return FacilityAnalystUpstream3DParameters_possibleConstructorReturn(this, result); }; }
  34504. function FacilityAnalystUpstream3DParameters_possibleConstructorReturn(self, call) { if (call && (FacilityAnalystUpstream3DParameters_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return FacilityAnalystUpstream3DParameters_assertThisInitialized(self); }
  34505. function FacilityAnalystUpstream3DParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  34506. function FacilityAnalystUpstream3DParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  34507. function FacilityAnalystUpstream3DParameters_getPrototypeOf(o) { FacilityAnalystUpstream3DParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FacilityAnalystUpstream3DParameters_getPrototypeOf(o); }
  34508. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  34509. * This program are made available under the terms of the Apache License, Version 2.0
  34510. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  34511. /**
  34512. * @class FacilityAnalystUpstream3DParameters
  34513. * @deprecatedclass SuperMap.FacilityAnalystUpstream3DParameters
  34514. * @category iServer FacilityAnalyst3D UpstreamCirticalFaclilities
  34515. * @classdesc 上游关键设施查找资源参数类。
  34516. * @extends {FacilityAnalyst3DParameters}
  34517. * @param {Object} options - 参数。
  34518. * @param {Array.<number>} options.sourceNodeIDs - 指定的设施点 ID 数组。
  34519. * @param {number} [options.edgeID] - 指定的弧段ID。edgeID 与 nodeID 必须指定一个。
  34520. * @param {number} [options.nodeID] - 指定的结点ID。edgeID 与 edgeID 必须指定一个。
  34521. * @param {boolean} [options.isUncertainDirectionValid=false] - 指定不确定流向是否有效。指定为 true,表示不确定流向有效,遇到不确定流向时分析继续进行;
  34522. * 指定为 false,表示不确定流向无效,遇到不确定流向将停止在该方向上继续查找。
  34523. * @usage
  34524. */
  34525. var FacilityAnalystUpstream3DParameters = /*#__PURE__*/function (_FacilityAnalyst3DPar) {
  34526. FacilityAnalystUpstream3DParameters_inherits(FacilityAnalystUpstream3DParameters, _FacilityAnalyst3DPar);
  34527. var _super = FacilityAnalystUpstream3DParameters_createSuper(FacilityAnalystUpstream3DParameters);
  34528. function FacilityAnalystUpstream3DParameters(options) {
  34529. var _this;
  34530. FacilityAnalystUpstream3DParameters_classCallCheck(this, FacilityAnalystUpstream3DParameters);
  34531. _this = _super.call(this, options);
  34532. options = options || {};
  34533. _this.sourceNodeIDs = null;
  34534. Util_Util.extend(FacilityAnalystUpstream3DParameters_assertThisInitialized(_this), options);
  34535. _this.CLASS_NAME = "SuperMap.FacilityAnalystUpstream3DParameters";
  34536. return _this;
  34537. }
  34538. /**
  34539. * @function FacilityAnalystUpstream3DParameters.prototype.destroy
  34540. * @override
  34541. */
  34542. FacilityAnalystUpstream3DParameters_createClass(FacilityAnalystUpstream3DParameters, [{
  34543. key: "destroy",
  34544. value: function destroy() {
  34545. FacilityAnalystUpstream3DParameters_get(FacilityAnalystUpstream3DParameters_getPrototypeOf(FacilityAnalystUpstream3DParameters.prototype), "destroy", this).call(this);
  34546. this.sourceNodeIDs = null;
  34547. }
  34548. }]);
  34549. return FacilityAnalystUpstream3DParameters;
  34550. }(FacilityAnalyst3DParameters);
  34551. ;// CONCATENATED MODULE: ./src/common/iServer/FacilityAnalystUpstream3DService.js
  34552. function FacilityAnalystUpstream3DService_typeof(obj) { "@babel/helpers - typeof"; return FacilityAnalystUpstream3DService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, FacilityAnalystUpstream3DService_typeof(obj); }
  34553. function FacilityAnalystUpstream3DService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  34554. function FacilityAnalystUpstream3DService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  34555. function FacilityAnalystUpstream3DService_createClass(Constructor, protoProps, staticProps) { if (protoProps) FacilityAnalystUpstream3DService_defineProperties(Constructor.prototype, protoProps); if (staticProps) FacilityAnalystUpstream3DService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  34556. function FacilityAnalystUpstream3DService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { FacilityAnalystUpstream3DService_get = Reflect.get.bind(); } else { FacilityAnalystUpstream3DService_get = function _get(target, property, receiver) { var base = FacilityAnalystUpstream3DService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return FacilityAnalystUpstream3DService_get.apply(this, arguments); }
  34557. function FacilityAnalystUpstream3DService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FacilityAnalystUpstream3DService_getPrototypeOf(object); if (object === null) break; } return object; }
  34558. function FacilityAnalystUpstream3DService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) FacilityAnalystUpstream3DService_setPrototypeOf(subClass, superClass); }
  34559. function FacilityAnalystUpstream3DService_setPrototypeOf(o, p) { FacilityAnalystUpstream3DService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FacilityAnalystUpstream3DService_setPrototypeOf(o, p); }
  34560. function FacilityAnalystUpstream3DService_createSuper(Derived) { var hasNativeReflectConstruct = FacilityAnalystUpstream3DService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = FacilityAnalystUpstream3DService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = FacilityAnalystUpstream3DService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return FacilityAnalystUpstream3DService_possibleConstructorReturn(this, result); }; }
  34561. function FacilityAnalystUpstream3DService_possibleConstructorReturn(self, call) { if (call && (FacilityAnalystUpstream3DService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return FacilityAnalystUpstream3DService_assertThisInitialized(self); }
  34562. function FacilityAnalystUpstream3DService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  34563. function FacilityAnalystUpstream3DService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  34564. function FacilityAnalystUpstream3DService_getPrototypeOf(o) { FacilityAnalystUpstream3DService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FacilityAnalystUpstream3DService_getPrototypeOf(o); }
  34565. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  34566. * This program are made available under the terms of the Apache License, Version 2.0
  34567. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  34568. /**
  34569. * @class FacilityAnalystUpstream3DService
  34570. * @deprecatedclass SuperMap.FacilityAnalystUpstream3DService
  34571. * @category iServer FacilityAnalyst3D UpstreamCirticalFaclilities
  34572. * @classdesc 上游关键设施查找资源服务类
  34573. * @extends {CommonServiceBase}
  34574. * @param {string} url - 服务地址。请求网络分析服务,URL应为:
  34575. * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};
  34576. * 例如:"http://localhost:8090/iserver/services/components-rest/rest/networkanalyst/RoadNet@Changchun"。
  34577. * @param {Object} options - 参数。
  34578. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  34579. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  34580. * @param {Object} [options.headers] - 请求头。
  34581. * @usage
  34582. */
  34583. var FacilityAnalystUpstream3DService = /*#__PURE__*/function (_CommonServiceBase) {
  34584. FacilityAnalystUpstream3DService_inherits(FacilityAnalystUpstream3DService, _CommonServiceBase);
  34585. var _super = FacilityAnalystUpstream3DService_createSuper(FacilityAnalystUpstream3DService);
  34586. function FacilityAnalystUpstream3DService(url, options) {
  34587. var _this;
  34588. FacilityAnalystUpstream3DService_classCallCheck(this, FacilityAnalystUpstream3DService);
  34589. _this = _super.call(this, url, options);
  34590. _this.CLASS_NAME = "SuperMap.FacilityAnalystUpstream3DService";
  34591. return _this;
  34592. }
  34593. /**
  34594. * @function FacilityAnalystUpstream3DService.prototype.destroy
  34595. * @override
  34596. */
  34597. FacilityAnalystUpstream3DService_createClass(FacilityAnalystUpstream3DService, [{
  34598. key: "destroy",
  34599. value: function destroy() {
  34600. FacilityAnalystUpstream3DService_get(FacilityAnalystUpstream3DService_getPrototypeOf(FacilityAnalystUpstream3DService.prototype), "destroy", this).call(this);
  34601. }
  34602. /**
  34603. * @function FacilityAnalystUpstream3DService.prototype.processAsync
  34604. * @description 负责将客户端的查询参数传递到服务端。
  34605. * @param {FacilityAnalystUpstream3DParameters} params - 上游关键设施查找资源参数类
  34606. */
  34607. }, {
  34608. key: "processAsync",
  34609. value: function processAsync(params) {
  34610. if (!(params instanceof FacilityAnalystUpstream3DParameters)) {
  34611. return;
  34612. }
  34613. var me = this,
  34614. jsonObject;
  34615. me.url = Util_Util.urlPathAppend(me.url, 'upstreamcirticalfaclilities');
  34616. jsonObject = {
  34617. sourceNodeIDs: params.sourceNodeIDs,
  34618. edgeID: params.edgeID,
  34619. nodeID: params.nodeID,
  34620. isUncertainDirectionValid: params.isUncertainDirectionValid
  34621. };
  34622. me.request({
  34623. method: "GET",
  34624. params: jsonObject,
  34625. scope: me,
  34626. success: me.serviceProcessCompleted,
  34627. failure: me.serviceProcessFailed
  34628. });
  34629. }
  34630. }]);
  34631. return FacilityAnalystUpstream3DService;
  34632. }(CommonServiceBase);
  34633. ;// CONCATENATED MODULE: ./src/common/iServer/NetworkAnalyst3DService.js
  34634. function NetworkAnalyst3DService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  34635. function NetworkAnalyst3DService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  34636. function NetworkAnalyst3DService_createClass(Constructor, protoProps, staticProps) { if (protoProps) NetworkAnalyst3DService_defineProperties(Constructor.prototype, protoProps); if (staticProps) NetworkAnalyst3DService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  34637. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  34638. * This program are made available under the terms of the Apache License, Version 2.0
  34639. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  34640. /**
  34641. * @class NetworkAnalyst3DService
  34642. * @category iServer FacilityAnalyst3D
  34643. * @classdesc 3D 网络分析服务类。
  34644. * @extends {ServiceBase}
  34645. * @example
  34646. * new NetworkAnalyst3DService(url).sinksFacilityAnalyst(params,function(result){
  34647. * //doSomething
  34648. * })
  34649. * @param {string} url - 网络分析服务地址。请求网络分析服务,URL 应为:
  34650. * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};
  34651. * 例如:"http://localhost:8090/iserver/services/components-rest/rest/networkanalyst/RoadNet@Changchun"。
  34652. * @param {Object} options - 参数。
  34653. * @param {string} [options.proxy] - 服务代理地址。
  34654. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  34655. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  34656. * @param {Object} [options.headers] - 请求头。
  34657. * @usage
  34658. */
  34659. var NetworkAnalyst3DService_NetworkAnalyst3DService = /*#__PURE__*/function () {
  34660. function NetworkAnalyst3DService(url, options) {
  34661. NetworkAnalyst3DService_classCallCheck(this, NetworkAnalyst3DService);
  34662. this.url = url;
  34663. this.options = options || {};
  34664. }
  34665. /**
  34666. * @function NetworkAnalyst3DService.prototype.sinksFacilityAnalyst
  34667. * @description 汇查找服务
  34668. * @param {FacilityAnalystSinks3DParameters} params- 最近设施分析参数类(汇查找资源)。
  34669. * @param {RequestCallback} callback - 回调函数。
  34670. * @returns {NetworkAnalyst3DService} 3D 网络分析服务。
  34671. */
  34672. NetworkAnalyst3DService_createClass(NetworkAnalyst3DService, [{
  34673. key: "sinksFacilityAnalyst",
  34674. value: function sinksFacilityAnalyst(params, callback) {
  34675. var me = this;
  34676. var facilityAnalystSinks3DService = new FacilityAnalystSinks3DService(me.url, {
  34677. proxy: me.options.proxy,
  34678. withCredentials: me.options.withCredentials,
  34679. crossOrigin: me.options.crossOrigin,
  34680. headers: me.options.headers,
  34681. eventListeners: {
  34682. scope: me,
  34683. processCompleted: callback,
  34684. processFailed: callback
  34685. }
  34686. });
  34687. facilityAnalystSinks3DService.processAsync(params);
  34688. }
  34689. /**
  34690. * @function NetworkAnalyst3DService.prototype.sourcesFacilityAnalyst
  34691. * @description 源查找服务。
  34692. * @param {FacilityAnalystSources3DParameters} params - 最近设施分析参数类(源查找服务)。
  34693. * @param {RequestCallback} callback - 回调函数。
  34694. * @returns {NetworkAnalyst3DService} 3D 网络分析服务。
  34695. */
  34696. }, {
  34697. key: "sourcesFacilityAnalyst",
  34698. value: function sourcesFacilityAnalyst(params, callback) {
  34699. var me = this;
  34700. var facilityAnalystSources3DService = new FacilityAnalystSources3DService(me.url, {
  34701. proxy: me.options.proxy,
  34702. withCredentials: me.options.withCredentials,
  34703. crossOrigin: me.options.crossOrigin,
  34704. headers: me.options.headers,
  34705. eventListeners: {
  34706. scope: me,
  34707. processCompleted: callback,
  34708. processFailed: callback
  34709. }
  34710. });
  34711. facilityAnalystSources3DService.processAsync(params);
  34712. }
  34713. /**
  34714. * @function NetworkAnalyst3DService.prototype.traceUpFacilityAnalyst
  34715. * @description 上游追踪资源服务。
  34716. * @param {FacilityAnalystTraceup3DParameters} params - 上游追踪资源参数类。
  34717. * @param {RequestCallback} callback - 回调函数。
  34718. * @returns {NetworkAnalyst3DService} 3D 网络分析服务。
  34719. */
  34720. }, {
  34721. key: "traceUpFacilityAnalyst",
  34722. value: function traceUpFacilityAnalyst(params, callback) {
  34723. var me = this;
  34724. var facilityAnalystTraceup3DService = new FacilityAnalystTraceup3DService(me.url, {
  34725. proxy: me.options.proxy,
  34726. withCredentials: me.options.withCredentials,
  34727. crossOrigin: me.options.crossOrigin,
  34728. headers: me.options.headers,
  34729. eventListeners: {
  34730. scope: me,
  34731. processCompleted: callback,
  34732. processFailed: callback
  34733. }
  34734. });
  34735. facilityAnalystTraceup3DService.processAsync(params);
  34736. }
  34737. /**
  34738. * @function NetworkAnalyst3DService.prototype.traceDownFacilityAnalyst
  34739. * @description 下游追踪资源服务。
  34740. * @param {FacilityAnalystTracedown3DParameters} params - 下游追踪资源服务参数类。
  34741. * @param {RequestCallback} callback - 回调函数。
  34742. * @returns {NetworkAnalyst3DService} 3D 网络分析服务。
  34743. */
  34744. }, {
  34745. key: "traceDownFacilityAnalyst",
  34746. value: function traceDownFacilityAnalyst(params, callback) {
  34747. var me = this;
  34748. var facilityAnalystTracedown3DService = new FacilityAnalystTracedown3DService(me.url, {
  34749. proxy: me.options.proxy,
  34750. withCredentials: me.options.withCredentials,
  34751. crossOrigin: me.options.crossOrigin,
  34752. headers: me.options.headers,
  34753. eventListeners: {
  34754. scope: me,
  34755. processCompleted: callback,
  34756. processFailed: callback
  34757. }
  34758. });
  34759. facilityAnalystTracedown3DService.processAsync(params);
  34760. }
  34761. /**
  34762. * @function NetworkAnalyst3DService.prototype.upstreamFacilityAnalyst
  34763. * @description 上游关键设施查找服务。
  34764. * @param {FacilityAnalystUpstream3DParameters} params - 上游关键设施查找服务参数类。
  34765. * @param {RequestCallback} callback - 回调函数。
  34766. * @returns {NetworkAnalyst3DService} 3D 网络分析服务。
  34767. */
  34768. }, {
  34769. key: "upstreamFacilityAnalyst",
  34770. value: function upstreamFacilityAnalyst(params, callback) {
  34771. var me = this;
  34772. var facilityAnalystUpstream3DService = new FacilityAnalystUpstream3DService(me.url, {
  34773. proxy: me.options.proxy,
  34774. withCredentials: me.options.withCredentials,
  34775. crossOrigin: me.options.crossOrigin,
  34776. headers: me.options.headers,
  34777. eventListeners: {
  34778. scope: me,
  34779. processCompleted: callback,
  34780. processFailed: callback
  34781. }
  34782. });
  34783. facilityAnalystUpstream3DService.processAsync(params);
  34784. }
  34785. }]);
  34786. return NetworkAnalyst3DService;
  34787. }();
  34788. ;// CONCATENATED MODULE: ./src/maplibregl/services/NetworkAnalyst3DService.js
  34789. function NetworkAnalyst3DService_typeof(obj) { "@babel/helpers - typeof"; return NetworkAnalyst3DService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, NetworkAnalyst3DService_typeof(obj); }
  34790. function services_NetworkAnalyst3DService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  34791. function services_NetworkAnalyst3DService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  34792. function services_NetworkAnalyst3DService_createClass(Constructor, protoProps, staticProps) { if (protoProps) services_NetworkAnalyst3DService_defineProperties(Constructor.prototype, protoProps); if (staticProps) services_NetworkAnalyst3DService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  34793. function NetworkAnalyst3DService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) NetworkAnalyst3DService_setPrototypeOf(subClass, superClass); }
  34794. function NetworkAnalyst3DService_setPrototypeOf(o, p) { NetworkAnalyst3DService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return NetworkAnalyst3DService_setPrototypeOf(o, p); }
  34795. function NetworkAnalyst3DService_createSuper(Derived) { var hasNativeReflectConstruct = NetworkAnalyst3DService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = NetworkAnalyst3DService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = NetworkAnalyst3DService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return NetworkAnalyst3DService_possibleConstructorReturn(this, result); }; }
  34796. function NetworkAnalyst3DService_possibleConstructorReturn(self, call) { if (call && (NetworkAnalyst3DService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return NetworkAnalyst3DService_assertThisInitialized(self); }
  34797. function NetworkAnalyst3DService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  34798. function NetworkAnalyst3DService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  34799. function NetworkAnalyst3DService_getPrototypeOf(o) { NetworkAnalyst3DService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return NetworkAnalyst3DService_getPrototypeOf(o); }
  34800. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  34801. * This program are made available under the terms of the Apache License, Version 2.0
  34802. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  34803. /**
  34804. * @class NetworkAnalyst3DService
  34805. * @category iServer FacilityAnalyst3D
  34806. * @classdesc 3D 网络分析服务类。
  34807. * @version 11.1.0
  34808. * @modulecategory Services
  34809. * @extends {ServiceBase}
  34810. * @example
  34811. * new NetworkAnalyst3DService(url)
  34812. * .sinksFacilityAnalyst(params,function(result){
  34813. * //doSomething
  34814. * })
  34815. * @param {string} url - 服务地址。请求网络分析服务,URL应为:</br>
  34816. * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源}。
  34817. * 例如:"http://localhost:8090/iserver/services/components-rest/rest/networkanalyst/RoadNet@Changchun"。
  34818. * @param {Object} options - 参数。
  34819. * @param {string} [options.proxy] - 服务代理地址。
  34820. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  34821. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  34822. * @param {Object} [options.headers] - 请求头。
  34823. * @usage
  34824. */
  34825. var NetworkAnalyst3DService = /*#__PURE__*/function (_ServiceBase) {
  34826. NetworkAnalyst3DService_inherits(NetworkAnalyst3DService, _ServiceBase);
  34827. var _super = NetworkAnalyst3DService_createSuper(NetworkAnalyst3DService);
  34828. function NetworkAnalyst3DService(url, options) {
  34829. var _this;
  34830. services_NetworkAnalyst3DService_classCallCheck(this, NetworkAnalyst3DService);
  34831. _this = _super.call(this, url, options);
  34832. _this._networkAnalyst3DService = new NetworkAnalyst3DService_NetworkAnalyst3DService(url, options);
  34833. return _this;
  34834. }
  34835. /**
  34836. * @function NetworkAnalyst3DService.prototype.sinksFacilityAnalyst
  34837. * @description 汇查找服务。
  34838. * @param {FacilityAnalystSinks3DParameters} params - 最近设施分析参数类(汇查找资源)。
  34839. * @param {RequestCallback} callback - 回调函数。
  34840. * @returns {NetworkAnalyst3DService} 3D 网络分析服务。
  34841. */
  34842. services_NetworkAnalyst3DService_createClass(NetworkAnalyst3DService, [{
  34843. key: "sinksFacilityAnalyst",
  34844. value: function sinksFacilityAnalyst(params, callback) {
  34845. this._networkAnalyst3DService.sinksFacilityAnalyst(params, callback);
  34846. }
  34847. /**
  34848. * @function NetworkAnalyst3DService.prototype.sourcesFacilityAnalyst
  34849. * @description 源查找服务。
  34850. * @param {FacilityAnalystSources3DParameters} params - 最近设施分析参数类(源查找服务)。
  34851. * @param {RequestCallback} callback - 回调函数。
  34852. * @returns {NetworkAnalyst3DService} 3D 网络分析服务。
  34853. */
  34854. }, {
  34855. key: "sourcesFacilityAnalyst",
  34856. value: function sourcesFacilityAnalyst(params, callback) {
  34857. this._networkAnalyst3DService.sourcesFacilityAnalyst(params, callback);
  34858. }
  34859. /**
  34860. * @function NetworkAnalyst3DService.prototype.traceUpFacilityAnalyst
  34861. * @description 上游追踪资源服务。
  34862. * @param {FacilityAnalystTraceup3DParameters} params - 上游追踪资源参数类。
  34863. * @param {RequestCallback} callback 回调函数。
  34864. * @returns {NetworkAnalyst3DService} 3D 网络分析服务。
  34865. */
  34866. }, {
  34867. key: "traceUpFacilityAnalyst",
  34868. value: function traceUpFacilityAnalyst(params, callback) {
  34869. this._networkAnalyst3DService.traceUpFacilityAnalyst(params, callback);
  34870. }
  34871. /**
  34872. * @function NetworkAnalyst3DService.prototype.traceDownFacilityAnalyst
  34873. * @description 下游追踪资源服务。
  34874. * @param {FacilityAnalystTracedown3DParameters} params - 下游追踪资源服务参数类。
  34875. * @param {RequestCallback} callback 回调函数。
  34876. * @returns {NetworkAnalyst3DService} 3D 网络分析服务。
  34877. */
  34878. }, {
  34879. key: "traceDownFacilityAnalyst",
  34880. value: function traceDownFacilityAnalyst(params, callback) {
  34881. this._networkAnalyst3DService.traceDownFacilityAnalyst(params, callback);
  34882. }
  34883. /**
  34884. * @function NetworkAnalyst3DService.prototype.upstreamFacilityAnalyst
  34885. * @description 上游关键设施查找服务。
  34886. * @param {FacilityAnalystUpstream3DParameters} params - 上游关键设施查找服务参数类。
  34887. * @param {RequestCallback} callback 回调函数。
  34888. * @returns {NetworkAnalyst3DService} 3D 网络分析服务。
  34889. */
  34890. }, {
  34891. key: "upstreamFacilityAnalyst",
  34892. value: function upstreamFacilityAnalyst(params, callback) {
  34893. this._networkAnalyst3DService.upstreamFacilityAnalyst(params, callback);
  34894. }
  34895. }]);
  34896. return NetworkAnalyst3DService;
  34897. }(ServiceBase);
  34898. ;// CONCATENATED MODULE: ./src/common/iServer/ProcessingServiceBase.js
  34899. function ProcessingServiceBase_typeof(obj) { "@babel/helpers - typeof"; return ProcessingServiceBase_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, ProcessingServiceBase_typeof(obj); }
  34900. function ProcessingServiceBase_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  34901. 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); } }
  34902. function ProcessingServiceBase_createClass(Constructor, protoProps, staticProps) { if (protoProps) ProcessingServiceBase_defineProperties(Constructor.prototype, protoProps); if (staticProps) ProcessingServiceBase_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  34903. function ProcessingServiceBase_get() { if (typeof Reflect !== "undefined" && Reflect.get) { ProcessingServiceBase_get = Reflect.get.bind(); } else { ProcessingServiceBase_get = function _get(target, property, receiver) { var base = ProcessingServiceBase_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return ProcessingServiceBase_get.apply(this, arguments); }
  34904. function ProcessingServiceBase_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ProcessingServiceBase_getPrototypeOf(object); if (object === null) break; } return object; }
  34905. function ProcessingServiceBase_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) ProcessingServiceBase_setPrototypeOf(subClass, superClass); }
  34906. function ProcessingServiceBase_setPrototypeOf(o, p) { ProcessingServiceBase_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ProcessingServiceBase_setPrototypeOf(o, p); }
  34907. 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); }; }
  34908. function ProcessingServiceBase_possibleConstructorReturn(self, call) { if (call && (ProcessingServiceBase_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return ProcessingServiceBase_assertThisInitialized(self); }
  34909. function ProcessingServiceBase_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  34910. function ProcessingServiceBase_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  34911. function ProcessingServiceBase_getPrototypeOf(o) { ProcessingServiceBase_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ProcessingServiceBase_getPrototypeOf(o); }
  34912. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  34913. * This program are made available under the terms of the Apache License, Version 2.0
  34914. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  34915. /**
  34916. * @class ProcessingServiceBase
  34917. * @deprecatedclass SuperMap.ProcessingServiceBase
  34918. * @category iServer Core
  34919. * @classdesc 分布式分析服务基类
  34920. * @extends {CommonServiceBase}
  34921. * @param {string} url - 服务地址。
  34922. * @param {Object} options - 参数。
  34923. * @param {Events} options.events - 处理所有事件的对象。
  34924. * @param {number} options.index - 服务访问地址在数组中的位置。
  34925. * @param {number} options.length - 服务访问地址数组长度。
  34926. * @param {Object} [options.eventListeners] - 事件监听器对象。有 processCompleted 属性可传入处理完成后的回调函数。processFailed 属性传入处理失败后的回调函数。
  34927. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  34928. * @param {Object} [options.headers] - 请求头。
  34929. * @usage
  34930. */
  34931. var ProcessingServiceBase = /*#__PURE__*/function (_CommonServiceBase) {
  34932. ProcessingServiceBase_inherits(ProcessingServiceBase, _CommonServiceBase);
  34933. var _super = ProcessingServiceBase_createSuper(ProcessingServiceBase);
  34934. function ProcessingServiceBase(url, options) {
  34935. var _this;
  34936. ProcessingServiceBase_classCallCheck(this, ProcessingServiceBase);
  34937. options = options || {};
  34938. /*
  34939. * Constant: EVENT_TYPES
  34940. * {Array.<string>}
  34941. * 此类支持的事件类型
  34942. * - *processCompleted* 创建成功后触发的事件。
  34943. * - *processFailed* 创建失败后触发的事件 。
  34944. * - *processRunning* 创建过程的整个阶段都会触发的事件,用于获取创建过程的状态 。
  34945. */
  34946. options.EVENT_TYPES = ["processCompleted", "processFailed", "processRunning"];
  34947. _this = _super.call(this, url, options);
  34948. _this.CLASS_NAME = "SuperMap.ProcessingServiceBase";
  34949. return _this;
  34950. }
  34951. /**
  34952. * @function ProcessingServiceBase.prototype.destroy
  34953. * @override
  34954. */
  34955. ProcessingServiceBase_createClass(ProcessingServiceBase, [{
  34956. key: "destroy",
  34957. value: function destroy() {
  34958. ProcessingServiceBase_get(ProcessingServiceBase_getPrototypeOf(ProcessingServiceBase.prototype), "destroy", this).call(this);
  34959. }
  34960. /**
  34961. * @function ProcessingServiceBase.prototype.getJobs
  34962. * @description 获取分布式分析任务。
  34963. * @param {string} url - 资源地址。
  34964. */
  34965. }, {
  34966. key: "getJobs",
  34967. value: function getJobs(url) {
  34968. var me = this;
  34969. FetchRequest.get(SecurityManager.appendCredential(url), null, {
  34970. proxy: me.proxy
  34971. }).then(function (response) {
  34972. return response.json();
  34973. }).then(function (result) {
  34974. me.events.triggerEvent("processCompleted", {
  34975. result: result
  34976. });
  34977. })["catch"](function (e) {
  34978. me.eventListeners.processFailed({
  34979. error: e
  34980. });
  34981. });
  34982. }
  34983. /**
  34984. * @function ProcessingServiceBase.prototype.addJob
  34985. * @description 添加分布式分析任务。
  34986. * @param {string} url - 资源根地址。
  34987. * @param {Object} params - 创建一个空间分析的请求参数。
  34988. * @param {string} paramType - 请求参数类型。
  34989. * @param {number} seconds - 开始创建后,获取创建成功结果的时间间隔。
  34990. */
  34991. }, {
  34992. key: "addJob",
  34993. value: function addJob(url, params, paramType, seconds) {
  34994. var me = this,
  34995. parameterObject = null;
  34996. if (params && params instanceof paramType) {
  34997. parameterObject = new Object();
  34998. paramType.toObject(params, parameterObject);
  34999. }
  35000. var headers = Object.assign({
  35001. 'Content-Type': 'application/x-www-form-urlencoded'
  35002. }, me.headers || {});
  35003. var options = {
  35004. proxy: me.proxy,
  35005. headers: headers,
  35006. withCredentials: me.withCredentials,
  35007. crossOrigin: me.crossOrigin,
  35008. isInTheSameDomain: me.isInTheSameDomain
  35009. };
  35010. FetchRequest.post(SecurityManager.appendCredential(url), JSON.stringify(parameterObject), options).then(function (response) {
  35011. return response.json();
  35012. }).then(function (result) {
  35013. if (result.succeed) {
  35014. me.serviceProcessCompleted(result, seconds);
  35015. } else {
  35016. me.serviceProcessFailed(result);
  35017. }
  35018. })["catch"](function (e) {
  35019. me.serviceProcessFailed({
  35020. error: e
  35021. });
  35022. });
  35023. }
  35024. }, {
  35025. key: "serviceProcessCompleted",
  35026. value: function serviceProcessCompleted(result, seconds) {
  35027. result = Util_Util.transformResult(result);
  35028. seconds = seconds || 1000;
  35029. var me = this;
  35030. if (result) {
  35031. var id = setInterval(function () {
  35032. FetchRequest.get(SecurityManager.appendCredential(result.newResourceLocation), {
  35033. _t: new Date().getTime()
  35034. }).then(function (response) {
  35035. return response.json();
  35036. }).then(function (job) {
  35037. me.events.triggerEvent("processRunning", {
  35038. id: job.id,
  35039. state: job.state
  35040. });
  35041. if (job.state.runState === 'LOST' || job.state.runState === 'KILLED' || job.state.runState === 'FAILED') {
  35042. clearInterval(id);
  35043. me.events.triggerEvent("processFailed", {
  35044. error: job.state.errorMsg,
  35045. state: job.state.runState
  35046. });
  35047. }
  35048. if (job.state.runState === 'FINISHED' && job.setting.serviceInfo) {
  35049. clearInterval(id);
  35050. me.events.triggerEvent("processCompleted", {
  35051. result: job
  35052. });
  35053. }
  35054. })["catch"](function (e) {
  35055. clearInterval(id);
  35056. me.events.triggerEvent("processFailed", {
  35057. error: e
  35058. });
  35059. });
  35060. }, seconds);
  35061. }
  35062. }
  35063. }, {
  35064. key: "serviceProcessFailed",
  35065. value: function serviceProcessFailed(result) {
  35066. ProcessingServiceBase_get(ProcessingServiceBase_getPrototypeOf(ProcessingServiceBase.prototype), "serviceProcessFailed", this).call(this, result);
  35067. }
  35068. }]);
  35069. return ProcessingServiceBase;
  35070. }(CommonServiceBase);
  35071. ;// CONCATENATED MODULE: ./src/common/iServer/DatasourceConnectionInfo.js
  35072. function DatasourceConnectionInfo_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  35073. 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); } }
  35074. function DatasourceConnectionInfo_createClass(Constructor, protoProps, staticProps) { if (protoProps) DatasourceConnectionInfo_defineProperties(Constructor.prototype, protoProps); if (staticProps) DatasourceConnectionInfo_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  35075. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  35076. * This program are made available under the terms of the Apache License, Version 2.0
  35077. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  35078. // eslint-disable-line no-unused-vars
  35079. /**
  35080. * @class DatasourceConnectionInfo
  35081. * @deprecatedclass SuperMap.DatasourceConnectionInfo
  35082. * @category iServer Data Datasource
  35083. * @classdesc 数据源连接信息类。该类包括了进行数据源连接的所有信息,如所要连接的服务器名称、数据库名称、用户名以及密码等。
  35084. * 当保存为工作空间时,工作空间中的数据源的连接信息都将存储到工作空间文件中。对于不同类型的数据源,其连接信息有所区别。
  35085. * 所以在使用该类所包含的成员时,请注意该成员所适用的数据源类型。对于从数据源对象中返回的数据连接信息对象,只有 connect 方法可以被修改,
  35086. * 其他内容是不可以被修改的。对于用户创建的数据源连接信息对象,其内容都可以修改。
  35087. * @param {Object} options - 参数。
  35088. * @param {string} options.alias - 数据源别名。
  35089. * @param {string} options.dataBase - 数据源连接的数据库名。
  35090. * @param {boolean} [options.connect] - 数据源是否自动连接数据。
  35091. * @param {string} [options.driver] - 使用 ODBC(Open Database Connectivity,开放数据库互连)的数据库的驱动程序名。
  35092. * @param {EngineType} [options.engineType] - 数据源连接的引擎类型。
  35093. * @param {boolean} [options.exclusive] - 是否以独占方式打开数据源。
  35094. * @param {boolean} [options.OpenLinkTable] - 是否把数据库中的其他非 SuperMap 数据表作为 LinkTable 打开。
  35095. * @param {string} [options.password] - 登录数据源连接的数据库或文件的密码。
  35096. * @param {boolean} [options.readOnly] - 是否以只读方式打开数据源。
  35097. * @param {string} [options.server] - 数据库服务器名或 SDB 文件名。
  35098. * @param {string} [options.user] - 登录数据库的用户名。
  35099. * @usage
  35100. */
  35101. var DatasourceConnectionInfo = /*#__PURE__*/function () {
  35102. function DatasourceConnectionInfo(options) {
  35103. DatasourceConnectionInfo_classCallCheck(this, DatasourceConnectionInfo);
  35104. /**
  35105. * @member {string} DatasourceConnectionInfo.prototype.alias
  35106. * @description 数据源别名。
  35107. */
  35108. this.alias = null;
  35109. /**
  35110. * @member {boolean} [DatasourceConnectionInfo.prototype.connect]
  35111. * @description 数据源是否自动连接数据。
  35112. */
  35113. this.connect = null;
  35114. /**
  35115. * @member {string} DatasourceConnectionInfo.prototype.dataBase
  35116. * @description 数据源连接的数据库名。
  35117. */
  35118. this.dataBase = null;
  35119. /**
  35120. * @member {string} [DatasourceConnectionInfo.prototype.driver]
  35121. * @description 使用 ODBC(Open Database Connectivity,开放数据库互连) 的数据库的驱动程序名。
  35122. * 其中,对于 SQL Server 数据库与 iServer 发布的 WMTS 服务,此为必设参数。
  35123. * 对于 SQL Server 数据库,它使用 ODBC 连接,所设置的驱动程序名为 "SQL Server" 或 "SQL Native Client";
  35124. * 对于 iServer 发布的 WMTS 服务,设置的驱动名称为 "WMTS"。
  35125. */
  35126. this.driver = null;
  35127. /**
  35128. * @member {EngineType} [DatasourceConnectionInfo.prototype.engineType]
  35129. * @description 数据源连接的引擎类型。
  35130. */
  35131. this.engineType = null;
  35132. /**
  35133. * @member {boolean} [DatasourceConnectionInfo.prototype.exclusive]
  35134. * @description 是否以独占方式打开数据源。
  35135. */
  35136. this.exclusive = null;
  35137. /**
  35138. * @member {boolean} [DatasourceConnectionInfo.prototype.OpenLinkTable]
  35139. * @description 是否把数据库中的其他非 SuperMap 数据表作为 LinkTable 打开。
  35140. */
  35141. this.OpenLinkTable = null;
  35142. /**
  35143. * @member {string} [DatasourceConnectionInfo.prototype.password]
  35144. * @description 登录数据源连接的数据库或文件的密码。
  35145. */
  35146. this.password = null;
  35147. /**
  35148. * @member {boolean} [DatasourceConnectionInfo.prototype.readOnly]
  35149. * @description 是否以只读方式打开数据源。
  35150. */
  35151. this.readOnly = null;
  35152. /**
  35153. * @member {string} [DatasourceConnectionInfo.prototype.server]
  35154. * @description 数据库服务器名、文件名或服务地址。
  35155. * 1.对于 SDB 和 UDB 文件,为其文件的绝对路径。注意:当绝对路径的长度超过 UTF-8 编码格式的 260 字节长度,该数据源无法打开。
  35156. * 2.对于 Oracle 数据库,其服务器名为其 TNS 服务名称。
  35157. * 3.对于 SQL Server 数据库,其服务器名为其系统的 DSN(Database Source Name) 名称。
  35158. * 4.对于 PostgreSQL 数据库,其服务器名为 “IP:端口号”,默认的端口号是 5432。
  35159. * 5.对于 DB2 数据库,已经进行了编目,所以不需要进行服务器的设置。
  35160. * 6.对于 Kingbase 数据库,其服务器名为其 IP 地址。
  35161. * 7.对于 GoogleMaps 数据源,其服务器地址,默认设置为 “{@link http://maps.google.com}”,且不可更改。
  35162. * 8.对于 SuperMapCould 数据源,为其服务地址。
  35163. * 9.对于 MAPWORLD 数据源,为其服务地址,默认设置为 “{@link http://www.tianditu.cn}”,且不可更改。
  35164. * 10.对于 OGC 和 REST 数据源,为其服务地址。
  35165. */
  35166. this.server = null;
  35167. /**
  35168. * @member {string} DatasourceConnectionInfo.prototype.user
  35169. * @description 登录数据库的用户名。
  35170. */
  35171. this.user = null;
  35172. if (options) {
  35173. Util_Util.extend(this, options);
  35174. }
  35175. this.CLASS_NAME = "SuperMap.DatasourceConnectionInfo";
  35176. }
  35177. /**
  35178. * @function DatasourceConnectionInfo.prototype.destroy
  35179. * @description 释放资源,将引用资源的属性置空。
  35180. */
  35181. DatasourceConnectionInfo_createClass(DatasourceConnectionInfo, [{
  35182. key: "destroy",
  35183. value: function destroy() {
  35184. var me = this;
  35185. me.alias = null;
  35186. me.connect = null;
  35187. me.dataBase = null;
  35188. me.driver = null;
  35189. me.engineType = null;
  35190. me.exclusive = null;
  35191. me.OpenLinkTable = null;
  35192. me.password = null;
  35193. me.readOnly = null;
  35194. me.server = null;
  35195. me.user = null;
  35196. }
  35197. }]);
  35198. return DatasourceConnectionInfo;
  35199. }();
  35200. ;// CONCATENATED MODULE: ./src/common/iServer/OutputSetting.js
  35201. function OutputSetting_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  35202. 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); } }
  35203. function OutputSetting_createClass(Constructor, protoProps, staticProps) { if (protoProps) OutputSetting_defineProperties(Constructor.prototype, protoProps); if (staticProps) OutputSetting_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  35204. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  35205. * This program are made available under the terms of the Apache License, Version 2.0
  35206. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  35207. /**
  35208. * @class OutputSetting
  35209. * @deprecatedclass SuperMap.OutputSetting
  35210. * @category iServer ProcessingService
  35211. * @classdesc 分布式分析输出类型设置类。
  35212. * @param {Object} options - 参数。
  35213. * @param {DatasourceConnectionInfo} options.datasourceInfo - 数据源连接信息。
  35214. * @param {string} [options.datasetName='analystResult'] - 结果数据集名称。
  35215. * @param {OutputType} [options.type=OutputType.UDB] - 输出类型。
  35216. * @param {string} [options.outputPath] - 分析结果输出路径。
  35217. * @usage
  35218. */
  35219. var OutputSetting = /*#__PURE__*/function () {
  35220. function OutputSetting(options) {
  35221. OutputSetting_classCallCheck(this, OutputSetting);
  35222. /**
  35223. * @member {OutputType} OutputSetting.prototype.type
  35224. * @description 分布式分析的输出类型。
  35225. */
  35226. this.type = OutputType.UDB;
  35227. /**
  35228. * @member {string} [OutputSetting.prototype.datasetName='analystResult']
  35229. * @description 分布式分析的输出结果数据集名称。
  35230. */
  35231. this.datasetName = "analystResult";
  35232. /**
  35233. * @member {DatasourceConnectionInfo} OutputSetting.prototype.datasourceInfo
  35234. * @description 分布式分析的输出结果数据源连接信息。
  35235. */
  35236. this.datasourceInfo = null;
  35237. /**
  35238. * @member {string} [OutputSetting.prototype.outputPath]
  35239. * @description 分布式分析的分析结果输出路径。
  35240. */
  35241. this.outputPath = "";
  35242. Util_Util.extend(this, options);
  35243. this.CLASS_NAME = "SuperMap.OutputSetting";
  35244. }
  35245. /**
  35246. * @function OutputSetting.prototype.destroy
  35247. * @description 释放资源,将引用资源的属性置空。
  35248. */
  35249. OutputSetting_createClass(OutputSetting, [{
  35250. key: "destroy",
  35251. value: function destroy() {
  35252. var me = this;
  35253. me.type = null;
  35254. me.datasetName = null;
  35255. me.outputPath = null;
  35256. if (me.datasourceInfo instanceof DatasourceConnectionInfo) {
  35257. me.datasourceInfo.destroy();
  35258. me.datasourceInfo = null;
  35259. }
  35260. }
  35261. }]);
  35262. return OutputSetting;
  35263. }();
  35264. ;// CONCATENATED MODULE: ./src/common/iServer/MappingParameters.js
  35265. function MappingParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  35266. 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); } }
  35267. function MappingParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) MappingParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) MappingParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  35268. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  35269. * This program are made available under the terms of the Apache License, Version 2.0
  35270. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  35271. /**
  35272. * @class MappingParameters
  35273. * @deprecatedclass SuperMap.MappingParameters
  35274. * @category iServer ProcessingService
  35275. * @classdesc 分析后结果可视化的参数类。
  35276. * @param {Object} options - 参数。
  35277. * @param {Array.<ThemeGridRangeItem>} [options.items] - 栅格分段专题图子项数组。
  35278. * @param {number} [options.numericPrecision=1] - 精度,此字段用于设置分析结果标签专题图中标签数值的精度,如“1”表示精确到小数点的后一位。
  35279. * @param {RangeMode} [options.rangeMode=RangeMode.EQUALINTERVAL] - 专题图分段模式。
  35280. * @param {number} [options.rangeCount] - 专题图分段个数。
  35281. * @param {ColorGradientType} [options.colorGradientType=ColorGradientType.YELLOW_RED] - 专题图颜色渐变模式。
  35282. * @usage
  35283. */
  35284. var MappingParameters = /*#__PURE__*/function () {
  35285. function MappingParameters(options) {
  35286. MappingParameters_classCallCheck(this, MappingParameters);
  35287. /**
  35288. * @member {Array.<ThemeGridRangeItem>} [MappingParameters.prototype.items]
  35289. * @description 栅格分段专题图子项数组。
  35290. */
  35291. this.items = null;
  35292. /**
  35293. * @member {number} [MappingParameters.prototype.numericPrecision=1]
  35294. * @description 精度,此字段用于设置分析结果标签专题图中标签数值的精度,如“1”表示精确到小数点的后一位。
  35295. */
  35296. this.numericPrecision = 1;
  35297. /**
  35298. * @member {RangeMode} [MappingParameters.prototype.RangeMode=RangeMode.EQUALINTERVAL]
  35299. * @description 专题图分段模式。
  35300. */
  35301. this.rangeMode = RangeMode.EQUALINTERVAL;
  35302. /**
  35303. * @member {number} [MappingParameters.prototype.rangeCount]
  35304. * @description 专题图分段个数。
  35305. */
  35306. this.rangeCount = "";
  35307. /**
  35308. * @member {ColorGradientType} [MappingParameters.prototype.colorGradientType=ColorGradientType.YELLOW_RED]
  35309. * @description 专题图颜色渐变模式。
  35310. */
  35311. this.colorGradientType = ColorGradientType.YELLOW_RED;
  35312. Util_Util.extend(this, options);
  35313. this.CLASS_NAME = "SuperMap.MappingParameters";
  35314. }
  35315. /**
  35316. * @function MappingParameters.prototype.destroy
  35317. * @description 释放资源,将引用资源的属性置空。
  35318. */
  35319. MappingParameters_createClass(MappingParameters, [{
  35320. key: "destroy",
  35321. value: function destroy() {
  35322. var me = this;
  35323. if (me.items) {
  35324. if (me.items.length > 0) {
  35325. for (var item in me.items) {
  35326. me.items[item].destroy();
  35327. me.items[item] = null;
  35328. }
  35329. }
  35330. me.items = null;
  35331. }
  35332. me.numericPrecision = null;
  35333. me.rangeMode = null;
  35334. me.rangeCount = null;
  35335. me.colorGradientType = null;
  35336. }
  35337. }]);
  35338. return MappingParameters;
  35339. }();
  35340. ;// CONCATENATED MODULE: ./src/common/iServer/KernelDensityJobParameter.js
  35341. function KernelDensityJobParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  35342. 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); } }
  35343. function KernelDensityJobParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) KernelDensityJobParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) KernelDensityJobParameter_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  35344. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  35345. * This program are made available under the terms of the Apache License, Version 2.0
  35346. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  35347. /**
  35348. * @class KernelDensityJobParameter
  35349. * @deprecatedclass SuperMap.KernelDensityJobParameter
  35350. * @category iServer ProcessingService DensityAnalyst
  35351. * @classdesc 核密度分析服务参数类。
  35352. * @param {Object} options - 参数。
  35353. * @param {string} options.datasetName - 数据集名。
  35354. * @param {string} options.fields - 权重索引。
  35355. * @param {(SuperMap.Bounds|L.Bounds|L.LatLngBounds|ol.extent|mapboxgl.LngLatBounds|GeoJSONObject)} [options.query] - 分析范围(默认为全图范围)。
  35356. * @param {number} [options.resolution=80] - 分辨率。
  35357. * @param {number} [options.method=0] - 分析方法。
  35358. * @param {number} [options.meshType=0] - 分析类型。
  35359. * @param {number} [options.radius=300] - 分析的影响半径。
  35360. * @param {AnalystSizeUnit} [options.meshSizeUnit=AnalystSizeUnit.METER] - 网格大小单位。
  35361. * @param {AnalystSizeUnit} [options.radiusUnit=AnalystSizeUnit.METER] - 搜索半径单位。
  35362. * @param {AnalystAreaUnit} [options.areaUnit=AnalystAreaUnit.SQUAREMILE] - 面积单位。
  35363. * @param {OutputSetting} [options.output] - 输出参数设置。
  35364. * @param {MappingParameters} [options.mappingParameters] - 分析后结果可视化的参数类。
  35365. * @usage
  35366. */
  35367. var KernelDensityJobParameter = /*#__PURE__*/function () {
  35368. function KernelDensityJobParameter(options) {
  35369. KernelDensityJobParameter_classCallCheck(this, KernelDensityJobParameter);
  35370. if (!options) {
  35371. return;
  35372. }
  35373. /**
  35374. * @member {string} KernelDensityJobParameter.prototype.datasetName
  35375. * @description 数据集名。
  35376. */
  35377. this.datasetName = "";
  35378. /**
  35379. * @member {SuperMap.Bounds|L.Bounds|L.LatLngBounds|ol.extent|mapboxgl.LngLatBounds|GeoJSONObject} [KernelDensityJobParameter.prototype.query]
  35380. * @description 分析范围。
  35381. */
  35382. this.query = "";
  35383. /**
  35384. * @member {number} [KernelDensityJobParameter.prototype.resolution=80]
  35385. * @description 网格大小。
  35386. */
  35387. this.resolution = 80;
  35388. /**
  35389. * @member {number} [KernelDensityJobParameter.prototype.method=0]
  35390. * @description 分析方法。
  35391. */
  35392. this.method = 0;
  35393. /**
  35394. * @member {number} [KernelDensityJobParameter.prototype.meshType=0]
  35395. * @description 分析类型。
  35396. */
  35397. this.meshType = 0;
  35398. /**
  35399. * @member {string} KernelDensityJobParameter.prototype.fields
  35400. * @description 权重索引。
  35401. */
  35402. this.fields = "";
  35403. /**
  35404. * @member {number} [KernelDensityJobParameter.prototype.radius=300]
  35405. * @description 分析的影响半径。
  35406. */
  35407. this.radius = 300;
  35408. /**
  35409. * @member {AnalystSizeUnit} [KernelDensityJobParameter.prototype.meshSizeUnit=AnalystSizeUnit.METER]
  35410. * @description 网格大小单位。
  35411. */
  35412. this.meshSizeUnit = AnalystSizeUnit.METER;
  35413. /**
  35414. * @member {AnalystSizeUnit} [KernelDensityJobParameter.prototype.radiusUnit=AnalystSizeUnit.METER]
  35415. * @description 搜索半径单位。
  35416. */
  35417. this.radiusUnit = AnalystSizeUnit.METER;
  35418. /**
  35419. * @member {AnalystAreaUnit} [KernelDensityJobParameter.prototype.areaUnit=AnalystAreaUnit.SQUAREMILE]
  35420. * @description 面积单位。
  35421. */
  35422. this.areaUnit = AnalystAreaUnit.SQUAREMILE;
  35423. /**
  35424. * @member {OutputSetting} KernelDensityJobParameter.prototype.output
  35425. * @description 输出参数设置类。
  35426. */
  35427. this.output = null;
  35428. /**
  35429. * @member {MappingParameters} [KernelDensityJobParameter.prototype.mappingParameters]
  35430. * @description 分析后结果可视化的参数类。
  35431. */
  35432. this.mappingParameters = null;
  35433. Util_Util.extend(this, options);
  35434. this.CLASS_NAME = "SuperMap.KernelDensityJobParameter";
  35435. }
  35436. /**
  35437. * @function KernelDensityJobParameter.prototype.destroy
  35438. * @description 释放资源,将引用资源的属性置空。
  35439. */
  35440. KernelDensityJobParameter_createClass(KernelDensityJobParameter, [{
  35441. key: "destroy",
  35442. value: function destroy() {
  35443. this.datasetName = null;
  35444. this.query = null;
  35445. this.resolution = null;
  35446. this.method = null;
  35447. this.radius = null;
  35448. this.meshType = null;
  35449. this.fields = null;
  35450. this.meshSizeUnit = null;
  35451. this.radiusUnit = null;
  35452. this.areaUnit = null;
  35453. if (this.output instanceof OutputSetting) {
  35454. this.output.destroy();
  35455. this.output = null;
  35456. }
  35457. if (this.mappingParameters instanceof MappingParameters) {
  35458. this.mappingParameters.destroy();
  35459. this.mappingParameters = null;
  35460. }
  35461. }
  35462. /**
  35463. * @function KernelDensityJobParameter.toObject
  35464. * @param {KernelDensityJobParameter} kernelDensityJobParameter - 核密度分析服务参数类。
  35465. * @param {KernelDensityJobParameter} tempObj - 核密度分析服务参数对象。
  35466. * @description 将核密度分析服务参数对象转换为 JSON 对象。
  35467. * @returns JSON 对象。
  35468. */
  35469. }], [{
  35470. key: "toObject",
  35471. value: function toObject(kernelDensityJobParameter, tempObj) {
  35472. for (var name in kernelDensityJobParameter) {
  35473. if (name === "datasetName") {
  35474. tempObj['input'] = tempObj['input'] || {};
  35475. tempObj['input'][name] = kernelDensityJobParameter[name];
  35476. continue;
  35477. }
  35478. if (name === "output") {
  35479. tempObj['output'] = tempObj['output'] || {};
  35480. tempObj['output'] = kernelDensityJobParameter[name];
  35481. continue;
  35482. }
  35483. tempObj['analyst'] = tempObj['analyst'] || {};
  35484. if (name === 'query' && kernelDensityJobParameter[name]) {
  35485. tempObj['analyst'][name] = kernelDensityJobParameter[name].toBBOX();
  35486. } else {
  35487. tempObj['analyst'][name] = kernelDensityJobParameter[name];
  35488. }
  35489. if (name === 'mappingParameters') {
  35490. tempObj['analyst'][name] = tempObj['analyst'][name] || {};
  35491. tempObj['analyst']['mappingParameters'] = kernelDensityJobParameter[name];
  35492. }
  35493. }
  35494. }
  35495. }]);
  35496. return KernelDensityJobParameter;
  35497. }();
  35498. ;// CONCATENATED MODULE: ./src/common/iServer/KernelDensityJobsService.js
  35499. function KernelDensityJobsService_typeof(obj) { "@babel/helpers - typeof"; return KernelDensityJobsService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, KernelDensityJobsService_typeof(obj); }
  35500. function KernelDensityJobsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  35501. 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); } }
  35502. function KernelDensityJobsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) KernelDensityJobsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) KernelDensityJobsService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  35503. function KernelDensityJobsService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { KernelDensityJobsService_get = Reflect.get.bind(); } else { KernelDensityJobsService_get = function _get(target, property, receiver) { var base = KernelDensityJobsService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return KernelDensityJobsService_get.apply(this, arguments); }
  35504. function KernelDensityJobsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = KernelDensityJobsService_getPrototypeOf(object); if (object === null) break; } return object; }
  35505. function KernelDensityJobsService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) KernelDensityJobsService_setPrototypeOf(subClass, superClass); }
  35506. function KernelDensityJobsService_setPrototypeOf(o, p) { KernelDensityJobsService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return KernelDensityJobsService_setPrototypeOf(o, p); }
  35507. 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); }; }
  35508. function KernelDensityJobsService_possibleConstructorReturn(self, call) { if (call && (KernelDensityJobsService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return KernelDensityJobsService_assertThisInitialized(self); }
  35509. function KernelDensityJobsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  35510. function KernelDensityJobsService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  35511. function KernelDensityJobsService_getPrototypeOf(o) { KernelDensityJobsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return KernelDensityJobsService_getPrototypeOf(o); }
  35512. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  35513. * This program are made available under the terms of the Apache License, Version 2.0
  35514. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  35515. /**
  35516. * @class KernelDensityJobsService
  35517. * @deprecatedclass SuperMap.KernelDensityJobsService
  35518. * @category iServer ProcessingService DensityAnalyst
  35519. * @classdesc 核密度分析服务类
  35520. * @extends {ProcessingServiceBase}
  35521. * @param {string} url - 服务地址。
  35522. * @param {Object} options - 可选参数。
  35523. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  35524. * @param {Object} [options.headers] - 请求头。
  35525. * @usage
  35526. */
  35527. var KernelDensityJobsService = /*#__PURE__*/function (_ProcessingServiceBas) {
  35528. KernelDensityJobsService_inherits(KernelDensityJobsService, _ProcessingServiceBas);
  35529. var _super = KernelDensityJobsService_createSuper(KernelDensityJobsService);
  35530. function KernelDensityJobsService(url, options) {
  35531. var _this;
  35532. KernelDensityJobsService_classCallCheck(this, KernelDensityJobsService);
  35533. _this = _super.call(this, url, options);
  35534. _this.url = Util_Util.urlPathAppend(_this.url, 'spatialanalyst/density');
  35535. _this.CLASS_NAME = "SuperMap.KernelDensityJobsService";
  35536. return _this;
  35537. }
  35538. /**
  35539. * @function KernelDensityJobsService.prototype.destroy
  35540. * @override
  35541. */
  35542. KernelDensityJobsService_createClass(KernelDensityJobsService, [{
  35543. key: "destroy",
  35544. value: function destroy() {
  35545. KernelDensityJobsService_get(KernelDensityJobsService_getPrototypeOf(KernelDensityJobsService.prototype), "destroy", this).call(this);
  35546. }
  35547. /**
  35548. * @function KernelDensityJobsService.prototype.getKernelDensityJobs
  35549. * @description 获取核密度分析任务
  35550. */
  35551. }, {
  35552. key: "getKernelDensityJobs",
  35553. value: function getKernelDensityJobs() {
  35554. KernelDensityJobsService_get(KernelDensityJobsService_getPrototypeOf(KernelDensityJobsService.prototype), "getJobs", this).call(this, this.url);
  35555. }
  35556. /**
  35557. * @function KernelDensityJobsService.prototype.getKernelDensityJobs
  35558. * @description 获取指定id的核密度分析服务
  35559. * @param {string} id - 指定要获取数据的id
  35560. */
  35561. }, {
  35562. key: "getKernelDensityJob",
  35563. value: function getKernelDensityJob(id) {
  35564. KernelDensityJobsService_get(KernelDensityJobsService_getPrototypeOf(KernelDensityJobsService.prototype), "getJobs", this).call(this, Util_Util.urlPathAppend(this.url, id));
  35565. }
  35566. /**
  35567. * @function KernelDensityJobsService.prototype.addKernelDensityJob
  35568. * @description 新建核密度分析服务
  35569. * @param {KernelDensityJobParameter} params - 核密度分析服务参数类。
  35570. * @param {number} seconds - 开始创建后,获取创建成功结果的时间间隔。
  35571. */
  35572. }, {
  35573. key: "addKernelDensityJob",
  35574. value: function addKernelDensityJob(params, seconds) {
  35575. KernelDensityJobsService_get(KernelDensityJobsService_getPrototypeOf(KernelDensityJobsService.prototype), "addJob", this).call(this, this.url, params, KernelDensityJobParameter, seconds);
  35576. }
  35577. }]);
  35578. return KernelDensityJobsService;
  35579. }(ProcessingServiceBase);
  35580. ;// CONCATENATED MODULE: ./src/common/iServer/SingleObjectQueryJobsParameter.js
  35581. function SingleObjectQueryJobsParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  35582. 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); } }
  35583. function SingleObjectQueryJobsParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) SingleObjectQueryJobsParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) SingleObjectQueryJobsParameter_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  35584. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  35585. * This program are made available under the terms of the Apache License, Version 2.0
  35586. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  35587. /**
  35588. * @class SingleObjectQueryJobsParameter
  35589. * @deprecatedclass SuperMap.SingleObjectQueryJobsParameter
  35590. * @category iServer ProcessingService Query
  35591. * @classdesc 单对象空间查询分析任务参数类。
  35592. * @param {Object} options - 参数。
  35593. * @param {string} options.datasetName - 数据集名。
  35594. * @param {string} options.datasetQuery - 查询对象所在的数据集名称。
  35595. * @param {SpatialQueryMode} [options.mode=SpatialQueryMode.CONTAIN] - 空间查询模式。
  35596. * @param {OutputSetting} [options.output] - 输出参数设置。
  35597. * @param {MappingParameters} [options.mappingParameters] - 分析后结果可视化的参数类。
  35598. * @usage
  35599. */
  35600. var SingleObjectQueryJobsParameter = /*#__PURE__*/function () {
  35601. function SingleObjectQueryJobsParameter(options) {
  35602. SingleObjectQueryJobsParameter_classCallCheck(this, SingleObjectQueryJobsParameter);
  35603. if (!options) {
  35604. return;
  35605. }
  35606. /**
  35607. * @member {string} SingleObjectQueryJobsParameter.prototype.datasetName
  35608. * @description 数据集名。
  35609. */
  35610. this.datasetName = "";
  35611. /**
  35612. * @member {string} SingleObjectQueryJobsParameter.prototype.datasetQuery
  35613. * @description 查询对象所在的数据集名称。
  35614. */
  35615. this.datasetQuery = "";
  35616. /**
  35617. * @member {string} SingleObjectQueryJobsParameter.prototype.geometryQuery
  35618. * @description 查询对象所在的几何对象。
  35619. */
  35620. this.geometryQuery = "";
  35621. /**
  35622. * @member {SpatialQueryMode} [SingleObjectQueryJobsParameter.prototype.mode=SpatialQueryMode.CONTAIN]
  35623. * @description 空间查询模式 。
  35624. */
  35625. this.mode = SpatialQueryMode.CONTAIN;
  35626. /**
  35627. * @member {OutputSetting} [SingleObjectQueryJobsParameter.prototype.output]
  35628. * @description 输出参数设置类。
  35629. */
  35630. this.output = null;
  35631. /**
  35632. * @member {MappingParameters} [SingleObjectQueryJobsParameter.prototype.mappingParameters]
  35633. * @description 分析后结果可视化的参数类。
  35634. */
  35635. this.mappingParameters = null;
  35636. Util_Util.extend(this, options);
  35637. this.CLASS_NAME = "SuperMap.SingleObjectQueryJobsParameter";
  35638. }
  35639. /**
  35640. * @function SingleObjectQueryJobsParameter.prototype.destroy
  35641. * @description 释放资源,将引用资源的属性置空。
  35642. */
  35643. SingleObjectQueryJobsParameter_createClass(SingleObjectQueryJobsParameter, [{
  35644. key: "destroy",
  35645. value: function destroy() {
  35646. this.datasetName = null;
  35647. this.datasetQuery = null;
  35648. this.geometryQuery = null;
  35649. this.mode = null;
  35650. if (this.output instanceof OutputSetting) {
  35651. this.output.destroy();
  35652. this.output = null;
  35653. }
  35654. if (this.mappingParameters instanceof MappingParameters) {
  35655. this.mappingParameters.destroy();
  35656. this.mappingParameters = null;
  35657. }
  35658. }
  35659. /**
  35660. * @function SingleObjectQueryJobsParameter.toObject
  35661. * @param {Object} singleObjectQueryJobsParameter - 单对象空间查询分析任务参数。
  35662. * @param {Object} tempObj - 目标对象。
  35663. * @description 生成单对象空间查询分析任务对象。
  35664. */
  35665. }], [{
  35666. key: "toObject",
  35667. value: function toObject(singleObjectQueryJobsParameter, tempObj) {
  35668. for (var name in singleObjectQueryJobsParameter) {
  35669. if (name === "datasetName") {
  35670. tempObj['input'] = tempObj['input'] || {};
  35671. tempObj['input'][name] = singleObjectQueryJobsParameter[name];
  35672. continue;
  35673. }
  35674. if (name === "output") {
  35675. tempObj['output'] = tempObj['output'] || {};
  35676. tempObj['output'] = singleObjectQueryJobsParameter[name];
  35677. continue;
  35678. }
  35679. tempObj['analyst'] = tempObj['analyst'] || {};
  35680. tempObj['analyst'][name] = singleObjectQueryJobsParameter[name];
  35681. if (name === 'mappingParameters') {
  35682. tempObj['analyst'][name] = tempObj['analyst'][name] || {};
  35683. tempObj['analyst']['mappingParameters'] = singleObjectQueryJobsParameter[name];
  35684. }
  35685. }
  35686. }
  35687. }]);
  35688. return SingleObjectQueryJobsParameter;
  35689. }();
  35690. ;// CONCATENATED MODULE: ./src/common/iServer/SingleObjectQueryJobsService.js
  35691. function SingleObjectQueryJobsService_typeof(obj) { "@babel/helpers - typeof"; return SingleObjectQueryJobsService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, SingleObjectQueryJobsService_typeof(obj); }
  35692. function SingleObjectQueryJobsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  35693. 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); } }
  35694. function SingleObjectQueryJobsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) SingleObjectQueryJobsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) SingleObjectQueryJobsService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  35695. function SingleObjectQueryJobsService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { SingleObjectQueryJobsService_get = Reflect.get.bind(); } else { SingleObjectQueryJobsService_get = function _get(target, property, receiver) { var base = SingleObjectQueryJobsService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return SingleObjectQueryJobsService_get.apply(this, arguments); }
  35696. function SingleObjectQueryJobsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SingleObjectQueryJobsService_getPrototypeOf(object); if (object === null) break; } return object; }
  35697. function SingleObjectQueryJobsService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) SingleObjectQueryJobsService_setPrototypeOf(subClass, superClass); }
  35698. function SingleObjectQueryJobsService_setPrototypeOf(o, p) { SingleObjectQueryJobsService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SingleObjectQueryJobsService_setPrototypeOf(o, p); }
  35699. 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); }; }
  35700. function SingleObjectQueryJobsService_possibleConstructorReturn(self, call) { if (call && (SingleObjectQueryJobsService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return SingleObjectQueryJobsService_assertThisInitialized(self); }
  35701. function SingleObjectQueryJobsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  35702. function SingleObjectQueryJobsService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  35703. function SingleObjectQueryJobsService_getPrototypeOf(o) { SingleObjectQueryJobsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SingleObjectQueryJobsService_getPrototypeOf(o); }
  35704. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  35705. * This program are made available under the terms of the Apache License, Version 2.0
  35706. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  35707. /**
  35708. * @class SingleObjectQueryJobsService
  35709. * @deprecatedclass SuperMap.SingleObjectQueryJobsService
  35710. * @category iServer ProcessingService Query
  35711. * @classdesc 单对象查询分析服务类
  35712. * @extends {ProcessingServiceBase}
  35713. * @param {string} url - 服务地址。
  35714. * @param {Object} options - 可选参数。
  35715. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  35716. * @param {Object} [options.headers] - 请求头。
  35717. * @usage
  35718. */
  35719. var SingleObjectQueryJobsService = /*#__PURE__*/function (_ProcessingServiceBas) {
  35720. SingleObjectQueryJobsService_inherits(SingleObjectQueryJobsService, _ProcessingServiceBas);
  35721. var _super = SingleObjectQueryJobsService_createSuper(SingleObjectQueryJobsService);
  35722. function SingleObjectQueryJobsService(url, options) {
  35723. var _this;
  35724. SingleObjectQueryJobsService_classCallCheck(this, SingleObjectQueryJobsService);
  35725. _this = _super.call(this, url, options);
  35726. _this.url = Util_Util.urlPathAppend(_this.url, 'spatialanalyst/query');
  35727. _this.CLASS_NAME = 'SuperMap.SingleObjectQueryJobsService';
  35728. return _this;
  35729. }
  35730. /**
  35731. *@override
  35732. */
  35733. SingleObjectQueryJobsService_createClass(SingleObjectQueryJobsService, [{
  35734. key: "destroy",
  35735. value: function destroy() {
  35736. SingleObjectQueryJobsService_get(SingleObjectQueryJobsService_getPrototypeOf(SingleObjectQueryJobsService.prototype), "destroy", this).call(this);
  35737. }
  35738. /**
  35739. * @function SingleObjectQueryJobsService.protitype.getQueryJobs
  35740. * @description 获取单对象空间查询分析所有任务
  35741. */
  35742. }, {
  35743. key: "getQueryJobs",
  35744. value: function getQueryJobs() {
  35745. SingleObjectQueryJobsService_get(SingleObjectQueryJobsService_getPrototypeOf(SingleObjectQueryJobsService.prototype), "getJobs", this).call(this, this.url);
  35746. }
  35747. /**
  35748. * @function KernelDensityJobsService.protitype.getQueryJob
  35749. * @description 获取指定id的单对象空间查询分析服务
  35750. * @param {string} id - 指定要获取数据的id
  35751. */
  35752. }, {
  35753. key: "getQueryJob",
  35754. value: function getQueryJob(id) {
  35755. SingleObjectQueryJobsService_get(SingleObjectQueryJobsService_getPrototypeOf(SingleObjectQueryJobsService.prototype), "getJobs", this).call(this, Util_Util.urlPathAppend(this.url, id));
  35756. }
  35757. /**
  35758. * @function SingleObjectQueryJobsService.protitype.addQueryJob
  35759. * @description 新建单对象空间查询分析服务
  35760. * @param {SingleObjectQueryJobsParameter} params - 创建一个空间分析的请求参数。
  35761. * @param {number} seconds - 开始创建后,获取创建成功结果的时间间隔。
  35762. */
  35763. }, {
  35764. key: "addQueryJob",
  35765. value: function addQueryJob(params, seconds) {
  35766. SingleObjectQueryJobsService_get(SingleObjectQueryJobsService_getPrototypeOf(SingleObjectQueryJobsService.prototype), "addJob", this).call(this, this.url, params, SingleObjectQueryJobsParameter, seconds);
  35767. }
  35768. }]);
  35769. return SingleObjectQueryJobsService;
  35770. }(ProcessingServiceBase);
  35771. ;// CONCATENATED MODULE: ./src/common/iServer/SummaryMeshJobParameter.js
  35772. function SummaryMeshJobParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  35773. 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); } }
  35774. function SummaryMeshJobParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) SummaryMeshJobParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) SummaryMeshJobParameter_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  35775. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  35776. * This program are made available under the terms of the Apache License, Version 2.0
  35777. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  35778. /**
  35779. * @class SummaryMeshJobParameter
  35780. * @deprecatedclass SuperMap.SummaryMeshJobParameter
  35781. * @category iServer ProcessingService AggregatePoints
  35782. * @classdesc 点聚合分析任务参数类。
  35783. * @param {Object} options - 参数。
  35784. * @param {string} options.datasetName - 数据集名。
  35785. * @param {string} [options.regionDataset ] - 聚合面数据集(聚合类型为多边形聚合时使用的参数)
  35786. * @param {(SuperMap.Bounds|L.Bounds|L.LatLngBounds|ol.extent|mapboxgl.LngLatBounds|GeoJSONObject)} [options.query] - 分析范围(默认为全图范围)。
  35787. * @param {number} options.fields - 权重索引。
  35788. * @param {number} [options.resolution=100] - 分辨率。
  35789. * @param {StatisticAnalystMode} [options.statisticModes=StatisticAnalystMode.AVERAGE] - 分析模式。
  35790. * @param {number} [options.meshType=0] - 分析类型。
  35791. * @param {SummaryType} [options.type=SummaryType.SUMMARYMESH] - 聚合类型。
  35792. * @param {OutputSetting} [options.output] - 输出参数设置。
  35793. * @param {MappingParameters} [options.mappingParameters] - 分析后结果可视化的参数类。
  35794. * @usage
  35795. */
  35796. var SummaryMeshJobParameter = /*#__PURE__*/function () {
  35797. function SummaryMeshJobParameter(options) {
  35798. SummaryMeshJobParameter_classCallCheck(this, SummaryMeshJobParameter);
  35799. if (!options) {
  35800. return;
  35801. }
  35802. /**
  35803. * @member {string} SummaryMeshJobParameter.prototype.datasetName
  35804. * @description 数据集名。
  35805. */
  35806. this.datasetName = "";
  35807. /**
  35808. * @member {string} SummaryMeshJobParameter.prototype.regionDataset
  35809. * @description 聚合面数据集(聚合类型为多边形聚合时使用的参数)。
  35810. */
  35811. this.regionDataset = "";
  35812. /**
  35813. * @member {(SuperMap.Bounds|L.Bounds|L.LatLngBounds|ol.extent|mapboxgl.LngLatBounds|GeoJSONObject)} SummaryMeshJobParameter.prototype.query
  35814. * @description 分析范围(聚合类型为网格面聚合时使用的参数)。
  35815. */
  35816. this.query = "";
  35817. /**
  35818. * @member {number} [SummaryMeshJobParameter.prototype.resolution=100]
  35819. * @description 分辨率(聚合类型为网格面聚合时使用的参数)。
  35820. */
  35821. this.resolution = 100;
  35822. /**
  35823. * @member {number} [SummaryMeshJobParameter.prototype.meshType=0]
  35824. * @description 网格面类型(聚合类型为网格面聚合时使用的参数),取值:0 或 1。
  35825. */
  35826. this.meshType = 0;
  35827. /**
  35828. * @member {StatisticAnalystMode} [SummaryMeshJobParameter.prototype.statisticModes=StatisticAnalystMode.AVERAGE]
  35829. * @description 统计模式。
  35830. */
  35831. this.statisticModes = StatisticAnalystMode.AVERAGE;
  35832. /**
  35833. * @member {number} SummaryMeshJobParameter.prototype.fields
  35834. * @description 权重字段。
  35835. */
  35836. this.fields = "";
  35837. /**
  35838. * @member {SummaryType} [SummaryMeshJobParameter.prototype.type=SummaryType.SUMMARYMESH]
  35839. * @description 聚合类型。
  35840. */
  35841. this.type = SummaryType.SUMMARYMESH;
  35842. /**
  35843. * @member {OutputSetting} [SummaryMeshJobParameter.prototype.output]
  35844. * @description 输出参数设置类。
  35845. */
  35846. this.output = null;
  35847. /**
  35848. * @member {MappingParameters} [SummaryMeshJobParameter.prototype.mappingParameters]
  35849. * @description 分析后结果可视化的参数类。
  35850. */
  35851. this.mappingParameters = null;
  35852. Util_Util.extend(this, options);
  35853. this.CLASS_NAME = "SuperMap.SummaryMeshJobParameter";
  35854. }
  35855. /**
  35856. * @function SummaryMeshJobParameter.prototype.destroy
  35857. * @description 释放资源,将资源的属性置空。
  35858. */
  35859. SummaryMeshJobParameter_createClass(SummaryMeshJobParameter, [{
  35860. key: "destroy",
  35861. value: function destroy() {
  35862. this.datasetName = null;
  35863. this.query = null;
  35864. this.resolution = null;
  35865. this.statisticModes = null;
  35866. this.meshType = null;
  35867. this.fields = null;
  35868. this.regionDataset = null;
  35869. this.type = null;
  35870. if (this.output instanceof OutputSetting) {
  35871. this.output.destroy();
  35872. this.output = null;
  35873. }
  35874. if (this.mappingParameters instanceof MappingParameters) {
  35875. this.mappingParameters.destroy();
  35876. this.mappingParameters = null;
  35877. }
  35878. }
  35879. /**
  35880. * @function SummaryMeshJobParameter.toObject
  35881. * @param {Object} summaryMeshJobParameter - 点聚合分析任务参数。
  35882. * @param {Object} tempObj - 目标对象。
  35883. * @description 生成点聚合分析任务对象。
  35884. */
  35885. }], [{
  35886. key: "toObject",
  35887. value: function toObject(summaryMeshJobParameter, tempObj) {
  35888. for (var name in summaryMeshJobParameter) {
  35889. if (name === "datasetName") {
  35890. tempObj['input'] = tempObj['input'] || {};
  35891. tempObj['input'][name] = summaryMeshJobParameter[name];
  35892. continue;
  35893. }
  35894. if (name === "type") {
  35895. tempObj['type'] = summaryMeshJobParameter[name];
  35896. continue;
  35897. }
  35898. if (name === "output") {
  35899. tempObj['output'] = tempObj['output'] || {};
  35900. tempObj['output'] = summaryMeshJobParameter[name];
  35901. continue;
  35902. }
  35903. if (summaryMeshJobParameter.type === 'SUMMARYMESH' && name !== 'regionDataset' || summaryMeshJobParameter.type === 'SUMMARYREGION' && !contains(['meshType', 'resolution', 'query'], name)) {
  35904. tempObj['analyst'] = tempObj['analyst'] || {};
  35905. if (name === 'query' && summaryMeshJobParameter[name]) {
  35906. tempObj['analyst'][name] = summaryMeshJobParameter[name].toBBOX();
  35907. } else {
  35908. tempObj['analyst'][name] = summaryMeshJobParameter[name];
  35909. }
  35910. if (name === 'mappingParameters') {
  35911. tempObj['analyst'][name] = tempObj['analyst'][name] || {};
  35912. tempObj['analyst']['mappingParameters'] = summaryMeshJobParameter[name];
  35913. }
  35914. }
  35915. }
  35916. function contains(arr, obj) {
  35917. var i = arr.length;
  35918. while (i--) {
  35919. if (arr[i] === obj) {
  35920. return true;
  35921. }
  35922. }
  35923. return false;
  35924. }
  35925. }
  35926. }]);
  35927. return SummaryMeshJobParameter;
  35928. }();
  35929. ;// CONCATENATED MODULE: ./src/common/iServer/SummaryMeshJobsService.js
  35930. function SummaryMeshJobsService_typeof(obj) { "@babel/helpers - typeof"; return SummaryMeshJobsService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, SummaryMeshJobsService_typeof(obj); }
  35931. function SummaryMeshJobsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  35932. 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); } }
  35933. function SummaryMeshJobsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) SummaryMeshJobsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) SummaryMeshJobsService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  35934. function SummaryMeshJobsService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { SummaryMeshJobsService_get = Reflect.get.bind(); } else { SummaryMeshJobsService_get = function _get(target, property, receiver) { var base = SummaryMeshJobsService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return SummaryMeshJobsService_get.apply(this, arguments); }
  35935. function SummaryMeshJobsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SummaryMeshJobsService_getPrototypeOf(object); if (object === null) break; } return object; }
  35936. function SummaryMeshJobsService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) SummaryMeshJobsService_setPrototypeOf(subClass, superClass); }
  35937. function SummaryMeshJobsService_setPrototypeOf(o, p) { SummaryMeshJobsService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SummaryMeshJobsService_setPrototypeOf(o, p); }
  35938. 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); }; }
  35939. function SummaryMeshJobsService_possibleConstructorReturn(self, call) { if (call && (SummaryMeshJobsService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return SummaryMeshJobsService_assertThisInitialized(self); }
  35940. function SummaryMeshJobsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  35941. function SummaryMeshJobsService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  35942. function SummaryMeshJobsService_getPrototypeOf(o) { SummaryMeshJobsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SummaryMeshJobsService_getPrototypeOf(o); }
  35943. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  35944. * This program are made available under the terms of the Apache License, Version 2.0
  35945. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  35946. /**
  35947. * @class SummaryMeshJobsService
  35948. * @deprecatedclass SuperMap.SummaryMeshJobsService
  35949. * @category iServer ProcessingService AggregatePoints
  35950. * @classdesc 点聚合分析任务类。
  35951. * @param {string} url - 服务地址。
  35952. * @param {Object} options - 参数。
  35953. * @param {Events} options.events - 处理所有事件的对象。
  35954. * @param {Object} [options.eventListeners] - 事件监听器对象。有 processCompleted 属性可传入处理完成后的回调函数。processFailed 属性传入处理失败后的回调函数。
  35955. * @param {number} options.index - 服务地址在数组中的位置。
  35956. * @param {number} options.length - 服务地址数组长度。
  35957. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  35958. * @param {Object} [options.headers] - 请求头。
  35959. * @usage
  35960. */
  35961. var SummaryMeshJobsService = /*#__PURE__*/function (_ProcessingServiceBas) {
  35962. SummaryMeshJobsService_inherits(SummaryMeshJobsService, _ProcessingServiceBas);
  35963. var _super = SummaryMeshJobsService_createSuper(SummaryMeshJobsService);
  35964. function SummaryMeshJobsService(url, options) {
  35965. var _this;
  35966. SummaryMeshJobsService_classCallCheck(this, SummaryMeshJobsService);
  35967. _this = _super.call(this, url, options);
  35968. _this.url = Util_Util.urlPathAppend(_this.url, 'spatialanalyst/aggregatepoints');
  35969. _this.CLASS_NAME = 'SuperMap.SummaryMeshJobsService';
  35970. return _this;
  35971. }
  35972. /**
  35973. * @override
  35974. */
  35975. SummaryMeshJobsService_createClass(SummaryMeshJobsService, [{
  35976. key: "destroy",
  35977. value: function destroy() {
  35978. SummaryMeshJobsService_get(SummaryMeshJobsService_getPrototypeOf(SummaryMeshJobsService.prototype), "destroy", this).call(this);
  35979. }
  35980. /**
  35981. * @function SummaryMeshJobsService.prototype.getSummaryMeshJobs
  35982. * @description 获取点聚合分析任务
  35983. */
  35984. }, {
  35985. key: "getSummaryMeshJobs",
  35986. value: function getSummaryMeshJobs() {
  35987. SummaryMeshJobsService_get(SummaryMeshJobsService_getPrototypeOf(SummaryMeshJobsService.prototype), "getJobs", this).call(this, this.url);
  35988. }
  35989. /**
  35990. * @function SummaryMeshJobsService.prototype.getSummaryMeshJob
  35991. * @description 获取指定ip的点聚合分析任务
  35992. * @param {string} id - 指定要获取数据的id
  35993. */
  35994. }, {
  35995. key: "getSummaryMeshJob",
  35996. value: function getSummaryMeshJob(id) {
  35997. SummaryMeshJobsService_get(SummaryMeshJobsService_getPrototypeOf(SummaryMeshJobsService.prototype), "getJobs", this).call(this, Util_Util.urlPathAppend(this.url, id));
  35998. }
  35999. /**
  36000. * @function SummaryMeshJobsService.prototype.addSummaryMeshJob
  36001. * @description 新建点聚合分析服务
  36002. * @param {SummaryMeshJobParameter} params - 创建一个空间分析的请求参数。
  36003. * @param {number} seconds - 开始创建后,获取创建成功结果的时间间隔。
  36004. */
  36005. }, {
  36006. key: "addSummaryMeshJob",
  36007. value: function addSummaryMeshJob(params, seconds) {
  36008. SummaryMeshJobsService_get(SummaryMeshJobsService_getPrototypeOf(SummaryMeshJobsService.prototype), "addJob", this).call(this, this.url, params, SummaryMeshJobParameter, seconds);
  36009. }
  36010. }]);
  36011. return SummaryMeshJobsService;
  36012. }(ProcessingServiceBase);
  36013. ;// CONCATENATED MODULE: ./src/common/iServer/VectorClipJobsParameter.js
  36014. function VectorClipJobsParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  36015. 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); } }
  36016. function VectorClipJobsParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) VectorClipJobsParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) VectorClipJobsParameter_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  36017. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  36018. * This program are made available under the terms of the Apache License, Version 2.0
  36019. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  36020. /**
  36021. * @class VectorClipJobsParameter
  36022. * @deprecatedclass SuperMap.VectorClipJobsParameter
  36023. * @category iServer ProcessingService VectorClip
  36024. * @classdesc 矢量裁剪分析任务参数类。
  36025. * @param {Object} options - 参数。
  36026. * @param {string} options.datasetName - 数据集名。
  36027. * @param {string} options.datasetOverlay - 裁剪对象数据集。
  36028. * @param {ClipAnalystMode} [options.mode=ClipAnalystMode.CLIP] - 裁剪分析模式。
  36029. * @param {string} [options.geometryClip] - 裁剪几何对象。
  36030. * @param {OutputSetting} [options.output] - 输出参数设置。
  36031. * @param {MappingParameters} [options.mappingParameters] - 分析后结果可视化的参数类。
  36032. * @usage
  36033. */
  36034. var VectorClipJobsParameter = /*#__PURE__*/function () {
  36035. function VectorClipJobsParameter(options) {
  36036. VectorClipJobsParameter_classCallCheck(this, VectorClipJobsParameter);
  36037. options = options || {};
  36038. /**
  36039. * @member {string} VectorClipJobsParameter.prototype.datasetName
  36040. * @description 数据集名。
  36041. */
  36042. this.datasetName = "";
  36043. /**
  36044. * @member {string} VectorClipJobsParameter.prototype.datasetOverlay
  36045. * @description 裁剪对象数据集。
  36046. */
  36047. this.datasetVectorClip = "";
  36048. /**
  36049. * @member {string} VectorClipJobsParameter.prototype.geometryClip
  36050. * @description 裁剪几何对象。
  36051. */
  36052. this.geometryClip = "";
  36053. /**
  36054. * @member {ClipAnalystMode} [VectorClipJobsParameter.prototype.mode=ClipAnalystMode.CLIP]
  36055. * @description 裁剪分析模式 。
  36056. */
  36057. this.mode = ClipAnalystMode.CLIP;
  36058. /**
  36059. * @member {OutputSetting} VectorClipJobsParameter.prototype.output
  36060. * @description 输出参数设置类。
  36061. */
  36062. this.output = null;
  36063. /**
  36064. * @member {MappingParameters} [VectorClipJobsParameter.prototype.mappingParameters]
  36065. * @description 分析后结果可视化的参数类。
  36066. */
  36067. this.mappingParameters = null;
  36068. Util_Util.extend(this, options);
  36069. this.CLASS_NAME = "SuperMap.VectorClipJobsParameter";
  36070. }
  36071. /**
  36072. * @function VectorClipJobsParameter.prototype.destroy
  36073. * @description 释放资源,将引用资源的属性置空。
  36074. */
  36075. VectorClipJobsParameter_createClass(VectorClipJobsParameter, [{
  36076. key: "destroy",
  36077. value: function destroy() {
  36078. this.datasetName = null;
  36079. this.datasetVectorClip = null;
  36080. this.geometryClip = null;
  36081. this.mode = null;
  36082. if (this.output instanceof OutputSetting) {
  36083. this.output.destroy();
  36084. this.output = null;
  36085. }
  36086. if (this.mappingParameters instanceof MappingParameters) {
  36087. this.mappingParameters.destroy();
  36088. this.mappingParameters = null;
  36089. }
  36090. }
  36091. /**
  36092. * @function VectorClipJobsParameter.toObject
  36093. * @param {Object} vectorClipJobsParameter - 区域汇总分析服务参数。
  36094. * @param {Object} tempObj - 目标对象。
  36095. * @description 矢量裁剪分析任务对象。
  36096. */
  36097. }], [{
  36098. key: "toObject",
  36099. value: function toObject(vectorClipJobsParameter, tempObj) {
  36100. for (var name in vectorClipJobsParameter) {
  36101. if (name === "datasetName") {
  36102. tempObj['input'] = tempObj['input'] || {};
  36103. tempObj['input'][name] = vectorClipJobsParameter[name];
  36104. continue;
  36105. }
  36106. if (name === "output") {
  36107. tempObj['output'] = tempObj['output'] || {};
  36108. tempObj['output'] = vectorClipJobsParameter[name];
  36109. continue;
  36110. }
  36111. tempObj['analyst'] = tempObj['analyst'] || {};
  36112. tempObj['analyst'][name] = vectorClipJobsParameter[name];
  36113. if (name === 'mappingParameters') {
  36114. tempObj['analyst'][name] = tempObj['analyst'][name] || {};
  36115. tempObj['analyst']['mappingParameters'] = vectorClipJobsParameter[name];
  36116. }
  36117. }
  36118. }
  36119. }]);
  36120. return VectorClipJobsParameter;
  36121. }();
  36122. ;// CONCATENATED MODULE: ./src/common/iServer/VectorClipJobsService.js
  36123. function VectorClipJobsService_typeof(obj) { "@babel/helpers - typeof"; return VectorClipJobsService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, VectorClipJobsService_typeof(obj); }
  36124. function VectorClipJobsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  36125. 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); } }
  36126. function VectorClipJobsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) VectorClipJobsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) VectorClipJobsService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  36127. function VectorClipJobsService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { VectorClipJobsService_get = Reflect.get.bind(); } else { VectorClipJobsService_get = function _get(target, property, receiver) { var base = VectorClipJobsService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return VectorClipJobsService_get.apply(this, arguments); }
  36128. function VectorClipJobsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = VectorClipJobsService_getPrototypeOf(object); if (object === null) break; } return object; }
  36129. function VectorClipJobsService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) VectorClipJobsService_setPrototypeOf(subClass, superClass); }
  36130. function VectorClipJobsService_setPrototypeOf(o, p) { VectorClipJobsService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return VectorClipJobsService_setPrototypeOf(o, p); }
  36131. 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); }; }
  36132. function VectorClipJobsService_possibleConstructorReturn(self, call) { if (call && (VectorClipJobsService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return VectorClipJobsService_assertThisInitialized(self); }
  36133. function VectorClipJobsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  36134. function VectorClipJobsService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  36135. function VectorClipJobsService_getPrototypeOf(o) { VectorClipJobsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return VectorClipJobsService_getPrototypeOf(o); }
  36136. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  36137. * This program are made available under the terms of the Apache License, Version 2.0
  36138. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  36139. /**
  36140. * @class VectorClipJobsService
  36141. * @deprecatedclass SuperMap.VectorClipJobsService
  36142. * @category iServer ProcessingService VectorClip
  36143. * @classdesc 矢量裁剪分析服务类
  36144. * @extends {ProcessingServiceBase}
  36145. * @param {string} url -服务地址。
  36146. * @param {Object} options - 可选参数。
  36147. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  36148. * @param {Object} [options.headers] - 请求头。
  36149. * @usage
  36150. */
  36151. var VectorClipJobsService = /*#__PURE__*/function (_ProcessingServiceBas) {
  36152. VectorClipJobsService_inherits(VectorClipJobsService, _ProcessingServiceBas);
  36153. var _super = VectorClipJobsService_createSuper(VectorClipJobsService);
  36154. function VectorClipJobsService(url, options) {
  36155. var _this;
  36156. VectorClipJobsService_classCallCheck(this, VectorClipJobsService);
  36157. _this = _super.call(this, url, options);
  36158. _this.url = Util_Util.urlPathAppend(_this.url, 'spatialanalyst/vectorclip');
  36159. _this.CLASS_NAME = 'SuperMap.VectorClipJobsService';
  36160. return _this;
  36161. }
  36162. /**
  36163. *@override
  36164. */
  36165. VectorClipJobsService_createClass(VectorClipJobsService, [{
  36166. key: "destroy",
  36167. value: function destroy() {
  36168. VectorClipJobsService_get(VectorClipJobsService_getPrototypeOf(VectorClipJobsService.prototype), "destroy", this).call(this);
  36169. }
  36170. /**
  36171. * @function VectorClipJobsService.protitype.getVectorClipJobs
  36172. * @description 获取矢量裁剪分析所有任务
  36173. */
  36174. }, {
  36175. key: "getVectorClipJobs",
  36176. value: function getVectorClipJobs() {
  36177. VectorClipJobsService_get(VectorClipJobsService_getPrototypeOf(VectorClipJobsService.prototype), "getJobs", this).call(this, this.url);
  36178. }
  36179. /**
  36180. * @function KernelDensityJobsService.protitype.getVectorClipJob
  36181. * @description 获取指定id的矢量裁剪分析服务
  36182. * @param {string} id - 指定要获取数据的id
  36183. */
  36184. }, {
  36185. key: "getVectorClipJob",
  36186. value: function getVectorClipJob(id) {
  36187. VectorClipJobsService_get(VectorClipJobsService_getPrototypeOf(VectorClipJobsService.prototype), "getJobs", this).call(this, Util_Util.urlPathAppend(this.url, id));
  36188. }
  36189. /**
  36190. * @function VectorClipJobsService.protitype.addVectorClipJob
  36191. * @description 新建矢量裁剪分析服务
  36192. * @param {VectorClipJobsParameter} params - 创建一个空间分析的请求参数。
  36193. * @param {number} seconds - 开始创建后,获取创建成功结果的时间间隔。
  36194. */
  36195. }, {
  36196. key: "addVectorClipJob",
  36197. value: function addVectorClipJob(params, seconds) {
  36198. VectorClipJobsService_get(VectorClipJobsService_getPrototypeOf(VectorClipJobsService.prototype), "addJob", this).call(this, this.url, params, VectorClipJobsParameter, seconds);
  36199. }
  36200. }]);
  36201. return VectorClipJobsService;
  36202. }(ProcessingServiceBase);
  36203. ;// CONCATENATED MODULE: ./src/common/iServer/OverlayGeoJobParameter.js
  36204. function OverlayGeoJobParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  36205. 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); } }
  36206. function OverlayGeoJobParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) OverlayGeoJobParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) OverlayGeoJobParameter_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  36207. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  36208. * This program are made available under the terms of the Apache License, Version 2.0
  36209. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  36210. /**
  36211. * @class OverlayGeoJobParameter
  36212. * @deprecatedclass SuperMap.OverlayGeoJobParameter
  36213. * @category iServer ProcessingService OverlayAnalyst
  36214. * @classdesc 叠加分析任务参数类。
  36215. * @param {Object} options - 参数。
  36216. * @param {string} options.datasetName - 数据集名。
  36217. * @param {string} options.datasetOverlay - 叠加对象所在的数据集名称。
  36218. * @param {string} options.srcFields - 输入数据需要保留的字段。
  36219. * @param {string} [options.overlayFields] - 叠加数据需要保留的字段。对分析模式为 clip、update、erase 时,此参数无效。
  36220. * @param {string} [options.mode] - 叠加分析模式。
  36221. * @param {OutputSetting} [options.output] - 输出参数设置。
  36222. * @param {MappingParameters} [options.mappingParameters] - 分析后结果可视化的参数类。
  36223. * @usage
  36224. */
  36225. var OverlayGeoJobParameter = /*#__PURE__*/function () {
  36226. function OverlayGeoJobParameter(options) {
  36227. OverlayGeoJobParameter_classCallCheck(this, OverlayGeoJobParameter);
  36228. if (!options) {
  36229. return;
  36230. }
  36231. /**
  36232. * @member {string} OverlayGeoJobParameter.prototype.datasetName
  36233. * @description 数据集名。
  36234. */
  36235. this.datasetName = "";
  36236. /**
  36237. * @member {string} OverlayGeoJobParameter.prototype.datasetOverlay
  36238. * @description 叠加对象所在的数据集名称。
  36239. */
  36240. this.datasetOverlay = "";
  36241. /**
  36242. * @member {string} [OverlayGeoJobParameter.prototype.mode]
  36243. * @description 叠加分析模式。
  36244. */
  36245. this.mode = "";
  36246. /**
  36247. * @member {string} OverlayGeoJobParameter.prototype.srcFields
  36248. * @description 输入数据需要保留的字段。
  36249. */
  36250. this.srcFields = "";
  36251. /**
  36252. * @member {string} OverlayGeoJobParameter.prototype.overlayFields
  36253. * @description 叠加数据需要保留的字段,对分析模式为 clip、update、erase 时,此参数无效。
  36254. */
  36255. this.overlayFields = "";
  36256. /**
  36257. * @member {OutputSetting} [OverlayGeoJobParameter.prototype.output]
  36258. * @description 输出参数设置类。
  36259. */
  36260. this.output = null;
  36261. /**
  36262. * @member {MappingParameters} [OverlayGeoJobParameter.prototype.mappingParameters]
  36263. * @description 分析后结果可视化的参数类。
  36264. */
  36265. this.mappingParameters = null;
  36266. Util_Util.extend(this, options);
  36267. this.CLASS_NAME = "SuperMap.OverlayGeoJobParameter";
  36268. }
  36269. /**
  36270. * @function OverlayGeoJobParameter.prototype.destroy
  36271. * @description 释放资源,将资源的属性置空。
  36272. */
  36273. OverlayGeoJobParameter_createClass(OverlayGeoJobParameter, [{
  36274. key: "destroy",
  36275. value: function destroy() {
  36276. this.datasetName = null;
  36277. this.datasetOverlay = null;
  36278. this.mode = null;
  36279. this.srcFields = null;
  36280. this.overlayFields = null;
  36281. if (this.output instanceof OutputSetting) {
  36282. this.output.destroy();
  36283. this.output = null;
  36284. }
  36285. if (this.mappingParameters instanceof MappingParameters) {
  36286. this.mappingParameters.destroy();
  36287. this.mappingParameters = null;
  36288. }
  36289. }
  36290. /**
  36291. * @function OverlayGeoJobParameter.toObject
  36292. * @param {Object} OverlayGeoJobParameter - 点聚合分析任务参数。
  36293. * @param {Object} tempObj - 目标对象。
  36294. * @description 生成点聚合分析任务对象。
  36295. */
  36296. }], [{
  36297. key: "toObject",
  36298. value: function toObject(_OverlayGeoJobParameter, tempObj) {
  36299. for (var name in _OverlayGeoJobParameter) {
  36300. if (name == "datasetName") {
  36301. tempObj['input'] = tempObj['input'] || {};
  36302. tempObj['input'][name] = _OverlayGeoJobParameter[name];
  36303. continue;
  36304. }
  36305. if (name === "output") {
  36306. tempObj['output'] = tempObj['output'] || {};
  36307. tempObj['output'] = _OverlayGeoJobParameter[name];
  36308. continue;
  36309. }
  36310. tempObj['analyst'] = tempObj['analyst'] || {};
  36311. tempObj['analyst'][name] = _OverlayGeoJobParameter[name];
  36312. if (name === 'mappingParameters') {
  36313. tempObj['analyst'][name] = tempObj['analyst'][name] || {};
  36314. tempObj['analyst']['mappingParameters'] = _OverlayGeoJobParameter[name];
  36315. }
  36316. }
  36317. }
  36318. }]);
  36319. return OverlayGeoJobParameter;
  36320. }();
  36321. ;// CONCATENATED MODULE: ./src/common/iServer/OverlayGeoJobsService.js
  36322. function OverlayGeoJobsService_typeof(obj) { "@babel/helpers - typeof"; return OverlayGeoJobsService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, OverlayGeoJobsService_typeof(obj); }
  36323. function OverlayGeoJobsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  36324. 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); } }
  36325. function OverlayGeoJobsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) OverlayGeoJobsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) OverlayGeoJobsService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  36326. function OverlayGeoJobsService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { OverlayGeoJobsService_get = Reflect.get.bind(); } else { OverlayGeoJobsService_get = function _get(target, property, receiver) { var base = OverlayGeoJobsService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return OverlayGeoJobsService_get.apply(this, arguments); }
  36327. function OverlayGeoJobsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = OverlayGeoJobsService_getPrototypeOf(object); if (object === null) break; } return object; }
  36328. function OverlayGeoJobsService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) OverlayGeoJobsService_setPrototypeOf(subClass, superClass); }
  36329. function OverlayGeoJobsService_setPrototypeOf(o, p) { OverlayGeoJobsService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return OverlayGeoJobsService_setPrototypeOf(o, p); }
  36330. 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); }; }
  36331. function OverlayGeoJobsService_possibleConstructorReturn(self, call) { if (call && (OverlayGeoJobsService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return OverlayGeoJobsService_assertThisInitialized(self); }
  36332. function OverlayGeoJobsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  36333. function OverlayGeoJobsService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  36334. function OverlayGeoJobsService_getPrototypeOf(o) { OverlayGeoJobsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return OverlayGeoJobsService_getPrototypeOf(o); }
  36335. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  36336. * This program are made available under the terms of the Apache License, Version 2.0
  36337. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  36338. /**
  36339. * @class OverlayGeoJobsService
  36340. * @deprecatedclass SuperMap.OverlayGeoJobsService
  36341. * @category iServer ProcessingService OverlayAnalyst
  36342. * @classdesc 叠加分析任务类。
  36343. * @param {string} url - 服务地址。
  36344. * @param {Object} options - 参数。
  36345. * @param {Events} options.events - 处理所有事件的对象。
  36346. * @param {Object} [options.eventListeners] - 事件监听器对象。有 processCompleted 属性可传入处理完成后的回调函数。processFailed 属性传入处理失败后的回调函数。
  36347. * @param {number} options.index - 服务访问地址在数组中的位置。
  36348. * @param {number} options.length - 服务访问地址数组长度。
  36349. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  36350. * @param {Object} [options.headers] - 请求头。
  36351. * @usage
  36352. */
  36353. var OverlayGeoJobsService = /*#__PURE__*/function (_ProcessingServiceBas) {
  36354. OverlayGeoJobsService_inherits(OverlayGeoJobsService, _ProcessingServiceBas);
  36355. var _super = OverlayGeoJobsService_createSuper(OverlayGeoJobsService);
  36356. function OverlayGeoJobsService(url, options) {
  36357. var _this;
  36358. OverlayGeoJobsService_classCallCheck(this, OverlayGeoJobsService);
  36359. _this = _super.call(this, url, options);
  36360. _this.url = Util_Util.urlPathAppend(_this.url, 'spatialanalyst/overlay');
  36361. _this.CLASS_NAME = 'SuperMap.OverlayGeoJobsService';
  36362. return _this;
  36363. }
  36364. /**
  36365. * @override
  36366. */
  36367. OverlayGeoJobsService_createClass(OverlayGeoJobsService, [{
  36368. key: "destroy",
  36369. value: function destroy() {
  36370. OverlayGeoJobsService_get(OverlayGeoJobsService_getPrototypeOf(OverlayGeoJobsService.prototype), "destroy", this).call(this);
  36371. }
  36372. /**
  36373. * @function OverlayGeoJobsService.prototype.getOverlayGeoJobs
  36374. * @description 获取叠加分析任务
  36375. */
  36376. }, {
  36377. key: "getOverlayGeoJobs",
  36378. value: function getOverlayGeoJobs() {
  36379. OverlayGeoJobsService_get(OverlayGeoJobsService_getPrototypeOf(OverlayGeoJobsService.prototype), "getJobs", this).call(this, this.url);
  36380. }
  36381. /**
  36382. * @function OverlayGeoJobsService.prototype.getOverlayGeoJob
  36383. * @description 获取指定id的叠加分析任务
  36384. * @param {string} id - 指定要获取数据的id
  36385. */
  36386. }, {
  36387. key: "getOverlayGeoJob",
  36388. value: function getOverlayGeoJob(id) {
  36389. OverlayGeoJobsService_get(OverlayGeoJobsService_getPrototypeOf(OverlayGeoJobsService.prototype), "getJobs", this).call(this, Util_Util.urlPathAppend(this.url, id));
  36390. }
  36391. /**
  36392. * @function OverlayGeoJobsService.prototype.addOverlayGeoJob
  36393. * @description 新建点叠加析服务
  36394. * @param {OverlayGeoJobParameter} params - 创建一个叠加分析的请求参数。
  36395. * @param {number} seconds - 开始创建后,获取创建成功结果的时间间隔。
  36396. */
  36397. }, {
  36398. key: "addOverlayGeoJob",
  36399. value: function addOverlayGeoJob(params, seconds) {
  36400. OverlayGeoJobsService_get(OverlayGeoJobsService_getPrototypeOf(OverlayGeoJobsService.prototype), "addJob", this).call(this, this.url, params, OverlayGeoJobParameter, seconds);
  36401. }
  36402. }]);
  36403. return OverlayGeoJobsService;
  36404. }(ProcessingServiceBase);
  36405. ;// CONCATENATED MODULE: ./src/common/iServer/SummaryRegionJobParameter.js
  36406. function SummaryRegionJobParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  36407. 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); } }
  36408. function SummaryRegionJobParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) SummaryRegionJobParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) SummaryRegionJobParameter_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  36409. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  36410. * This program are made available under the terms of the Apache License, Version 2.0
  36411. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  36412. /**
  36413. * @class SummaryRegionJobParameter
  36414. * @deprecatedclass SuperMap.SummaryRegionJobParameter
  36415. * @category iServer ProcessingService SummaryRegion
  36416. * @classdesc 区域汇总分析任务参数类。
  36417. * @param {Object} options - 参数。
  36418. * @param {string} options.datasetName - 数据集名。
  36419. * @param {string} [options.regionDataset] - 汇总数据源(多边形汇总时用到的参数)。
  36420. * @param {(SuperMap.Bounds|L.Bounds|L.LatLngBounds|ol.extent|mapboxgl.LngLatBounds|GeoJSONObject)} [options.query] - 分析范围(默认为全图范围)。
  36421. * @param {string} [options.standardFields] - 标准属性字段名称。
  36422. * @param {string} [options.weightedFields] - 权重字段名称。
  36423. * @param {StatisticAnalystMode} [options.standardStatisticModes] - 标准属性字段的统计模式。standardSummaryFields 为 true 时必填。
  36424. * @param {StatisticAnalystMode} [options.weightedStatisticModes] - 权重字段的统计模式。weightedSummaryFields 为 true 时必填。
  36425. * @param {boolean} [options.sumShape=true] - 是否统计长度或面积。
  36426. * @param {boolean} [options.standardSummaryFields=false] - 是否以标准属性字段统计。
  36427. * @param {boolean} [options.weightedSummaryFields=false] - 是否以权重字段统计。
  36428. * @param {number} [options.resolution=100] - 网格大小。
  36429. * @param {number} [options.meshType=0] - 网格面汇总类型。
  36430. * @param {AnalystSizeUnit} [options.meshSizeUnit=AnalystSizeUnit.METER] - 网格大小单位。
  36431. * @param {SummaryType} [options.type=SummaryType.SUMMARYMESH] - 汇总类型。
  36432. * @param {OutputSetting} [options.output] - 输出参数设置。
  36433. * @param {MappingParameters} [options.mappingParameters] - 分析后结果可视化的参数类。
  36434. * @usage
  36435. */
  36436. var SummaryRegionJobParameter = /*#__PURE__*/function () {
  36437. function SummaryRegionJobParameter(options) {
  36438. SummaryRegionJobParameter_classCallCheck(this, SummaryRegionJobParameter);
  36439. if (!options) {
  36440. return;
  36441. }
  36442. /**
  36443. * @member {string} SummaryRegionJobParameter.prototype.datasetName
  36444. * @description 数据集名。
  36445. */
  36446. this.datasetName = "";
  36447. /**
  36448. * @member {string} SummaryRegionJobParameter.prototype.regionDataset
  36449. * @description 汇总数据源(多边形汇总时用到的参数)。
  36450. */
  36451. this.regionDataset = "";
  36452. /**
  36453. * @member {boolean} [SummaryRegionJobParameter.prototype.sumShape=true]
  36454. * @description 是否统计长度或面积。
  36455. */
  36456. this.sumShape = true;
  36457. /**
  36458. * @member {(SuperMap.Bounds|L.Bounds|L.LatLngBounds|ol.extent|mapboxgl.LngLatBounds|GeoJSONObject)} SummaryRegionJobParameter.prototype.query
  36459. * @description 分析范围。
  36460. */
  36461. this.query = "";
  36462. /**
  36463. * @member {boolean} [SummaryRegionJobParameter.prototype.standardSummaryFields=false]
  36464. * @description 是否以标准属字段统计。
  36465. */
  36466. this.standardSummaryFields = false;
  36467. /**
  36468. * @member {string} SummaryRegionJobParameter.prototype.standardFields
  36469. * @description 标准属性字段名称。仅支持系统字段以外的整形、长整形、浮点型的字段的名称。standardSummaryFields 为 true 时必填。
  36470. */
  36471. this.standardFields = "";
  36472. /**
  36473. * @member {StatisticAnalystMode} SummaryRegionJobParameter.prototype.standardStatisticModes
  36474. * @description 标准属性字段的统计模式。standardSummaryFields 为 true 时必填。
  36475. */
  36476. this.standardStatisticModes = "";
  36477. /**
  36478. * @member {boolean} [SummaryRegionJobParameter.prototype.weightedSummaryFields=false]
  36479. * @description 是否以权重字段统计。
  36480. */
  36481. this.weightedSummaryFields = false;
  36482. /**
  36483. * @member {string} SummaryRegionJobParameter.prototype.weightedFields
  36484. * @description 权重字段名称。仅支持系统字段以外的整形、长整形、浮点型的字段的名称。weightedSummaryFields 为 true 时必填。
  36485. */
  36486. this.weightedFields = "";
  36487. /**
  36488. * @member {StatisticAnalystMode} SummaryRegionJobParameter.prototype.weightedStatisticModes
  36489. * @description 以权重字段统计的统计模式。权重字段的统计模式。weightedSummaryFields 为 true 时必填。
  36490. */
  36491. this.weightedStatisticModes = "";
  36492. /**
  36493. * @member {number} [SummaryRegionJobParameter.prototype.meshType=0]
  36494. * @description 网格面汇总类型。
  36495. */
  36496. this.meshType = 0;
  36497. /**
  36498. * @member {number} [SummaryRegionJobParameter.prototype.resolution=100]
  36499. * @description 网格大小。
  36500. */
  36501. this.resolution = 100;
  36502. /**
  36503. * @member {AnalystSizeUnit} [SummaryRegionJobParameter.prototype.meshSizeUnit=AnalystSizeUnit.METER]
  36504. * @description 网格大小单位。
  36505. */
  36506. this.meshSizeUnit = AnalystSizeUnit.METER;
  36507. /**
  36508. * @member {SummaryType} [SummaryRegionJobParameter.prototype.type=SummaryType.SUMMARYMESH]
  36509. * @description 汇总类型。
  36510. */
  36511. this.type = SummaryType.SUMMARYMESH;
  36512. /**
  36513. * @member {OutputSetting} SummaryRegionJobParameter.prototype.output
  36514. * @description 输出参数设置类。
  36515. */
  36516. this.output = null;
  36517. /**
  36518. * @member {MappingParameters} [SummaryRegionJobParameter.prototype.mappingParameters]
  36519. * @description 分析后结果可视化的参数类。
  36520. */
  36521. this.mappingParameters = null;
  36522. Util_Util.extend(this, options);
  36523. this.CLASS_NAME = "SuperMap.SummaryRegionJobParameter";
  36524. }
  36525. /**
  36526. * @function SummaryRegionJobParameter.prototype.destroy
  36527. * @description 释放资源,将引用资源的属性置空。
  36528. */
  36529. SummaryRegionJobParameter_createClass(SummaryRegionJobParameter, [{
  36530. key: "destroy",
  36531. value: function destroy() {
  36532. this.datasetName = null;
  36533. this.sumShape = null;
  36534. this.regionDataset = null;
  36535. this.query = null;
  36536. this.standardSummaryFields = null;
  36537. this.standardFields = null;
  36538. this.standardStatisticModes = null;
  36539. this.weightedSummaryFields = null;
  36540. this.weightedFields = null;
  36541. this.weightedStatisticModes = null;
  36542. this.meshType = null;
  36543. this.resolution = null;
  36544. this.meshSizeUnit = null;
  36545. this.type = null;
  36546. if (this.output instanceof OutputSetting) {
  36547. this.output.destroy();
  36548. this.output = null;
  36549. }
  36550. if (this.mappingParameters instanceof MappingParameters) {
  36551. this.mappingParameters.destroy();
  36552. this.mappingParameters = null;
  36553. }
  36554. }
  36555. /**
  36556. * @function SummaryRegionJobParameter.toObject
  36557. * @param {Object} summaryRegionJobParameter - 矢量裁剪分析任务参数。
  36558. * @param {Object} tempObj - 目标对象。
  36559. * @description 生成区域汇总分析服务对象。
  36560. */
  36561. }], [{
  36562. key: "toObject",
  36563. value: function toObject(summaryRegionJobParameter, tempObj) {
  36564. for (var name in summaryRegionJobParameter) {
  36565. if (name === "datasetName") {
  36566. tempObj['input'] = tempObj['input'] || {};
  36567. tempObj['input'][name] = summaryRegionJobParameter[name];
  36568. continue;
  36569. }
  36570. if (name === "type") {
  36571. tempObj['type'] = summaryRegionJobParameter[name];
  36572. continue;
  36573. }
  36574. if (name === "type") {
  36575. tempObj['type'] = summaryRegionJobParameter[name];
  36576. continue;
  36577. }
  36578. if (name === "output") {
  36579. tempObj['output'] = tempObj['output'] || {};
  36580. tempObj['output'] = summaryRegionJobParameter[name];
  36581. continue;
  36582. }
  36583. if (summaryRegionJobParameter.type === "SUMMARYREGION" || summaryRegionJobParameter.type === "SUMMARYMESH" && name !== "regionDataset") {
  36584. tempObj['analyst'] = tempObj['analyst'] || {};
  36585. if (name === 'query' && summaryRegionJobParameter[name]) {
  36586. tempObj['analyst'][name] = summaryRegionJobParameter[name].toBBOX();
  36587. } else {
  36588. tempObj['analyst'][name] = summaryRegionJobParameter[name];
  36589. }
  36590. if (name === 'mappingParameters') {
  36591. tempObj['analyst'][name] = tempObj['analyst'][name] || {};
  36592. tempObj['analyst']['mappingParameters'] = summaryRegionJobParameter[name];
  36593. }
  36594. }
  36595. }
  36596. }
  36597. }]);
  36598. return SummaryRegionJobParameter;
  36599. }();
  36600. ;// CONCATENATED MODULE: ./src/common/iServer/SummaryRegionJobsService.js
  36601. function SummaryRegionJobsService_typeof(obj) { "@babel/helpers - typeof"; return SummaryRegionJobsService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, SummaryRegionJobsService_typeof(obj); }
  36602. function SummaryRegionJobsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  36603. 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); } }
  36604. function SummaryRegionJobsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) SummaryRegionJobsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) SummaryRegionJobsService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  36605. function SummaryRegionJobsService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { SummaryRegionJobsService_get = Reflect.get.bind(); } else { SummaryRegionJobsService_get = function _get(target, property, receiver) { var base = SummaryRegionJobsService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return SummaryRegionJobsService_get.apply(this, arguments); }
  36606. function SummaryRegionJobsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SummaryRegionJobsService_getPrototypeOf(object); if (object === null) break; } return object; }
  36607. function SummaryRegionJobsService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) SummaryRegionJobsService_setPrototypeOf(subClass, superClass); }
  36608. function SummaryRegionJobsService_setPrototypeOf(o, p) { SummaryRegionJobsService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SummaryRegionJobsService_setPrototypeOf(o, p); }
  36609. 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); }; }
  36610. function SummaryRegionJobsService_possibleConstructorReturn(self, call) { if (call && (SummaryRegionJobsService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return SummaryRegionJobsService_assertThisInitialized(self); }
  36611. function SummaryRegionJobsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  36612. function SummaryRegionJobsService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  36613. function SummaryRegionJobsService_getPrototypeOf(o) { SummaryRegionJobsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SummaryRegionJobsService_getPrototypeOf(o); }
  36614. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  36615. * This program are made available under the terms of the Apache License, Version 2.0
  36616. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  36617. /**
  36618. * @class SummaryRegionJobsService
  36619. * @deprecatedclass SuperMap.SummaryRegionJobsService
  36620. * @category iServer ProcessingService SummaryRegion
  36621. * @classdesc 区域汇总分析服务类
  36622. * @extends {ProcessingServiceBase}
  36623. * @param {string} url - 服务地址。
  36624. * @param {Object} options - 可选参数。
  36625. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  36626. * @param {Object} [options.headers] - 请求头。
  36627. * @usage
  36628. */
  36629. var SummaryRegionJobsService = /*#__PURE__*/function (_ProcessingServiceBas) {
  36630. SummaryRegionJobsService_inherits(SummaryRegionJobsService, _ProcessingServiceBas);
  36631. var _super = SummaryRegionJobsService_createSuper(SummaryRegionJobsService);
  36632. function SummaryRegionJobsService(url, options) {
  36633. var _this;
  36634. SummaryRegionJobsService_classCallCheck(this, SummaryRegionJobsService);
  36635. _this = _super.call(this, url, options);
  36636. _this.url = Util_Util.urlPathAppend(_this.url, 'spatialanalyst/summaryregion');
  36637. _this.CLASS_NAME = 'SuperMap.SummaryRegionJobsService';
  36638. return _this;
  36639. }
  36640. /**
  36641. *@override
  36642. */
  36643. SummaryRegionJobsService_createClass(SummaryRegionJobsService, [{
  36644. key: "destroy",
  36645. value: function destroy() {
  36646. SummaryRegionJobsService_get(SummaryRegionJobsService_getPrototypeOf(SummaryRegionJobsService.prototype), "destroy", this).call(this);
  36647. }
  36648. /**
  36649. * @function SummaryRegionJobsService.prototype.getSummaryRegionJobs
  36650. * @description 获取区域汇总分析任务集合。
  36651. */
  36652. }, {
  36653. key: "getSummaryRegionJobs",
  36654. value: function getSummaryRegionJobs() {
  36655. SummaryRegionJobsService_get(SummaryRegionJobsService_getPrototypeOf(SummaryRegionJobsService.prototype), "getJobs", this).call(this, this.url);
  36656. }
  36657. /**
  36658. * @function SummaryRegionJobsService.prototype.getSummaryRegionJob
  36659. * @description 获取指定id的区域汇总分析任务。
  36660. * @param {string} id -要获取区域汇总分析任务的id
  36661. */
  36662. }, {
  36663. key: "getSummaryRegionJob",
  36664. value: function getSummaryRegionJob(id) {
  36665. SummaryRegionJobsService_get(SummaryRegionJobsService_getPrototypeOf(SummaryRegionJobsService.prototype), "getJobs", this).call(this, Util_Util.urlPathAppend(this.url, id));
  36666. }
  36667. /**
  36668. * @function SummaryRegionJobsService.prototype.addSummaryRegionJob
  36669. * @description 新建区域汇总任务。
  36670. * @param {SummaryRegionJobParameter} params - 区域汇总分析任务参数类。
  36671. * @param {number} seconds - 创建成功结果的时间间隔。
  36672. */
  36673. }, {
  36674. key: "addSummaryRegionJob",
  36675. value: function addSummaryRegionJob(params, seconds) {
  36676. SummaryRegionJobsService_get(SummaryRegionJobsService_getPrototypeOf(SummaryRegionJobsService.prototype), "addJob", this).call(this, this.url, params, SummaryRegionJobParameter, seconds);
  36677. }
  36678. }]);
  36679. return SummaryRegionJobsService;
  36680. }(ProcessingServiceBase);
  36681. ;// CONCATENATED MODULE: ./src/common/iServer/BuffersAnalystJobsParameter.js
  36682. function BuffersAnalystJobsParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  36683. 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); } }
  36684. function BuffersAnalystJobsParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) BuffersAnalystJobsParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) BuffersAnalystJobsParameter_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  36685. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  36686. * This program are made available under the terms of the Apache License, Version 2.0
  36687. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  36688. /**
  36689. * @class BuffersAnalystJobsParameter
  36690. * @deprecatedclass SuperMap.BuffersAnalystJobsParameter
  36691. * @category iServer ProcessingService BufferAnalyst
  36692. * @classdesc 缓冲区分析任务参数类。
  36693. * @param {Object} options - 参数。
  36694. * @param {string} options.datasetName - 数据集名。
  36695. * @param {(SuperMap.Bounds|L.Bounds|L.LatLngBounds|ol.extent|mapboxgl.LngLatBounds|GeoJSONObject)} [options.bounds] - 分析范围(默认为全图范围)。
  36696. * @param {string} [options.distance='15'] - 缓冲距离,或缓冲区半径。
  36697. * @param {string} [options.distanceField='pickup_latitude'] - 缓冲区分析距离字段。
  36698. * @param {AnalystSizeUnit} [options.distanceUnit=AnalystSizeUnit.METER] - 缓冲距离单位单位。
  36699. * @param {OutputSetting} [options.output] - 输出参数设置。
  36700. * @param {MappingParameters} [options.mappingParameters] - 分析后结果可视化的参数类。
  36701. * @usage
  36702. */
  36703. var BuffersAnalystJobsParameter = /*#__PURE__*/function () {
  36704. function BuffersAnalystJobsParameter(options) {
  36705. BuffersAnalystJobsParameter_classCallCheck(this, BuffersAnalystJobsParameter);
  36706. /**
  36707. * @member {string} BuffersAnalystJobsParameter.prototype.datasetName
  36708. * @description 数据集名。
  36709. */
  36710. this.datasetName = '';
  36711. /**
  36712. * @member {(SuperMap.Bounds|L.Bounds|L.LatLngBounds|ol.extent|mapboxgl.LngLatBounds|GeoJSONObject)} BuffersAnalystJobsParameter.prototype.bounds
  36713. * @description 分析范围。
  36714. */
  36715. this.bounds = '';
  36716. /**
  36717. * @member {string} [BuffersAnalystJobsParameter.prototype.distance='15']
  36718. * @description 缓冲距离,或称为缓冲区半径。当缓冲距离字段为空时,此参数有效。
  36719. */
  36720. this.distance = '';
  36721. /**
  36722. * @member {string} [BuffersAnalystJobsParameter.prototype.distanceField='pickup_latitude']
  36723. * @description 缓冲距离字段。
  36724. */
  36725. this.distanceField = '';
  36726. /**
  36727. * @member {AnalystSizeUnit} [BuffersAnalystJobsParameter.prototype.distanceUnit=AnalystSizeUnit.METER]
  36728. * @description 缓冲距离单位。
  36729. */
  36730. this.distanceUnit = AnalystSizeUnit.METER;
  36731. /**
  36732. * @member {string} BuffersAnalystJobsParameter.prototype.dissolveField
  36733. * @description 融合字段,根据字段值对缓冲区结果面对象进行融合。
  36734. */
  36735. this.dissolveField = '';
  36736. /**
  36737. * @member {OutputSetting} [BuffersAnalystJobsParameter.prototype.output]
  36738. * @description 输出参数设置类。
  36739. */
  36740. this.output = null;
  36741. /**
  36742. * @member {MappingParameters} [BuffersAnalystJobsParameter.prototype.mappingParameters]
  36743. * @description 分析后结果可视化的参数类。
  36744. */
  36745. this.mappingParameters = null;
  36746. if (!options) {
  36747. return this;
  36748. }
  36749. Util_Util.extend(this, options);
  36750. this.CLASS_NAME = 'SuperMap.BuffersAnalystJobsParameter';
  36751. }
  36752. /**
  36753. * @function BuffersAnalystJobsParameter.prototype.destroy
  36754. * @description 释放资源,将引用资源的属性置空。
  36755. */
  36756. BuffersAnalystJobsParameter_createClass(BuffersAnalystJobsParameter, [{
  36757. key: "destroy",
  36758. value: function destroy() {
  36759. this.datasetName = null;
  36760. this.bounds = null;
  36761. this.distance = null;
  36762. this.distanceField = null;
  36763. this.distanceUnit = null;
  36764. this.dissolveField = null;
  36765. if (this.output instanceof OutputSetting) {
  36766. this.output.destroy();
  36767. this.output = null;
  36768. }
  36769. if (this.mappingParameters instanceof MappingParameters) {
  36770. this.mappingParameters.destroy();
  36771. this.mappingParameters = null;
  36772. }
  36773. }
  36774. /**
  36775. * @function BuffersAnalystJobsParameter.toObject
  36776. * @param {BuffersAnalystJobsParameter} BuffersAnalystJobsParameter - 缓冲区分析任务参数。
  36777. * @param {Object} tempObj - 目标对象。
  36778. * @description 生成缓冲区分析任务对象。
  36779. */
  36780. }], [{
  36781. key: "toObject",
  36782. value: function toObject(_BuffersAnalystJobsParameter, tempObj) {
  36783. for (var name in _BuffersAnalystJobsParameter) {
  36784. if (name === 'datasetName') {
  36785. tempObj['input'] = tempObj['input'] || {};
  36786. tempObj['input'][name] = _BuffersAnalystJobsParameter[name];
  36787. continue;
  36788. }
  36789. if (name === 'output') {
  36790. tempObj['output'] = tempObj['output'] || {};
  36791. tempObj['output'] = _BuffersAnalystJobsParameter[name];
  36792. continue;
  36793. }
  36794. tempObj['analyst'] = tempObj['analyst'] || {};
  36795. if (name === 'bounds' && _BuffersAnalystJobsParameter[name]) {
  36796. tempObj['analyst'][name] = _BuffersAnalystJobsParameter[name].toBBOX();
  36797. } else {
  36798. tempObj['analyst'][name] = _BuffersAnalystJobsParameter[name];
  36799. }
  36800. if (name === 'mappingParameters') {
  36801. tempObj['analyst'][name] = tempObj['analyst'][name] || {};
  36802. tempObj['analyst']['mappingParameters'] = _BuffersAnalystJobsParameter[name];
  36803. }
  36804. }
  36805. }
  36806. }]);
  36807. return BuffersAnalystJobsParameter;
  36808. }();
  36809. ;// CONCATENATED MODULE: ./src/common/iServer/BuffersAnalystJobsService.js
  36810. function BuffersAnalystJobsService_typeof(obj) { "@babel/helpers - typeof"; return BuffersAnalystJobsService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, BuffersAnalystJobsService_typeof(obj); }
  36811. function BuffersAnalystJobsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  36812. 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); } }
  36813. function BuffersAnalystJobsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) BuffersAnalystJobsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) BuffersAnalystJobsService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  36814. function BuffersAnalystJobsService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { BuffersAnalystJobsService_get = Reflect.get.bind(); } else { BuffersAnalystJobsService_get = function _get(target, property, receiver) { var base = BuffersAnalystJobsService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return BuffersAnalystJobsService_get.apply(this, arguments); }
  36815. function BuffersAnalystJobsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = BuffersAnalystJobsService_getPrototypeOf(object); if (object === null) break; } return object; }
  36816. function BuffersAnalystJobsService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) BuffersAnalystJobsService_setPrototypeOf(subClass, superClass); }
  36817. function BuffersAnalystJobsService_setPrototypeOf(o, p) { BuffersAnalystJobsService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return BuffersAnalystJobsService_setPrototypeOf(o, p); }
  36818. 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); }; }
  36819. function BuffersAnalystJobsService_possibleConstructorReturn(self, call) { if (call && (BuffersAnalystJobsService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return BuffersAnalystJobsService_assertThisInitialized(self); }
  36820. function BuffersAnalystJobsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  36821. function BuffersAnalystJobsService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  36822. function BuffersAnalystJobsService_getPrototypeOf(o) { BuffersAnalystJobsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return BuffersAnalystJobsService_getPrototypeOf(o); }
  36823. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  36824. * This program are made available under the terms of the Apache License, Version 2.0
  36825. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  36826. /**
  36827. * @class BuffersAnalystJobsService
  36828. * @deprecatedclass SuperMap.BuffersAnalystJobsService
  36829. * @category iServer ProcessingService BufferAnalyst
  36830. * @classdesc 缓冲区分析服务类。
  36831. * @extends {ProcessingServiceBase}
  36832. * @param {string} url - 服务地址。
  36833. * @param {Object} options - 参数。
  36834. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  36835. * @param {Object} [options.headers] - 请求头。
  36836. * @usage
  36837. */
  36838. var BuffersAnalystJobsService = /*#__PURE__*/function (_ProcessingServiceBas) {
  36839. BuffersAnalystJobsService_inherits(BuffersAnalystJobsService, _ProcessingServiceBas);
  36840. var _super = BuffersAnalystJobsService_createSuper(BuffersAnalystJobsService);
  36841. function BuffersAnalystJobsService(url, options) {
  36842. var _this;
  36843. BuffersAnalystJobsService_classCallCheck(this, BuffersAnalystJobsService);
  36844. _this = _super.call(this, url, options);
  36845. _this.url = Util_Util.urlPathAppend(_this.url, 'spatialanalyst/buffers');
  36846. _this.CLASS_NAME = 'SuperMap.BuffersAnalystJobsService';
  36847. return _this;
  36848. }
  36849. /**
  36850. *@override
  36851. */
  36852. BuffersAnalystJobsService_createClass(BuffersAnalystJobsService, [{
  36853. key: "destroy",
  36854. value: function destroy() {
  36855. BuffersAnalystJobsService_get(BuffersAnalystJobsService_getPrototypeOf(BuffersAnalystJobsService.prototype), "destroy", this).call(this);
  36856. }
  36857. /**
  36858. * @function BuffersAnalystJobsService.prototype.getBufferJobs
  36859. * @description 获取缓冲区分析所有任务
  36860. */
  36861. }, {
  36862. key: "getBuffersJobs",
  36863. value: function getBuffersJobs() {
  36864. BuffersAnalystJobsService_get(BuffersAnalystJobsService_getPrototypeOf(BuffersAnalystJobsService.prototype), "getJobs", this).call(this, this.url);
  36865. }
  36866. /**
  36867. * @function BuffersAnalystJobsService.prototype.getBufferJob
  36868. * @description 获取指定id的缓冲区分析服务
  36869. * @param {string} id - 指定要获取数据的id。
  36870. */
  36871. }, {
  36872. key: "getBuffersJob",
  36873. value: function getBuffersJob(id) {
  36874. BuffersAnalystJobsService_get(BuffersAnalystJobsService_getPrototypeOf(BuffersAnalystJobsService.prototype), "getJobs", this).call(this, Util_Util.urlPathAppend(this.url, id));
  36875. }
  36876. /**
  36877. * @function BuffersAnalystJobsService.prototype.addBufferJob
  36878. * @description 新建缓冲区分析服务
  36879. * @param {BuffersAnalystJobsParameter} params - 创建一个空间分析的请求参数。
  36880. * @param {number} seconds - 开始创建后,获取创建成功结果的时间间隔。
  36881. */
  36882. }, {
  36883. key: "addBuffersJob",
  36884. value: function addBuffersJob(params, seconds) {
  36885. BuffersAnalystJobsService_get(BuffersAnalystJobsService_getPrototypeOf(BuffersAnalystJobsService.prototype), "addJob", this).call(this, this.url, params, BuffersAnalystJobsParameter, seconds);
  36886. }
  36887. }]);
  36888. return BuffersAnalystJobsService;
  36889. }(ProcessingServiceBase);
  36890. ;// CONCATENATED MODULE: ./src/common/iServer/TopologyValidatorJobsParameter.js
  36891. function TopologyValidatorJobsParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  36892. 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); } }
  36893. function TopologyValidatorJobsParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) TopologyValidatorJobsParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) TopologyValidatorJobsParameter_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  36894. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  36895. * This program are made available under the terms of the Apache License, Version 2.0
  36896. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  36897. /**
  36898. * @class TopologyValidatorJobsParameter
  36899. * @deprecatedclass SuperMap.TopologyValidatorJobsParameter
  36900. * @category iServer ProcessingService TopologyValidator
  36901. * @classdesc 拓扑检查分析任务参数类。
  36902. * @param {Object} options - 参数。
  36903. * @param {string} options.datasetName - 数据集名。
  36904. * @param {string} options.datasetTopology -检查对象所在的数据集名称。
  36905. * @param {TopologyValidatorRule} [options.rule=TopologyValidatorRule.REGIONNOOVERLAP] - 拓扑检查规则。
  36906. * @param {string} [options.tolerance] - 容限。
  36907. * @param {OutputSetting} [options.output] - 输出参数设置。
  36908. * @param {MappingParameters} [options.mappingParameters] - 分析后结果可视化的参数类。
  36909. * @usage
  36910. */
  36911. var TopologyValidatorJobsParameter = /*#__PURE__*/function () {
  36912. function TopologyValidatorJobsParameter(options) {
  36913. TopologyValidatorJobsParameter_classCallCheck(this, TopologyValidatorJobsParameter);
  36914. if (!options) {
  36915. return;
  36916. }
  36917. /**
  36918. * @member {string} TopologyValidatorJobsParameter.prototype.datasetName
  36919. * @description 数据集名。
  36920. */
  36921. this.datasetName = "";
  36922. /**
  36923. * @member {string} TopologyValidatorJobsParameter.prototype.datasetTopology
  36924. * @description 拓扑检查对象所在的数据集名称。
  36925. */
  36926. this.datasetTopology = "";
  36927. /**
  36928. * @member {string} [TopologyValidatorJobsParameter.prototype.tolerance]
  36929. * @description 容限,指定的拓扑错误检查时使用的容限。
  36930. */
  36931. this.tolerance = "";
  36932. /**
  36933. * @member {TopologyValidatorRule} [TopologyValidatorJobsParameter.prototype.rule=TopologyValidatorRule.REGIONNOOVERLAP]
  36934. * @description 拓扑检查模式。
  36935. */
  36936. this.rule = TopologyValidatorRule.REGIONNOOVERLAP;
  36937. /**
  36938. * @member {OutputSetting} [TopologyValidatorJobsParameter.prototype.output]
  36939. * @description 输出参数设置类。
  36940. */
  36941. this.output = null;
  36942. /**
  36943. * @member {MappingParameters} [TopologyValidatorJobsParameter.prototype.mappingParameters]
  36944. * @description 分析后结果可视化的参数类。
  36945. */
  36946. this.mappingParameters = null;
  36947. Util_Util.extend(this, options);
  36948. this.CLASS_NAME = "SuperMap.TopologyValidatorJobsParameter";
  36949. }
  36950. /**
  36951. * @function TopologyValidatorJobsParameter.prototype.destroy
  36952. * @description 释放资源,将引用资源的属性置空。
  36953. */
  36954. TopologyValidatorJobsParameter_createClass(TopologyValidatorJobsParameter, [{
  36955. key: "destroy",
  36956. value: function destroy() {
  36957. this.datasetName = null;
  36958. this.datasetTopology = null;
  36959. this.tolerance = null;
  36960. this.rule = null;
  36961. if (this.output instanceof OutputSetting) {
  36962. this.output.destroy();
  36963. this.output = null;
  36964. }
  36965. if (this.mappingParameters instanceof MappingParameters) {
  36966. this.mappingParameters.destroy();
  36967. this.mappingParameters = null;
  36968. }
  36969. }
  36970. /**
  36971. * @function TopologyValidatorJobsParameter.toObject
  36972. * @param {Object} TopologyValidatorJobsParameter -拓扑检查分析任务参数。
  36973. * @param {Object} tempObj - 目标对象。
  36974. * @description 生成拓扑检查分析任务对象。
  36975. */
  36976. }], [{
  36977. key: "toObject",
  36978. value: function toObject(_TopologyValidatorJobsParameter, tempObj) {
  36979. for (var name in _TopologyValidatorJobsParameter) {
  36980. if (name === "datasetName") {
  36981. tempObj['input'] = tempObj['input'] || {};
  36982. tempObj['input'][name] = _TopologyValidatorJobsParameter[name];
  36983. continue;
  36984. }
  36985. if (name === "output") {
  36986. tempObj['output'] = tempObj['output'] || {};
  36987. tempObj['output'] = _TopologyValidatorJobsParameter[name];
  36988. continue;
  36989. }
  36990. tempObj['analyst'] = tempObj['analyst'] || {};
  36991. tempObj['analyst'][name] = _TopologyValidatorJobsParameter[name];
  36992. if (name === 'mappingParameters') {
  36993. tempObj['analyst'][name] = tempObj['analyst'][name] || {};
  36994. tempObj['analyst']['mappingParameters'] = _TopologyValidatorJobsParameter[name];
  36995. }
  36996. }
  36997. }
  36998. }]);
  36999. return TopologyValidatorJobsParameter;
  37000. }();
  37001. ;// CONCATENATED MODULE: ./src/common/iServer/TopologyValidatorJobsService.js
  37002. function TopologyValidatorJobsService_typeof(obj) { "@babel/helpers - typeof"; return TopologyValidatorJobsService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, TopologyValidatorJobsService_typeof(obj); }
  37003. function TopologyValidatorJobsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  37004. 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); } }
  37005. function TopologyValidatorJobsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) TopologyValidatorJobsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) TopologyValidatorJobsService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  37006. function TopologyValidatorJobsService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { TopologyValidatorJobsService_get = Reflect.get.bind(); } else { TopologyValidatorJobsService_get = function _get(target, property, receiver) { var base = TopologyValidatorJobsService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return TopologyValidatorJobsService_get.apply(this, arguments); }
  37007. function TopologyValidatorJobsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = TopologyValidatorJobsService_getPrototypeOf(object); if (object === null) break; } return object; }
  37008. function TopologyValidatorJobsService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) TopologyValidatorJobsService_setPrototypeOf(subClass, superClass); }
  37009. function TopologyValidatorJobsService_setPrototypeOf(o, p) { TopologyValidatorJobsService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return TopologyValidatorJobsService_setPrototypeOf(o, p); }
  37010. 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); }; }
  37011. function TopologyValidatorJobsService_possibleConstructorReturn(self, call) { if (call && (TopologyValidatorJobsService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return TopologyValidatorJobsService_assertThisInitialized(self); }
  37012. function TopologyValidatorJobsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  37013. function TopologyValidatorJobsService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  37014. function TopologyValidatorJobsService_getPrototypeOf(o) { TopologyValidatorJobsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return TopologyValidatorJobsService_getPrototypeOf(o); }
  37015. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  37016. * This program are made available under the terms of the Apache License, Version 2.0
  37017. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  37018. /**
  37019. * @class TopologyValidatorJobsService
  37020. * @deprecatedclass SuperMap.TopologyValidatorJobsService
  37021. * @category iServer ProcessingService TopologyValidator
  37022. * @classdesc 拓扑检查分析服务类
  37023. * @extends {ProcessingServiceBase}
  37024. * @param {string} url - 服务地址。
  37025. * @param {Object} options - 可选参数。
  37026. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  37027. * @param {Object} [options.headers] - 请求头。
  37028. * @usage
  37029. */
  37030. var TopologyValidatorJobsService = /*#__PURE__*/function (_ProcessingServiceBas) {
  37031. TopologyValidatorJobsService_inherits(TopologyValidatorJobsService, _ProcessingServiceBas);
  37032. var _super = TopologyValidatorJobsService_createSuper(TopologyValidatorJobsService);
  37033. function TopologyValidatorJobsService(url, options) {
  37034. var _this;
  37035. TopologyValidatorJobsService_classCallCheck(this, TopologyValidatorJobsService);
  37036. _this = _super.call(this, url, options);
  37037. _this.url = Util_Util.urlPathAppend(_this.url, 'spatialanalyst/topologyvalidator');
  37038. _this.CLASS_NAME = "SuperMap.TopologyValidatorJobsService";
  37039. return _this;
  37040. }
  37041. /**
  37042. *@override
  37043. */
  37044. TopologyValidatorJobsService_createClass(TopologyValidatorJobsService, [{
  37045. key: "destroy",
  37046. value: function destroy() {
  37047. TopologyValidatorJobsService_get(TopologyValidatorJobsService_getPrototypeOf(TopologyValidatorJobsService.prototype), "destroy", this).call(this);
  37048. }
  37049. /**
  37050. * @function TopologyValidatorJobsService.protitype.getTopologyValidatorJobs
  37051. * @description 获取拓扑检查分析所有任务
  37052. */
  37053. }, {
  37054. key: "getTopologyValidatorJobs",
  37055. value: function getTopologyValidatorJobs() {
  37056. TopologyValidatorJobsService_get(TopologyValidatorJobsService_getPrototypeOf(TopologyValidatorJobsService.prototype), "getJobs", this).call(this, this.url);
  37057. }
  37058. /**
  37059. * @function TopologyValidatorJobsService.protitype.getTopologyValidatorJob
  37060. * @description 获取指定id的拓扑检查分析服务
  37061. * @param {string} id - 指定要获取数据的id
  37062. */
  37063. }, {
  37064. key: "getTopologyValidatorJob",
  37065. value: function getTopologyValidatorJob(id) {
  37066. TopologyValidatorJobsService_get(TopologyValidatorJobsService_getPrototypeOf(TopologyValidatorJobsService.prototype), "getJobs", this).call(this, Util_Util.urlPathAppend(this.url, id));
  37067. }
  37068. /**
  37069. * @function TopologyValidatorJobsService.protitype.addTopologyValidatorJob
  37070. * @description 新建拓扑检查分析服务
  37071. * @param {TopologyValidatorJobsParameter} params - 拓扑检查分析任务参数类。
  37072. * @param {number} seconds -创建成功结果的时间间隔。
  37073. */
  37074. }, {
  37075. key: "addTopologyValidatorJob",
  37076. value: function addTopologyValidatorJob(params, seconds) {
  37077. TopologyValidatorJobsService_get(TopologyValidatorJobsService_getPrototypeOf(TopologyValidatorJobsService.prototype), "addJob", this).call(this, this.url, params, TopologyValidatorJobsParameter, seconds);
  37078. }
  37079. }]);
  37080. return TopologyValidatorJobsService;
  37081. }(ProcessingServiceBase);
  37082. ;// CONCATENATED MODULE: ./src/common/iServer/SummaryAttributesJobsParameter.js
  37083. function SummaryAttributesJobsParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  37084. 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); } }
  37085. function SummaryAttributesJobsParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) SummaryAttributesJobsParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) SummaryAttributesJobsParameter_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  37086. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  37087. * This program are made available under the terms of the Apache License, Version 2.0
  37088. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  37089. /**
  37090. * @class SummaryAttributesJobsParameter
  37091. * @deprecatedclass SuperMap.SummaryAttributesJobsParameter
  37092. * @category iServer ProcessingService SummaryAttributes
  37093. * @classdesc 属性汇总分析任务参数类。
  37094. * @param {Object} options - 参数。
  37095. * @param {string} options.datasetName - 数据集名。
  37096. * @param {string} options.groupField - 分组字段。
  37097. * @param {string} options.attributeField - 属性字段。
  37098. * @param {string} options.statisticModes - 统计模式。
  37099. * @param {OutputSetting} [options.output] -输出参数设置。
  37100. * @param {MappingParameters} [options.mappingParameters] - 分析后结果可视化的参数类。
  37101. * @usage
  37102. */
  37103. var SummaryAttributesJobsParameter = /*#__PURE__*/function () {
  37104. function SummaryAttributesJobsParameter(options) {
  37105. SummaryAttributesJobsParameter_classCallCheck(this, SummaryAttributesJobsParameter);
  37106. if (!options) {
  37107. return;
  37108. }
  37109. /**
  37110. * @member {string} SummaryAttributesJobsParameter.prototype.datasetName
  37111. * @description 汇总数据集名称。
  37112. */
  37113. this.datasetName = "";
  37114. /**
  37115. * @member {string} SummaryAttributesJobsParameter.prototype.groupField
  37116. * @description 分组字段。
  37117. */
  37118. this.groupField = "";
  37119. /**
  37120. * @member {string} SummaryAttributesJobsParameter.prototype.attributeField
  37121. * @description 属性字段。
  37122. */
  37123. this.attributeField = "";
  37124. /**
  37125. * @member {string} SummaryAttributesJobsParameter.prototype.statisticModes
  37126. * @description 属性汇总统计模式。
  37127. */
  37128. this.statisticModes = "";
  37129. /**
  37130. * @member {OutputSetting} SummaryAttributesJobsParameter.prototype.output
  37131. * @description 输出参数设置类。
  37132. */
  37133. this.output = null;
  37134. /**
  37135. * @member {MappingParameters} [SummaryAttributesJobsParameter.prototype.mappingParameters]
  37136. * @description 分析后结果可视化的参数类。
  37137. */
  37138. this.mappingParameters = null;
  37139. Util_Util.extend(this, options);
  37140. this.CLASS_NAME = "SuperMap.SummaryAttributesJobsParameter";
  37141. }
  37142. /**
  37143. * @function SummaryAttributesJobsParameter.prototype.destroy
  37144. * @description 释放资源,将资源的属性置空。
  37145. */
  37146. SummaryAttributesJobsParameter_createClass(SummaryAttributesJobsParameter, [{
  37147. key: "destroy",
  37148. value: function destroy() {
  37149. this.datasetName = null;
  37150. this.groupField = null;
  37151. this.attributeField = null;
  37152. this.statisticModes = null;
  37153. if (this.output instanceof OutputSetting) {
  37154. this.output.destroy();
  37155. this.output = null;
  37156. }
  37157. if (this.mappingParameters instanceof MappingParameters) {
  37158. this.mappingParameters.destroy();
  37159. this.mappingParameters = null;
  37160. }
  37161. }
  37162. /**
  37163. * @function SummaryAttributesJobsParameter.toObject
  37164. * @param {Object} SummaryAttributesJobsParameter - 属性汇总任务参数。
  37165. * @param {Object} tempObj - 目标对象。
  37166. * @description 生成属性汇总分析任务对象。
  37167. */
  37168. }], [{
  37169. key: "toObject",
  37170. value: function toObject(_SummaryAttributesJobsParameter, tempObj) {
  37171. for (var name in _SummaryAttributesJobsParameter) {
  37172. if (name === "datasetName") {
  37173. tempObj['input'] = tempObj['input'] || {};
  37174. tempObj['input'][name] = _SummaryAttributesJobsParameter[name];
  37175. continue;
  37176. }
  37177. if (name === "output") {
  37178. tempObj['output'] = tempObj['output'] || {};
  37179. tempObj['output'] = _SummaryAttributesJobsParameter[name];
  37180. continue;
  37181. }
  37182. tempObj['analyst'] = tempObj['analyst'] || {};
  37183. tempObj['analyst'][name] = _SummaryAttributesJobsParameter[name];
  37184. if (name === 'mappingParameters') {
  37185. tempObj['analyst'][name] = tempObj['analyst'][name] || {};
  37186. tempObj['analyst']['mappingParameters'] = _SummaryAttributesJobsParameter[name];
  37187. }
  37188. }
  37189. }
  37190. }]);
  37191. return SummaryAttributesJobsParameter;
  37192. }();
  37193. ;// CONCATENATED MODULE: ./src/common/iServer/SummaryAttributesJobsService.js
  37194. function SummaryAttributesJobsService_typeof(obj) { "@babel/helpers - typeof"; return SummaryAttributesJobsService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, SummaryAttributesJobsService_typeof(obj); }
  37195. function SummaryAttributesJobsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  37196. 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); } }
  37197. function SummaryAttributesJobsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) SummaryAttributesJobsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) SummaryAttributesJobsService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  37198. function SummaryAttributesJobsService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { SummaryAttributesJobsService_get = Reflect.get.bind(); } else { SummaryAttributesJobsService_get = function _get(target, property, receiver) { var base = SummaryAttributesJobsService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return SummaryAttributesJobsService_get.apply(this, arguments); }
  37199. function SummaryAttributesJobsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SummaryAttributesJobsService_getPrototypeOf(object); if (object === null) break; } return object; }
  37200. function SummaryAttributesJobsService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) SummaryAttributesJobsService_setPrototypeOf(subClass, superClass); }
  37201. function SummaryAttributesJobsService_setPrototypeOf(o, p) { SummaryAttributesJobsService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SummaryAttributesJobsService_setPrototypeOf(o, p); }
  37202. 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); }; }
  37203. function SummaryAttributesJobsService_possibleConstructorReturn(self, call) { if (call && (SummaryAttributesJobsService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return SummaryAttributesJobsService_assertThisInitialized(self); }
  37204. function SummaryAttributesJobsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  37205. function SummaryAttributesJobsService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  37206. function SummaryAttributesJobsService_getPrototypeOf(o) { SummaryAttributesJobsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SummaryAttributesJobsService_getPrototypeOf(o); }
  37207. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  37208. * This program are made available under the terms of the Apache License, Version 2.0
  37209. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  37210. /**
  37211. * @class SummaryAttributesJobsService
  37212. * @deprecatedclass SuperMap.SummaryAttributesJobsService
  37213. * @category iServer ProcessingService SummaryAttributes
  37214. * @classdesc 属性汇总分析服务类
  37215. * @extends {ProcessingServiceBase}
  37216. * @param {string} url - 服务地址。
  37217. * @param {Object} options - 可选参数。
  37218. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  37219. * @param {Object} [options.headers] - 请求头。
  37220. * @usage
  37221. */
  37222. var SummaryAttributesJobsService = /*#__PURE__*/function (_ProcessingServiceBas) {
  37223. SummaryAttributesJobsService_inherits(SummaryAttributesJobsService, _ProcessingServiceBas);
  37224. var _super = SummaryAttributesJobsService_createSuper(SummaryAttributesJobsService);
  37225. function SummaryAttributesJobsService(url, options) {
  37226. var _this;
  37227. SummaryAttributesJobsService_classCallCheck(this, SummaryAttributesJobsService);
  37228. _this = _super.call(this, url, options);
  37229. _this.url = Util_Util.urlPathAppend(_this.url, 'spatialanalyst/summaryattributes');
  37230. _this.CLASS_NAME = "SuperMap.SummaryAttributesJobsService";
  37231. return _this;
  37232. }
  37233. /**
  37234. *@override
  37235. */
  37236. SummaryAttributesJobsService_createClass(SummaryAttributesJobsService, [{
  37237. key: "destroy",
  37238. value: function destroy() {
  37239. SummaryAttributesJobsService_get(SummaryAttributesJobsService_getPrototypeOf(SummaryAttributesJobsService.prototype), "destroy", this).call(this);
  37240. }
  37241. /**
  37242. * @function SummaryAttributesJobsService.protitype.getSummaryAttributesJobs
  37243. * @description 获取属性汇总分析所有任务
  37244. */
  37245. }, {
  37246. key: "getSummaryAttributesJobs",
  37247. value: function getSummaryAttributesJobs() {
  37248. SummaryAttributesJobsService_get(SummaryAttributesJobsService_getPrototypeOf(SummaryAttributesJobsService.prototype), "getJobs", this).call(this, this.url);
  37249. }
  37250. /**
  37251. * @function SummaryAttributesJobsService.protitype.getSummaryAttributesJob
  37252. * @description 获取指定id的属性汇总分析服务
  37253. * @param {string} id - 指定要获取数据的id
  37254. */
  37255. }, {
  37256. key: "getSummaryAttributesJob",
  37257. value: function getSummaryAttributesJob(id) {
  37258. SummaryAttributesJobsService_get(SummaryAttributesJobsService_getPrototypeOf(SummaryAttributesJobsService.prototype), "getJobs", this).call(this, Util_Util.urlPathAppend(this.url, id));
  37259. }
  37260. /**
  37261. * @function SummaryAttributesJobsService.protitype.addSummaryAttributesJob
  37262. * @description 新建属性汇总分析服务
  37263. * @param {SummaryAttributesJobsParameter} params - 属性汇总分析任务参数类。
  37264. * @param {number} seconds - 创建成功结果的时间间隔。
  37265. */
  37266. }, {
  37267. key: "addSummaryAttributesJob",
  37268. value: function addSummaryAttributesJob(params, seconds) {
  37269. SummaryAttributesJobsService_get(SummaryAttributesJobsService_getPrototypeOf(SummaryAttributesJobsService.prototype), "addJob", this).call(this, this.url, params, SummaryAttributesJobsParameter, seconds);
  37270. }
  37271. }]);
  37272. return SummaryAttributesJobsService;
  37273. }(ProcessingServiceBase);
  37274. ;// CONCATENATED MODULE: ./src/common/iServer/ProcessingService.js
  37275. function ProcessingService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  37276. 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); } }
  37277. function ProcessingService_createClass(Constructor, protoProps, staticProps) { if (protoProps) ProcessingService_defineProperties(Constructor.prototype, protoProps); if (staticProps) ProcessingService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  37278. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  37279. * This program are made available under the terms of the Apache License, Version 2.0
  37280. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  37281. /**
  37282. * @class ProcessingService
  37283. * @category iServer ProcessingService
  37284. * @classdesc 分布式分析相关服务类。
  37285. * @extends {ServiceBase}
  37286. * @example
  37287. * new ProcessingService(url,options)
  37288. * .getKernelDensityJobs(function(result){
  37289. * //doSomething
  37290. * })
  37291. * @param {string} url - 服务地址。
  37292. * @param {Object} options - 参数。
  37293. * @param {string} [options.proxy] - 服务代理地址。
  37294. * @param {boolean} [options.withCredentials=false] - 请求是否携带cookie。
  37295. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  37296. * @param {Object} [options.headers] - 请求头。
  37297. * @usage
  37298. */
  37299. var ProcessingService_ProcessingService = /*#__PURE__*/function () {
  37300. function ProcessingService(url, options) {
  37301. ProcessingService_classCallCheck(this, ProcessingService);
  37302. this.url = url;
  37303. this.options = options || {};
  37304. this.kernelDensityJobs = {};
  37305. this.summaryMeshJobs = {};
  37306. this.queryJobs = {};
  37307. this.summaryRegionJobs = {};
  37308. this.vectorClipJobs = {};
  37309. this.overlayGeoJobs = {};
  37310. this.buffersJobs = {};
  37311. this.topologyValidatorJobs = {};
  37312. this.summaryAttributesJobs = {};
  37313. }
  37314. /**
  37315. * @function ProcessingService.prototype.getKernelDensityJobs
  37316. * @description 获取密度分析的列表。
  37317. * @param {RequestCallback} callback - 回调函数。
  37318. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  37319. */
  37320. ProcessingService_createClass(ProcessingService, [{
  37321. key: "getKernelDensityJobs",
  37322. value: function getKernelDensityJobs(callback, resultFormat) {
  37323. var me = this,
  37324. format = me._processFormat(resultFormat);
  37325. var kernelDensityJobsService = new KernelDensityJobsService(me.url, {
  37326. proxy: me.options.proxy,
  37327. withCredentials: me.options.withCredentials,
  37328. crossOrigin: me.options.crossOrigin,
  37329. headers: me.options.headers,
  37330. eventListeners: {
  37331. scope: me,
  37332. processCompleted: callback,
  37333. processFailed: callback
  37334. },
  37335. format: format
  37336. });
  37337. kernelDensityJobsService.getKernelDensityJobs();
  37338. }
  37339. /**
  37340. * @function ProcessingService.prototype.getKernelDensityJob
  37341. * @description 获取某个密度分析。
  37342. * @param {string} id - 空间分析的ID。
  37343. * @param {RequestCallback} callback - 回调函数。
  37344. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  37345. */
  37346. }, {
  37347. key: "getKernelDensityJob",
  37348. value: function getKernelDensityJob(id, callback, resultFormat) {
  37349. var me = this,
  37350. format = me._processFormat(resultFormat);
  37351. var kernelDensityJobsService = new KernelDensityJobsService(me.url, {
  37352. proxy: me.options.proxy,
  37353. withCredentials: me.options.withCredentials,
  37354. crossOrigin: me.options.crossOrigin,
  37355. headers: me.options.headers,
  37356. eventListeners: {
  37357. scope: me,
  37358. processCompleted: callback,
  37359. processFailed: callback
  37360. },
  37361. format: format
  37362. });
  37363. kernelDensityJobsService.getKernelDensityJob(id);
  37364. }
  37365. /**
  37366. * @function ProcessingService.prototype.addKernelDensityJob
  37367. * @description 密度分析。
  37368. * @param {KernelDensityJobParameter} params -密度分析参数类。
  37369. * @param {RequestCallback} callback 回调函数。
  37370. * @param {number} [seconds=1000] - 获取创建成功结果的时间间隔。
  37371. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  37372. */
  37373. }, {
  37374. key: "addKernelDensityJob",
  37375. value: function addKernelDensityJob(params, callback, seconds, resultFormat) {
  37376. var me = this,
  37377. format = me._processFormat(resultFormat);
  37378. var kernelDensityJobsService = new KernelDensityJobsService(me.url, {
  37379. proxy: me.options.proxy,
  37380. withCredentials: me.options.withCredentials,
  37381. crossOrigin: me.options.crossOrigin,
  37382. headers: me.options.headers,
  37383. eventListeners: {
  37384. scope: me,
  37385. processCompleted: callback,
  37386. processFailed: callback,
  37387. processRunning: function processRunning(job) {
  37388. me.kernelDensityJobs[job.id] = job.state;
  37389. }
  37390. },
  37391. format: format
  37392. });
  37393. kernelDensityJobsService.addKernelDensityJob(params, seconds);
  37394. }
  37395. /**
  37396. * @function ProcessingService.prototype.getKernelDensityJobState
  37397. * @description 获取密度分析的状态。
  37398. * @param {string} id - 密度分析的id。
  37399. * @returns {Object} 密度分析的状态。
  37400. */
  37401. }, {
  37402. key: "getKernelDensityJobState",
  37403. value: function getKernelDensityJobState(id) {
  37404. return this.kernelDensityJobs[id];
  37405. }
  37406. /**
  37407. * @function ProcessingService.prototype.getSummaryMeshJobs
  37408. * @description 获取点聚合分析的列表。
  37409. * @param {RequestCallback} callback - 回调函数。
  37410. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  37411. */
  37412. }, {
  37413. key: "getSummaryMeshJobs",
  37414. value: function getSummaryMeshJobs(callback, resultFormat) {
  37415. var me = this,
  37416. format = me._processFormat(resultFormat);
  37417. var summaryMeshJobsService = new SummaryMeshJobsService(me.url, {
  37418. proxy: me.options.proxy,
  37419. withCredentials: me.options.withCredentials,
  37420. crossOrigin: me.options.crossOrigin,
  37421. headers: me.options.headers,
  37422. eventListeners: {
  37423. scope: me,
  37424. processCompleted: callback,
  37425. processFailed: callback
  37426. },
  37427. format: format
  37428. });
  37429. summaryMeshJobsService.getSummaryMeshJobs();
  37430. }
  37431. /**
  37432. * @function ProcessingService.prototype.getSummaryMeshJob
  37433. * @description 获取某个点聚合分析。
  37434. * @param {string} id - 空间分析的 ID。
  37435. * @param {RequestCallback} callback - 回调函数。
  37436. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  37437. */
  37438. }, {
  37439. key: "getSummaryMeshJob",
  37440. value: function getSummaryMeshJob(id, callback, resultFormat) {
  37441. var me = this,
  37442. format = me._processFormat(resultFormat);
  37443. var summaryMeshJobsService = new SummaryMeshJobsService(me.url, {
  37444. proxy: me.options.proxy,
  37445. withCredentials: me.options.withCredentials,
  37446. crossOrigin: me.options.crossOrigin,
  37447. headers: me.options.headers,
  37448. eventListeners: {
  37449. scope: me,
  37450. processCompleted: callback,
  37451. processFailed: callback
  37452. },
  37453. format: format
  37454. });
  37455. summaryMeshJobsService.getSummaryMeshJob(id);
  37456. }
  37457. /**
  37458. * @function ProcessingService.prototype.addSummaryMeshJob
  37459. * @description 点聚合分析。
  37460. * @param {SummaryMeshJobParameter} params - 点聚合分析任务参数类。
  37461. * @param {RequestCallback} callback 回调函数。
  37462. * @param {number} [seconds=1000] - 获取创建成功结果的时间间隔。
  37463. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  37464. */
  37465. }, {
  37466. key: "addSummaryMeshJob",
  37467. value: function addSummaryMeshJob(params, callback, seconds, resultFormat) {
  37468. var me = this,
  37469. format = me._processFormat(resultFormat);
  37470. var summaryMeshJobsService = new SummaryMeshJobsService(me.url, {
  37471. proxy: me.options.proxy,
  37472. withCredentials: me.options.withCredentials,
  37473. crossOrigin: me.options.crossOrigin,
  37474. headers: me.options.headers,
  37475. eventListeners: {
  37476. scope: me,
  37477. processCompleted: callback,
  37478. processFailed: callback,
  37479. processRunning: function processRunning(job) {
  37480. me.summaryMeshJobs[job.id] = job.state;
  37481. }
  37482. },
  37483. format: format
  37484. });
  37485. summaryMeshJobsService.addSummaryMeshJob(params, seconds);
  37486. }
  37487. /**
  37488. * @function ProcessingService.prototype.getSummaryMeshJobState
  37489. * @description 获取点聚合分析的状态。
  37490. * @param {string} id - 点聚合分析的 ID。
  37491. * @returns {Object} 点聚合分析的状态。
  37492. */
  37493. }, {
  37494. key: "getSummaryMeshJobState",
  37495. value: function getSummaryMeshJobState(id) {
  37496. return this.summaryMeshJobs[id];
  37497. }
  37498. /**
  37499. * @function ProcessingService.prototype.getQueryJobs
  37500. * @description 获取单对象查询分析的列表。
  37501. * @param {RequestCallback} callback - 回调函数。
  37502. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  37503. */
  37504. }, {
  37505. key: "getQueryJobs",
  37506. value: function getQueryJobs(callback, resultFormat) {
  37507. var me = this,
  37508. format = me._processFormat(resultFormat);
  37509. var singleObjectQueryJobsService = new SingleObjectQueryJobsService(me.url, {
  37510. proxy: me.options.proxy,
  37511. withCredentials: me.options.withCredentials,
  37512. crossOrigin: me.options.crossOrigin,
  37513. headers: me.options.headers,
  37514. eventListeners: {
  37515. scope: me,
  37516. processCompleted: callback,
  37517. processFailed: callback
  37518. },
  37519. format: format
  37520. });
  37521. singleObjectQueryJobsService.getQueryJobs();
  37522. }
  37523. /**
  37524. * @function ProcessingService.prototype.getQueryJob
  37525. * @description 获取某个单对象查询分析。
  37526. * @param {string} id - 空间分析的 ID。
  37527. * @param {RequestCallback} callback - 回调函数。
  37528. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  37529. */
  37530. }, {
  37531. key: "getQueryJob",
  37532. value: function getQueryJob(id, callback, resultFormat) {
  37533. var me = this,
  37534. format = me._processFormat(resultFormat);
  37535. var singleObjectQueryJobsService = new SingleObjectQueryJobsService(me.url, {
  37536. proxy: me.options.proxy,
  37537. withCredentials: me.options.withCredentials,
  37538. crossOrigin: me.options.crossOrigin,
  37539. headers: me.options.headers,
  37540. eventListeners: {
  37541. scope: me,
  37542. processCompleted: callback,
  37543. processFailed: callback
  37544. },
  37545. format: format
  37546. });
  37547. singleObjectQueryJobsService.getQueryJob(id);
  37548. }
  37549. /**
  37550. * @function ProcessingService.prototype.addQueryJob
  37551. * @description 单对象查询分析。
  37552. * @param {SingleObjectQueryJobsParameter} params - 单对象查询分析的请求参数。
  37553. * @param {RequestCallback} callback - 回调函数。
  37554. * @param {number} [seconds=1000] - 获取创建成功结果的时间间隔。
  37555. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  37556. */
  37557. }, {
  37558. key: "addQueryJob",
  37559. value: function addQueryJob(params, callback, seconds, resultFormat) {
  37560. var me = this,
  37561. format = me._processFormat(resultFormat);
  37562. var singleObjectQueryJobsService = new SingleObjectQueryJobsService(me.url, {
  37563. proxy: me.options.proxy,
  37564. withCredentials: me.options.withCredentials,
  37565. crossOrigin: me.options.crossOrigin,
  37566. headers: me.options.headers,
  37567. eventListeners: {
  37568. scope: me,
  37569. processCompleted: callback,
  37570. processFailed: callback,
  37571. processRunning: function processRunning(job) {
  37572. me.queryJobs[job.id] = job.state;
  37573. }
  37574. },
  37575. format: format
  37576. });
  37577. singleObjectQueryJobsService.addQueryJob(params, seconds);
  37578. }
  37579. /**
  37580. * @function ProcessingService.prototype.getQueryJobState
  37581. * @description 获取单对象查询分析的状态。
  37582. * @param {string} id - 单对象查询分析的 ID。
  37583. * @returns {Object} 单对象查询分析的状态。
  37584. */
  37585. }, {
  37586. key: "getQueryJobState",
  37587. value: function getQueryJobState(id) {
  37588. return this.queryJobs[id];
  37589. }
  37590. /**
  37591. * @function ProcessingService.prototype.getSummaryRegionJobs
  37592. * @description 获取区域汇总分析的列表。
  37593. * @param {RequestCallback} callback - 回调函数。
  37594. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  37595. */
  37596. }, {
  37597. key: "getSummaryRegionJobs",
  37598. value: function getSummaryRegionJobs(callback, resultFormat) {
  37599. var me = this,
  37600. format = me._processFormat(resultFormat);
  37601. var summaryRegionJobsService = new SummaryRegionJobsService(me.url, {
  37602. proxy: me.options.proxy,
  37603. withCredentials: me.options.withCredentials,
  37604. crossOrigin: me.options.crossOrigin,
  37605. headers: me.options.headers,
  37606. eventListeners: {
  37607. scope: me,
  37608. processCompleted: callback,
  37609. processFailed: callback
  37610. },
  37611. format: format
  37612. });
  37613. summaryRegionJobsService.getSummaryRegionJobs();
  37614. }
  37615. /**
  37616. * @function ProcessingService.prototype.getSummaryRegionJob
  37617. * @description 获取某个区域汇总分析。
  37618. * @param {string} id - 区域汇总分析的 ID。
  37619. * @param {RequestCallback} callback - 回调函数。
  37620. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  37621. */
  37622. }, {
  37623. key: "getSummaryRegionJob",
  37624. value: function getSummaryRegionJob(id, callback, resultFormat) {
  37625. var me = this,
  37626. format = me._processFormat(resultFormat);
  37627. var summaryRegionJobsService = new SummaryRegionJobsService(me.url, {
  37628. proxy: me.options.proxy,
  37629. withCredentials: me.options.withCredentials,
  37630. crossOrigin: me.options.crossOrigin,
  37631. headers: me.options.headers,
  37632. eventListeners: {
  37633. scope: me,
  37634. processCompleted: callback,
  37635. processFailed: callback
  37636. },
  37637. format: format
  37638. });
  37639. summaryRegionJobsService.getSummaryRegionJob(id);
  37640. }
  37641. /**
  37642. * @function ProcessingService.prototype.addSummaryRegionJob
  37643. * @description 区域汇总分析。
  37644. * @param {SummaryRegionJobParameter} params - 区域汇总分析参数类。
  37645. * @param {RequestCallback} callback - 回调函数。
  37646. * @param {number} [seconds=1000] - 获取创建成功结果的时间间隔。
  37647. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  37648. */
  37649. }, {
  37650. key: "addSummaryRegionJob",
  37651. value: function addSummaryRegionJob(params, callback, seconds, resultFormat) {
  37652. var me = this,
  37653. format = me._processFormat(resultFormat);
  37654. var summaryRegionJobsService = new SummaryRegionJobsService(me.url, {
  37655. proxy: me.options.proxy,
  37656. withCredentials: me.options.withCredentials,
  37657. crossOrigin: me.options.crossOrigin,
  37658. headers: me.options.headers,
  37659. eventListeners: {
  37660. scope: me,
  37661. processCompleted: callback,
  37662. processFailed: callback,
  37663. processRunning: function processRunning(job) {
  37664. me.summaryRegionJobs[job.id] = job.state;
  37665. }
  37666. },
  37667. format: format
  37668. });
  37669. summaryRegionJobsService.addSummaryRegionJob(params, seconds);
  37670. }
  37671. /**
  37672. * @function ProcessingService.prototype.getSummaryRegionJobState
  37673. * @description 获取区域汇总分析的状态。
  37674. * @param {string} id - 生成区域汇总分析的 ID。
  37675. * @returns {Object} 区域汇总分析的状态。
  37676. */
  37677. }, {
  37678. key: "getSummaryRegionJobState",
  37679. value: function getSummaryRegionJobState(id) {
  37680. return this.summaryRegionJobs[id];
  37681. }
  37682. /**
  37683. * @function ProcessingService.prototype.getVectorClipJobs
  37684. * @description 获取矢量裁剪分析的列表。
  37685. * @param {RequestCallback} callback - 回调函数。
  37686. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  37687. */
  37688. }, {
  37689. key: "getVectorClipJobs",
  37690. value: function getVectorClipJobs(callback, resultFormat) {
  37691. var me = this,
  37692. format = me._processFormat(resultFormat);
  37693. var vectorClipJobsService = new VectorClipJobsService(me.url, {
  37694. proxy: me.options.proxy,
  37695. withCredentials: me.options.withCredentials,
  37696. crossOrigin: me.options.crossOrigin,
  37697. headers: me.options.headers,
  37698. eventListeners: {
  37699. scope: me,
  37700. processCompleted: callback,
  37701. processFailed: callback
  37702. },
  37703. format: format
  37704. });
  37705. vectorClipJobsService.getVectorClipJobs();
  37706. }
  37707. /**
  37708. * @function ProcessingService.prototype.getVectorClipJob
  37709. * @description 获取某个矢量裁剪分析。
  37710. * @param {string} id - 空间分析的 ID。
  37711. * @param {RequestCallback} callback - 回调函数。
  37712. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  37713. */
  37714. }, {
  37715. key: "getVectorClipJob",
  37716. value: function getVectorClipJob(id, callback, resultFormat) {
  37717. var me = this,
  37718. format = me._processFormat(resultFormat);
  37719. var vectorClipJobsService = new VectorClipJobsService(me.url, {
  37720. proxy: me.options.proxy,
  37721. withCredentials: me.options.withCredentials,
  37722. crossOrigin: me.options.crossOrigin,
  37723. headers: me.options.headers,
  37724. eventListeners: {
  37725. scope: me,
  37726. processCompleted: callback,
  37727. processFailed: callback
  37728. },
  37729. format: format
  37730. });
  37731. vectorClipJobsService.getVectorClipJob(id);
  37732. }
  37733. /**
  37734. * @function ProcessingService.prototype.addVectorClipJob
  37735. * @description 矢量裁剪分析。
  37736. * @param {VectorClipJobsParameter} params - 矢量裁剪分析请求参数类。
  37737. * @param {RequestCallback} callback - 回调函数。
  37738. * @param {number} [seconds=1000] - 获取创建成功结果的时间间隔。
  37739. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  37740. */
  37741. }, {
  37742. key: "addVectorClipJob",
  37743. value: function addVectorClipJob(params, callback, seconds, resultFormat) {
  37744. var me = this,
  37745. format = me._processFormat(resultFormat);
  37746. var vectorClipJobsService = new VectorClipJobsService(me.url, {
  37747. proxy: me.options.proxy,
  37748. withCredentials: me.options.withCredentials,
  37749. crossOrigin: me.options.crossOrigin,
  37750. headers: me.options.headers,
  37751. eventListeners: {
  37752. scope: me,
  37753. processCompleted: callback,
  37754. processFailed: callback,
  37755. processRunning: function processRunning(job) {
  37756. me.vectorClipJobs[job.id] = job.state;
  37757. }
  37758. },
  37759. format: format
  37760. });
  37761. vectorClipJobsService.addVectorClipJob(params, seconds);
  37762. }
  37763. /**
  37764. * @function ProcessingService.prototype.getVectorClipJobState
  37765. * @description 获取矢量裁剪分析的状态。
  37766. * @param {number} id - 矢量裁剪分析的ID。
  37767. * @returns {Object} 矢量裁剪分析的状态。
  37768. */
  37769. }, {
  37770. key: "getVectorClipJobState",
  37771. value: function getVectorClipJobState(id) {
  37772. return this.vectorClipJobs[id];
  37773. }
  37774. /**
  37775. * @function ProcessingService.prototype.getOverlayGeoJobs
  37776. * @description 获取叠加分析的列表。
  37777. * @param {RequestCallback} callback - 回调函数。
  37778. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  37779. */
  37780. }, {
  37781. key: "getOverlayGeoJobs",
  37782. value: function getOverlayGeoJobs(callback, resultFormat) {
  37783. var me = this,
  37784. format = me._processFormat(resultFormat);
  37785. var overlayGeoJobsService = new OverlayGeoJobsService(me.url, {
  37786. proxy: me.options.proxy,
  37787. withCredentials: me.options.withCredentials,
  37788. crossOrigin: me.options.crossOrigin,
  37789. headers: me.options.headers,
  37790. eventListeners: {
  37791. scope: me,
  37792. processCompleted: callback,
  37793. processFailed: callback
  37794. },
  37795. format: format
  37796. });
  37797. overlayGeoJobsService.getOverlayGeoJobs();
  37798. }
  37799. /**
  37800. * @function ProcessingService.prototype.getOverlayGeoJob
  37801. * @description 获取某个叠加分析。
  37802. * @param {string} id - 空间分析的 ID。
  37803. * @param {RequestCallback} callback - 回调函数。
  37804. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  37805. */
  37806. }, {
  37807. key: "getOverlayGeoJob",
  37808. value: function getOverlayGeoJob(id, callback, resultFormat) {
  37809. var me = this,
  37810. format = me._processFormat(resultFormat);
  37811. var overlayGeoJobsService = new OverlayGeoJobsService(me.url, {
  37812. proxy: me.options.proxy,
  37813. withCredentials: me.options.withCredentials,
  37814. crossOrigin: me.options.crossOrigin,
  37815. headers: me.options.headers,
  37816. eventListeners: {
  37817. scope: me,
  37818. processCompleted: callback,
  37819. processFailed: callback
  37820. },
  37821. format: format
  37822. });
  37823. overlayGeoJobsService.getOverlayGeoJob(id);
  37824. }
  37825. /**
  37826. * @function ProcessingService.prototype.addOverlayGeoJob
  37827. * @description 叠加分析。
  37828. * @param {OverlayGeoJobParameter} params - 叠加分析请求参数类。
  37829. * @param {RequestCallback} callback - 回调函数。
  37830. * @param {number} [seconds=1000] - 获取创建成功结果的时间间隔。
  37831. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  37832. */
  37833. }, {
  37834. key: "addOverlayGeoJob",
  37835. value: function addOverlayGeoJob(params, callback, seconds, resultFormat) {
  37836. var me = this,
  37837. format = me._processFormat(resultFormat);
  37838. var overlayGeoJobsService = new OverlayGeoJobsService(me.url, {
  37839. proxy: me.options.proxy,
  37840. withCredentials: me.options.withCredentials,
  37841. crossOrigin: me.options.crossOrigin,
  37842. headers: me.options.headers,
  37843. eventListeners: {
  37844. scope: me,
  37845. processCompleted: callback,
  37846. processFailed: callback,
  37847. processRunning: function processRunning(job) {
  37848. me.overlayGeoJobs[job.id] = job.state;
  37849. }
  37850. },
  37851. format: format
  37852. });
  37853. overlayGeoJobsService.addOverlayGeoJob(params, seconds);
  37854. }
  37855. /**
  37856. * @function ProcessingService.prototype.getoverlayGeoJobState
  37857. * @description 获取叠加分析的状态。
  37858. * @param {string} id - 叠加分析的 ID。
  37859. * @returns {Object} 叠加分析的状态。
  37860. */
  37861. }, {
  37862. key: "getoverlayGeoJobState",
  37863. value: function getoverlayGeoJobState(id) {
  37864. return this.overlayGeoJobs[id];
  37865. }
  37866. /**
  37867. * @function ProcessingService.prototype.getBuffersJobs
  37868. * @description 获取缓冲区分析的列表。
  37869. * @param {RequestCallback} callback - 回调函数。
  37870. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  37871. */
  37872. }, {
  37873. key: "getBuffersJobs",
  37874. value: function getBuffersJobs(callback, resultFormat) {
  37875. var me = this,
  37876. format = me._processFormat(resultFormat);
  37877. var buffersAnalystJobsService = new BuffersAnalystJobsService(me.url, {
  37878. proxy: me.options.proxy,
  37879. withCredentials: me.options.withCredentials,
  37880. crossOrigin: me.options.crossOrigin,
  37881. headers: me.options.headers,
  37882. eventListeners: {
  37883. scope: me,
  37884. processCompleted: callback,
  37885. processFailed: callback
  37886. },
  37887. format: format
  37888. });
  37889. buffersAnalystJobsService.getBuffersJobs();
  37890. }
  37891. /**
  37892. * @function ProcessingService.prototype.getBuffersJob
  37893. * @description 获取某个缓冲区分析。
  37894. * @param {string} id - 空间分析的 ID。
  37895. * @param {RequestCallback} callback - 回调函数。
  37896. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  37897. */
  37898. }, {
  37899. key: "getBuffersJob",
  37900. value: function getBuffersJob(id, callback, resultFormat) {
  37901. var me = this,
  37902. format = me._processFormat(resultFormat);
  37903. var buffersAnalystJobsService = new BuffersAnalystJobsService(me.url, {
  37904. proxy: me.options.proxy,
  37905. withCredentials: me.options.withCredentials,
  37906. crossOrigin: me.options.crossOrigin,
  37907. headers: me.options.headers,
  37908. eventListeners: {
  37909. scope: me,
  37910. processCompleted: callback,
  37911. processFailed: callback
  37912. },
  37913. format: format
  37914. });
  37915. buffersAnalystJobsService.getBuffersJob(id);
  37916. }
  37917. /**
  37918. * @function ProcessingService.prototype.addBuffersJob
  37919. * @description 缓冲区分析。
  37920. * @param {BuffersAnalystJobsParameter} params - 缓冲区分析请求参数类。
  37921. * @param {RequestCallback} callback - 回调函数。
  37922. * @param {number} seconds - 获取创建成功结果的时间间隔。
  37923. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  37924. */
  37925. }, {
  37926. key: "addBuffersJob",
  37927. value: function addBuffersJob(params, callback, seconds, resultFormat) {
  37928. var me = this,
  37929. format = me._processFormat(resultFormat);
  37930. var buffersAnalystJobsService = new BuffersAnalystJobsService(me.url, {
  37931. proxy: me.options.proxy,
  37932. withCredentials: me.options.withCredentials,
  37933. crossOrigin: me.options.crossOrigin,
  37934. headers: me.options.headers,
  37935. eventListeners: {
  37936. scope: me,
  37937. processCompleted: callback,
  37938. processFailed: callback,
  37939. processRunning: function processRunning(job) {
  37940. me.buffersJobs[job.id] = job.state;
  37941. }
  37942. },
  37943. format: format
  37944. });
  37945. buffersAnalystJobsService.addBuffersJob(params, seconds);
  37946. }
  37947. /**
  37948. * @function ProcessingService.prototype.getBuffersJobState
  37949. * @description 获取缓冲区分析的状态。
  37950. * @param {string} id - 缓冲区分析的 ID。
  37951. * @returns {Object} 缓冲区分析的状态。
  37952. */
  37953. }, {
  37954. key: "getBuffersJobState",
  37955. value: function getBuffersJobState(id) {
  37956. return this.buffersJobs[id];
  37957. }
  37958. /**
  37959. * @function ProcessingService.prototype.getTopologyValidatorJobs
  37960. * @description 获取拓扑检查分析的列表。
  37961. * @param {RequestCallback} callback - 回调函数。
  37962. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  37963. */
  37964. }, {
  37965. key: "getTopologyValidatorJobs",
  37966. value: function getTopologyValidatorJobs(callback, resultFormat) {
  37967. var me = this,
  37968. format = me._processFormat(resultFormat);
  37969. var topologyValidatorJobsService = new TopologyValidatorJobsService(me.url, {
  37970. proxy: me.options.proxy,
  37971. withCredentials: me.options.withCredentials,
  37972. crossOrigin: me.options.crossOrigin,
  37973. headers: me.options.headers,
  37974. eventListeners: {
  37975. scope: me,
  37976. processCompleted: callback,
  37977. processFailed: callback
  37978. },
  37979. format: format
  37980. });
  37981. topologyValidatorJobsService.getTopologyValidatorJobs();
  37982. }
  37983. /**
  37984. * @function ProcessingService.prototype.getTopologyValidatorJob
  37985. * @description 获取某个拓扑检查分析。
  37986. * @param {string} id - 空间分析的 ID。
  37987. * @param {RequestCallback} callback - 回调函数。
  37988. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  37989. */
  37990. }, {
  37991. key: "getTopologyValidatorJob",
  37992. value: function getTopologyValidatorJob(id, callback, resultFormat) {
  37993. var me = this,
  37994. format = me._processFormat(resultFormat);
  37995. var topologyValidatorJobsService = new TopologyValidatorJobsService(me.url, {
  37996. proxy: me.options.proxy,
  37997. withCredentials: me.options.withCredentials,
  37998. crossOrigin: me.options.crossOrigin,
  37999. headers: me.options.headers,
  38000. eventListeners: {
  38001. scope: me,
  38002. processCompleted: callback,
  38003. processFailed: callback
  38004. },
  38005. format: format
  38006. });
  38007. topologyValidatorJobsService.getTopologyValidatorJob(id);
  38008. }
  38009. /**
  38010. * @function ProcessingService.prototype.addTopologyValidatorJob
  38011. * @description 拓扑检查分析。
  38012. * @param {TopologyValidatorJobsParameter} params - 拓扑检查分析请求参数类。
  38013. * @param {RequestCallback} callback - 回调函数。
  38014. * @param {number} [seconds=1000] - 获取创建成功结果的时间间隔。
  38015. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  38016. */
  38017. }, {
  38018. key: "addTopologyValidatorJob",
  38019. value: function addTopologyValidatorJob(params, callback, seconds, resultFormat) {
  38020. var me = this,
  38021. format = me._processFormat(resultFormat);
  38022. var topologyValidatorJobsService = new TopologyValidatorJobsService(me.url, {
  38023. proxy: me.options.proxy,
  38024. withCredentials: me.options.withCredentials,
  38025. crossOrigin: me.options.crossOrigin,
  38026. headers: me.options.headers,
  38027. eventListeners: {
  38028. scope: me,
  38029. processCompleted: callback,
  38030. processFailed: callback,
  38031. processRunning: function processRunning(job) {
  38032. me.topologyValidatorJobs[job.id] = job.state;
  38033. }
  38034. },
  38035. format: format
  38036. });
  38037. topologyValidatorJobsService.addTopologyValidatorJob(params, seconds);
  38038. }
  38039. /**
  38040. * @function ProcessingService.prototype.getTopologyValidatorJobState
  38041. * @description 获取拓扑检查分析的状态。
  38042. * @param {string} id - 拓扑检查分析的 ID。
  38043. * @returns {Object} 拓扑检查分析的状态。
  38044. */
  38045. }, {
  38046. key: "getTopologyValidatorJobState",
  38047. value: function getTopologyValidatorJobState(id) {
  38048. return this.topologyValidatorJobs[id];
  38049. }
  38050. /**
  38051. * @function ProcessingService.prototype.getSummaryAttributesJobs
  38052. * @description 获取属性汇总分析的列表。
  38053. * @param {RequestCallback} callback - 回调函数。
  38054. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  38055. */
  38056. }, {
  38057. key: "getSummaryAttributesJobs",
  38058. value: function getSummaryAttributesJobs(callback, resultFormat) {
  38059. var me = this,
  38060. format = me._processFormat(resultFormat);
  38061. var summaryAttributesJobsService = new SummaryAttributesJobsService(me.url, {
  38062. proxy: me.options.proxy,
  38063. withCredentials: me.options.withCredentials,
  38064. crossOrigin: me.options.crossOrigin,
  38065. headers: me.options.headers,
  38066. eventListeners: {
  38067. scope: me,
  38068. processCompleted: callback,
  38069. processFailed: callback
  38070. },
  38071. format: format
  38072. });
  38073. summaryAttributesJobsService.getSummaryAttributesJobs();
  38074. }
  38075. /**
  38076. * @function ProcessingService.prototype.getSummaryAttributesJob
  38077. * @description 获取某个属性汇总分析。
  38078. * @param {string} id - 空间分析的 ID。
  38079. * @param {RequestCallback} callback - 回调函数。
  38080. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  38081. */
  38082. }, {
  38083. key: "getSummaryAttributesJob",
  38084. value: function getSummaryAttributesJob(id, callback, resultFormat) {
  38085. var me = this,
  38086. format = me._processFormat(resultFormat);
  38087. var summaryAttributesJobsService = new SummaryAttributesJobsService(me.url, {
  38088. proxy: me.options.proxy,
  38089. withCredentials: me.options.withCredentials,
  38090. crossOrigin: me.options.crossOrigin,
  38091. headers: me.options.headers,
  38092. eventListeners: {
  38093. scope: me,
  38094. processCompleted: callback,
  38095. processFailed: callback
  38096. },
  38097. format: format
  38098. });
  38099. summaryAttributesJobsService.getSummaryAttributesJob(id);
  38100. }
  38101. /**
  38102. * @function ProcessingService.prototype.addSummaryAttributesJob
  38103. * @description 属性汇总分析。
  38104. * @param {SummaryAttributesJobsParameter} params - 属性汇总分析参数类。
  38105. * @param {RequestCallback} callback - 回调函数。
  38106. * @param {number} [seconds=1000] - 获取创建成功结果的时间间隔。
  38107. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  38108. */
  38109. }, {
  38110. key: "addSummaryAttributesJob",
  38111. value: function addSummaryAttributesJob(params, callback, seconds, resultFormat) {
  38112. var me = this,
  38113. format = me._processFormat(resultFormat);
  38114. var summaryAttributesJobsService = new SummaryAttributesJobsService(me.url, {
  38115. proxy: me.options.proxy,
  38116. withCredentials: me.options.withCredentials,
  38117. crossOrigin: me.options.crossOrigin,
  38118. headers: me.options.headers,
  38119. eventListeners: {
  38120. scope: me,
  38121. processCompleted: callback,
  38122. processFailed: callback,
  38123. processRunning: function processRunning(job) {
  38124. me.summaryAttributesJobs[job.id] = job.state;
  38125. }
  38126. },
  38127. format: format
  38128. });
  38129. summaryAttributesJobsService.addSummaryAttributesJob(params, seconds);
  38130. }
  38131. /**
  38132. * @function ProcessingService.prototype.getSummaryAttributesJobState
  38133. * @description 获取属性汇总分析的状态。
  38134. * @param {string} id - 属性汇总分析的 ID。
  38135. * @returns {Object} 属性汇总分析的状态
  38136. */
  38137. }, {
  38138. key: "getSummaryAttributesJobState",
  38139. value: function getSummaryAttributesJobState(id) {
  38140. return this.summaryAttributesJobs[id];
  38141. }
  38142. }, {
  38143. key: "_processFormat",
  38144. value: function _processFormat(resultFormat) {
  38145. return resultFormat ? resultFormat : DataFormat.GEOJSON;
  38146. }
  38147. }]);
  38148. return ProcessingService;
  38149. }();
  38150. ;// CONCATENATED MODULE: ./src/maplibregl/services/ProcessingService.js
  38151. function ProcessingService_typeof(obj) { "@babel/helpers - typeof"; return ProcessingService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, ProcessingService_typeof(obj); }
  38152. function services_ProcessingService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  38153. function services_ProcessingService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  38154. function services_ProcessingService_createClass(Constructor, protoProps, staticProps) { if (protoProps) services_ProcessingService_defineProperties(Constructor.prototype, protoProps); if (staticProps) services_ProcessingService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  38155. function ProcessingService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) ProcessingService_setPrototypeOf(subClass, superClass); }
  38156. function ProcessingService_setPrototypeOf(o, p) { ProcessingService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ProcessingService_setPrototypeOf(o, p); }
  38157. 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); }; }
  38158. function ProcessingService_possibleConstructorReturn(self, call) { if (call && (ProcessingService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return ProcessingService_assertThisInitialized(self); }
  38159. function ProcessingService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  38160. function ProcessingService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  38161. function ProcessingService_getPrototypeOf(o) { ProcessingService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ProcessingService_getPrototypeOf(o); }
  38162. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  38163. * This program are made available under the terms of the Apache License, Version 2.0
  38164. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  38165. /**
  38166. * @class ProcessingService
  38167. * @category iServer ProcessingService
  38168. * @classdesc 分布式分析相关服务类。
  38169. * @version 11.1.0
  38170. * @modulecategory Services
  38171. * @extends {ServiceBase}
  38172. * @example
  38173. * new ProcessingService(url,options)
  38174. * .getKernelDensityJobs(function(result){
  38175. * //doSomething
  38176. * })
  38177. * @param {string} url - 服务地址。
  38178. * @param {Object} options - 参数。
  38179. * @param {string} [options.proxy] - 服务代理地址。
  38180. * @param {boolean} [options.withCredentials=false] - 请求是否携带cookie。
  38181. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  38182. * @param {Object} [options.headers] - 请求头。
  38183. * @usage
  38184. */
  38185. var ProcessingService = /*#__PURE__*/function (_ServiceBase) {
  38186. ProcessingService_inherits(ProcessingService, _ServiceBase);
  38187. var _super = ProcessingService_createSuper(ProcessingService);
  38188. function ProcessingService(url, options) {
  38189. var _this;
  38190. services_ProcessingService_classCallCheck(this, ProcessingService);
  38191. _this = _super.call(this, url, options);
  38192. _this._processingService = new ProcessingService_ProcessingService(url, options);
  38193. return _this;
  38194. }
  38195. /**
  38196. * @function ProcessingService.prototype.getKernelDensityJobs
  38197. * @description 获取密度分析的列表。
  38198. * @param {RequestCallback} callback - 回调函数。
  38199. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  38200. */
  38201. services_ProcessingService_createClass(ProcessingService, [{
  38202. key: "getKernelDensityJobs",
  38203. value: function getKernelDensityJobs(callback, resultFormat) {
  38204. this._processingService.getKernelDensityJobs(callback, resultFormat);
  38205. }
  38206. /**
  38207. * @function ProcessingService.prototype.getKernelDensityJob
  38208. * @description 获取某个密度分析。
  38209. * @param {string} id - 空间分析的ID。
  38210. * @param {RequestCallback} callback - 回调函数。
  38211. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  38212. */
  38213. }, {
  38214. key: "getKernelDensityJob",
  38215. value: function getKernelDensityJob(id, callback, resultFormat) {
  38216. this._processingService.getKernelDensityJob(id, callback, resultFormat);
  38217. }
  38218. /**
  38219. * @function ProcessingService.prototype.addKernelDensityJob
  38220. * @description 密度分析。
  38221. * @param {KernelDensityJobParameter} params -密度分析参数类。
  38222. * @param {RequestCallback} callback 回调函数。
  38223. * @param {number} [seconds=1000] - 获取创建成功结果的时间间隔。
  38224. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  38225. */
  38226. }, {
  38227. key: "addKernelDensityJob",
  38228. value: function addKernelDensityJob(params, callback, seconds, resultFormat) {
  38229. params = this._processParams(params);
  38230. this._processingService.addKernelDensityJob(params, callback, seconds, resultFormat);
  38231. }
  38232. /**
  38233. * @function ProcessingService.prototype.getKernelDensityJobState
  38234. * @description 获取密度分析的状态。
  38235. * @param {string} id - 密度分析的id。
  38236. * @returns {Object} 密度分析的状态。
  38237. */
  38238. }, {
  38239. key: "getKernelDensityJobState",
  38240. value: function getKernelDensityJobState(id) {
  38241. return this._processingService.getKernelDensityJobState(id);
  38242. }
  38243. /**
  38244. * @function ProcessingService.prototype.getSummaryMeshJobs
  38245. * @description 获取点聚合分析的列表。
  38246. * @param {RequestCallback} callback - 回调函数。
  38247. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  38248. */
  38249. }, {
  38250. key: "getSummaryMeshJobs",
  38251. value: function getSummaryMeshJobs(callback, resultFormat) {
  38252. this._processingService.getSummaryMeshJobs(callback, resultFormat);
  38253. }
  38254. /**
  38255. * @function ProcessingService.prototype.getSummaryMeshJob
  38256. * @description 获取某个点聚合分析。
  38257. * @param {string} id - 空间分析的 ID。
  38258. * @param {RequestCallback} callback - 回调函数。
  38259. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  38260. */
  38261. }, {
  38262. key: "getSummaryMeshJob",
  38263. value: function getSummaryMeshJob(id, callback, resultFormat) {
  38264. this._processingService.getSummaryMeshJob(id, callback, resultFormat);
  38265. }
  38266. /**
  38267. * @function ProcessingService.prototype.addSummaryMeshJob
  38268. * @description 点聚合分析。
  38269. * @param {SummaryMeshJobParameter} params - 点聚合分析任务参数类。
  38270. * @param {RequestCallback} callback 回调函数。
  38271. * @param {number} [seconds=1000] - 获取创建成功结果的时间间隔。
  38272. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  38273. */
  38274. }, {
  38275. key: "addSummaryMeshJob",
  38276. value: function addSummaryMeshJob(params, callback, seconds, resultFormat) {
  38277. params = this._processParams(params);
  38278. this._processingService.addSummaryMeshJob(params, callback, seconds, resultFormat);
  38279. }
  38280. /**
  38281. * @function ProcessingService.prototype.getSummaryMeshJobState
  38282. * @description 获取点聚合分析的状态。
  38283. * @param {string} id - 点聚合分析的 ID。
  38284. * @returns {Object} 点聚合分析的状态。
  38285. */
  38286. }, {
  38287. key: "getSummaryMeshJobState",
  38288. value: function getSummaryMeshJobState(id) {
  38289. return this._processingService.getSummaryMeshJobState(id);
  38290. }
  38291. /**
  38292. * @function ProcessingService.prototype.getQueryJobs
  38293. * @description 获取单对象查询分析的列表。
  38294. * @param {RequestCallback} callback - 回调函数。
  38295. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  38296. */
  38297. }, {
  38298. key: "getQueryJobs",
  38299. value: function getQueryJobs(callback, resultFormat) {
  38300. this._processingService.getQueryJobs(callback, resultFormat);
  38301. }
  38302. /**
  38303. * @function ProcessingService.prototype.getQueryJob
  38304. * @description 获取某个单对象查询分析。
  38305. * @param {string} id - 空间分析的 ID。
  38306. * @param {RequestCallback} callback - 回调函数。
  38307. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  38308. */
  38309. }, {
  38310. key: "getQueryJob",
  38311. value: function getQueryJob(id, callback, resultFormat) {
  38312. this._processingService.getQueryJob(id, callback, resultFormat);
  38313. }
  38314. /**
  38315. * @function ProcessingService.prototype.addQueryJob
  38316. * @description 单对象查询分析。
  38317. * @param {SingleObjectQueryJobsParameter} params - 单对象查询分析的请求参数。
  38318. * @param {RequestCallback} callback - 回调函数。
  38319. * @param {number} [seconds=1000] - 获取创建成功结果的时间间隔。
  38320. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  38321. */
  38322. }, {
  38323. key: "addQueryJob",
  38324. value: function addQueryJob(params, callback, seconds, resultFormat) {
  38325. params = this._processParams(params);
  38326. this._processingService.addQueryJob(params, callback, seconds, resultFormat);
  38327. }
  38328. /**
  38329. * @function ProcessingService.prototype.getQueryJobState
  38330. * @description 获取单对象查询分析的状态。
  38331. * @param {string} id - 单对象查询分析的 ID。
  38332. * @returns {Object} 单对象查询分析的状态。
  38333. */
  38334. }, {
  38335. key: "getQueryJobState",
  38336. value: function getQueryJobState(id) {
  38337. return this._processingService.getQueryJobState(id);
  38338. }
  38339. /**
  38340. * @function ProcessingService.prototype.getSummaryRegionJobs
  38341. * @description 获取区域汇总分析的列表。
  38342. * @param {RequestCallback} callback - 回调函数。
  38343. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  38344. */
  38345. }, {
  38346. key: "getSummaryRegionJobs",
  38347. value: function getSummaryRegionJobs(callback, resultFormat) {
  38348. this._processingService.getSummaryRegionJobs(callback, resultFormat);
  38349. }
  38350. /**
  38351. * @function ProcessingService.prototype.getSummaryRegionJob
  38352. * @description 获取某个区域汇总分析。
  38353. * @param {string} id - 区域汇总分析的 ID。
  38354. * @param {RequestCallback} callback - 回调函数。
  38355. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  38356. */
  38357. }, {
  38358. key: "getSummaryRegionJob",
  38359. value: function getSummaryRegionJob(id, callback, resultFormat) {
  38360. this._processingService.getSummaryRegionJob(id, callback, resultFormat);
  38361. }
  38362. /**
  38363. * @function ProcessingService.prototype.addSummaryRegionJob
  38364. * @description 区域汇总分析。
  38365. * @param {SummaryRegionJobParameter} params - 区域汇总分析参数类。
  38366. * @param {RequestCallback} callback - 回调函数。
  38367. * @param {number} [seconds=1000] - 获取创建成功结果的时间间隔。
  38368. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  38369. */
  38370. }, {
  38371. key: "addSummaryRegionJob",
  38372. value: function addSummaryRegionJob(params, callback, seconds, resultFormat) {
  38373. params = this._processParams(params);
  38374. this._processingService.addSummaryRegionJob(params, callback, seconds, resultFormat);
  38375. }
  38376. /**
  38377. * @function ProcessingService.prototype.getSummaryRegionJobState
  38378. * @description 获取区域汇总分析的状态。
  38379. * @param {string} id - 生成区域汇总分析的 ID。
  38380. * @returns {Object} 区域汇总分析的状态。
  38381. */
  38382. }, {
  38383. key: "getSummaryRegionJobState",
  38384. value: function getSummaryRegionJobState(id) {
  38385. return this._processingService.getSummaryRegionJobState(id);
  38386. }
  38387. /**
  38388. * @function ProcessingService.prototype.getVectorClipJobs
  38389. * @description 获取矢量裁剪分析的列表。
  38390. * @param {RequestCallback} callback - 回调函数。
  38391. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  38392. */
  38393. }, {
  38394. key: "getVectorClipJobs",
  38395. value: function getVectorClipJobs(callback, resultFormat) {
  38396. this._processingService.getVectorClipJobs(callback, resultFormat);
  38397. }
  38398. /**
  38399. * @function ProcessingService.prototype.getVectorClipJob
  38400. * @description 获取某个矢量裁剪分析。
  38401. * @param {string} id - 空间分析的 ID。
  38402. * @param {RequestCallback} callback - 回调函数。
  38403. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  38404. */
  38405. }, {
  38406. key: "getVectorClipJob",
  38407. value: function getVectorClipJob(id, callback, resultFormat) {
  38408. this._processingService.getVectorClipJob(id, callback, resultFormat);
  38409. }
  38410. /**
  38411. * @function ProcessingService.prototype.addVectorClipJob
  38412. * @description 矢量裁剪分析。
  38413. * @param {VectorClipJobsParameter} params - 矢量裁剪分析请求参数类。
  38414. * @param {RequestCallback} callback - 回调函数。
  38415. * @param {number} [seconds=1000] - 获取创建成功结果的时间间隔。
  38416. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  38417. */
  38418. }, {
  38419. key: "addVectorClipJob",
  38420. value: function addVectorClipJob(params, callback, seconds, resultFormat) {
  38421. params = this._processParams(params);
  38422. this._processingService.addVectorClipJob(params, callback, seconds, resultFormat);
  38423. }
  38424. /**
  38425. * @function ProcessingService.prototype.getVectorClipJobState
  38426. * @description 获取矢量裁剪分析的状态。
  38427. * @param {number} id - 矢量裁剪分析的ID。
  38428. * @returns {Object} 矢量裁剪分析的状态。
  38429. */
  38430. }, {
  38431. key: "getVectorClipJobState",
  38432. value: function getVectorClipJobState(id) {
  38433. return this._processingService.getVectorClipJobState(id);
  38434. }
  38435. /**
  38436. * @function ProcessingService.prototype.getOverlayGeoJobs
  38437. * @description 获取叠加分析的列表。
  38438. * @param {RequestCallback} callback - 回调函数。
  38439. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  38440. */
  38441. }, {
  38442. key: "getOverlayGeoJobs",
  38443. value: function getOverlayGeoJobs(callback, resultFormat) {
  38444. this._processingService.getOverlayGeoJobs(callback, resultFormat);
  38445. }
  38446. /**
  38447. * @function ProcessingService.prototype.getOverlayGeoJob
  38448. * @description 获取某个叠加分析。
  38449. * @param {string} id - 空间分析的 ID。
  38450. * @param {RequestCallback} callback - 回调函数。
  38451. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  38452. */
  38453. }, {
  38454. key: "getOverlayGeoJob",
  38455. value: function getOverlayGeoJob(id, callback, resultFormat) {
  38456. this._processingService.getOverlayGeoJob(id, callback, resultFormat);
  38457. }
  38458. /**
  38459. * @function ProcessingService.prototype.addOverlayGeoJob
  38460. * @description 叠加分析。
  38461. * @param {OverlayGeoJobParameter} params - 叠加分析请求参数类。
  38462. * @param {RequestCallback} callback - 回调函数。
  38463. * @param {number} [seconds=1000] - 获取创建成功结果的时间间隔。
  38464. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  38465. */
  38466. }, {
  38467. key: "addOverlayGeoJob",
  38468. value: function addOverlayGeoJob(params, callback, seconds, resultFormat) {
  38469. params = this._processParams(params);
  38470. this._processingService.addOverlayGeoJob(params, callback, seconds, resultFormat);
  38471. }
  38472. /**
  38473. * @function ProcessingService.prototype.getoverlayGeoJobState
  38474. * @description 获取叠加分析的状态。
  38475. * @param {string} id - 叠加分析的 ID。
  38476. * @returns {Object} 叠加分析的状态。
  38477. */
  38478. }, {
  38479. key: "getoverlayGeoJobState",
  38480. value: function getoverlayGeoJobState(id) {
  38481. return this._processingService.getoverlayGeoJobState(id);
  38482. }
  38483. /**
  38484. * @function ProcessingService.prototype.getBuffersJobs
  38485. * @description 获取缓冲区分析的列表。
  38486. * @param {RequestCallback} callback - 回调函数。
  38487. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  38488. */
  38489. }, {
  38490. key: "getBuffersJobs",
  38491. value: function getBuffersJobs(callback, resultFormat) {
  38492. this._processingService.getBuffersJobs(callback, resultFormat);
  38493. }
  38494. /**
  38495. * @function ProcessingService.prototype.getBuffersJob
  38496. * @description 获取某个缓冲区分析。
  38497. * @param {string} id - 空间分析的 ID。
  38498. * @param {RequestCallback} callback - 回调函数。
  38499. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  38500. */
  38501. }, {
  38502. key: "getBuffersJob",
  38503. value: function getBuffersJob(id, callback, resultFormat) {
  38504. this._processingService.getBuffersJob(id, callback, resultFormat);
  38505. }
  38506. /**
  38507. * @function ProcessingService.prototype.addBuffersJob
  38508. * @description 缓冲区分析。
  38509. * @param {BuffersAnalystJobsParameter} params - 缓冲区分析请求参数类。
  38510. * @param {RequestCallback} callback - 回调函数。
  38511. * @param {number} seconds - 获取创建成功结果的时间间隔。
  38512. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  38513. */
  38514. }, {
  38515. key: "addBuffersJob",
  38516. value: function addBuffersJob(params, callback, seconds, resultFormat) {
  38517. params = this._processParams(params);
  38518. this._processingService.addBuffersJob(params, callback, seconds, resultFormat);
  38519. }
  38520. /**
  38521. * @function ProcessingService.prototype.getBuffersJobState
  38522. * @description 获取缓冲区分析的状态。
  38523. * @param {string} id - 缓冲区分析的 ID。
  38524. * @returns {Object} 缓冲区分析的状态。
  38525. */
  38526. }, {
  38527. key: "getBuffersJobState",
  38528. value: function getBuffersJobState(id) {
  38529. return this._processingService.getBuffersJobState(id);
  38530. }
  38531. /**
  38532. * @function ProcessingService.prototype.getTopologyValidatorJobs
  38533. * @description 获取拓扑检查分析的列表。
  38534. * @param {RequestCallback} callback - 回调函数。
  38535. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  38536. */
  38537. }, {
  38538. key: "getTopologyValidatorJobs",
  38539. value: function getTopologyValidatorJobs(callback, resultFormat) {
  38540. this._processingService.getTopologyValidatorJobs(callback, resultFormat);
  38541. }
  38542. /**
  38543. * @function ProcessingService.prototype.getTopologyValidatorJob
  38544. * @description 获取某个拓扑检查分析。
  38545. * @param {string} id - 空间分析的 ID。
  38546. * @param {RequestCallback} callback - 回调函数。
  38547. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  38548. */
  38549. }, {
  38550. key: "getTopologyValidatorJob",
  38551. value: function getTopologyValidatorJob(id, callback, resultFormat) {
  38552. this._processingService.getTopologyValidatorJob(id, callback, resultFormat);
  38553. }
  38554. /**
  38555. * @function ProcessingService.prototype.addTopologyValidatorJob
  38556. * @description 拓扑检查分析。
  38557. * @param {TopologyValidatorJobsParameter} params - 拓扑检查分析请求参数类。
  38558. * @param {RequestCallback} callback - 回调函数。
  38559. * @param {number} [seconds=1000] - 获取创建成功结果的时间间隔。
  38560. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  38561. */
  38562. }, {
  38563. key: "addTopologyValidatorJob",
  38564. value: function addTopologyValidatorJob(params, callback, seconds, resultFormat) {
  38565. params = this._processParams(params);
  38566. this._processingService.addTopologyValidatorJob(params, callback, seconds, resultFormat);
  38567. }
  38568. /**
  38569. * @function ProcessingService.prototype.getTopologyValidatorJobState
  38570. * @description 获取拓扑检查分析的状态。
  38571. * @param {string} id - 拓扑检查分析的 ID。
  38572. * @returns {Object} 拓扑检查分析的状态。
  38573. */
  38574. }, {
  38575. key: "getTopologyValidatorJobState",
  38576. value: function getTopologyValidatorJobState(id) {
  38577. return this._processingService.getTopologyValidatorJobState(id);
  38578. }
  38579. /**
  38580. * @function ProcessingService.prototype.getSummaryAttributesJobs
  38581. * @description 获取属性汇总分析的列表。
  38582. * @param {RequestCallback} callback - 回调函数。
  38583. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  38584. */
  38585. }, {
  38586. key: "getSummaryAttributesJobs",
  38587. value: function getSummaryAttributesJobs(callback, resultFormat) {
  38588. this._processingService.getSummaryAttributesJobs(callback, resultFormat);
  38589. }
  38590. /**
  38591. * @function ProcessingService.prototype.getSummaryAttributesJob
  38592. * @description 获取某个属性汇总分析。
  38593. * @param {string} id - 空间分析的 ID。
  38594. * @param {RequestCallback} callback - 回调函数。
  38595. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  38596. */
  38597. }, {
  38598. key: "getSummaryAttributesJob",
  38599. value: function getSummaryAttributesJob(id, callback, resultFormat) {
  38600. this._processingService.getSummaryAttributesJob(id, callback, resultFormat);
  38601. }
  38602. /**
  38603. * @function ProcessingService.prototype.addSummaryAttributesJob
  38604. * @description 属性汇总分析。
  38605. * @param {SummaryAttributesJobsParameter} params - 属性汇总分析参数类。
  38606. * @param {RequestCallback} callback - 回调函数。
  38607. * @param {number} [seconds=1000] - 获取创建成功结果的时间间隔。
  38608. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  38609. */
  38610. }, {
  38611. key: "addSummaryAttributesJob",
  38612. value: function addSummaryAttributesJob(params, callback, seconds, resultFormat) {
  38613. params = this._processParams(params);
  38614. this._processingService.addSummaryAttributesJob(params, callback, seconds, resultFormat);
  38615. }
  38616. /**
  38617. * @function ProcessingService.prototype.getSummaryAttributesJobState
  38618. * @description 获取属性汇总分析的状态。
  38619. * @param {string} id - 属性汇总分析的 ID。
  38620. * @returns {Object} 属性汇总分析的状态
  38621. */
  38622. }, {
  38623. key: "getSummaryAttributesJobState",
  38624. value: function getSummaryAttributesJobState(id) {
  38625. return this._processingService.getSummaryAttributesJobState(id);
  38626. }
  38627. }, {
  38628. key: "_processFormat",
  38629. value: function _processFormat(resultFormat) {
  38630. return resultFormat ? resultFormat : DataFormat.GEOJSON;
  38631. }
  38632. }, {
  38633. key: "_processParams",
  38634. value: function _processParams(params) {
  38635. if (!params) {
  38636. return {};
  38637. }
  38638. if (params.bounds) {
  38639. params.bounds = core_Util_Util.toSuperMapBounds(params.bounds);
  38640. }
  38641. //这里只允许传端的bounds
  38642. if (params.query) {
  38643. params.query = core_Util_Util.toSuperMapBounds(params.query);
  38644. }
  38645. if (params.geometryQuery) {
  38646. params.geometryQuery = core_Util_Util.toProcessingParam(params.geometryQuery);
  38647. }
  38648. if (params.geometryClip) {
  38649. params.geometryClip = core_Util_Util.toProcessingParam(params.geometryClip);
  38650. }
  38651. return params;
  38652. }
  38653. }]);
  38654. return ProcessingService;
  38655. }(ServiceBase);
  38656. ;// CONCATENATED MODULE: ./src/common/iServer/QueryServiceBase.js
  38657. function QueryServiceBase_typeof(obj) { "@babel/helpers - typeof"; return QueryServiceBase_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, QueryServiceBase_typeof(obj); }
  38658. function QueryServiceBase_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  38659. function QueryServiceBase_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  38660. function QueryServiceBase_createClass(Constructor, protoProps, staticProps) { if (protoProps) QueryServiceBase_defineProperties(Constructor.prototype, protoProps); if (staticProps) QueryServiceBase_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  38661. function QueryServiceBase_get() { if (typeof Reflect !== "undefined" && Reflect.get) { QueryServiceBase_get = Reflect.get.bind(); } else { QueryServiceBase_get = function _get(target, property, receiver) { var base = QueryServiceBase_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return QueryServiceBase_get.apply(this, arguments); }
  38662. function QueryServiceBase_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = QueryServiceBase_getPrototypeOf(object); if (object === null) break; } return object; }
  38663. function QueryServiceBase_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) QueryServiceBase_setPrototypeOf(subClass, superClass); }
  38664. function QueryServiceBase_setPrototypeOf(o, p) { QueryServiceBase_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return QueryServiceBase_setPrototypeOf(o, p); }
  38665. function QueryServiceBase_createSuper(Derived) { var hasNativeReflectConstruct = QueryServiceBase_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = QueryServiceBase_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = QueryServiceBase_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return QueryServiceBase_possibleConstructorReturn(this, result); }; }
  38666. function QueryServiceBase_possibleConstructorReturn(self, call) { if (call && (QueryServiceBase_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return QueryServiceBase_assertThisInitialized(self); }
  38667. function QueryServiceBase_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  38668. function QueryServiceBase_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  38669. function QueryServiceBase_getPrototypeOf(o) { QueryServiceBase_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return QueryServiceBase_getPrototypeOf(o); }
  38670. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  38671. * This program are made available under the terms of the Apache License, Version 2.0
  38672. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  38673. /**
  38674. * @class QueryService
  38675. * @deprecatedclass SuperMap.QueryService
  38676. * @category iServer Map QueryResults
  38677. * @classdesc 查询服务基类。
  38678. * @extends {CommonServiceBase}
  38679. * @param {string} url - 服务地址。请求地图查询服务的 URL 应为:http://{服务器地址}:{服务端口号}/iserver/services/{地图服务名}/rest/maps/{地图名};
  38680. * @param {Object} options - 参数。
  38681. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  38682. * @param {DataFormat} [options.format=DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON、GeoJSON、FGB 三种格式。参数格式为 "ISERVER","GEOJSON","FGB"。
  38683. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  38684. * @param {Object} [options.headers] - 请求头。
  38685. * @example
  38686. * var myService = new QueryService(url, {
  38687. * eventListeners: {
  38688. * "processCompleted": queryCompleted,
  38689. * "processFailed": queryError
  38690. * }
  38691. * };
  38692. * @usage
  38693. */
  38694. var QueryServiceBase = /*#__PURE__*/function (_CommonServiceBase) {
  38695. QueryServiceBase_inherits(QueryServiceBase, _CommonServiceBase);
  38696. var _super = QueryServiceBase_createSuper(QueryServiceBase);
  38697. function QueryServiceBase(url, options) {
  38698. var _this;
  38699. QueryServiceBase_classCallCheck(this, QueryServiceBase);
  38700. _this = _super.call(this, url, options);
  38701. /**
  38702. * @member {boolean} QueryService.prototype.returnContent
  38703. * @description 是否立即返回新创建资源的表述还是返回新资源的URI。
  38704. */
  38705. _this.returnContent = false;
  38706. /**
  38707. * @member {string} QueryService.prototype.format
  38708. * @description 查询结果返回格式,目前支持iServerJSON、GeoJSON、FGB三种格式。参数格式为"ISERVER","GEOJSON","FGB"。
  38709. */
  38710. _this.format = DataFormat.GEOJSON;
  38711. _this.returnFeatureWithFieldCaption = false;
  38712. if (options) {
  38713. Util_Util.extend(QueryServiceBase_assertThisInitialized(_this), options);
  38714. }
  38715. _this.CLASS_NAME = "SuperMap.QueryService";
  38716. if (!_this.url) {
  38717. return QueryServiceBase_possibleConstructorReturn(_this);
  38718. }
  38719. if (options && options.format) {
  38720. _this.format = options.format.toUpperCase();
  38721. }
  38722. _this.url = Util_Util.urlPathAppend(_this.url, 'queryResults');
  38723. return _this;
  38724. }
  38725. /**
  38726. * @function QueryService.prototype.destroy
  38727. * @description 释放资源,将引用资源的属性置空。
  38728. */
  38729. QueryServiceBase_createClass(QueryServiceBase, [{
  38730. key: "destroy",
  38731. value: function destroy() {
  38732. QueryServiceBase_get(QueryServiceBase_getPrototypeOf(QueryServiceBase.prototype), "destroy", this).call(this);
  38733. var me = this;
  38734. me.returnContent = null;
  38735. me.format = null;
  38736. }
  38737. /**
  38738. * @function QueryService.prototype.processAsync
  38739. * @description 负责将客户端的查询参数传递到服务端。
  38740. * @param {QueryParameters} params - 查询参数。
  38741. */
  38742. }, {
  38743. key: "processAsync",
  38744. value: function processAsync(params) {
  38745. if (!(params instanceof QueryParameters)) {
  38746. return;
  38747. }
  38748. var me = this,
  38749. returnCustomResult = null,
  38750. jsonParameters = null;
  38751. me.returnContent = params.returnContent;
  38752. jsonParameters = me.getJsonParameters(params);
  38753. if (!me.returnContent) {
  38754. //仅供三维使用 获取高亮图片的bounds
  38755. returnCustomResult = params.returnCustomResult;
  38756. if (returnCustomResult) {
  38757. me.url = Util_Util.urlAppend(me.url, 'returnCustomResult=' + returnCustomResult);
  38758. }
  38759. }
  38760. me.returnFeatureWithFieldCaption = params.returnFeatureWithFieldCaption;
  38761. me.request({
  38762. method: "POST",
  38763. data: jsonParameters,
  38764. scope: me,
  38765. success: me.serviceProcessCompleted,
  38766. failure: me.serviceProcessFailed
  38767. });
  38768. }
  38769. /**
  38770. * @function QueryService.prototype.serviceProcessCompleted
  38771. * @description 查询完成,执行此方法。
  38772. * @param {Object} result - 服务器返回的结果对象。
  38773. */
  38774. }, {
  38775. key: "serviceProcessCompleted",
  38776. value: function serviceProcessCompleted(result, options) {
  38777. var me = this;
  38778. result = Util_Util.transformResult(result);
  38779. var geoJSONFormat = new GeoJSON();
  38780. if (result && result.recordsets) {
  38781. for (var i = 0, recordsets = result.recordsets, len = recordsets.length; i < len; i++) {
  38782. if (recordsets[i].features) {
  38783. if (me.returnFeatureWithFieldCaption === true) {
  38784. recordsets[i].features.map(function (feature) {
  38785. feature.fieldNames = recordsets[i].fieldCaptions;
  38786. return feature;
  38787. });
  38788. }
  38789. if (me.format === DataFormat.GEOJSON) {
  38790. recordsets[i].features = geoJSONFormat.toGeoJSON(recordsets[i].features);
  38791. }
  38792. }
  38793. }
  38794. }
  38795. me.events.triggerEvent("processCompleted", {
  38796. result: result,
  38797. options: options
  38798. });
  38799. }
  38800. }, {
  38801. key: "dataFormat",
  38802. value: function dataFormat() {
  38803. return [DataFormat.GEOJSON, DataFormat.ISERVER, DataFormat.FGB];
  38804. }
  38805. /**
  38806. * @function QueryService.prototype.getQueryParameters
  38807. * @description 将 JSON 对象表示的查询参数转化为 QueryParameters 对象。
  38808. * @param {Object} params - JSON 字符串表示的查询参数。
  38809. * @returns {QueryParameters} 返回转化后的 QueryParameters 对象。
  38810. */
  38811. }, {
  38812. key: "getQueryParameters",
  38813. value: function getQueryParameters(params) {
  38814. return new QueryParameters({
  38815. customParams: params.customParams,
  38816. expectCount: params.expectCount,
  38817. networkType: params.networkType,
  38818. queryOption: params.queryOption,
  38819. queryParams: params.queryParams,
  38820. startRecord: params.startRecord,
  38821. prjCoordSys: params.prjCoordSys,
  38822. holdTime: params.holdTime
  38823. });
  38824. }
  38825. }]);
  38826. return QueryServiceBase;
  38827. }(CommonServiceBase);
  38828. ;// CONCATENATED MODULE: ./src/common/iServer/QueryByBoundsParameters.js
  38829. function QueryByBoundsParameters_typeof(obj) { "@babel/helpers - typeof"; return QueryByBoundsParameters_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, QueryByBoundsParameters_typeof(obj); }
  38830. function QueryByBoundsParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  38831. function QueryByBoundsParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  38832. function QueryByBoundsParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) QueryByBoundsParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) QueryByBoundsParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  38833. function QueryByBoundsParameters_get() { if (typeof Reflect !== "undefined" && Reflect.get) { QueryByBoundsParameters_get = Reflect.get.bind(); } else { QueryByBoundsParameters_get = function _get(target, property, receiver) { var base = QueryByBoundsParameters_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return QueryByBoundsParameters_get.apply(this, arguments); }
  38834. function QueryByBoundsParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = QueryByBoundsParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  38835. function QueryByBoundsParameters_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) QueryByBoundsParameters_setPrototypeOf(subClass, superClass); }
  38836. function QueryByBoundsParameters_setPrototypeOf(o, p) { QueryByBoundsParameters_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return QueryByBoundsParameters_setPrototypeOf(o, p); }
  38837. function QueryByBoundsParameters_createSuper(Derived) { var hasNativeReflectConstruct = QueryByBoundsParameters_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = QueryByBoundsParameters_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = QueryByBoundsParameters_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return QueryByBoundsParameters_possibleConstructorReturn(this, result); }; }
  38838. function QueryByBoundsParameters_possibleConstructorReturn(self, call) { if (call && (QueryByBoundsParameters_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return QueryByBoundsParameters_assertThisInitialized(self); }
  38839. function QueryByBoundsParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  38840. function QueryByBoundsParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  38841. function QueryByBoundsParameters_getPrototypeOf(o) { QueryByBoundsParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return QueryByBoundsParameters_getPrototypeOf(o); }
  38842. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  38843. * This program are made available under the terms of the Apache License, Version 2.0
  38844. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  38845. /**
  38846. * @class QueryByBoundsParameters
  38847. * @deprecatedclass SuperMap.QueryByBoundsParameters
  38848. * @category iServer Map QueryResults
  38849. * @classdesc Bounds 查询参数类。该类用于设置 Bounds 查询的相关参数。
  38850. * @extends {QueryParameters}
  38851. * @param {Object} options - 参数。
  38852. * @param {(SuperMap.Bounds|L.Bounds|L.LatLngBounds|ol.extent|mapboxgl.LngLatBounds|GeoJSONObject)} options.bounds - 指定的查询范围。
  38853. * @param {Array.<FilterParameter>} options.queryParams - 查询过滤条件参数数组。
  38854. * @param {string} [options.customParams] - 自定义参数,供扩展使用。
  38855. * @param {Object} [options.prjCoordSys] -自定义参数,供 SuperMap Online 提供的动态投影查询扩展使用。如 {"epsgCode":3857}。
  38856. * @param {number} [options.expectCount=100000] - 期望返回结果记录个数。
  38857. * @param {GeometryType} [options.networkType=GeometryType.LINE] - 网络数据集对应的查询类型。
  38858. * @param {QueryOption} [options.queryOption=QueryOption.ATTRIBUTEANDGEOMETRY] - 查询结果类型枚举类。
  38859. * @param {number} [options.startRecord=0] - 查询起始记录号。
  38860. * @param {number} [options.holdTime=10] - 资源在服务端保存的时间,单位为分钟。
  38861. * @param {boolean} [options.returnCustomResult=false] - 仅供三维使用。
  38862. * @param {boolean} [options.returnContent=true] - 是否立即返回新创建资源的表述还是返回新资源的 URI。
  38863. * @param {boolean} [options.returnFeatureWithFieldCaption = false] - 返回的查询结果要素字段标识是否为字段别名。为 false 时,返回的是字段名;为 true 时,返回的是字段别名。
  38864. * @usage
  38865. */
  38866. var QueryByBoundsParameters = /*#__PURE__*/function (_QueryParameters) {
  38867. QueryByBoundsParameters_inherits(QueryByBoundsParameters, _QueryParameters);
  38868. var _super = QueryByBoundsParameters_createSuper(QueryByBoundsParameters);
  38869. function QueryByBoundsParameters(options) {
  38870. var _this;
  38871. QueryByBoundsParameters_classCallCheck(this, QueryByBoundsParameters);
  38872. options = options || {};
  38873. _this = _super.call(this, options);
  38874. /**
  38875. * @member {boolean} [QueryByBoundsParameters.prototype.returnContent=true]
  38876. * @description 是否立即返回新创建资源的表述还是返回新资源的 URI。
  38877. * 如果为 true,则直接返回新创建资源,即查询结果的表述。
  38878. * 为 false,则返回的是查询结果资源的 URI。
  38879. */
  38880. _this.returnContent = true;
  38881. /**
  38882. * @member {(SuperMap.Bounds|L.Bounds|L.LatLngBounds|ol.extent|mapboxgl.LngLatBounds|GeoJSONObject)} QueryByBoundsParameters.prototype.bounds
  38883. * @description 指定的查询范围。
  38884. */
  38885. _this.bounds = null;
  38886. Util_Util.extend(QueryByBoundsParameters_assertThisInitialized(_this), options);
  38887. _this.CLASS_NAME = "SuperMap.QueryByBoundsParameters";
  38888. return _this;
  38889. }
  38890. /**
  38891. * @function QueryByBoundsParameters.prototype.destroy
  38892. * @description 释放资源,将引用资源的属性置空。
  38893. */
  38894. QueryByBoundsParameters_createClass(QueryByBoundsParameters, [{
  38895. key: "destroy",
  38896. value: function destroy() {
  38897. QueryByBoundsParameters_get(QueryByBoundsParameters_getPrototypeOf(QueryByBoundsParameters.prototype), "destroy", this).call(this);
  38898. var me = this;
  38899. me.returnContent = null;
  38900. if (me.bounds) {
  38901. me.bounds = null;
  38902. }
  38903. }
  38904. }]);
  38905. return QueryByBoundsParameters;
  38906. }(QueryParameters);
  38907. ;// CONCATENATED MODULE: ./src/common/iServer/QueryByBoundsService.js
  38908. function QueryByBoundsService_typeof(obj) { "@babel/helpers - typeof"; return QueryByBoundsService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, QueryByBoundsService_typeof(obj); }
  38909. function QueryByBoundsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  38910. function QueryByBoundsService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  38911. function QueryByBoundsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) QueryByBoundsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) QueryByBoundsService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  38912. function QueryByBoundsService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { QueryByBoundsService_get = Reflect.get.bind(); } else { QueryByBoundsService_get = function _get(target, property, receiver) { var base = QueryByBoundsService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return QueryByBoundsService_get.apply(this, arguments); }
  38913. function QueryByBoundsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = QueryByBoundsService_getPrototypeOf(object); if (object === null) break; } return object; }
  38914. function QueryByBoundsService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) QueryByBoundsService_setPrototypeOf(subClass, superClass); }
  38915. function QueryByBoundsService_setPrototypeOf(o, p) { QueryByBoundsService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return QueryByBoundsService_setPrototypeOf(o, p); }
  38916. function QueryByBoundsService_createSuper(Derived) { var hasNativeReflectConstruct = QueryByBoundsService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = QueryByBoundsService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = QueryByBoundsService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return QueryByBoundsService_possibleConstructorReturn(this, result); }; }
  38917. function QueryByBoundsService_possibleConstructorReturn(self, call) { if (call && (QueryByBoundsService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return QueryByBoundsService_assertThisInitialized(self); }
  38918. function QueryByBoundsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  38919. function QueryByBoundsService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  38920. function QueryByBoundsService_getPrototypeOf(o) { QueryByBoundsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return QueryByBoundsService_getPrototypeOf(o); }
  38921. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  38922. * This program are made available under the terms of the Apache License, Version 2.0
  38923. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  38924. /**
  38925. * @class QueryByBoundsService
  38926. * @deprecatedclass SuperMap.QueryByBoundsService
  38927. * @category iServer Map QueryResults
  38928. * @classdesc Bounds 查询服务类。
  38929. * @augments {QueryService}
  38930. * @example
  38931. * (start end)
  38932. * var myQueryByBoundsService = new QueryByBoundsService(url, {
  38933. * eventListeners: {
  38934. * "processCompleted": queryCompleted,
  38935. * "processFailed": queryError
  38936. * }
  38937. * });
  38938. * function queryCompleted(object){//todo};
  38939. * function queryError(object){//todo};
  38940. * (end)
  38941. * @param {string} url - 服务地址。如访问World Map服务,只需将url设为: http://localhost:8090/iserver/services/map-world/rest/maps/World+Map 即可。
  38942. * @param {Object} options - 参数。
  38943. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。<br>
  38944. * @param {DataFormat} [options.format=DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON、GeoJSON、FGB 三种格式。参数格式为 "ISERVER","GEOJSON","FGB"。
  38945. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  38946. * @param {Object} [options.headers] - 请求头。
  38947. * @usage
  38948. */
  38949. var QueryByBoundsService = /*#__PURE__*/function (_QueryServiceBase) {
  38950. QueryByBoundsService_inherits(QueryByBoundsService, _QueryServiceBase);
  38951. var _super = QueryByBoundsService_createSuper(QueryByBoundsService);
  38952. function QueryByBoundsService(url, options) {
  38953. var _this;
  38954. QueryByBoundsService_classCallCheck(this, QueryByBoundsService);
  38955. _this = _super.call(this, url, options);
  38956. _this.CLASS_NAME = "SuperMap.QueryByBoundsService";
  38957. return _this;
  38958. }
  38959. /**
  38960. * @override
  38961. */
  38962. QueryByBoundsService_createClass(QueryByBoundsService, [{
  38963. key: "destroy",
  38964. value: function destroy() {
  38965. QueryByBoundsService_get(QueryByBoundsService_getPrototypeOf(QueryByBoundsService.prototype), "destroy", this).call(this);
  38966. }
  38967. /**
  38968. * @function QueryByBoundsService.prototype.getJsonParameters
  38969. * @description 将查询参数转化为 JSON 字符串。
  38970. * 在本类中重写此方法,可以实现不同种类的查询(sql, geometry, distance, bounds 等)。
  38971. * @param {QueryByBoundsParameters} params - Bounds 查询参数。
  38972. * @returns {Object} 转化后的 JSON 字符串。
  38973. */
  38974. }, {
  38975. key: "getJsonParameters",
  38976. value: function getJsonParameters(params) {
  38977. if (!(params instanceof QueryByBoundsParameters)) {
  38978. return null;
  38979. }
  38980. var me = this,
  38981. jsonParameters = "",
  38982. qp = null,
  38983. bounds = params.bounds;
  38984. qp = me.getQueryParameters(params);
  38985. jsonParameters += "'queryMode':'BoundsQuery','queryParameters':";
  38986. jsonParameters += Util_Util.toJSON(qp);
  38987. jsonParameters += ",'bounds': {'rightTop':{'y':" + bounds.top + ",'x':" + bounds.right + "},'leftBottom':{'y':" + bounds.bottom + ",'x':" + bounds.left + "}}";
  38988. jsonParameters = "{" + jsonParameters + "}";
  38989. return jsonParameters;
  38990. }
  38991. }]);
  38992. return QueryByBoundsService;
  38993. }(QueryServiceBase);
  38994. ;// CONCATENATED MODULE: ./src/common/iServer/QueryByDistanceParameters.js
  38995. function QueryByDistanceParameters_typeof(obj) { "@babel/helpers - typeof"; return QueryByDistanceParameters_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, QueryByDistanceParameters_typeof(obj); }
  38996. function QueryByDistanceParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  38997. function QueryByDistanceParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  38998. function QueryByDistanceParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) QueryByDistanceParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) QueryByDistanceParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  38999. function QueryByDistanceParameters_get() { if (typeof Reflect !== "undefined" && Reflect.get) { QueryByDistanceParameters_get = Reflect.get.bind(); } else { QueryByDistanceParameters_get = function _get(target, property, receiver) { var base = QueryByDistanceParameters_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return QueryByDistanceParameters_get.apply(this, arguments); }
  39000. function QueryByDistanceParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = QueryByDistanceParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  39001. function QueryByDistanceParameters_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) QueryByDistanceParameters_setPrototypeOf(subClass, superClass); }
  39002. function QueryByDistanceParameters_setPrototypeOf(o, p) { QueryByDistanceParameters_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return QueryByDistanceParameters_setPrototypeOf(o, p); }
  39003. function QueryByDistanceParameters_createSuper(Derived) { var hasNativeReflectConstruct = QueryByDistanceParameters_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = QueryByDistanceParameters_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = QueryByDistanceParameters_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return QueryByDistanceParameters_possibleConstructorReturn(this, result); }; }
  39004. function QueryByDistanceParameters_possibleConstructorReturn(self, call) { if (call && (QueryByDistanceParameters_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return QueryByDistanceParameters_assertThisInitialized(self); }
  39005. function QueryByDistanceParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  39006. function QueryByDistanceParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  39007. function QueryByDistanceParameters_getPrototypeOf(o) { QueryByDistanceParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return QueryByDistanceParameters_getPrototypeOf(o); }
  39008. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  39009. * This program are made available under the terms of the Apache License, Version 2.0
  39010. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  39011. /**
  39012. * @class QueryByDistanceParameters
  39013. * @deprecatedclass SuperMap.QueryByDistanceParameters
  39014. * @category iServer Map QueryResults
  39015. * @classdesc Distance 查询参数类。
  39016. * 该类用于设置 Distance 查询的相关参数。
  39017. * @extends {QueryParameters}
  39018. * @param {Object} options - 参数。
  39019. * @param {GeoJSONObject} options.geometry - 用于查询的几何对象。
  39020. * @param {Array.<FilterParameter>} options.queryParams - 查询过滤条件参数数组。
  39021. * @param {number} options.distance - 查询距离,单位与所查询图层对应的数据集单位相同。距离查询时,表示距离地物的距离。最近地物查询时,表示搜索的范围。此为必选参数。
  39022. * @param {string} [options.customParams] - 自定义参数,供扩展使用。
  39023. * @param {Object} [options.prjCoordSys] -自定义参数,供 SuperMap Online 提供的动态投影查询扩展使用。如 {"epsgCode":3857}。
  39024. * @param {number} [options.expectCount=100000] - 期望返回结果记录个数。
  39025. * @param {GeometryType} [options.networkType=GeometryType.LINE] - 网络数据集对应的查询类型。
  39026. * @param {QueryOption} [options.queryOption=QueryOption.ATTRIBUTEANDGEOMETRY] - 查询结果类型枚举类。
  39027. * @param {number} [options.startRecord=0] - 查询起始记录号。
  39028. * @param {number} [options.holdTime=10] - 资源在服务端保存的时间,单位为分钟。
  39029. * @param {boolean} [options.returnCustomResult=false] -仅供三维使用。
  39030. * @param {boolean} [options.isNearest=false] - 是否为最近距离查询。
  39031. * @param {boolean} [options.returnContent=true] - 是否立即返回新创建资源的表述还是返回新资源的 URI。
  39032. * @param {boolean} [options.returnFeatureWithFieldCaption = false] - 返回的查询结果要素字段标识是否为字段别名。为 false 时,返回的是字段名;为 true 时,返回的是字段别名。
  39033. * @usage
  39034. */
  39035. var QueryByDistanceParameters = /*#__PURE__*/function (_QueryParameters) {
  39036. QueryByDistanceParameters_inherits(QueryByDistanceParameters, _QueryParameters);
  39037. var _super = QueryByDistanceParameters_createSuper(QueryByDistanceParameters);
  39038. function QueryByDistanceParameters(options) {
  39039. var _this;
  39040. QueryByDistanceParameters_classCallCheck(this, QueryByDistanceParameters);
  39041. options = options || {};
  39042. _this = _super.call(this, options);
  39043. /**
  39044. * @member {number} [QueryByDistanceParameters.prototype.distance=0]
  39045. * @description 查询距离,单位与所查询图层对应的数据集单位相同。
  39046. * 距离查询时,表示距离地物的距离。最近地物查询时,表示搜索的范围。
  39047. */
  39048. /**
  39049. * @member {GeoJSONObject} QueryByDistanceParameters.prototype.geometry
  39050. * @description 用于查询的地理对象。<br>
  39051. * 点类型可以是:{@link GeometryPoint}|{@link L.Marker}|{@link L.CircleMarker}|{@link L.Circle}|{@link L.GeoJSON}|{@link ol.geom.Point}|{@link ol.format.GeoJSON}|{@link mapboxgl.LngLat}|{@link mapboxgl.Point}|{@link GeoJSONObject}。<br>
  39052. * 线类型可以是:{@link GeometryLineString}|{@link GeometryLinearRing}|{@link L.Polyline}|{@link L.GeoJSON}|{@link ol.geom.LineString}|{@link ol.format.GeoJSON}|{@link GeoJSONObject}。<br>
  39053. * 面类型可以是:{@link GeometryPolygon}|{@link L.Polygon}|{@link L.GeoJSON}|{@link ol.geom.Polygon}|{@link ol.format.GeoJSON}|{@link mapboxgl.LngLatBounds}|{@link GeoJSONObject}。
  39054. */
  39055. _this.geometry = null;
  39056. /**
  39057. * @member {boolean} [QueryByDistanceParameters.prototype.isNearest=false]
  39058. * @description 是否为最近距离查询。<br>
  39059. * 建议该属性与 expectCount(继承自 {@link QueryParameters})属性联合使用。
  39060. * 当该属性为 true 时,即表示查找最近地物,如果查询结果数大于期望返回的结果记录数(expectCount),
  39061. * 则查找结果为查询总记录中距离中心最近的 expectCount 个地物。
  39062. * 当该属性为不为 true 时,如果查询结果数大于期望返回的结果记录数(expectCount),
  39063. * 则查找结果为从查询总记录中随机抽取的 expectCount 个地物。
  39064. * 目前查询结果不支持按远近距离排序。
  39065. */
  39066. _this.isNearest = null;
  39067. /**
  39068. * @member {boolean} [QueryByDistanceParameters.prototype.returnContent=true]
  39069. * @description 是否立即返回新创建资源的表述还是返回新资源的 URI。
  39070. * 如果为 true,则直接返回新创建资源,即查询结果的表述。
  39071. * 为 false,则返回的是查询结果资源的 URI。
  39072. */
  39073. _this.returnContent = true;
  39074. Util_Util.extend(QueryByDistanceParameters_assertThisInitialized(_this), options);
  39075. _this.CLASS_NAME = "SuperMap.QueryByDistanceParameters";
  39076. return _this;
  39077. }
  39078. /**
  39079. * @function QueryByDistanceParameters.prototype.destroy
  39080. * @description 释放资源,将引用资源的属性置空。
  39081. */
  39082. QueryByDistanceParameters_createClass(QueryByDistanceParameters, [{
  39083. key: "destroy",
  39084. value: function destroy() {
  39085. QueryByDistanceParameters_get(QueryByDistanceParameters_getPrototypeOf(QueryByDistanceParameters.prototype), "destroy", this).call(this);
  39086. var me = this;
  39087. me.returnContent = null;
  39088. me.distance = null;
  39089. me.isNearest = null;
  39090. if (me.geometry) {
  39091. me.geometry.destroy();
  39092. me.geometry = null;
  39093. }
  39094. }
  39095. }]);
  39096. return QueryByDistanceParameters;
  39097. }(QueryParameters);
  39098. ;// CONCATENATED MODULE: ./src/common/iServer/QueryByDistanceService.js
  39099. function QueryByDistanceService_typeof(obj) { "@babel/helpers - typeof"; return QueryByDistanceService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, QueryByDistanceService_typeof(obj); }
  39100. function QueryByDistanceService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  39101. function QueryByDistanceService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  39102. function QueryByDistanceService_createClass(Constructor, protoProps, staticProps) { if (protoProps) QueryByDistanceService_defineProperties(Constructor.prototype, protoProps); if (staticProps) QueryByDistanceService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  39103. function QueryByDistanceService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { QueryByDistanceService_get = Reflect.get.bind(); } else { QueryByDistanceService_get = function _get(target, property, receiver) { var base = QueryByDistanceService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return QueryByDistanceService_get.apply(this, arguments); }
  39104. function QueryByDistanceService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = QueryByDistanceService_getPrototypeOf(object); if (object === null) break; } return object; }
  39105. function QueryByDistanceService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) QueryByDistanceService_setPrototypeOf(subClass, superClass); }
  39106. function QueryByDistanceService_setPrototypeOf(o, p) { QueryByDistanceService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return QueryByDistanceService_setPrototypeOf(o, p); }
  39107. function QueryByDistanceService_createSuper(Derived) { var hasNativeReflectConstruct = QueryByDistanceService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = QueryByDistanceService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = QueryByDistanceService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return QueryByDistanceService_possibleConstructorReturn(this, result); }; }
  39108. function QueryByDistanceService_possibleConstructorReturn(self, call) { if (call && (QueryByDistanceService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return QueryByDistanceService_assertThisInitialized(self); }
  39109. function QueryByDistanceService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  39110. function QueryByDistanceService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  39111. function QueryByDistanceService_getPrototypeOf(o) { QueryByDistanceService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return QueryByDistanceService_getPrototypeOf(o); }
  39112. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  39113. * This program are made available under the terms of the Apache License, Version 2.0
  39114. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  39115. /**
  39116. * @class QueryByDistanceService
  39117. * @deprecatedclass SuperMap.QueryByDistanceService
  39118. * @category iServer Map QueryResults
  39119. * @classdesc Distance查询服务类。
  39120. * @extends {QueryServiceBase}
  39121. * @example
  39122. * var myQueryByDistService = new QueryByDistanceService(url, {
  39123. * eventListeners: {
  39124. * "processCompleted": queryCompleted,
  39125. * "processFailed": queryError
  39126. * }
  39127. * });
  39128. * function queryCompleted(object){//todo};
  39129. * function queryError(object){//todo};
  39130. * @param {string} url - 服务地址。如访问World Map服务,只需将url设为:http://localhost:8090/iserver/services/map-world/rest/maps/World+Map 即可。
  39131. * @param {Object} options - 参数。
  39132. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  39133. * @param {DataFormat} [options.format=DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON、GeoJSON、FGB 三种格式。参数格式为 "ISERVER","GEOJSON","FGB"。
  39134. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  39135. * @param {Object} [options.headers] - 请求头。
  39136. * @usage
  39137. */
  39138. var QueryByDistanceService = /*#__PURE__*/function (_QueryServiceBase) {
  39139. QueryByDistanceService_inherits(QueryByDistanceService, _QueryServiceBase);
  39140. var _super = QueryByDistanceService_createSuper(QueryByDistanceService);
  39141. function QueryByDistanceService(url, options) {
  39142. var _this;
  39143. QueryByDistanceService_classCallCheck(this, QueryByDistanceService);
  39144. _this = _super.call(this, url, options);
  39145. _this.CLASS_NAME = "SuperMap.QueryByDistanceService";
  39146. return _this;
  39147. }
  39148. /**
  39149. * @override
  39150. */
  39151. QueryByDistanceService_createClass(QueryByDistanceService, [{
  39152. key: "destroy",
  39153. value: function destroy() {
  39154. QueryByDistanceService_get(QueryByDistanceService_getPrototypeOf(QueryByDistanceService.prototype), "destroy", this).call(this);
  39155. }
  39156. /**
  39157. * @function QueryByDistanceService.prototype.getJsonParameters
  39158. * @description 将查询参数转化为 JSON 字符串。
  39159. * 在本类中重写此方法,可以实现不同种类的查询(sql, geometry, distance, bounds等)。
  39160. * @param {QueryByDistanceParameters} params - Distance 查询参数类。
  39161. * @returns {Object} 转化后的 JSON 字符串。
  39162. */
  39163. }, {
  39164. key: "getJsonParameters",
  39165. value: function getJsonParameters(params) {
  39166. if (!(params instanceof QueryByDistanceParameters)) {
  39167. return;
  39168. }
  39169. var me = this,
  39170. jsonParameters = "",
  39171. qp = me.getQueryParameters(params);
  39172. var sg = ServerGeometry.fromGeometry(params.geometry);
  39173. jsonParameters += params.isNearest ? "'queryMode':'FindNearest','queryParameters':" : "'queryMode':'DistanceQuery','queryParameters':";
  39174. jsonParameters += Util_Util.toJSON(qp);
  39175. jsonParameters += ",'geometry':" + Util_Util.toJSON(sg) + ",'distance':" + params.distance;
  39176. jsonParameters = "{" + jsonParameters + "}";
  39177. return jsonParameters;
  39178. }
  39179. }]);
  39180. return QueryByDistanceService;
  39181. }(QueryServiceBase);
  39182. ;// CONCATENATED MODULE: ./src/common/iServer/QueryBySQLParameters.js
  39183. function QueryBySQLParameters_typeof(obj) { "@babel/helpers - typeof"; return QueryBySQLParameters_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, QueryBySQLParameters_typeof(obj); }
  39184. function QueryBySQLParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  39185. function QueryBySQLParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  39186. function QueryBySQLParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) QueryBySQLParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) QueryBySQLParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  39187. function QueryBySQLParameters_get() { if (typeof Reflect !== "undefined" && Reflect.get) { QueryBySQLParameters_get = Reflect.get.bind(); } else { QueryBySQLParameters_get = function _get(target, property, receiver) { var base = QueryBySQLParameters_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return QueryBySQLParameters_get.apply(this, arguments); }
  39188. function QueryBySQLParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = QueryBySQLParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  39189. function QueryBySQLParameters_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) QueryBySQLParameters_setPrototypeOf(subClass, superClass); }
  39190. function QueryBySQLParameters_setPrototypeOf(o, p) { QueryBySQLParameters_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return QueryBySQLParameters_setPrototypeOf(o, p); }
  39191. function QueryBySQLParameters_createSuper(Derived) { var hasNativeReflectConstruct = QueryBySQLParameters_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = QueryBySQLParameters_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = QueryBySQLParameters_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return QueryBySQLParameters_possibleConstructorReturn(this, result); }; }
  39192. function QueryBySQLParameters_possibleConstructorReturn(self, call) { if (call && (QueryBySQLParameters_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return QueryBySQLParameters_assertThisInitialized(self); }
  39193. function QueryBySQLParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  39194. function QueryBySQLParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  39195. function QueryBySQLParameters_getPrototypeOf(o) { QueryBySQLParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return QueryBySQLParameters_getPrototypeOf(o); }
  39196. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  39197. * This program are made available under the terms of the Apache License, Version 2.0
  39198. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  39199. /**
  39200. * @class QueryBySQLParameters
  39201. * @deprecatedclass SuperMap.QueryBySQLParameters
  39202. * @category iServer Map QueryResults
  39203. * @classdesc SQL 查询参数类。
  39204. * 该类用于设置 SQL 查询的相关参数。
  39205. * @extends {QueryParameters}
  39206. * @param {Object} options - 参数。
  39207. * @param {Array.<FilterParameter>} options.queryParams - 查询过滤条件参数数组。
  39208. * @param {string} [options.customParams] - 自定义参数,供扩展使用。
  39209. * @param {Object} [options.prjCoordSys] - 自定义参数,供 SuperMap Online 提供的动态投影查询扩展使用。如 {"epsgCode":3857}。
  39210. * @param {number} [options.expectCount=100000] - 期望返回结果记录个数。
  39211. * @param {GeometryType} [options.networkType=GeometryType.LINE] - 网络数据集对应的查询类型。
  39212. * @param {QueryOption} [options.queryOption=QueryOption.ATTRIBUTEANDGEOMETRY] - 查询结果类型枚举类。
  39213. * @param {number} [options.startRecord=0] - 查询起始记录号。
  39214. * @param {number} [options.holdTime=10] - 资源在服务端保存的时间,单位为分钟。
  39215. * @param {boolean} [options.returnCustomResult=false] - 仅供三维使用。
  39216. * @param {boolean} [options.returnContent=true] - 是否立即返回新创建资源的表述还是返回新资源的 URI。
  39217. * @param {boolean} [options.returnFeatureWithFieldCaption = false] - 返回的查询结果要素字段标识是否为字段别名。为 false 时,返回的是字段名;为 true 时,返回的是字段别名。
  39218. * @usage
  39219. */
  39220. var QueryBySQLParameters = /*#__PURE__*/function (_QueryParameters) {
  39221. QueryBySQLParameters_inherits(QueryBySQLParameters, _QueryParameters);
  39222. var _super = QueryBySQLParameters_createSuper(QueryBySQLParameters);
  39223. function QueryBySQLParameters(options) {
  39224. var _this;
  39225. QueryBySQLParameters_classCallCheck(this, QueryBySQLParameters);
  39226. options = options || {};
  39227. _this = _super.call(this, options);
  39228. /**
  39229. * @member {boolean} [QueryBySQLParameters.prototype.returnContent=true]
  39230. * @description 是否立即返回新创建资源的表述还是返回新资源的 URI。
  39231. * 如果为 true,则直接返回新创建资源,即查询结果的表述。
  39232. * 为 false,则返回的是查询结果资源的 URI。
  39233. */
  39234. _this.returnContent = true;
  39235. Util_Util.extend(QueryBySQLParameters_assertThisInitialized(_this), options);
  39236. _this.CLASS_NAME = "SuperMap.QueryBySQLParameters";
  39237. return _this;
  39238. }
  39239. /**
  39240. * @function QueryBySQLParameters.prototype.destroy
  39241. * @description 释放资源,将引用资源的属性置空。
  39242. */
  39243. QueryBySQLParameters_createClass(QueryBySQLParameters, [{
  39244. key: "destroy",
  39245. value: function destroy() {
  39246. QueryBySQLParameters_get(QueryBySQLParameters_getPrototypeOf(QueryBySQLParameters.prototype), "destroy", this).call(this);
  39247. var me = this;
  39248. me.returnContent = null;
  39249. }
  39250. }]);
  39251. return QueryBySQLParameters;
  39252. }(QueryParameters);
  39253. ;// CONCATENATED MODULE: ./src/common/iServer/QueryBySQLService.js
  39254. function QueryBySQLService_typeof(obj) { "@babel/helpers - typeof"; return QueryBySQLService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, QueryBySQLService_typeof(obj); }
  39255. function QueryBySQLService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  39256. function QueryBySQLService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  39257. function QueryBySQLService_createClass(Constructor, protoProps, staticProps) { if (protoProps) QueryBySQLService_defineProperties(Constructor.prototype, protoProps); if (staticProps) QueryBySQLService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  39258. function QueryBySQLService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { QueryBySQLService_get = Reflect.get.bind(); } else { QueryBySQLService_get = function _get(target, property, receiver) { var base = QueryBySQLService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return QueryBySQLService_get.apply(this, arguments); }
  39259. function QueryBySQLService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = QueryBySQLService_getPrototypeOf(object); if (object === null) break; } return object; }
  39260. function QueryBySQLService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) QueryBySQLService_setPrototypeOf(subClass, superClass); }
  39261. function QueryBySQLService_setPrototypeOf(o, p) { QueryBySQLService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return QueryBySQLService_setPrototypeOf(o, p); }
  39262. function QueryBySQLService_createSuper(Derived) { var hasNativeReflectConstruct = QueryBySQLService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = QueryBySQLService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = QueryBySQLService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return QueryBySQLService_possibleConstructorReturn(this, result); }; }
  39263. function QueryBySQLService_possibleConstructorReturn(self, call) { if (call && (QueryBySQLService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return QueryBySQLService_assertThisInitialized(self); }
  39264. function QueryBySQLService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  39265. function QueryBySQLService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  39266. function QueryBySQLService_getPrototypeOf(o) { QueryBySQLService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return QueryBySQLService_getPrototypeOf(o); }
  39267. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  39268. * This program are made available under the terms of the Apache License, Version 2.0
  39269. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  39270. /**
  39271. * @class QueryBySQLService
  39272. * @deprecatedclass SuperMap.QueryBySQLService
  39273. * @category iServer Map QueryResults
  39274. * @classdesc SQL 查询服务类。在一个或多个指定的图层上查询符合 SQL 条件的空间地物信息。
  39275. * @extends {QueryServiceBase}
  39276. * @example
  39277. * var queryParam = new FilterParameter({
  39278. * name: "Countries@World.1",
  39279. * attributeFilter: "Pop_1994>1000000000 and SmArea>900"
  39280. * });
  39281. * var queryBySQLParams = new QueryBySQLParameters({
  39282. * queryParams: [queryParam]
  39283. * });
  39284. * var myQueryBySQLService = new QueryBySQLService(url, {eventListeners: {
  39285. * "processCompleted": queryCompleted,
  39286. * "processFailed": queryError
  39287. * }
  39288. * });
  39289. * queryBySQLService.processAsync(queryBySQLParams);
  39290. * function queryCompleted(object){//todo};
  39291. * function queryError(object){//todo};
  39292. * @param {string} url - 服务地址。如访问World Map服务,只需将url设为: http://localhost:8090/iserver/services/map-world/rest/maps/World+Map 即可。
  39293. * @param {Object} options - 参数。
  39294. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  39295. * @param {DataFormat} [options.format=DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON、GeoJSON、FGB 三种格式。参数格式为 "ISERVER","GEOJSON","FGB"。
  39296. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  39297. * @param {Object} [options.headers] - 请求头。
  39298. * @usage
  39299. */
  39300. var QueryBySQLService = /*#__PURE__*/function (_QueryServiceBase) {
  39301. QueryBySQLService_inherits(QueryBySQLService, _QueryServiceBase);
  39302. var _super = QueryBySQLService_createSuper(QueryBySQLService);
  39303. function QueryBySQLService(url, options) {
  39304. var _this;
  39305. QueryBySQLService_classCallCheck(this, QueryBySQLService);
  39306. _this = _super.call(this, url, options);
  39307. _this.CLASS_NAME = "SuperMap.QueryBySQLService";
  39308. return _this;
  39309. }
  39310. /**
  39311. * @override
  39312. */
  39313. QueryBySQLService_createClass(QueryBySQLService, [{
  39314. key: "destroy",
  39315. value: function destroy() {
  39316. QueryBySQLService_get(QueryBySQLService_getPrototypeOf(QueryBySQLService.prototype), "destroy", this).call(this);
  39317. }
  39318. /**
  39319. * @function QueryBySQLService.prototype.getJsonParameters
  39320. * @description 将查询参数转化为 JSON 字符串。
  39321. * 在本类中重写此方法,可以实现不同种类的查询(sql, geometry, distance, bounds等)。
  39322. * @param {QueryBySQLParameters} params - SQL 查询参数类。
  39323. * @returns {Object} 转化后的 JSON 字符串。
  39324. */
  39325. }, {
  39326. key: "getJsonParameters",
  39327. value: function getJsonParameters(params) {
  39328. if (!(params instanceof QueryBySQLParameters)) {
  39329. return;
  39330. }
  39331. var me = this,
  39332. jsonParameters = "",
  39333. qp = null;
  39334. qp = me.getQueryParameters(params);
  39335. jsonParameters += "'queryMode':'SqlQuery','queryParameters':";
  39336. jsonParameters += Util_Util.toJSON(qp);
  39337. jsonParameters = "{" + jsonParameters + "}";
  39338. return jsonParameters;
  39339. }
  39340. }]);
  39341. return QueryBySQLService;
  39342. }(QueryServiceBase);
  39343. ;// CONCATENATED MODULE: ./src/common/iServer/QueryByGeometryParameters.js
  39344. function QueryByGeometryParameters_typeof(obj) { "@babel/helpers - typeof"; return QueryByGeometryParameters_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, QueryByGeometryParameters_typeof(obj); }
  39345. function QueryByGeometryParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  39346. function QueryByGeometryParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  39347. function QueryByGeometryParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) QueryByGeometryParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) QueryByGeometryParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  39348. function QueryByGeometryParameters_get() { if (typeof Reflect !== "undefined" && Reflect.get) { QueryByGeometryParameters_get = Reflect.get.bind(); } else { QueryByGeometryParameters_get = function _get(target, property, receiver) { var base = QueryByGeometryParameters_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return QueryByGeometryParameters_get.apply(this, arguments); }
  39349. function QueryByGeometryParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = QueryByGeometryParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  39350. function QueryByGeometryParameters_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) QueryByGeometryParameters_setPrototypeOf(subClass, superClass); }
  39351. function QueryByGeometryParameters_setPrototypeOf(o, p) { QueryByGeometryParameters_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return QueryByGeometryParameters_setPrototypeOf(o, p); }
  39352. function QueryByGeometryParameters_createSuper(Derived) { var hasNativeReflectConstruct = QueryByGeometryParameters_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = QueryByGeometryParameters_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = QueryByGeometryParameters_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return QueryByGeometryParameters_possibleConstructorReturn(this, result); }; }
  39353. function QueryByGeometryParameters_possibleConstructorReturn(self, call) { if (call && (QueryByGeometryParameters_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return QueryByGeometryParameters_assertThisInitialized(self); }
  39354. function QueryByGeometryParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  39355. function QueryByGeometryParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  39356. function QueryByGeometryParameters_getPrototypeOf(o) { QueryByGeometryParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return QueryByGeometryParameters_getPrototypeOf(o); }
  39357. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  39358. * This program are made available under the terms of the Apache License, Version 2.0
  39359. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  39360. /**
  39361. * @class QueryByGeometryParameters
  39362. * @deprecatedclass SuperMap.QueryByGeometryParameters
  39363. * @category iServer Map QueryResults
  39364. * @classdesc Geometry 查询参数类。
  39365. * 该类用于设置 Geometry查询的相关参数。
  39366. * @extends {QueryParameters}
  39367. * @param {Object} options - 参数。
  39368. * @param {Array.<FilterParameter>} options.queryParams - 查询过滤条件参数数组。
  39369. * @param {GeoJSONObject} options.geometry - 查询的几何对象。
  39370. * @param {string} [options.customParams] - 自定义参数,供扩展使用。
  39371. * @param {QueryOption} [options.queryOption=QueryOption.ATTRIBUTEANDGEOMETRY] - 查询结果类型枚举类。
  39372. * @param {Object} [options.prjCoordSys] -自定义参数,供SuperMap Online提供的动态投影查询扩展使用。如 {"epsgCode":3857}。
  39373. * @param {number} [options.expectCount=100000] - 期望返回结果记录个数。
  39374. * @param {GeometryType} [options.networkType=GeometryType.LINE] - 网络数据集对应的查询类型。
  39375. * @param {boolean} [options.returnCustomResult=false] -仅供三维使用。
  39376. * @param {number} [options.startRecord=0] - 查询起始记录号。
  39377. * @param {number} [options.holdTime=10] - 资源在服务端保存的时间,单位为分钟。
  39378. * @param {boolean} [options.returnContent=true] - 是否立即返回新创建资源的表述还是返回新资源的 URI。
  39379. * @param {boolean} [options.returnFeatureWithFieldCaption = false] - 返回的查询结果要素字段标识是否为字段别名。为 false 时,返回的是字段名;为 true 时,返回的是字段别名。
  39380. * @param {SpatialQueryMode} [spatialQueryMode=SpatialQueryMode.INTERSECT] - 空间查询模式。
  39381. * @usage
  39382. */
  39383. var QueryByGeometryParameters = /*#__PURE__*/function (_QueryParameters) {
  39384. QueryByGeometryParameters_inherits(QueryByGeometryParameters, _QueryParameters);
  39385. var _super = QueryByGeometryParameters_createSuper(QueryByGeometryParameters);
  39386. function QueryByGeometryParameters(options) {
  39387. var _this;
  39388. QueryByGeometryParameters_classCallCheck(this, QueryByGeometryParameters);
  39389. options = options || {};
  39390. _this = _super.call(this, options);
  39391. /**
  39392. * @member {boolean} [QueryByGeometryParameters.prototype.returnContent=true]
  39393. * @description 是否立即返回新创建资源的表述还是返回新资源的 URI。<br>
  39394. * 如果为 true,则直接返回新创建资源,即查询结果的表述。<br>
  39395. * 为 false,则返回的是查询结果资源的 URI。
  39396. */
  39397. _this.returnContent = true;
  39398. /**
  39399. * @member {GeoJSONObject} QueryByGeometryParameters.prototype.geometry
  39400. * @description 用于查询的几何对象。<br>
  39401. * 点类型可以是:{@link GeometryPoint}|{@link L.Marker}|{@link L.CircleMarker}|{@link L.Circle}|{@link L.GeoJSON}|{@link ol.geom.Point}|{@link ol.format.GeoJSON}|{@link mapboxgl.LngLat}|{@link mapboxgl.Point}|{@link GeoJSONObject}。<br>
  39402. * 线类型可以是:{@link GeometryLineString}|{@link GeometryLinearRing}|{@link L.Polyline}|{@link L.GeoJSON}|{@link ol.geom.LineString}|{@link ol.format.GeoJSON}|{@link GeoJSONObject}。<br>
  39403. * 面类型可以是:{@link GeometryPolygon}|{@link L.Polygon}|{@link L.GeoJSON}|{@link ol.geom.Polygon}|{@link ol.format.GeoJSON}|{@link mapboxgl.LngLatBounds}|{@link GeoJSONObject}。
  39404. */
  39405. _this.geometry = null;
  39406. /**
  39407. * @member {SpatialQueryMode} [QueryByGeometryParameters.prototype.spatialQueryMode=SpatialQueryMode.INTERSECT]
  39408. * @description 空间查询模式。
  39409. */
  39410. _this.spatialQueryMode = SpatialQueryMode.INTERSECT;
  39411. Util_Util.extend(QueryByGeometryParameters_assertThisInitialized(_this), options);
  39412. _this.CLASS_NAME = "SuperMap.QueryByGeometryParameters";
  39413. return _this;
  39414. }
  39415. /**
  39416. * @function QueryByGeometryParameters.prototype.destroy
  39417. * @description 释放资源,将引用资源的属性置空。
  39418. */
  39419. QueryByGeometryParameters_createClass(QueryByGeometryParameters, [{
  39420. key: "destroy",
  39421. value: function destroy() {
  39422. QueryByGeometryParameters_get(QueryByGeometryParameters_getPrototypeOf(QueryByGeometryParameters.prototype), "destroy", this).call(this);
  39423. var me = this;
  39424. me.returnContent = null;
  39425. me.geometry = null;
  39426. me.spatialQueryMode = null;
  39427. }
  39428. }]);
  39429. return QueryByGeometryParameters;
  39430. }(QueryParameters);
  39431. ;// CONCATENATED MODULE: ./src/common/iServer/QueryByGeometryService.js
  39432. function QueryByGeometryService_typeof(obj) { "@babel/helpers - typeof"; return QueryByGeometryService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, QueryByGeometryService_typeof(obj); }
  39433. function QueryByGeometryService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  39434. function QueryByGeometryService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  39435. function QueryByGeometryService_createClass(Constructor, protoProps, staticProps) { if (protoProps) QueryByGeometryService_defineProperties(Constructor.prototype, protoProps); if (staticProps) QueryByGeometryService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  39436. function QueryByGeometryService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { QueryByGeometryService_get = Reflect.get.bind(); } else { QueryByGeometryService_get = function _get(target, property, receiver) { var base = QueryByGeometryService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return QueryByGeometryService_get.apply(this, arguments); }
  39437. function QueryByGeometryService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = QueryByGeometryService_getPrototypeOf(object); if (object === null) break; } return object; }
  39438. function QueryByGeometryService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) QueryByGeometryService_setPrototypeOf(subClass, superClass); }
  39439. function QueryByGeometryService_setPrototypeOf(o, p) { QueryByGeometryService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return QueryByGeometryService_setPrototypeOf(o, p); }
  39440. function QueryByGeometryService_createSuper(Derived) { var hasNativeReflectConstruct = QueryByGeometryService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = QueryByGeometryService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = QueryByGeometryService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return QueryByGeometryService_possibleConstructorReturn(this, result); }; }
  39441. function QueryByGeometryService_possibleConstructorReturn(self, call) { if (call && (QueryByGeometryService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return QueryByGeometryService_assertThisInitialized(self); }
  39442. function QueryByGeometryService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  39443. function QueryByGeometryService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  39444. function QueryByGeometryService_getPrototypeOf(o) { QueryByGeometryService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return QueryByGeometryService_getPrototypeOf(o); }
  39445. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  39446. * This program are made available under the terms of the Apache License, Version 2.0
  39447. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  39448. /**
  39449. * @class QueryByGeometryService
  39450. * @deprecatedclass SuperMap.QueryByGeometryService
  39451. * @category iServer Map QueryResults
  39452. * @classdesc Geometry查询服务类。
  39453. * @extends {QueryServiceBase}
  39454. * @example
  39455. * var myQueryByGeometryService = new QueryByGeometryService(url, {
  39456. * eventListeners: {
  39457. * "processCompleted": queryCompleted,
  39458. * "processFailed": queryError
  39459. * }
  39460. * });
  39461. * function queryCompleted(object){//todo};
  39462. * function queryError(object){//todo};
  39463. * @param {string} url - 服务地址。如访问World Map服务,只需将url设为: http://localhost:8090/iserver/services/map-world/rest/maps/World+Map 即可。
  39464. * @param {Object} options - 参数。
  39465. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  39466. * @param {DataFormat} [options.format=DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON、GeoJSON、FGB 三种格式。参数格式为 "ISERVER","GEOJSON","FGB"。
  39467. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  39468. * @param {Object} [options.headers] - 请求头。
  39469. * @usage
  39470. */
  39471. var QueryByGeometryService = /*#__PURE__*/function (_QueryServiceBase) {
  39472. QueryByGeometryService_inherits(QueryByGeometryService, _QueryServiceBase);
  39473. var _super = QueryByGeometryService_createSuper(QueryByGeometryService);
  39474. function QueryByGeometryService(url, options) {
  39475. var _this;
  39476. QueryByGeometryService_classCallCheck(this, QueryByGeometryService);
  39477. _this = _super.call(this, url, options);
  39478. _this.CLASS_NAME = "SuperMap.QueryByGeometryService";
  39479. return _this;
  39480. }
  39481. /**
  39482. * @override
  39483. */
  39484. QueryByGeometryService_createClass(QueryByGeometryService, [{
  39485. key: "destroy",
  39486. value: function destroy() {
  39487. QueryByGeometryService_get(QueryByGeometryService_getPrototypeOf(QueryByGeometryService.prototype), "destroy", this).call(this);
  39488. }
  39489. /**
  39490. * @function QueryByGeometryService.prototype.getJsonParameters
  39491. * @description 将查询参数转化为 JSON 字符串。
  39492. * 在本类中重写此方法,可以实现不同种类的查询(sql, geometry, distance, bounds等)。
  39493. * @param {QueryByGeometryParameters} params - Geometry 查询参数类。
  39494. * @returns {Object} 转化后的 JSON 字符串。
  39495. */
  39496. }, {
  39497. key: "getJsonParameters",
  39498. value: function getJsonParameters(params) {
  39499. if (!(params instanceof QueryByGeometryParameters)) {
  39500. return;
  39501. }
  39502. var me = this,
  39503. jsonParameters = "",
  39504. qp = null,
  39505. geometry = params.geometry,
  39506. sg = ServerGeometry.fromGeometry(geometry);
  39507. qp = me.getQueryParameters(params);
  39508. jsonParameters += "'queryMode':'SpatialQuery','queryParameters':";
  39509. jsonParameters += Util_Util.toJSON(qp) + ",'geometry':" + Util_Util.toJSON(sg) + ",'spatialQueryMode':" + Util_Util.toJSON(params.spatialQueryMode);
  39510. jsonParameters = "{" + jsonParameters + "}";
  39511. return jsonParameters;
  39512. }
  39513. }]);
  39514. return QueryByGeometryService;
  39515. }(QueryServiceBase);
  39516. ;// CONCATENATED MODULE: ./src/common/iServer/QueryService.js
  39517. function QueryService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  39518. function QueryService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  39519. function QueryService_createClass(Constructor, protoProps, staticProps) { if (protoProps) QueryService_defineProperties(Constructor.prototype, protoProps); if (staticProps) QueryService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  39520. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  39521. * This program are made available under the terms of the Apache License, Version 2.0
  39522. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  39523. /**
  39524. * @class QueryService
  39525. * @category iServer Map QueryResults
  39526. * @classdesc 地图查询服务类。
  39527. * 提供:范围查询,SQL 查询,几何查询,距离查询。
  39528. * @extends {ServiceBase}
  39529. * @param {string} url - 服务地址。
  39530. * @param {Object} options - 参数。
  39531. * @param {string} [options.proxy] - 服务代理地址。
  39532. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  39533. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  39534. * @param {Object} [options.headers] - 请求头。
  39535. * @example
  39536. * new QueryService(url)
  39537. * .queryByBounds(param,function(result){
  39538. * //doSomething
  39539. * })
  39540. * @usage
  39541. */
  39542. var QueryService_QueryService = /*#__PURE__*/function () {
  39543. function QueryService(url, options) {
  39544. QueryService_classCallCheck(this, QueryService);
  39545. this.options = options || {};
  39546. this.url = url;
  39547. }
  39548. /**
  39549. * @function QueryService.prototype.queryByBounds
  39550. * @description Bounds 查询地图服务。
  39551. * @param {QueryByBoundsParameters} params - Bounds 查询参数类。
  39552. * @param {RequestCallback} callback - 回调函数。
  39553. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  39554. */
  39555. QueryService_createClass(QueryService, [{
  39556. key: "queryByBounds",
  39557. value: function queryByBounds(params, callback, resultFormat) {
  39558. var me = this;
  39559. var queryService = new QueryByBoundsService(me.url, {
  39560. proxy: me.options.proxy,
  39561. withCredentials: me.options.withCredentials,
  39562. crossOrigin: me.options.crossOrigin,
  39563. headers: me.options.headers,
  39564. eventListeners: {
  39565. scope: me,
  39566. processCompleted: callback,
  39567. processFailed: callback
  39568. },
  39569. format: me._processFormat(resultFormat)
  39570. });
  39571. queryService.processAsync(params);
  39572. }
  39573. /**
  39574. * @function QueryService.prototype.queryByDistance
  39575. * @description 地图距离查询服务。
  39576. * @param {QueryByDistanceParameters} params - Distance 查询参数类。
  39577. * @param {RequestCallback} callback - 回调函数。
  39578. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型
  39579. */
  39580. }, {
  39581. key: "queryByDistance",
  39582. value: function queryByDistance(params, callback, resultFormat) {
  39583. var me = this;
  39584. var queryByDistanceService = new QueryByDistanceService(me.url, {
  39585. proxy: me.options.proxy,
  39586. withCredentials: me.options.withCredentials,
  39587. crossOrigin: me.options.crossOrigin,
  39588. headers: me.options.headers,
  39589. eventListeners: {
  39590. scope: me,
  39591. processCompleted: callback,
  39592. processFailed: callback
  39593. },
  39594. format: resultFormat
  39595. });
  39596. queryByDistanceService.processAsync(params);
  39597. }
  39598. /**
  39599. * @function QueryService.prototype.queryBySQL
  39600. * @description 地图 SQL 查询服务。
  39601. * @param {QueryBySQLParameters} params - SQL 查询参数类。
  39602. * @param {RequestCallback} callback - 回调函数。
  39603. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  39604. */
  39605. }, {
  39606. key: "queryBySQL",
  39607. value: function queryBySQL(params, callback, resultFormat) {
  39608. var me = this;
  39609. var queryBySQLService = new QueryBySQLService(me.url, {
  39610. proxy: me.options.proxy,
  39611. withCredentials: me.options.withCredentials,
  39612. crossOrigin: me.options.crossOrigin,
  39613. headers: me.options.headers,
  39614. eventListeners: {
  39615. scope: me,
  39616. processCompleted: callback,
  39617. processFailed: callback
  39618. },
  39619. format: resultFormat
  39620. });
  39621. queryBySQLService.processAsync(params);
  39622. }
  39623. /**
  39624. * @function QueryService.prototype.queryByGeometry
  39625. * @description 地图几何查询服务。
  39626. * @param {QueryByGeometryParameters} params - Geometry 查询参数类。
  39627. * @param {RequestCallback} callback - 回调函数。
  39628. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  39629. */
  39630. }, {
  39631. key: "queryByGeometry",
  39632. value: function queryByGeometry(params, callback, resultFormat) {
  39633. var me = this;
  39634. var queryByGeometryService = new QueryByGeometryService(me.url, {
  39635. proxy: me.options.proxy,
  39636. withCredentials: me.options.withCredentials,
  39637. crossOrigin: me.options.crossOrigin,
  39638. headers: me.options.headers,
  39639. eventListeners: {
  39640. scope: me,
  39641. processCompleted: callback,
  39642. processFailed: callback
  39643. },
  39644. format: resultFormat
  39645. });
  39646. queryByGeometryService.processAsync(params);
  39647. }
  39648. }, {
  39649. key: "_processFormat",
  39650. value: function _processFormat(resultFormat) {
  39651. return resultFormat ? resultFormat : DataFormat.GEOJSON;
  39652. }
  39653. }]);
  39654. return QueryService;
  39655. }();
  39656. ;// CONCATENATED MODULE: ./src/maplibregl/services/QueryService.js
  39657. function QueryService_typeof(obj) { "@babel/helpers - typeof"; return QueryService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, QueryService_typeof(obj); }
  39658. function services_QueryService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  39659. function services_QueryService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  39660. function services_QueryService_createClass(Constructor, protoProps, staticProps) { if (protoProps) services_QueryService_defineProperties(Constructor.prototype, protoProps); if (staticProps) services_QueryService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  39661. function QueryService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) QueryService_setPrototypeOf(subClass, superClass); }
  39662. function QueryService_setPrototypeOf(o, p) { QueryService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return QueryService_setPrototypeOf(o, p); }
  39663. function QueryService_createSuper(Derived) { var hasNativeReflectConstruct = QueryService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = QueryService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = QueryService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return QueryService_possibleConstructorReturn(this, result); }; }
  39664. function QueryService_possibleConstructorReturn(self, call) { if (call && (QueryService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return QueryService_assertThisInitialized(self); }
  39665. function QueryService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  39666. function QueryService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  39667. function QueryService_getPrototypeOf(o) { QueryService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return QueryService_getPrototypeOf(o); }
  39668. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  39669. * This program are made available under the terms of the Apache License, Version 2.0
  39670. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  39671. /**
  39672. * @class QueryService
  39673. * @category iServer Map QueryResults
  39674. * @classdesc 地图查询服务类。
  39675. * 提供:范围查询,SQL 查询,几何查询,距离查询。
  39676. * @version 11.1.0
  39677. * @modulecategory Services
  39678. * @extends {ServiceBase}
  39679. * @param {string} url - 服务地址。
  39680. * @param {Object} options - 参数。
  39681. * @param {string} [options.proxy] - 服务代理地址。
  39682. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  39683. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  39684. * @param {Object} [options.headers] - 请求头。
  39685. * @example
  39686. * new QueryService(url)
  39687. * .queryByBounds(param,function(result){
  39688. * //doSomething
  39689. * })
  39690. * @usage
  39691. */
  39692. var QueryService = /*#__PURE__*/function (_ServiceBase) {
  39693. QueryService_inherits(QueryService, _ServiceBase);
  39694. var _super = QueryService_createSuper(QueryService);
  39695. function QueryService(url, options) {
  39696. var _this;
  39697. services_QueryService_classCallCheck(this, QueryService);
  39698. _this = _super.call(this, url, options);
  39699. _this._queryService = new QueryService_QueryService(url, options);
  39700. return _this;
  39701. }
  39702. /**
  39703. * @function QueryService.prototype.queryByBounds
  39704. * @description Bounds 查询地图服务。
  39705. * @param {QueryByBoundsParameters} params - Bounds 查询参数类。
  39706. * @param {RequestCallback} callback - 回调函数。
  39707. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  39708. */
  39709. services_QueryService_createClass(QueryService, [{
  39710. key: "queryByBounds",
  39711. value: function queryByBounds(params, callback, resultFormat) {
  39712. params = this._processParams(params);
  39713. this._queryService.queryByBounds(params, callback, resultFormat);
  39714. }
  39715. /**
  39716. * @function QueryService.prototype.queryByDistance
  39717. * @description 地图距离查询服务。
  39718. * @param {QueryByDistanceParameters} params - Distance 查询参数类。
  39719. * @param {RequestCallback} callback - 回调函数。
  39720. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型
  39721. */
  39722. }, {
  39723. key: "queryByDistance",
  39724. value: function queryByDistance(params, callback, resultFormat) {
  39725. params = this._processParams(params);
  39726. this._queryService.queryByDistance(params, callback, resultFormat);
  39727. }
  39728. /**
  39729. * @function QueryService.prototype.queryBySQL
  39730. * @description 地图 SQL 查询服务。
  39731. * @param {QueryBySQLParameters} params - SQL 查询参数类。
  39732. * @param {RequestCallback} callback - 回调函数。
  39733. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  39734. */
  39735. }, {
  39736. key: "queryBySQL",
  39737. value: function queryBySQL(params, callback, resultFormat) {
  39738. params = this._processParams(params);
  39739. this._queryService.queryBySQL(params, callback, resultFormat);
  39740. }
  39741. /**
  39742. * @function QueryService.prototype.queryByGeometry
  39743. * @description 地图几何查询服务。
  39744. * @param {QueryByGeometryParameters} params - Geometry 查询参数类。
  39745. * @param {RequestCallback} callback - 回调函数。
  39746. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  39747. */
  39748. }, {
  39749. key: "queryByGeometry",
  39750. value: function queryByGeometry(params, callback, resultFormat) {
  39751. params = this._processParams(params);
  39752. this._queryService.queryByGeometry(params, callback, resultFormat);
  39753. }
  39754. }, {
  39755. key: "_processParams",
  39756. value: function _processParams(params) {
  39757. if (!params) {
  39758. return {};
  39759. }
  39760. params.returnContent = params.returnContent == null ? true : params.returnContent;
  39761. if (params.queryParams && !core_Util_Util.isArray(params.queryParams)) {
  39762. params.queryParams = [params.queryParams];
  39763. }
  39764. if (params.bounds) {
  39765. if (params.bounds instanceof Array) {
  39766. params.bounds = new Bounds(params.bounds[0], params.bounds[1], params.bounds[2], params.bounds[3]);
  39767. }
  39768. if (params.bounds instanceof (external_maplibregl_default()).LngLatBounds) {
  39769. params.bounds = new Bounds(params.bounds.getSouthWest().lng, params.bounds.getSouthWest().lat, params.bounds.getNorthEast().lng, params.bounds.getNorthEast().lat);
  39770. }
  39771. }
  39772. if (params.geometry) {
  39773. if (params.geometry instanceof (external_maplibregl_default()).LngLat) {
  39774. params.geometry = new Point(params.geometry.lng, params.geometry.lat);
  39775. }
  39776. if (params.geometry instanceof (external_maplibregl_default()).Point) {
  39777. params.geometry = new Point(params.geometry.x, params.geometry.y);
  39778. }
  39779. if (params.geometry instanceof (external_maplibregl_default()).LngLatBounds) {
  39780. params.geometry = core_Util_Util.toSuperMapPolygon(params.geometry);
  39781. }
  39782. if (!(params.geometry instanceof Geometry_Geometry)) {
  39783. params.geometry = core_Util_Util.toSuperMapGeometry(params.geometry);
  39784. }
  39785. }
  39786. return params;
  39787. }
  39788. }]);
  39789. return QueryService;
  39790. }(ServiceBase);
  39791. ;// CONCATENATED MODULE: ./src/common/iServer/SpatialAnalystBase.js
  39792. function SpatialAnalystBase_typeof(obj) { "@babel/helpers - typeof"; return SpatialAnalystBase_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, SpatialAnalystBase_typeof(obj); }
  39793. function SpatialAnalystBase_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  39794. function SpatialAnalystBase_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  39795. function SpatialAnalystBase_createClass(Constructor, protoProps, staticProps) { if (protoProps) SpatialAnalystBase_defineProperties(Constructor.prototype, protoProps); if (staticProps) SpatialAnalystBase_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  39796. function SpatialAnalystBase_get() { if (typeof Reflect !== "undefined" && Reflect.get) { SpatialAnalystBase_get = Reflect.get.bind(); } else { SpatialAnalystBase_get = function _get(target, property, receiver) { var base = SpatialAnalystBase_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return SpatialAnalystBase_get.apply(this, arguments); }
  39797. function SpatialAnalystBase_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SpatialAnalystBase_getPrototypeOf(object); if (object === null) break; } return object; }
  39798. function SpatialAnalystBase_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) SpatialAnalystBase_setPrototypeOf(subClass, superClass); }
  39799. function SpatialAnalystBase_setPrototypeOf(o, p) { SpatialAnalystBase_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SpatialAnalystBase_setPrototypeOf(o, p); }
  39800. function SpatialAnalystBase_createSuper(Derived) { var hasNativeReflectConstruct = SpatialAnalystBase_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = SpatialAnalystBase_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = SpatialAnalystBase_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return SpatialAnalystBase_possibleConstructorReturn(this, result); }; }
  39801. function SpatialAnalystBase_possibleConstructorReturn(self, call) { if (call && (SpatialAnalystBase_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return SpatialAnalystBase_assertThisInitialized(self); }
  39802. function SpatialAnalystBase_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  39803. function SpatialAnalystBase_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  39804. function SpatialAnalystBase_getPrototypeOf(o) { SpatialAnalystBase_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SpatialAnalystBase_getPrototypeOf(o); }
  39805. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  39806. * This program are made available under the terms of the Apache License, Version 2.0
  39807. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  39808. /**
  39809. * @class SpatialAnalystBase
  39810. * @deprecatedclass SuperMap.SpatialAnalystBase
  39811. * @category iServer Core
  39812. * @classdesc 空间分析服务基类。
  39813. * @param {string} url - 地址。
  39814. * @param {Object} options - 可选参数。
  39815. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  39816. * @param {Object} [options.headers] - 请求头。
  39817. * @extends {CommonServiceBase}
  39818. * @usage
  39819. */
  39820. var SpatialAnalystBase = /*#__PURE__*/function (_CommonServiceBase) {
  39821. SpatialAnalystBase_inherits(SpatialAnalystBase, _CommonServiceBase);
  39822. var _super = SpatialAnalystBase_createSuper(SpatialAnalystBase);
  39823. function SpatialAnalystBase(url, options) {
  39824. var _this;
  39825. SpatialAnalystBase_classCallCheck(this, SpatialAnalystBase);
  39826. _this = _super.call(this, url, options);
  39827. /**
  39828. * @member {DataFormat} [SpatialAnalystBase.prototype.format=DataFormat.GEOJSON]
  39829. * @description 查询结果返回格式,目前支持 iServerJSON、GeoJSON、FGB 三种格式。参数格式为 "ISERVER","GEOJSON","FGB"。
  39830. */
  39831. _this.format = options.format || DataFormat.GEOJSON;
  39832. _this.CLASS_NAME = "SuperMap.SpatialAnalystBase";
  39833. return _this;
  39834. }
  39835. /**
  39836. * @function SpatialAnalystBase.prototype.destroy
  39837. * @override
  39838. */
  39839. SpatialAnalystBase_createClass(SpatialAnalystBase, [{
  39840. key: "destroy",
  39841. value: function destroy() {
  39842. SpatialAnalystBase_get(SpatialAnalystBase_getPrototypeOf(SpatialAnalystBase.prototype), "destroy", this).call(this);
  39843. this.format = null;
  39844. }
  39845. /**
  39846. * @function SpatialAnalystBase.prototype.serviceProcessCompleted
  39847. * @description 分析完成,执行此方法。
  39848. * @param {Object} result - 服务器返回的结果对象。
  39849. */
  39850. }, {
  39851. key: "serviceProcessCompleted",
  39852. value: function serviceProcessCompleted(result, options) {
  39853. var me = this,
  39854. analystResult;
  39855. result = Util_Util.transformResult(result);
  39856. if (result && me.format === DataFormat.GEOJSON && typeof me.toGeoJSONResult === 'function') {
  39857. //批量分析时会返回多个结果
  39858. if (Util_Util.isArray(result)) {
  39859. for (var i = 0; i < result.length; i++) {
  39860. result[i] = me.toGeoJSONResult(result[i]);
  39861. }
  39862. analystResult = result;
  39863. } else {
  39864. analystResult = me.toGeoJSONResult(result);
  39865. }
  39866. }
  39867. if (!analystResult) {
  39868. analystResult = result;
  39869. }
  39870. me.events.triggerEvent("processCompleted", {
  39871. result: analystResult,
  39872. options: options
  39873. });
  39874. }
  39875. /**
  39876. * @function SpatialAnalystBase.prototype.toGeoJSONResult
  39877. * @description 将含有 geometry 的数据转换为 GeoJSON 格式。
  39878. * @param {Object} result - 服务器返回的结果对象。
  39879. *
  39880. */
  39881. }, {
  39882. key: "toGeoJSONResult",
  39883. value: function toGeoJSONResult(result) {
  39884. if (!result) {
  39885. return null;
  39886. }
  39887. //批量叠加分析时结果这样处理
  39888. if (result.result && result.result.resultGeometry) {
  39889. result = result.result;
  39890. }
  39891. var geoJSONFormat = new GeoJSON();
  39892. if (result.recordsets) {
  39893. for (var i = 0, recordsets = result.recordsets, len = recordsets.length; i < len; i++) {
  39894. if (recordsets[i].features) {
  39895. recordsets[i].features = geoJSONFormat.toGeoJSON(recordsets[i].features);
  39896. }
  39897. }
  39898. } else if (result.recordset && result.recordset.features) {
  39899. result.recordset.features = geoJSONFormat.toGeoJSON(result.recordset.features);
  39900. }
  39901. if (result.resultGeometry) {
  39902. result.resultGeometry = geoJSONFormat.toGeoJSON(result.resultGeometry);
  39903. }
  39904. if (result.regions) {
  39905. result.regions = geoJSONFormat.toGeoJSON(result.regions);
  39906. }
  39907. return result;
  39908. }
  39909. }]);
  39910. return SpatialAnalystBase;
  39911. }(CommonServiceBase);
  39912. ;// CONCATENATED MODULE: ./src/common/iServer/AreaSolarRadiationParameters.js
  39913. function AreaSolarRadiationParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  39914. function AreaSolarRadiationParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  39915. function AreaSolarRadiationParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) AreaSolarRadiationParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) AreaSolarRadiationParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  39916. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  39917. * This program are made available under the terms of the Apache License, Version 2.0
  39918. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  39919. /**
  39920. * @class AreaSolarRadiationParameters
  39921. * @deprecatedclass SuperMap.AreaSolarRadiationParameters
  39922. * @category iServer SpatialAnalyst SolarRadiationAnalyst
  39923. * @classdesc 地区太阳辐射参数类。
  39924. * @param {Object} options - 参数。
  39925. * @param {string} options.dataset - 要用来做地区太阳辐射数据源中数据集的名称。该名称用形如"数据集名称@数据源别名"的形式来表示,例如:JingjinTerrain@Jingjin。
  39926. * @param {string} options.targetDatasourceName - 指定的存储结果数据集的数据源名称, 例如:"Jingjin"。
  39927. * @param {string} options.totalGridName - 指定地区太阳辐射总辐射量数据集的名称。
  39928. * @param {string} options.diffuseDatasetGridName - 指定地区太阳辐射散射辐射量数据集的名称。
  39929. * @param {string} options.durationDatasetGridName - 指定地区太阳辐射太阳直射持续时间数据集的名称。
  39930. * @param {string} options.directDatasetGridName - 指定地区太阳辐射直射辐射量数据集的名称。
  39931. * @param {number} options.latitude - 待计算区域的纬度值。
  39932. * @param {string} [options.timeMode = 'MULTIDAYS'] - 时间模式。可选值"WITHINDAY"(单日)或"MULTIDAYS"(多日)。
  39933. * @param {number} options.dayStart - 起始日期(年内的第几天)。
  39934. * @param {number} options.dayEnd - 结束日期(年内的第几天)。
  39935. * @param {number} [options.hourStart] - 起始时间(一天中的第几个小时)。
  39936. * @param {number} [options.hourEnd] - 结束时间(一天中的第几个小时)。
  39937. * @param {number} [options.transmittance] - 太阳辐射穿过大气的透射率。
  39938. * @param {number} [options.hourInterval=0.5] - 计算时的小时间隔(设置的越小计算量越大并且计算结果更精确,如果修改此参数,必须使用整数)。
  39939. * @param {number} [options.dayInterval=5] - 计算时的天数间隔(设置的越小计算量越大并且计算结果更精确,必须使用整数)。
  39940. * @param {boolean} [options.deleteExistResultDataset=false] - 如果用户命名的结果数据集名称与已有的数据集重名,是否删除已有的数据集。
  39941. * @usage
  39942. */
  39943. var AreaSolarRadiationParameters = /*#__PURE__*/function () {
  39944. function AreaSolarRadiationParameters(options) {
  39945. AreaSolarRadiationParameters_classCallCheck(this, AreaSolarRadiationParameters);
  39946. /**
  39947. * @member {string} AreaSolarRadiationParameters.prototype.dataset
  39948. * @description 要用来做地区太阳辐射数据源中数据集的名称。该名称用形如“数据集名称@数据源别名”形式来表示,例如:JingjinTerrain@Jingjin。注:地区太阳辐射数据必须为栅格数据集。
  39949. */
  39950. this.dataset = null;
  39951. /**
  39952. * @member {string} AreaSolarRadiationParameters.prototype.targetDatasourceName
  39953. * @description 指定的存储结果数据集的数据源名称,例如:"Jingjin"。
  39954. */
  39955. this.targetDatasourceName = null;
  39956. /**
  39957. * @member {string} AreaSolarRadiationParameters.prototype.totalGridName
  39958. * @description 指定地区太阳辐射总辐射量数据集的名称。
  39959. */
  39960. this.totalGridName = null;
  39961. /**
  39962. * @member {string} AreaSolarRadiationParameters.prototype.diffuseDatasetGridName
  39963. * @description 指定地区太阳辐射散射辐射量数据集的名称。
  39964. */
  39965. this.diffuseDatasetGridName = null;
  39966. /**
  39967. * @member {string} AreaSolarRadiationParameters.prototype.durationDatasetGridName
  39968. * @description 指定地区太阳辐射太阳直射持续时间数据集的名称。
  39969. */
  39970. this.durationDatasetGridName = null;
  39971. /**
  39972. * @member {string} AreaSolarRadiationParameters.prototype.directDatasetGridName
  39973. * @description 指定地区太阳辐射直射辐射量数据集的名称。
  39974. */
  39975. this.directDatasetGridName = null;
  39976. /**
  39977. * @member {number} AreaSolarRadiationParameters.prototype.latitude
  39978. * @description 待计算区域的纬度值。
  39979. */
  39980. this.latitude = null;
  39981. /**
  39982. * @member {string} [AreaSolarRadiationParameters.prototype.timeMode='MULTIDAYS']
  39983. * @description 时间模式。可选值"WITHINDAY"(单日)或"MULTIDAYS"(多日)。
  39984. */
  39985. this.timeMode = "MULTIDAYS";
  39986. /**
  39987. * @member {number} AreaSolarRadiationParameters.prototype.dayStart
  39988. * @description 起始日期(年内的第几天)。
  39989. */
  39990. this.dayStart = null;
  39991. /**
  39992. * @member {number} AreaSolarRadiationParameters.prototype.dayEnd
  39993. * @description 结束日期(年内的第几天)。
  39994. */
  39995. this.dayEnd = null;
  39996. /**
  39997. * @member {number} [AreaSolarRadiationParameters.prototype.hourStart]
  39998. * @description 起始时间(一天中的第几个小时)。
  39999. */
  40000. this.hourStart = null;
  40001. /**
  40002. * @member {number} [AreaSolarRadiationParameters.prototype.hourEnd]
  40003. * @description 结束时间(一天中的第几个小时)。
  40004. */
  40005. this.hourEnd = null;
  40006. /**
  40007. * @member {number} [AreaSolarRadiationParameters.prototype.transmittance]
  40008. * @description 太阳辐射穿过大气的透射率。
  40009. */
  40010. this.transmittance = null;
  40011. /**
  40012. * @member {number} [AreaSolarRadiationParameters.prototype.hourInterval=0.5]
  40013. * @description 计算时的小时间隔(设置的越小计算量越大并且计算结果更精确, 如果修改此参数,必须使用整数)
  40014. */
  40015. this.hourInterval = null;
  40016. /**
  40017. * @member {number} [AreaSolarRadiationParameters.prototype.dayInterval=5]
  40018. * @description 计算时的天数间隔(设置的越小计算量越大并且计算结果更精确, 必须使用整数)
  40019. */
  40020. this.dayInterval = null;
  40021. /**
  40022. * @member {boolean} [AreaSolarRadiationParameters.prototype.deleteExistResultDataset=false]
  40023. * @description 如果用户命名的结果数据集名称与已有的数据集重名,是否删除已有的数据集。
  40024. */
  40025. this.deleteExistResultDataset = false;
  40026. Util_Util.extend(this, options);
  40027. this.CLASS_NAME = "SuperMap.AreaSolarRadiationParameters";
  40028. }
  40029. /**
  40030. * @function AreaSolarRadiationParameters.prototype.destroy
  40031. * @description 释放资源,将引用资源的属性置空。
  40032. */
  40033. AreaSolarRadiationParameters_createClass(AreaSolarRadiationParameters, [{
  40034. key: "destroy",
  40035. value: function destroy() {
  40036. var me = this;
  40037. me.dataset = null;
  40038. me.zFactor = 1.0;
  40039. me.averageCurvatureName = null;
  40040. me.profileCurvatureName = null;
  40041. me.planCurvatureName = null;
  40042. me.deleteExistResultDataset = true;
  40043. }
  40044. /**
  40045. * @function AreaSolarRadiationParameters.toObject
  40046. * @param {AreaSolarRadiationParameters} param - 地区太阳辐射参数类。
  40047. * @param {AreaSolarRadiationParameters} tempObj - 地区太阳辐射参数对象。
  40048. * @returns {Object} JSON对象。
  40049. * @description 将AreaSolarRadiationParameters对象转换成JSON对象。
  40050. */
  40051. }], [{
  40052. key: "toObject",
  40053. value: function toObject(param, tempObj) {
  40054. var parameter = {};
  40055. for (var name in param) {
  40056. if (name !== "dataset") {
  40057. var name1 = name === "latitude" || name === "timeMode" || name === "dayStart";
  40058. var name2 = name === "dayEnd" || name === "hourStart" || name === "hourEnd";
  40059. var name3 = name === "transmittance" || name === "hourInterval" || name === "dayInterval";
  40060. if (name1 || name2 || name3) {
  40061. parameter[name] = param[name];
  40062. } else {
  40063. tempObj[name] = param[name];
  40064. }
  40065. }
  40066. }
  40067. tempObj["parameter"] = parameter;
  40068. }
  40069. }]);
  40070. return AreaSolarRadiationParameters;
  40071. }();
  40072. ;// CONCATENATED MODULE: ./src/common/iServer/AreaSolarRadiationService.js
  40073. function AreaSolarRadiationService_typeof(obj) { "@babel/helpers - typeof"; return AreaSolarRadiationService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, AreaSolarRadiationService_typeof(obj); }
  40074. function AreaSolarRadiationService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  40075. function AreaSolarRadiationService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  40076. function AreaSolarRadiationService_createClass(Constructor, protoProps, staticProps) { if (protoProps) AreaSolarRadiationService_defineProperties(Constructor.prototype, protoProps); if (staticProps) AreaSolarRadiationService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  40077. function AreaSolarRadiationService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { AreaSolarRadiationService_get = Reflect.get.bind(); } else { AreaSolarRadiationService_get = function _get(target, property, receiver) { var base = AreaSolarRadiationService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return AreaSolarRadiationService_get.apply(this, arguments); }
  40078. function AreaSolarRadiationService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = AreaSolarRadiationService_getPrototypeOf(object); if (object === null) break; } return object; }
  40079. function AreaSolarRadiationService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) AreaSolarRadiationService_setPrototypeOf(subClass, superClass); }
  40080. function AreaSolarRadiationService_setPrototypeOf(o, p) { AreaSolarRadiationService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return AreaSolarRadiationService_setPrototypeOf(o, p); }
  40081. function AreaSolarRadiationService_createSuper(Derived) { var hasNativeReflectConstruct = AreaSolarRadiationService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = AreaSolarRadiationService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = AreaSolarRadiationService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return AreaSolarRadiationService_possibleConstructorReturn(this, result); }; }
  40082. function AreaSolarRadiationService_possibleConstructorReturn(self, call) { if (call && (AreaSolarRadiationService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return AreaSolarRadiationService_assertThisInitialized(self); }
  40083. function AreaSolarRadiationService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  40084. function AreaSolarRadiationService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  40085. function AreaSolarRadiationService_getPrototypeOf(o) { AreaSolarRadiationService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return AreaSolarRadiationService_getPrototypeOf(o); }
  40086. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  40087. * This program are made available under the terms of the Apache License, Version 2.0
  40088. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  40089. /**
  40090. * @class AreaSolarRadiationService
  40091. * @deprecatedclass SuperMap.AreaSolarRadiationService
  40092. * @category iServer SpatialAnalyst SolarRadiationAnalyst
  40093. * @classdesc 地区太阳辐射服务类。
  40094. * @param {string} url - 服务的访问地址。如:</br>http://localhost:8090/iserver/services/spatialanalyst-sample/restjsr/spatialanalyst。</br>
  40095. * @param {Object} options - 参数。</br>
  40096. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  40097. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  40098. * @param {Object} [options.headers] - 请求头。
  40099. * @extends {SpatialAnalystBase}
  40100. * @example 例如:
  40101. * (start code)
  40102. * var myAreaSolarRadiationService = new AreaSolarRadiationService(url);
  40103. * myAreaSolarRadiationService.on({
  40104. * "processCompleted": processCompleted,
  40105. * "processFailed": processFailed
  40106. * }
  40107. * );
  40108. * (end)
  40109. * @usage
  40110. */
  40111. var AreaSolarRadiationService = /*#__PURE__*/function (_SpatialAnalystBase) {
  40112. AreaSolarRadiationService_inherits(AreaSolarRadiationService, _SpatialAnalystBase);
  40113. var _super = AreaSolarRadiationService_createSuper(AreaSolarRadiationService);
  40114. function AreaSolarRadiationService(url, options) {
  40115. var _this;
  40116. AreaSolarRadiationService_classCallCheck(this, AreaSolarRadiationService);
  40117. _this = _super.call(this, url, options);
  40118. _this.CLASS_NAME = "SuperMap.AreaSolarRadiationService";
  40119. return _this;
  40120. }
  40121. /**
  40122. * @function AreaSolarRadiationService.prototype.destroy
  40123. * @override
  40124. */
  40125. AreaSolarRadiationService_createClass(AreaSolarRadiationService, [{
  40126. key: "destroy",
  40127. value: function destroy() {
  40128. AreaSolarRadiationService_get(AreaSolarRadiationService_getPrototypeOf(AreaSolarRadiationService.prototype), "destroy", this).call(this);
  40129. }
  40130. /**
  40131. * @function AreaSolarRadiationService.prototype.processAsync
  40132. * @description 负责将客户端的查询参数传递到服务端。
  40133. * @param {AreaSolarRadiationParameters} parameter - 地区太阳辐射参数。
  40134. */
  40135. }, {
  40136. key: "processAsync",
  40137. value: function processAsync(parameter) {
  40138. if (!(parameter instanceof AreaSolarRadiationParameters)) {
  40139. return;
  40140. }
  40141. var me = this;
  40142. var parameterObject = {};
  40143. if (parameter instanceof AreaSolarRadiationParameters) {
  40144. me.url = Util_Util.urlPathAppend(me.url, "datasets/".concat(parameter.dataset, "/solarradiation"));
  40145. }
  40146. me.url = Util_Util.urlAppend(me.url, 'returnContent=true');
  40147. AreaSolarRadiationParameters.toObject(parameter, parameterObject);
  40148. var jsonParameters = Util_Util.toJSON(parameterObject);
  40149. me.request({
  40150. method: 'POST',
  40151. data: jsonParameters,
  40152. scope: me,
  40153. success: me.serviceProcessCompleted,
  40154. failure: me.serviceProcessFailed
  40155. });
  40156. }
  40157. }]);
  40158. return AreaSolarRadiationService;
  40159. }(SpatialAnalystBase);
  40160. ;// CONCATENATED MODULE: ./src/common/iServer/BufferDistance.js
  40161. function BufferDistance_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  40162. function BufferDistance_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  40163. function BufferDistance_createClass(Constructor, protoProps, staticProps) { if (protoProps) BufferDistance_defineProperties(Constructor.prototype, protoProps); if (staticProps) BufferDistance_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  40164. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  40165. * This program are made available under the terms of the Apache License, Version 2.0
  40166. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  40167. /**
  40168. * @class BufferDistance
  40169. * @deprecatedclass SuperMap.BufferDistance
  40170. * @category iServer SpatialAnalyst BufferAnalyst
  40171. * @classdesc 缓冲区分析的缓冲距离类。通过该类可以设置缓冲区分析的缓冲距离,距离可以是数值也可以是数值型的字段表达式。
  40172. * @param {Object} options - 可选参数。
  40173. * @param {string} [options.exp] - 以数值型的字段表达式作为缓冲区分析的距离值。
  40174. * @param {number} [options.value=100] - 以数值作为缓冲区分析的距离值。单位:米。
  40175. * @usage
  40176. */
  40177. var BufferDistance = /*#__PURE__*/function () {
  40178. function BufferDistance(options) {
  40179. BufferDistance_classCallCheck(this, BufferDistance);
  40180. /**
  40181. * @member {string} [BufferDistance.prototype.exp]
  40182. * @description 以数值型的字段表达式作为缓冲区分析的距离值。
  40183. */
  40184. this.exp = null;
  40185. /**
  40186. * @member {number} [BufferDistance.prototype.value=100]
  40187. * @description 以数值作为缓冲区分析的距离值。单位:米。
  40188. */
  40189. this.value = 100;
  40190. Util_Util.extend(this, options);
  40191. this.CLASS_NAME = "SuperMap.BufferDistance";
  40192. }
  40193. /**
  40194. * @function BufferDistance.prototype.destroy
  40195. * @description 释放资源,将引用资源的属性置空。
  40196. */
  40197. BufferDistance_createClass(BufferDistance, [{
  40198. key: "destroy",
  40199. value: function destroy() {
  40200. this.exp = null;
  40201. this.value = null;
  40202. }
  40203. }]);
  40204. return BufferDistance;
  40205. }();
  40206. ;// CONCATENATED MODULE: ./src/common/iServer/BufferSetting.js
  40207. function BufferSetting_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  40208. function BufferSetting_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  40209. function BufferSetting_createClass(Constructor, protoProps, staticProps) { if (protoProps) BufferSetting_defineProperties(Constructor.prototype, protoProps); if (staticProps) BufferSetting_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  40210. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  40211. * This program are made available under the terms of the Apache License, Version 2.0
  40212. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  40213. /**
  40214. * @class BufferSetting
  40215. * @deprecatedclass SuperMap.BufferSetting
  40216. * @category iServer SpatialAnalyst BufferAnalyst
  40217. * @classdesc 缓冲区分析通用设置类。
  40218. * @param {Object} options - 可选参数。
  40219. * @param {BufferEndType} [options.endType=BufferEndType.FLAT] - 缓冲区端点枚举值。
  40220. * @param {BufferDistance} [options.leftDistance=100] - 左侧缓冲距离。
  40221. * @param {BufferDistance} [options.rightDistance=100] - 右侧缓冲距离。
  40222. * @param {number} [options.semicircleLineSegment=4] - 圆头缓冲圆弧处线段的个数。
  40223. * @param {BufferRadiusUnit} [options.radiusUnit=BufferRadiusUnit.METER] - 缓冲半径单位。
  40224. * @usage
  40225. */
  40226. var BufferSetting = /*#__PURE__*/function () {
  40227. function BufferSetting(options) {
  40228. BufferSetting_classCallCheck(this, BufferSetting);
  40229. /**
  40230. * @member {BufferEndType} [BufferSetting.prototype.endType = BufferEndType.FLAT]
  40231. * @description 缓冲区端点枚举值。分为平头和圆头两种。
  40232. */
  40233. this.endType = BufferEndType.FLAT;
  40234. /**
  40235. * @member {BufferDistance} [BufferSetting.prototype.leftDistance=100]
  40236. * @description 左侧缓冲距离。
  40237. * 当为 GeometryBufferAnalyst 时,单位为默认地图的投影系的单位(如3857为米,4326为度),
  40238. * 当为 DatasetBufferAnalyst 时,单位通过{@link BufferSetting.radiusUnit}设置(默认全部为米)。
  40239. */
  40240. this.leftDistance = new BufferDistance();
  40241. /**
  40242. * @member {BufferDistance} [BufferSetting.prototype.rightDistance=100]
  40243. * @description 右侧缓冲距离。
  40244. * 当为 GeometryBufferAnalyst 时,单位为默认地图的投影系的单位(如3857为米,4326为度),
  40245. * 当为 DatasetBufferAnalyst 时,单位通过{@link BufferSetting#radiusUnit}设置(默认全部为米)。
  40246. */
  40247. this.rightDistance = new BufferDistance();
  40248. /**
  40249. * @member {number} [BufferSetting.prototype.semicircleLineSegment=4]
  40250. * @description 圆头缓冲圆弧处线段的个数。即用多少个线段来模拟一个半圆。
  40251. */
  40252. this.semicircleLineSegment = 4;
  40253. /**
  40254. * @member {BufferRadiusUnit} [BufferSetting.prototype.radiusUnit = BufferRadiusUnit.METER]
  40255. * @description 缓冲半径单位,可以是{@link BufferRadiusUnit.METER}、{@link BufferRadiusUnit.MILLIMETER}、
  40256. * {@link BufferRadiusUnit.CENTIMETER}、{@link BufferRadiusUnit.DECIMETER}、{@link BufferRadiusUnit.KILOMETER}、
  40257. * {@link BufferRadiusUnit.FOOT}、{@link BufferRadiusUnit.INCH}、{@link BufferRadiusUnit.MILE}、{@link BufferRadiusUnit.YARD}。
  40258. * 仅对BufferAnalyst有效。
  40259. */
  40260. this.radiusUnit = BufferRadiusUnit.METER;
  40261. if (options) {
  40262. Util_Util.extend(this, options);
  40263. }
  40264. this.CLASS_NAME = "SuperMap.BufferSetting";
  40265. }
  40266. /**
  40267. * @function BufferSetting.prototype.destroy
  40268. * @description 释放资源,将引用资源的属性置空。
  40269. */
  40270. BufferSetting_createClass(BufferSetting, [{
  40271. key: "destroy",
  40272. value: function destroy() {
  40273. var me = this;
  40274. me.endType = null;
  40275. if (me.leftDistance) {
  40276. me.leftDistance.destroy();
  40277. me.leftDistance = null;
  40278. }
  40279. if (me.rightDistance) {
  40280. me.rightDistance.destroy();
  40281. me.rightDistance = null;
  40282. }
  40283. me.semicircleLineSegment = null;
  40284. me.radiusUnit = null;
  40285. }
  40286. }]);
  40287. return BufferSetting;
  40288. }();
  40289. ;// CONCATENATED MODULE: ./src/common/iServer/BufferAnalystParameters.js
  40290. function BufferAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  40291. function BufferAnalystParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  40292. function BufferAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) BufferAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) BufferAnalystParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  40293. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  40294. * This program are made available under the terms of the Apache License, Version 2.0
  40295. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  40296. /**
  40297. * @class BufferAnalystParameters
  40298. * @deprecatedclass SuperMap.BufferAnalystParameters
  40299. * @category iServer SpatialAnalyst BufferAnalyst
  40300. * @classdesc 缓冲区分析参数基类。
  40301. * @param {Object} options - 参数。
  40302. * @param {BufferSetting} [options.bufferSetting] - 设置缓冲区通用参数。为缓冲区分析提供必要的参数信息,包括左缓冲距离、右缓冲距离、端点类型、圆头缓冲圆弧处线段的个数信息。
  40303. * @usage
  40304. */
  40305. var BufferAnalystParameters = /*#__PURE__*/function () {
  40306. function BufferAnalystParameters(options) {
  40307. BufferAnalystParameters_classCallCheck(this, BufferAnalystParameters);
  40308. var me = this;
  40309. /**
  40310. * @member {BufferSetting} [BufferAnalystParameters.prototype.bufferSetting]
  40311. * @description 设置缓冲区通用参数。为缓冲区分析提供必要的参数信息,包括左缓冲距离、右缓冲距离、端点类型、圆头缓冲圆弧处线段的个数信息。
  40312. */
  40313. me.bufferSetting = new BufferSetting();
  40314. Util_Util.extend(this, options);
  40315. this.CLASS_NAME = "SuperMap.BufferAnalystParameters";
  40316. }
  40317. /**
  40318. * @function BufferAnalystParameters.prototype.destroy
  40319. * @description 释放资源,将引用资源的属性置空。
  40320. */
  40321. BufferAnalystParameters_createClass(BufferAnalystParameters, [{
  40322. key: "destroy",
  40323. value: function destroy() {
  40324. var me = this;
  40325. if (me.bufferSetting) {
  40326. me.bufferSetting.destroy();
  40327. me.bufferSetting = null;
  40328. }
  40329. }
  40330. }]);
  40331. return BufferAnalystParameters;
  40332. }();
  40333. ;// CONCATENATED MODULE: ./src/common/iServer/DataReturnOption.js
  40334. function DataReturnOption_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  40335. function DataReturnOption_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  40336. function DataReturnOption_createClass(Constructor, protoProps, staticProps) { if (protoProps) DataReturnOption_defineProperties(Constructor.prototype, protoProps); if (staticProps) DataReturnOption_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  40337. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  40338. * This program are made available under the terms of the Apache License, Version 2.0
  40339. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  40340. /**
  40341. * @class DataReturnOption
  40342. * @deprecatedclass SuperMap.DataReturnOption
  40343. * @category iServer Data Dataset
  40344. * @classdesc 数据返回设置类。
  40345. * @param {Object} options - 参数。
  40346. * @param {number} [options.expectCount=1000] - 设置返回的最大记录数,小于或者等于 0 时表示返回所有记录数。
  40347. * @param {string} [options.dataset] - 设置结果数据集标识,当 dataReturnMode 为 {@link DataReturnMode.DATASET_ONLY}或{@link DataReturnMode.DATASET_AND_RECORDSET}时有效,
  40348. * 作为返回数据集的名称。该名称用形如“数据集名称@数据源别名”形式来表示。
  40349. * @param {DataReturnMode} [options.dataReturnMode=DataReturnMode.RECORDSET_ONLY] - 数据返回模式。
  40350. * @param {boolean} [options.deleteExistResultDataset=true] - 如果用户命名的结果数据集名称与已有的数据集重名,是否删除已有的数据集。
  40351. * @usage
  40352. */
  40353. var DataReturnOption = /*#__PURE__*/function () {
  40354. function DataReturnOption(options) {
  40355. DataReturnOption_classCallCheck(this, DataReturnOption);
  40356. /**
  40357. * @member {number} [DataReturnOption.prototype.expectCount=1000]
  40358. * @description 设置返回的最大记录数,小于或者等于0时表示返回所有记录数。
  40359. */
  40360. this.expectCount = 1000;
  40361. /**
  40362. * @member {string} [DataReturnOption.prototype.dataset]
  40363. * @description 设置结果数据集标识,当dataReturnMode为 {@link DataReturnMode.DATASET_ONLY}
  40364. * 或{@link DataReturnMode.DATASET_AND_RECORDSET}时有效,
  40365. * 作为返回数据集的名称。该名称用形如"数据集名称@数据源别名"形式来表示。
  40366. */
  40367. this.dataset = null;
  40368. /**
  40369. * @member {DataReturnMode} [DataReturnOption.prototype.dataReturnMode=DataReturnMode.RECORDSET_ONLY]
  40370. * @description 数据返回模式。
  40371. */
  40372. this.dataReturnMode = DataReturnMode.RECORDSET_ONLY;
  40373. /**
  40374. * @member {boolean} [DataReturnOption.prototype.deleteExistResultDataset=true]
  40375. * @description 如果用户命名的结果数据集名称与已有的数据集重名,是否删除已有的数据集。
  40376. */
  40377. this.deleteExistResultDataset = true;
  40378. Util_Util.extend(this, options);
  40379. this.CLASS_NAME = "SuperMap.DataReturnOption";
  40380. }
  40381. /**
  40382. * @function DataReturnOption.prototype.destroy
  40383. * @description 释放资源,将引用资源的属性置空。
  40384. */
  40385. DataReturnOption_createClass(DataReturnOption, [{
  40386. key: "destroy",
  40387. value: function destroy() {
  40388. var me = this;
  40389. me.expectCount = null;
  40390. me.dataset = null;
  40391. me.dataReturnMode = null;
  40392. me.deleteExistResultDataset = null;
  40393. }
  40394. }]);
  40395. return DataReturnOption;
  40396. }();
  40397. ;// CONCATENATED MODULE: ./src/common/iServer/DatasetBufferAnalystParameters.js
  40398. function DatasetBufferAnalystParameters_typeof(obj) { "@babel/helpers - typeof"; return DatasetBufferAnalystParameters_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, DatasetBufferAnalystParameters_typeof(obj); }
  40399. function DatasetBufferAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  40400. function DatasetBufferAnalystParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  40401. function DatasetBufferAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) DatasetBufferAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) DatasetBufferAnalystParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  40402. function DatasetBufferAnalystParameters_get() { if (typeof Reflect !== "undefined" && Reflect.get) { DatasetBufferAnalystParameters_get = Reflect.get.bind(); } else { DatasetBufferAnalystParameters_get = function _get(target, property, receiver) { var base = DatasetBufferAnalystParameters_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return DatasetBufferAnalystParameters_get.apply(this, arguments); }
  40403. function DatasetBufferAnalystParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = DatasetBufferAnalystParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  40404. function DatasetBufferAnalystParameters_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) DatasetBufferAnalystParameters_setPrototypeOf(subClass, superClass); }
  40405. function DatasetBufferAnalystParameters_setPrototypeOf(o, p) { DatasetBufferAnalystParameters_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return DatasetBufferAnalystParameters_setPrototypeOf(o, p); }
  40406. function DatasetBufferAnalystParameters_createSuper(Derived) { var hasNativeReflectConstruct = DatasetBufferAnalystParameters_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = DatasetBufferAnalystParameters_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = DatasetBufferAnalystParameters_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return DatasetBufferAnalystParameters_possibleConstructorReturn(this, result); }; }
  40407. function DatasetBufferAnalystParameters_possibleConstructorReturn(self, call) { if (call && (DatasetBufferAnalystParameters_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return DatasetBufferAnalystParameters_assertThisInitialized(self); }
  40408. function DatasetBufferAnalystParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  40409. function DatasetBufferAnalystParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  40410. function DatasetBufferAnalystParameters_getPrototypeOf(o) { DatasetBufferAnalystParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return DatasetBufferAnalystParameters_getPrototypeOf(o); }
  40411. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  40412. * This program are made available under the terms of the Apache License, Version 2.0
  40413. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  40414. /**
  40415. * @class DatasetBufferAnalystParameters
  40416. * @deprecatedclass SuperMap.DatasetBufferAnalystParameters
  40417. * @category iServer SpatialAnalyst BufferAnalyst
  40418. * @classdesc 数据集缓冲区分析参数类。
  40419. * @param {Object} options - 参数。
  40420. * @param {string} options.dataset - 要用来做缓冲区分析的数据源中数据集的名称。该名称用形如“数据集名称@数据源别名”形式来表示。
  40421. * @param {FilterParameter} [options.filterQueryParameter] - 设置数据集中几何对象的过滤条件。只有满足此条件的几何对象才参与缓冲区分析。
  40422. * @param {DataReturnOption} [options.resultSetting] - 结果返回设置类。
  40423. * @param {boolean} [options.isAttributeRetained=true] - 是否保留进行缓冲区分析的对象的字段属性。当 isUnion 字段为 false 时该字段有效。
  40424. * @param {boolean} [options.isUnion=false] - 是否将缓冲区与源记录集中的对象合并后返回。对于面对象而言,要求源数据集中的面对象不相交。
  40425. * @param {BufferSetting} [options.bufferSetting] - 设置缓冲区通用参数。
  40426. *
  40427. * @extends {BufferAnalystParameters}
  40428. * @usage
  40429. */
  40430. var DatasetBufferAnalystParameters = /*#__PURE__*/function (_BufferAnalystParamet) {
  40431. DatasetBufferAnalystParameters_inherits(DatasetBufferAnalystParameters, _BufferAnalystParamet);
  40432. var _super = DatasetBufferAnalystParameters_createSuper(DatasetBufferAnalystParameters);
  40433. function DatasetBufferAnalystParameters(options) {
  40434. var _this;
  40435. DatasetBufferAnalystParameters_classCallCheck(this, DatasetBufferAnalystParameters);
  40436. _this = _super.call(this, options);
  40437. /**
  40438. * @member {string} DatasetBufferAnalystParameters.prototype.dataset
  40439. * @description 要用来做缓冲区分析的数据源中数据集的名称。该名称用形如“数据集名称@数据源别名”形式来表示。
  40440. */
  40441. _this.dataset = null;
  40442. /**
  40443. * @member {FilterParameter} [DatasetBufferAnalystParameters.prototype.filterQueryParameter]
  40444. * @description 设置数据集中几何对象的过滤条件。只有满足此条件的几何对象才参与缓冲区分析。
  40445. */
  40446. _this.filterQueryParameter = new FilterParameter();
  40447. /**
  40448. * @member {DataReturnOption} [DatasetBufferAnalystParameters.prototype.resultSetting]
  40449. * @description 结果返回设置类。
  40450. */
  40451. _this.resultSetting = new DataReturnOption();
  40452. /**
  40453. * @member {boolean} [DatasetBufferAnalystParameters.prototype.isAttributeRetained=true]
  40454. * @description 是否保留进行缓冲区分析的对象的字段属性。当 isUnion 字段为 false 时该字段有效。
  40455. */
  40456. _this.isAttributeRetained = true;
  40457. /**
  40458. * @member {boolean} [DatasetBufferAnalystParameters.prototype.isUnion=false]
  40459. * @description 是否将缓冲区与源记录集中的对象合并后返回。对于面对象而言,要求源数据集中的面对象不相交。
  40460. */
  40461. _this.isUnion = false;
  40462. Util_Util.extend(DatasetBufferAnalystParameters_assertThisInitialized(_this), options);
  40463. _this.CLASS_NAME = "SuperMap.DatasetBufferAnalystParameters";
  40464. return _this;
  40465. }
  40466. /**
  40467. * @function DatasetBufferAnalystParameters.prototype.destroy
  40468. * @override
  40469. */
  40470. DatasetBufferAnalystParameters_createClass(DatasetBufferAnalystParameters, [{
  40471. key: "destroy",
  40472. value: function destroy() {
  40473. DatasetBufferAnalystParameters_get(DatasetBufferAnalystParameters_getPrototypeOf(DatasetBufferAnalystParameters.prototype), "destroy", this).call(this);
  40474. var me = this;
  40475. me.dataset = null;
  40476. if (me.filterQueryParameter) {
  40477. me.filterQueryParameter.destroy();
  40478. me.filterQueryParameter = null;
  40479. }
  40480. if (me.resultSetting) {
  40481. me.resultSetting.destroy();
  40482. me.resultSetting = null;
  40483. }
  40484. me.isAttributeRetained = null;
  40485. me.isUnion = null;
  40486. }
  40487. /**
  40488. * @function DatasetBufferAnalystParameters.toObject
  40489. * @param {DatasetBufferAnalystParameters} datasetBufferAnalystParameters - 数据集缓冲区分析参数类。
  40490. * @param {DatasetBufferAnalystParameters} tempObj - 数据集缓冲区分析参数对象。
  40491. * @description 将数据集缓冲区分析参数对象转换为 JSON 对象。
  40492. * @returns {Object} JSON 对象。
  40493. */
  40494. }], [{
  40495. key: "toObject",
  40496. value: function toObject(datasetBufferAnalystParameters, tempObj) {
  40497. for (var name in datasetBufferAnalystParameters) {
  40498. if (name === "bufferSetting") {
  40499. datasetBufferAnalystParameters.bufferSetting.radiusUnit = datasetBufferAnalystParameters.bufferSetting.radiusUnit.toUpperCase();
  40500. tempObj.bufferAnalystParameter = datasetBufferAnalystParameters.bufferSetting;
  40501. } else if (name === "resultSetting") {
  40502. tempObj.dataReturnOption = datasetBufferAnalystParameters.resultSetting;
  40503. } else if (name === "dataset") {
  40504. continue;
  40505. } else {
  40506. tempObj[name] = datasetBufferAnalystParameters[name];
  40507. }
  40508. }
  40509. }
  40510. }]);
  40511. return DatasetBufferAnalystParameters;
  40512. }(BufferAnalystParameters);
  40513. ;// CONCATENATED MODULE: ./src/common/iServer/GeometryBufferAnalystParameters.js
  40514. function GeometryBufferAnalystParameters_typeof(obj) { "@babel/helpers - typeof"; return GeometryBufferAnalystParameters_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, GeometryBufferAnalystParameters_typeof(obj); }
  40515. function GeometryBufferAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  40516. function GeometryBufferAnalystParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  40517. function GeometryBufferAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) GeometryBufferAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) GeometryBufferAnalystParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  40518. function GeometryBufferAnalystParameters_get() { if (typeof Reflect !== "undefined" && Reflect.get) { GeometryBufferAnalystParameters_get = Reflect.get.bind(); } else { GeometryBufferAnalystParameters_get = function _get(target, property, receiver) { var base = GeometryBufferAnalystParameters_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return GeometryBufferAnalystParameters_get.apply(this, arguments); }
  40519. function GeometryBufferAnalystParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GeometryBufferAnalystParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  40520. function GeometryBufferAnalystParameters_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) GeometryBufferAnalystParameters_setPrototypeOf(subClass, superClass); }
  40521. function GeometryBufferAnalystParameters_setPrototypeOf(o, p) { GeometryBufferAnalystParameters_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GeometryBufferAnalystParameters_setPrototypeOf(o, p); }
  40522. function GeometryBufferAnalystParameters_createSuper(Derived) { var hasNativeReflectConstruct = GeometryBufferAnalystParameters_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = GeometryBufferAnalystParameters_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = GeometryBufferAnalystParameters_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return GeometryBufferAnalystParameters_possibleConstructorReturn(this, result); }; }
  40523. function GeometryBufferAnalystParameters_possibleConstructorReturn(self, call) { if (call && (GeometryBufferAnalystParameters_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return GeometryBufferAnalystParameters_assertThisInitialized(self); }
  40524. function GeometryBufferAnalystParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  40525. function GeometryBufferAnalystParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  40526. function GeometryBufferAnalystParameters_getPrototypeOf(o) { GeometryBufferAnalystParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GeometryBufferAnalystParameters_getPrototypeOf(o); }
  40527. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  40528. * This program are made available under the terms of the Apache License, Version 2.0
  40529. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  40530. /**
  40531. * @class GeometryBufferAnalystParameters
  40532. * @deprecatedclass SuperMap.GeometryBufferAnalystParameters
  40533. * @category iServer SpatialAnalyst BufferAnalyst
  40534. * @classdesc 几何对象缓冲区分析参数类。
  40535. * 对指定的某个几何对象做缓冲区分析。通过该类可以指定要做缓冲区分析的几何对象、缓冲区参数等。
  40536. * @param {Object} options - 参数。
  40537. * @param {GeoJSONObject} options.sourceGeometry - 要做缓冲区分析的几何对象。
  40538. * @param {number} options.sourceGeometrySRID - 缓冲区几何对象投影坐标参数, 如 4326,3857。
  40539. * @param {BufferSetting} [options.bufferSetting] - 设置缓冲区通用参数。
  40540. * @extends {BufferAnalystParameters}
  40541. * @usage
  40542. */
  40543. var GeometryBufferAnalystParameters = /*#__PURE__*/function (_BufferAnalystParamet) {
  40544. GeometryBufferAnalystParameters_inherits(GeometryBufferAnalystParameters, _BufferAnalystParamet);
  40545. var _super = GeometryBufferAnalystParameters_createSuper(GeometryBufferAnalystParameters);
  40546. function GeometryBufferAnalystParameters(options) {
  40547. var _this;
  40548. GeometryBufferAnalystParameters_classCallCheck(this, GeometryBufferAnalystParameters);
  40549. _this = _super.call(this, options);
  40550. /**
  40551. * @member {GeoJSONObject} GeometryBufferAnalystParameters.prototype.sourceGeometry
  40552. * @description 要做缓冲区分析的几何对象。<br>
  40553. * 点类型可以是:{@link GeometryPoint}|{@link L.Marker}|{@link L.CircleMarker}|{@link L.Circle}|{@link L.GeoJSON}|{@link ol.geom.Point}|{@link ol.format.GeoJSON}。</br>
  40554. * 线类型可以是:{@link GeometryLineString}|{@link GeometryLinearRing}|{@link L.Polyline}|{@link L.GeoJSON}|{@link ol.geom.LineString}|{@link ol.format.GeoJSON}。</br>
  40555. * 面类型可以是:{@link GeometryPolygon}|{@link L.Polygon}|{@link L.GeoJSON}|{@link ol.geom.Polygon}|{@link ol.format.GeoJSON}。
  40556. */
  40557. _this.sourceGeometry = null;
  40558. /**
  40559. * @member {number} GeometryBufferAnalystParameters.prototype.sourceGeometrySRID
  40560. * @description 缓冲区几何对象投影坐标参数, 如 4326,3857。
  40561. */
  40562. _this.sourceGeometrySRID = null;
  40563. if (options) {
  40564. Util_Util.extend(GeometryBufferAnalystParameters_assertThisInitialized(_this), options);
  40565. }
  40566. _this.CLASS_NAME = " SuperMap.GeometryBufferAnalystParameters";
  40567. return _this;
  40568. }
  40569. /**
  40570. * @function GeometryBufferAnalystParameters.prototype.destroy
  40571. * @override
  40572. */
  40573. GeometryBufferAnalystParameters_createClass(GeometryBufferAnalystParameters, [{
  40574. key: "destroy",
  40575. value: function destroy() {
  40576. GeometryBufferAnalystParameters_get(GeometryBufferAnalystParameters_getPrototypeOf(GeometryBufferAnalystParameters.prototype), "destroy", this).call(this);
  40577. var me = this;
  40578. if (me.sourceGeometry) {
  40579. me.sourceGeometry.destroy();
  40580. me.sourceGeometry = null;
  40581. }
  40582. }
  40583. /**
  40584. * @function GeometryBufferAnalystParameters.toObject
  40585. * @param {GeometryBufferAnalystParameters} geometryBufferAnalystParameters - 几何对象缓冲区分析参数类。
  40586. * @param {GeometryBufferAnalystParameters} tempObj - 几何对象缓冲区分析参数对象。
  40587. * @description 将几何对象缓冲区分析参数对象转换为 JSON 对象。
  40588. * @returns {Object} JSON 对象。
  40589. */
  40590. }], [{
  40591. key: "toObject",
  40592. value: function toObject(geometryBufferAnalystParameters, tempObj) {
  40593. for (var name in geometryBufferAnalystParameters) {
  40594. if (name === "bufferSetting") {
  40595. var tempBufferSetting = {};
  40596. for (var key in geometryBufferAnalystParameters.bufferSetting) {
  40597. tempBufferSetting[key] = geometryBufferAnalystParameters.bufferSetting[key];
  40598. }
  40599. tempObj.analystParameter = tempBufferSetting;
  40600. } else if (name === "sourceGeometry") {
  40601. tempObj.sourceGeometry = ServerGeometry.fromGeometry(geometryBufferAnalystParameters.sourceGeometry);
  40602. } else {
  40603. tempObj[name] = geometryBufferAnalystParameters[name];
  40604. }
  40605. }
  40606. }
  40607. }]);
  40608. return GeometryBufferAnalystParameters;
  40609. }(BufferAnalystParameters);
  40610. ;// CONCATENATED MODULE: ./src/common/iServer/BufferAnalystService.js
  40611. function BufferAnalystService_typeof(obj) { "@babel/helpers - typeof"; return BufferAnalystService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, BufferAnalystService_typeof(obj); }
  40612. function BufferAnalystService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  40613. function BufferAnalystService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  40614. function BufferAnalystService_createClass(Constructor, protoProps, staticProps) { if (protoProps) BufferAnalystService_defineProperties(Constructor.prototype, protoProps); if (staticProps) BufferAnalystService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  40615. function BufferAnalystService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { BufferAnalystService_get = Reflect.get.bind(); } else { BufferAnalystService_get = function _get(target, property, receiver) { var base = BufferAnalystService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return BufferAnalystService_get.apply(this, arguments); }
  40616. function BufferAnalystService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = BufferAnalystService_getPrototypeOf(object); if (object === null) break; } return object; }
  40617. function BufferAnalystService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) BufferAnalystService_setPrototypeOf(subClass, superClass); }
  40618. function BufferAnalystService_setPrototypeOf(o, p) { BufferAnalystService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return BufferAnalystService_setPrototypeOf(o, p); }
  40619. function BufferAnalystService_createSuper(Derived) { var hasNativeReflectConstruct = BufferAnalystService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = BufferAnalystService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = BufferAnalystService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return BufferAnalystService_possibleConstructorReturn(this, result); }; }
  40620. function BufferAnalystService_possibleConstructorReturn(self, call) { if (call && (BufferAnalystService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return BufferAnalystService_assertThisInitialized(self); }
  40621. function BufferAnalystService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  40622. function BufferAnalystService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  40623. function BufferAnalystService_getPrototypeOf(o) { BufferAnalystService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return BufferAnalystService_getPrototypeOf(o); }
  40624. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  40625. * This program are made available under the terms of the Apache License, Version 2.0
  40626. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  40627. /**
  40628. * @class BufferAnalystService
  40629. * @deprecatedclass SuperMap.BufferAnalystService
  40630. * @category iServer SpatialAnalyst BufferAnalyst
  40631. * @classdesc 缓冲区分析服务类。
  40632. * 该类负责将客户设置的缓冲区分析参数传递给服务端,并接收服务端返回的缓冲区分析结果数据。
  40633. * 缓冲区分析结果通过该类支持的事件的监听函数参数获取。
  40634. * @param {string} url - 服务的访问地址。如:http://localhost:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst。
  40635. * @param {Object} options - 参数。
  40636. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  40637. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  40638. * @param {Object} [options.headers] - 请求头。
  40639. * @extends {SpatialAnalystBase}
  40640. * @example 例如:
  40641. * (start code)
  40642. * var myBufferAnalystService = new BufferAnalystService(url, {
  40643. * eventListeners: {
  40644. * "processCompleted": bufferCompleted,
  40645. * "processFailed": bufferFailed
  40646. * }
  40647. * });
  40648. * (end)
  40649. * @usage
  40650. */
  40651. var BufferAnalystService = /*#__PURE__*/function (_SpatialAnalystBase) {
  40652. BufferAnalystService_inherits(BufferAnalystService, _SpatialAnalystBase);
  40653. var _super = BufferAnalystService_createSuper(BufferAnalystService);
  40654. function BufferAnalystService(url, options) {
  40655. var _this;
  40656. BufferAnalystService_classCallCheck(this, BufferAnalystService);
  40657. _this = _super.call(this, url, options);
  40658. /**
  40659. * @member {string} BufferAnalystService.prototype.mode
  40660. * @description 缓冲区分析类型
  40661. */
  40662. _this.mode = null;
  40663. if (options) {
  40664. Util_Util.extend(BufferAnalystService_assertThisInitialized(_this), options);
  40665. }
  40666. _this.CLASS_NAME = "SuperMap.BufferAnalystService";
  40667. return _this;
  40668. }
  40669. /**
  40670. * @function BufferAnalystService.prototype.destroy
  40671. * @override
  40672. */
  40673. BufferAnalystService_createClass(BufferAnalystService, [{
  40674. key: "destroy",
  40675. value: function destroy() {
  40676. BufferAnalystService_get(BufferAnalystService_getPrototypeOf(BufferAnalystService.prototype), "destroy", this).call(this);
  40677. this.mode = null;
  40678. }
  40679. /**
  40680. * @method BufferAnalystService.prototype.processAsync
  40681. * @description 负责将客户端的查询参数传递到服务端。
  40682. * @param {BufferAnalystParameters} parameter - 缓冲区分析参数
  40683. */
  40684. }, {
  40685. key: "processAsync",
  40686. value: function processAsync(parameter) {
  40687. var parameterObject = {};
  40688. var me = this;
  40689. if (parameter instanceof DatasetBufferAnalystParameters) {
  40690. me.mode = 'datasets';
  40691. me.url = Util_Util.urlPathAppend(me.url, 'datasets/' + parameter.dataset + '/buffer');
  40692. DatasetBufferAnalystParameters.toObject(parameter, parameterObject);
  40693. } else if (parameter instanceof GeometryBufferAnalystParameters) {
  40694. me.mode = 'geometry';
  40695. me.url = Util_Util.urlPathAppend(me.url, 'geometry/buffer');
  40696. GeometryBufferAnalystParameters.toObject(parameter, parameterObject);
  40697. }
  40698. var jsonParameters = Util_Util.toJSON(parameterObject);
  40699. this.returnContent = true;
  40700. me.request({
  40701. method: "POST",
  40702. data: jsonParameters,
  40703. scope: me,
  40704. success: me.serviceProcessCompleted,
  40705. failure: me.serviceProcessFailed
  40706. });
  40707. }
  40708. }, {
  40709. key: "dataFormat",
  40710. value: function dataFormat() {
  40711. return [DataFormat.GEOJSON, DataFormat.ISERVER, DataFormat.FGB];
  40712. }
  40713. }]);
  40714. return BufferAnalystService;
  40715. }(SpatialAnalystBase);
  40716. ;// CONCATENATED MODULE: ./src/common/iServer/DensityKernelAnalystParameters.js
  40717. function DensityKernelAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  40718. function DensityKernelAnalystParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  40719. function DensityKernelAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) DensityKernelAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) DensityKernelAnalystParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  40720. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  40721. * This program are made available under the terms of the Apache License, Version 2.0
  40722. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  40723. /**
  40724. * @class DensityKernelAnalystParameters
  40725. * @deprecatedclass SuperMap.DensityKernelAnalystParameters
  40726. * @category iServer SpatialAnalyst DensityAnalyst
  40727. * @classdesc 核密度分析参数类。
  40728. * @param {Object} options - 参数。
  40729. * @param {string} options.dataset - 要用来做核密度分析数据源中数据集的名称。该名称用形如 "数据集名称@数据源别名" 形式来表示,例如:BaseMap_P@Jingjin。
  40730. * @param {string} options.fieldName - 用于进行核密度分析的测量值的字段名称,核密度分析不支持文本类型的字段。
  40731. * @param {string} options.resultGridName - 指定结果数据集名称。
  40732. * @param {(SuperMap.Bounds|L.Bounds|L.LatLngBounds|ol.extent|mapboxgl.LngLatBounds|GeoJSONObject)} [options.bounds] - 核密度分析的范围,用于确定结果栅格数据集的范围。如果缺省,则默认为原数据集的范围。
  40733. * @param {number} [options.searchRadius] - 栅格邻域内用于计算密度的查找半径,单位与当前数据集相同。默认值为当前数据集的长宽中的最大值除30。
  40734. * @param {number} [options.resultGridDatasetResolution] - 密度分析结果栅格数据的分辨率,单位与当前数据集相同。默认值为当前数据集的长宽中的最小值除500。
  40735. * @param {string} [options.targetDatasource] - 指定的存储结果数据集的数据源,默认为当前分析的数据集所在的数据源。
  40736. * @param {boolean} [options.deleteExistResultDataset=false] - 如果用户命名的结果数据集名称与已有的数据集重名,是否删除已有的数据集。
  40737. * @usage
  40738. */
  40739. var DensityKernelAnalystParameters = /*#__PURE__*/function () {
  40740. function DensityKernelAnalystParameters(options) {
  40741. DensityKernelAnalystParameters_classCallCheck(this, DensityKernelAnalystParameters);
  40742. /**
  40743. * @member {string} DensityKernelAnalystParameters.prototype.dataset
  40744. * @description 要用来做核密度分析数据源中数据集的名称。
  40745. * 该名称用形如 "数据集名称@数据源别名" 形式来表示,例如:Railway@Changchun。
  40746. * 注:核密度分析支持点数据集和线数据集。
  40747. */
  40748. this.dataset = null;
  40749. /**
  40750. * @member {(SuperMap.Bounds|L.Bounds|L.LatLngBounds|ol.extent|mapboxgl.LngLatBounds|GeoJSONObject)} [DensityKernelAnalystParameters.prototype.bounds]
  40751. * @description 核密度分析的范围,用于确定结果栅格数据集的范围。
  40752. * 如果缺省,则默认为原数据集的范围。
  40753. */
  40754. this.bounds = null;
  40755. /**
  40756. * @member {string} DensityKernelAnalystParameters.prototype.fieldName
  40757. * @description 用于进行核密度分析的测量值的字段名称,核密度分析不支持文本类型的字段。
  40758. */
  40759. this.fieldName = null;
  40760. /**
  40761. * @member {number} [DensityKernelAnalystParameters.prototype.resultGridDatasetResolution]
  40762. * @description 密度分析结果栅格数据的分辨率,单位与当前数据集相同。默认值为当前数据集的长宽中的最小值除500。
  40763. */
  40764. this.resultGridDatasetResolution = null;
  40765. /**
  40766. * @member {number} [DensityKernelAnalystParameters.prototype.searchRadius]
  40767. * @description 栅格邻域内用于计算密度的查找半径,单位与当前数据集相同。默认值为当前数据集的长宽中的最大值除30。
  40768. */
  40769. this.searchRadius = null;
  40770. /**
  40771. * @member {string} [DensityKernelAnalystParameters.prototype.targetDatasource]
  40772. * @description 指定的存储结果数据集的数据源,默认为当前分析的数据集所在的数据源。
  40773. */
  40774. this.targetDatasource = null;
  40775. /**
  40776. * @member {string} DensityKernelAnalystParameters.prototype.resultGridName
  40777. * @description 指定结果数据集名称。
  40778. */
  40779. this.resultGridName = null;
  40780. /**
  40781. * @member {boolean} [DensityKernelAnalystParameters.prototype.deleteExistResultDataset=false]
  40782. * @description 如果用户命名的结果数据集名称与已有的数据集重名,是否删除已有的数据集。
  40783. */
  40784. this.deleteExistResultDataset = false;
  40785. Util_Util.extend(this, options);
  40786. this.CLASS_NAME = "SuperMap.DensityKernelAnalystParameters";
  40787. }
  40788. /**
  40789. * @function DensityKernelAnalystParameters.prototype.destroy
  40790. * @description 释放资源,将引用资源的属性置空。
  40791. */
  40792. DensityKernelAnalystParameters_createClass(DensityKernelAnalystParameters, [{
  40793. key: "destroy",
  40794. value: function destroy() {
  40795. var me = this;
  40796. me.dataset = null;
  40797. me.bounds = null;
  40798. me.fieldName = null;
  40799. me.resultGridDatasetResolution = null;
  40800. me.searchRadius = null;
  40801. me.targetDatasource = null;
  40802. me.resultGridName = null;
  40803. me.deleteExistResultDataset = null;
  40804. }
  40805. /**
  40806. * @function DensityKernelAnalystParameters.toObject
  40807. * @param {DensityKernelAnalystParameters} densityKernelAnalystParameters -核密度分析参数类。
  40808. * @param {DensityKernelAnalystParameters} tempObj - 核密度分析参数对象。
  40809. * @description 将核密度分析参数对象转换成 JSON 对象。
  40810. * @returns JSON 对象。
  40811. */
  40812. }], [{
  40813. key: "toObject",
  40814. value: function toObject(densityKernelAnalystParameters, tempObj) {
  40815. for (var name in densityKernelAnalystParameters) {
  40816. if (name !== "dataset") {
  40817. tempObj[name] = densityKernelAnalystParameters[name];
  40818. }
  40819. }
  40820. }
  40821. }]);
  40822. return DensityKernelAnalystParameters;
  40823. }();
  40824. ;// CONCATENATED MODULE: ./src/common/iServer/DensityAnalystService.js
  40825. function DensityAnalystService_typeof(obj) { "@babel/helpers - typeof"; return DensityAnalystService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, DensityAnalystService_typeof(obj); }
  40826. function DensityAnalystService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  40827. function DensityAnalystService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  40828. function DensityAnalystService_createClass(Constructor, protoProps, staticProps) { if (protoProps) DensityAnalystService_defineProperties(Constructor.prototype, protoProps); if (staticProps) DensityAnalystService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  40829. function DensityAnalystService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { DensityAnalystService_get = Reflect.get.bind(); } else { DensityAnalystService_get = function _get(target, property, receiver) { var base = DensityAnalystService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return DensityAnalystService_get.apply(this, arguments); }
  40830. function DensityAnalystService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = DensityAnalystService_getPrototypeOf(object); if (object === null) break; } return object; }
  40831. function DensityAnalystService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) DensityAnalystService_setPrototypeOf(subClass, superClass); }
  40832. function DensityAnalystService_setPrototypeOf(o, p) { DensityAnalystService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return DensityAnalystService_setPrototypeOf(o, p); }
  40833. function DensityAnalystService_createSuper(Derived) { var hasNativeReflectConstruct = DensityAnalystService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = DensityAnalystService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = DensityAnalystService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return DensityAnalystService_possibleConstructorReturn(this, result); }; }
  40834. function DensityAnalystService_possibleConstructorReturn(self, call) { if (call && (DensityAnalystService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return DensityAnalystService_assertThisInitialized(self); }
  40835. function DensityAnalystService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  40836. function DensityAnalystService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  40837. function DensityAnalystService_getPrototypeOf(o) { DensityAnalystService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return DensityAnalystService_getPrototypeOf(o); }
  40838. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  40839. * This program are made available under the terms of the Apache License, Version 2.0
  40840. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  40841. /**
  40842. * @class DensityAnalystService
  40843. * @deprecatedclass SuperMap.DensityAnalystService
  40844. * @category iServer SpatialAnalyst DensityAnalyst
  40845. * @classdesc
  40846. * 密度分析服务类,密度分析可计算每个输出栅格像元周围圆形邻域内输入的点或线对象的密度。
  40847. * 密度分析,在某种意义上来说,相当于在表面上将输入的点线对象的测量值散开来,将每个点或线对象的测量量分布在整个研究区域,并计算输出栅格中每个像元的密度值。目前提供1种密度分析:核密度分析(Kernel)。
  40848. * @param {string} url - 服务地址。如 http://localhost:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst 。
  40849. * @param {Object} options - 参数。
  40850. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  40851. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  40852. * @param {Object} [options.headers] - 请求头。
  40853. * @extends {SpatialAnalystBase}
  40854. * @example 例如:
  40855. * var myDensityAnalystService = new DensityAnalystService(url);
  40856. * myDensityAnalystService.on({
  40857. * "processCompleted": processCompleted,
  40858. * "processFailed": processFailed
  40859. * }
  40860. * );
  40861. * @usage
  40862. */
  40863. var DensityAnalystService = /*#__PURE__*/function (_SpatialAnalystBase) {
  40864. DensityAnalystService_inherits(DensityAnalystService, _SpatialAnalystBase);
  40865. var _super = DensityAnalystService_createSuper(DensityAnalystService);
  40866. function DensityAnalystService(url, options) {
  40867. var _this;
  40868. DensityAnalystService_classCallCheck(this, DensityAnalystService);
  40869. _this = _super.call(this, url, options);
  40870. /**
  40871. * @member {string} DensityAnalystService.prototype.mode
  40872. * @description 密度分析类型。
  40873. */
  40874. _this.mode = null;
  40875. if (options) {
  40876. Util_Util.extend(DensityAnalystService_assertThisInitialized(_this), options);
  40877. }
  40878. _this.CLASS_NAME = "SuperMap.DensityAnalystService";
  40879. return _this;
  40880. }
  40881. /**
  40882. * @function DensityAnalystService.prototype.destroy
  40883. * @description 释放资源,将引用资源的属性置空。
  40884. */
  40885. DensityAnalystService_createClass(DensityAnalystService, [{
  40886. key: "destroy",
  40887. value: function destroy() {
  40888. DensityAnalystService_get(DensityAnalystService_getPrototypeOf(DensityAnalystService.prototype), "destroy", this).call(this);
  40889. this.mode = null;
  40890. }
  40891. /**
  40892. * @function DensityAnalystService.prototype.processAsync
  40893. * @description 负责将客户端的查询参数传递到服务端。
  40894. * @param {DensityKernelAnalystParameters} parameter - 核密度分析参数。
  40895. */
  40896. }, {
  40897. key: "processAsync",
  40898. value: function processAsync(parameter) {
  40899. var me = this;
  40900. var parameterObject = new Object();
  40901. if (parameter instanceof DensityKernelAnalystParameters) {
  40902. me.url = Util_Util.urlPathAppend(me.url, 'datasets/' + parameter.dataset + '/densityanalyst/kernel');
  40903. me.mode = "kernel";
  40904. }
  40905. DensityKernelAnalystParameters.toObject(parameter, parameterObject);
  40906. var jsonParameters = Util_Util.toJSON(parameterObject);
  40907. me.url = Util_Util.urlAppend(me.url, 'returnContent=true');
  40908. me.request({
  40909. method: "POST",
  40910. data: jsonParameters,
  40911. scope: me,
  40912. success: me.serviceProcessCompleted,
  40913. failure: me.serviceProcessFailed
  40914. });
  40915. }
  40916. }]);
  40917. return DensityAnalystService;
  40918. }(SpatialAnalystBase);
  40919. ;// CONCATENATED MODULE: ./src/common/iServer/GenerateSpatialDataParameters.js
  40920. function GenerateSpatialDataParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  40921. function GenerateSpatialDataParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  40922. function GenerateSpatialDataParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) GenerateSpatialDataParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) GenerateSpatialDataParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  40923. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  40924. * This program are made available under the terms of the Apache License, Version 2.0
  40925. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  40926. /**
  40927. * @class GenerateSpatialDataParameters
  40928. * @deprecatedclass SuperMap.GenerateSpatialDataParameters
  40929. * @category iServer SpatialAnalyst GenerateSpatialData
  40930. * @classdesc 动态分段操作参数类。通过该类可以为动态分段提供参数信息。
  40931. * @param {Object} options - 参数。
  40932. * @param {string} options.routeTable - 路由数据集。
  40933. * @param {string} options.routeIDField - 路由数据集的标识字段。
  40934. * @param {string} options.eventTable - 用于生成空间数据的事件表名。
  40935. * @param {DataReturnOption} options.dataReturnOption - 设置数据返回选项。
  40936. * @param {string} [options.attributeFilter] - 属性过滤条件。
  40937. * @param {string} options.eventRouteIDField - 用于生成空间数据的事件表的路由标识字段。
  40938. * @param {string} [options.measureField] - 用于生成空间数据的事件表的刻度字段,只有当事件为点事件的时候该属性才有意义。
  40939. * @param {string} [options.measureStartField] - 用于生成空间数据的事件表的起始刻度字段,只有当事件为线事件的时候该属性才有意义。
  40940. * @param {string} [options.measureEndField] - 用于生成空间数据的事件表的终止刻度字段,只有当事件为线事件的时候该属性才有意义。
  40941. * @param {string} [options.measureOffsetField] - 刻度偏移量字段。
  40942. * @param {string} [options.errorInfoField] - 错误信息字段,直接写入原事件表,用于描述事件未能生成对应的点或线时的错误信息。
  40943. * @param {Array.<string>} [options.retainedFields] - 欲保留到结果空间数据中的字段集合(系统字段除外)。
  40944. * @usage
  40945. */
  40946. var GenerateSpatialDataParameters = /*#__PURE__*/function () {
  40947. function GenerateSpatialDataParameters(options) {
  40948. GenerateSpatialDataParameters_classCallCheck(this, GenerateSpatialDataParameters);
  40949. /**
  40950. * @member {string} GenerateSpatialDataParameters.prototype.routeTable
  40951. * @description 路由数据集。
  40952. */
  40953. this.routeTable = null;
  40954. /**
  40955. * @member {string} GenerateSpatialDataParameters.prototype.routeIDField
  40956. * @description 路由数据集的标识字段。
  40957. */
  40958. this.routeIDField = null;
  40959. /**
  40960. * @member {string} [GenerateSpatialDataParameters.prototype.attributeFilter]
  40961. * @description 属性过滤条件。
  40962. * 当 {@link GenerateSpatialDataParameters.prototype.dataReturnOption.dataReturnMode} 为 {@link DataReturnMode.DATASET_AND_RECORDSET} 或 {@link DataReturnMode.RECORDSET_ONLY} 时有效。
  40963. */
  40964. this.attributeFilter = null;
  40965. /**
  40966. * @member {string} GenerateSpatialDataParameters.prototype.eventTable
  40967. * @description 用于生成空间数据的事件表名。
  40968. */
  40969. this.eventTable = null;
  40970. /**
  40971. * @member {string} GenerateSpatialDataParameters.prototype.eventRouteIDField
  40972. * @description 用于生成空间数据的事件表的路由标识字段。
  40973. */
  40974. this.eventRouteIDField = null;
  40975. /**
  40976. * @member {string} [GenerateSpatialDataParameters.prototype.measureField]
  40977. * @description 用于生成空间数据的事件表的刻度字段,只有当事件为点事件的时候该属性才有意义。
  40978. */
  40979. this.measureField = null;
  40980. /**
  40981. * @member {string} [GenerateSpatialDataParameters.prototype.measureStartField]
  40982. * @description 用于生成空间数据的事件表的起始刻度字段,只有当事件为线事件的时候该属性才有意义。
  40983. */
  40984. this.measureStartField = null;
  40985. /**
  40986. * @member {string} [GenerateSpatialDataParameters.prototype.measureEndField]
  40987. * @description 用于生成空间数据的事件表的终止刻度字段,只有当事件为线事件的时候该属性才有意义。
  40988. */
  40989. this.measureEndField = null;
  40990. /**
  40991. * @member {string} [GenerateSpatialDataParameters.prototype.measureOffsetField]
  40992. * @description 刻度偏移量字段。
  40993. */
  40994. this.measureOffsetField = null;
  40995. /**
  40996. * @member {string} [GenerateSpatialDataParameters.prototype.errorInfoField]
  40997. * @description 错误信息字段,直接写入原事件表,用于描述事件未能生成对应的点或线时的错误信息。
  40998. */
  40999. this.errorInfoField = null;
  41000. /**
  41001. * @member {Array.<string>} [GenerateSpatialDataParameters.prototype.retainedFields]
  41002. * @description 欲保留到结果空间数据中的字段集合(系统字段除外)。
  41003. * 生成空间数据时,无论是否指定保留字段,路由 ID 字段、刻度偏移量字段、刻度值字段(点事件为刻度字段,线事件是起始和终止刻度字段)都会保留到结果空间数据中;
  41004. * 如果没有指定 retainedFields 参数或者 retainedFields 参数数组长度为 0,则返回所有用户字段。
  41005. */
  41006. this.retainedFields = null;
  41007. /**
  41008. * @member {DataReturnOption} GenerateSpatialDataParameters.prototype.dataReturnOption
  41009. * @description 设置数据返回的选项。
  41010. */
  41011. this.dataReturnOption = null;
  41012. if (options) {
  41013. Util_Util.extend(this, options);
  41014. }
  41015. this.CLASS_NAME = "SuperMap.GenerateSpatialDataParameters";
  41016. }
  41017. /**
  41018. * @function GenerateSpatialDataParameters.prototype.destroy
  41019. * @description 释放资源,将引用资源的属性置空。
  41020. */
  41021. GenerateSpatialDataParameters_createClass(GenerateSpatialDataParameters, [{
  41022. key: "destroy",
  41023. value: function destroy() {
  41024. var me = this;
  41025. if (me.routeTable) {
  41026. me.routeTable = null;
  41027. }
  41028. me.routeIDField = null;
  41029. me.attributeFilter = null;
  41030. me.eventTable = null;
  41031. me.eventRouteIDField = null;
  41032. me.measureField = null;
  41033. me.measureStartField = null;
  41034. me.measureEndField = null;
  41035. me.measureOffsetField = null;
  41036. me.errorInfoField = null;
  41037. if (me.dataReturnOption) {
  41038. me.dataReturnOption.destroy();
  41039. me.dataReturnOption = null;
  41040. }
  41041. }
  41042. }]);
  41043. return GenerateSpatialDataParameters;
  41044. }();
  41045. ;// CONCATENATED MODULE: ./src/common/iServer/GenerateSpatialDataService.js
  41046. function GenerateSpatialDataService_typeof(obj) { "@babel/helpers - typeof"; return GenerateSpatialDataService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, GenerateSpatialDataService_typeof(obj); }
  41047. function GenerateSpatialDataService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  41048. function GenerateSpatialDataService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  41049. function GenerateSpatialDataService_createClass(Constructor, protoProps, staticProps) { if (protoProps) GenerateSpatialDataService_defineProperties(Constructor.prototype, protoProps); if (staticProps) GenerateSpatialDataService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  41050. function GenerateSpatialDataService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { GenerateSpatialDataService_get = Reflect.get.bind(); } else { GenerateSpatialDataService_get = function _get(target, property, receiver) { var base = GenerateSpatialDataService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return GenerateSpatialDataService_get.apply(this, arguments); }
  41051. function GenerateSpatialDataService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GenerateSpatialDataService_getPrototypeOf(object); if (object === null) break; } return object; }
  41052. function GenerateSpatialDataService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) GenerateSpatialDataService_setPrototypeOf(subClass, superClass); }
  41053. function GenerateSpatialDataService_setPrototypeOf(o, p) { GenerateSpatialDataService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GenerateSpatialDataService_setPrototypeOf(o, p); }
  41054. function GenerateSpatialDataService_createSuper(Derived) { var hasNativeReflectConstruct = GenerateSpatialDataService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = GenerateSpatialDataService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = GenerateSpatialDataService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return GenerateSpatialDataService_possibleConstructorReturn(this, result); }; }
  41055. function GenerateSpatialDataService_possibleConstructorReturn(self, call) { if (call && (GenerateSpatialDataService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return GenerateSpatialDataService_assertThisInitialized(self); }
  41056. function GenerateSpatialDataService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  41057. function GenerateSpatialDataService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  41058. function GenerateSpatialDataService_getPrototypeOf(o) { GenerateSpatialDataService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GenerateSpatialDataService_getPrototypeOf(o); }
  41059. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  41060. * This program are made available under the terms of the Apache License, Version 2.0
  41061. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  41062. /**
  41063. * @class GenerateSpatialDataService
  41064. * @deprecatedclass SuperMap.GenerateSpatialDataService
  41065. * @category iServer SpatialAnalyst GenerateSpatialData
  41066. * @classdesc 动态分段分析服务类。该类负责将客户设置的动态分段分析服务参数传递给服务端,并接收服务端返回的动态分段分析结果数据。
  41067. * 获取的结果数据包括 originResult 、result 两种,其中,originResult 为服务端返回的用 JSON 对象表示的动态分段分析结果数据,result 为服务端返回的动态分段分析结果数据。
  41068. * @param {string} url - 服务地址。如 http://localhost:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst。
  41069. * @param {Object} options - 参数。</br>
  41070. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  41071. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  41072. * @param {Object} [options.headers] - 请求头。
  41073. * @extends {SpatialAnalystBase}
  41074. * @example 实例化该类如下例所示:
  41075. * (start code)
  41076. * function GenerateSpatialData(){
  41077. *
  41078. * //配置数据返回选项(option)
  41079. * var option = new DataReturnOption({
  41080. * expectCount: 1000,
  41081. * dataset: "generateSpatialData",
  41082. * deleteExistResultDataset: true,
  41083. * dataReturnMode: DataReturnMode.DATASET_ONLY
  41084. * }),
  41085. * //配置动态分段参数(Parameters)
  41086. * parameters = new GenerateSpatialDataParameters({
  41087. * routeTable: "RouteDT_road@Changchun",
  41088. * routeIDField: "RouteID",
  41089. * eventTable: "LinearEventTabDT@Changchun",
  41090. * eventRouteIDField: "RouteID",
  41091. * measureField: "",
  41092. * measureStartField: "LineMeasureFrom",
  41093. * measureEndField: "LineMeasureTo",
  41094. * measureOffsetField: "",
  41095. * errorInfoField: "",
  41096. * retainedFields:[],
  41097. * dataReturnOption: option
  41098. * }),
  41099. * //配置动态分段iService
  41100. * iService = new GenerateSpatialDataService(Changchun_spatialanalyst, {
  41101. * eventListeners: {
  41102. * processCompleted: generateCompleted,
  41103. * processFailed: generateFailded
  41104. * }
  41105. * });
  41106. * //执行
  41107. * iService.processAsync(parameters);
  41108. * function Completed(generateSpatialDataEventArgs){//todo};
  41109. * function Error(generateSpatialDataEventArgs){//todo};
  41110. * (end)
  41111. * @usage
  41112. */
  41113. var GenerateSpatialDataService = /*#__PURE__*/function (_SpatialAnalystBase) {
  41114. GenerateSpatialDataService_inherits(GenerateSpatialDataService, _SpatialAnalystBase);
  41115. var _super = GenerateSpatialDataService_createSuper(GenerateSpatialDataService);
  41116. function GenerateSpatialDataService(url, options) {
  41117. var _this;
  41118. GenerateSpatialDataService_classCallCheck(this, GenerateSpatialDataService);
  41119. _this = _super.call(this, url, options);
  41120. _this.CLASS_NAME = "SuperMap.GenerateSpatialDataService";
  41121. return _this;
  41122. }
  41123. /**
  41124. * @function GenerateSpatialDataService.prototype.destroy
  41125. * @override
  41126. */
  41127. GenerateSpatialDataService_createClass(GenerateSpatialDataService, [{
  41128. key: "destroy",
  41129. value: function destroy() {
  41130. GenerateSpatialDataService_get(GenerateSpatialDataService_getPrototypeOf(GenerateSpatialDataService.prototype), "destroy", this).call(this);
  41131. }
  41132. /**
  41133. * @function GenerateSpatialDataService.prototype.processAsync
  41134. * @description 负责将客户端的动态分段服务参数传递到服务端。
  41135. * @param {GenerateSpatialDataParameters} params - 动态分段操作参数类。
  41136. */
  41137. }, {
  41138. key: "processAsync",
  41139. value: function processAsync(params) {
  41140. if (!(params instanceof GenerateSpatialDataParameters)) {
  41141. return;
  41142. }
  41143. var me = this,
  41144. jsonParameters;
  41145. jsonParameters = me.getJsonParameters(params);
  41146. me.request({
  41147. method: "POST",
  41148. data: jsonParameters,
  41149. scope: me,
  41150. success: me.serviceProcessCompleted,
  41151. failure: me.serviceProcessFailed
  41152. });
  41153. }
  41154. /**
  41155. * @function GenerateSpatialDataService.prototype.getJsonParameters
  41156. * @description 将参数转化为 JSON 字符串。
  41157. * @param {GenerateSpatialDataParameters} params - 动态分段操作参数类。
  41158. * @returns {string}转化后的JSON字符串。
  41159. */
  41160. }, {
  41161. key: "getJsonParameters",
  41162. value: function getJsonParameters(params) {
  41163. var jsonParameters = "",
  41164. jsonStr = "datasets/" + params.routeTable + "/linearreferencing/generatespatialdata",
  41165. me = this;
  41166. me.url = Util_Util.urlPathAppend(me.url, jsonStr);
  41167. me.url = Util_Util.urlAppend(me.url, 'returnContent=true');
  41168. jsonParameters = Util_Util.toJSON(params);
  41169. return jsonParameters;
  41170. }
  41171. }]);
  41172. return GenerateSpatialDataService;
  41173. }(SpatialAnalystBase);
  41174. ;// CONCATENATED MODULE: ./src/common/iServer/GeoRelationAnalystParameters.js
  41175. function GeoRelationAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  41176. function GeoRelationAnalystParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  41177. function GeoRelationAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) GeoRelationAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) GeoRelationAnalystParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  41178. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  41179. * This program are made available under the terms of the Apache License, Version 2.0
  41180. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  41181. /**
  41182. * @class GeoRelationAnalystParameters
  41183. * @deprecatedclass SuperMap.GeoRelationAnalystParameters
  41184. * @category iServer SpatialAnalyst GeoRelationAnalyst
  41185. * @classdesc 空间关系分析服务参数类。使用该类可以为空间关系分析服务提供所需的参数信息。
  41186. * @param {Object} options - 参数。
  41187. * @param {FilterParameter} options.sourceFilter - 空间关系分析中的源数据集查询参数。仅 name, ids, attributeFilter 和 fields 字段有效。
  41188. * @param {FilterParameter} options.referenceFilter - 空间关系分析中的参考数据集查询参数。仅 name, ids, attributeFilter 和 fields 字段有效。
  41189. * @param {SpatialRelationType} options.spatialRelationType - 指定的空间关系类型。
  41190. * @param {boolean} [options.isBorderInside] - 边界处理方式,即位于面边线上的点是否被面包含。此参数仅用于空间关系为包含或被包含的情况。
  41191. * @param {boolean} [options.returnFeature] - 是否返回 Feature 信息。
  41192. * @param {boolean} [options.returnGeoRelatedOnly=true] - 仅返回满足指定空间关系的空间对象。
  41193. * @param {number} [options.startRecord=0] - 分析结果起始记录位置。
  41194. * @param {number} [options.expectCount=500] - 空间关系分析期望返回结果记录数,如果实际不足500条结果则返回所有分析结果。
  41195. * @usage
  41196. */
  41197. var GeoRelationAnalystParameters = /*#__PURE__*/function () {
  41198. function GeoRelationAnalystParameters(options) {
  41199. GeoRelationAnalystParameters_classCallCheck(this, GeoRelationAnalystParameters);
  41200. /**
  41201. * @member {string} GeoRelationAnalystParameters.prototype.dataset
  41202. * @description 源数据集名称。
  41203. */
  41204. this.dataset = null;
  41205. /**
  41206. * @member {FilterParameter} GeoRelationAnalystParameters.prototype.sourceFilter
  41207. * @description 空间关系分析中的源数据集查询参数。仅 ids、attributeFilter 和 fields 字段有效。
  41208. */
  41209. this.sourceFilter = null;
  41210. /**
  41211. * @member {FilterParameter} GeoRelationAnalystParameters.prototype.referenceFilter
  41212. * @description 空间关系分析中的参考数据集查询参数。仅 name,ids,attributeFilter 和 fields 字段有效。
  41213. */
  41214. this.referenceFilter = null;
  41215. /**
  41216. * @member {SpatialRelationType} GeoRelationAnalystParameters.prototype.spatialRelationType
  41217. * @description 指定的空间关系类型。
  41218. */
  41219. this.spatialRelationType = null;
  41220. /**
  41221. * @member {boolean} [GeoRelationAnalystParameters.prototype.isBorderInside]
  41222. * @description 边界处理方式,即位于面边线上的点是否被面包含。此参数仅用于空间关系为包含或被包含的情况。
  41223. */
  41224. this.isBorderInside = null;
  41225. /**
  41226. * @member {boolean} [GeoRelationAnalystParameters.prototype.returnFeature]
  41227. * @description 是否返回 Feature 信息。
  41228. */
  41229. this.returnFeature = null;
  41230. /**
  41231. * @member {boolean} [GeoRelationAnalystParameters.prototype.returnGeoRelatedOnly=true]
  41232. * @description 是否仅返回满足指定空间关系的空间对象。
  41233. */
  41234. this.returnGeoRelatedOnly = null;
  41235. /**
  41236. * @member {number} [GeoRelationAnalystParameters.prototype.returnGeoRelatedOnly=0]
  41237. * @description 分析结果起始记录位置。
  41238. */
  41239. this.startRecord = 0;
  41240. /**
  41241. * @member {number} [GeoRelationAnalystParameters.prototype.expectCount=500]
  41242. * @description 空间关系分析期望返回结果记录数,如果实际不足 500 条结果则返回所有分析结果。
  41243. */
  41244. this.expectCount = 500;
  41245. if (options) {
  41246. Util_Util.extend(this, options);
  41247. }
  41248. this.CLASS_NAME = "SuperMap.GeoRelationAnalystParameters";
  41249. }
  41250. /**
  41251. * @function GeoRelationAnalystParameters.prototype.destroy
  41252. * @description 释放资源,将引用资源的属性置空。
  41253. */
  41254. GeoRelationAnalystParameters_createClass(GeoRelationAnalystParameters, [{
  41255. key: "destroy",
  41256. value: function destroy() {
  41257. var me = this;
  41258. if (me.sourceFilter) {
  41259. me.sourceFilter.destroy();
  41260. }
  41261. me.sourceFilter = null;
  41262. if (me.referenceFilter) {
  41263. me.referenceFilter.destroy();
  41264. }
  41265. me.referenceFilter = null;
  41266. me.dataset = null;
  41267. me.spatialRelationType = null;
  41268. me.isBorderInside = null;
  41269. me.returnFeature = null;
  41270. me.returnGeoRelatedOnly = null;
  41271. me.startRecord = null;
  41272. me.expectCount = null;
  41273. }
  41274. }]);
  41275. return GeoRelationAnalystParameters;
  41276. }();
  41277. ;// CONCATENATED MODULE: ./src/common/iServer/GeoRelationAnalystService.js
  41278. function GeoRelationAnalystService_typeof(obj) { "@babel/helpers - typeof"; return GeoRelationAnalystService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, GeoRelationAnalystService_typeof(obj); }
  41279. function GeoRelationAnalystService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  41280. function GeoRelationAnalystService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  41281. function GeoRelationAnalystService_createClass(Constructor, protoProps, staticProps) { if (protoProps) GeoRelationAnalystService_defineProperties(Constructor.prototype, protoProps); if (staticProps) GeoRelationAnalystService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  41282. function GeoRelationAnalystService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { GeoRelationAnalystService_get = Reflect.get.bind(); } else { GeoRelationAnalystService_get = function _get(target, property, receiver) { var base = GeoRelationAnalystService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return GeoRelationAnalystService_get.apply(this, arguments); }
  41283. function GeoRelationAnalystService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GeoRelationAnalystService_getPrototypeOf(object); if (object === null) break; } return object; }
  41284. function GeoRelationAnalystService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) GeoRelationAnalystService_setPrototypeOf(subClass, superClass); }
  41285. function GeoRelationAnalystService_setPrototypeOf(o, p) { GeoRelationAnalystService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GeoRelationAnalystService_setPrototypeOf(o, p); }
  41286. function GeoRelationAnalystService_createSuper(Derived) { var hasNativeReflectConstruct = GeoRelationAnalystService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = GeoRelationAnalystService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = GeoRelationAnalystService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return GeoRelationAnalystService_possibleConstructorReturn(this, result); }; }
  41287. function GeoRelationAnalystService_possibleConstructorReturn(self, call) { if (call && (GeoRelationAnalystService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return GeoRelationAnalystService_assertThisInitialized(self); }
  41288. function GeoRelationAnalystService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  41289. function GeoRelationAnalystService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  41290. function GeoRelationAnalystService_getPrototypeOf(o) { GeoRelationAnalystService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GeoRelationAnalystService_getPrototypeOf(o); }
  41291. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  41292. * This program are made available under the terms of the Apache License, Version 2.0
  41293. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  41294. /**
  41295. * @class GeoRelationAnalystService
  41296. * @deprecatedclass SuperMap.GeoRelationAnalystService
  41297. * @category iServer SpatialAnalyst GeoRelationAnalyst
  41298. * @classdesc 空间关系分析服务类。该类负责将客户设置的空间关系分析服务参数传递给服务端,并接收服务端返回的空间关系分析结果数据。
  41299. * @param {string} url - 服务地址。如 http://localhost:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst。
  41300. * @param {Object} options - 参数。
  41301. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  41302. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  41303. * @param {Object} [options.headers] - 请求头。
  41304. * @extends {SpatialAnalystBase}
  41305. * @example 实例化该类如下例所示:
  41306. * (start code)
  41307. * function datasetGeoRelationAnalystProcess() {
  41308. * var referenceFilter = new FilterParameter({
  41309. * name:"Frame_R@Changchun",
  41310. * attributeFilter:"SmID>0"});
  41311. * var sourceFilter = new FilterParameter({
  41312. * attributeFilter:"SmID>0"});
  41313. * //初始化服务类
  41314. * var datasetGeoRelationService = new GeoRelationAnalystService(
  41315. * "http://localhost:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst/"),
  41316. * //构建参数类
  41317. * datasetGeoRelationParameters = new GeoRelationAnalystParameters({
  41318. * dataset: "Park@Changchun",
  41319. * startRecord: 0,
  41320. * expectCount: 20,
  41321. * sourceFilter: sourceFilter,
  41322. * referenceFilter: referenceFilter,
  41323. * spatialRelationType: SpatialRelationType.INTERSECT,
  41324. * isBorderInside: true,
  41325. * returnFeature: true,
  41326. * returnGeoRelatedOnly: true
  41327. * });
  41328. * datasetGeoRelationService.events.on({
  41329. * "processCompleted": datasetGeoRelationAnalystCompleted,
  41330. * "processFailed": datasetGeoRelationAnalystFailed});
  41331. * //执行
  41332. * datasetGeoRelationService.processAsync(datasetGeoRelationParameters);
  41333. * }
  41334. * function Completed(datasetGeoRelationAnalystCompleted){//todo};
  41335. * function Error(datasetGeoRelationAnalystFailed){//todo};
  41336. * (end)
  41337. * @usage
  41338. */
  41339. var GeoRelationAnalystService = /*#__PURE__*/function (_SpatialAnalystBase) {
  41340. GeoRelationAnalystService_inherits(GeoRelationAnalystService, _SpatialAnalystBase);
  41341. var _super = GeoRelationAnalystService_createSuper(GeoRelationAnalystService);
  41342. function GeoRelationAnalystService(url, options) {
  41343. var _this;
  41344. GeoRelationAnalystService_classCallCheck(this, GeoRelationAnalystService);
  41345. _this = _super.call(this, url, options);
  41346. _this.CLASS_NAME = "SuperMap.GeoRelationAnalystService";
  41347. return _this;
  41348. }
  41349. /**
  41350. * @function GeoRelationAnalystService.prototype.destroy
  41351. * @override
  41352. */
  41353. GeoRelationAnalystService_createClass(GeoRelationAnalystService, [{
  41354. key: "destroy",
  41355. value: function destroy() {
  41356. GeoRelationAnalystService_get(GeoRelationAnalystService_getPrototypeOf(GeoRelationAnalystService.prototype), "destroy", this).call(this);
  41357. }
  41358. /**
  41359. * @function GeoRelationAnalystService.prototype.processAsync
  41360. * @description 负责将客户端的空间关系分析参数传递到服务端
  41361. * @param {GeoRelationAnalystParameters} parameter - 空间关系分析所需的参数信息。
  41362. */
  41363. }, {
  41364. key: "processAsync",
  41365. value: function processAsync(parameter) {
  41366. if (!(parameter instanceof GeoRelationAnalystParameters)) {
  41367. return;
  41368. }
  41369. var me = this;
  41370. me.url = Util_Util.urlPathAppend(me.url, 'datasets/' + parameter.dataset + '/georelation');
  41371. var jsonParameters = Util_Util.toJSON(parameter);
  41372. me.url = Util_Util.urlAppend(me.url, 'returnContent=true');
  41373. me.request({
  41374. method: "POST",
  41375. data: jsonParameters,
  41376. scope: me,
  41377. success: me.serviceProcessCompleted,
  41378. failure: me.serviceProcessFailed
  41379. });
  41380. }
  41381. }]);
  41382. return GeoRelationAnalystService;
  41383. }(SpatialAnalystBase);
  41384. ;// CONCATENATED MODULE: ./src/common/iServer/InterpolationAnalystParameters.js
  41385. function InterpolationAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  41386. function InterpolationAnalystParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  41387. function InterpolationAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) InterpolationAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) InterpolationAnalystParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  41388. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  41389. * This program are made available under the terms of the Apache License, Version 2.0
  41390. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  41391. /**
  41392. * @class InterpolationAnalystParameters
  41393. * @deprecatedclass SuperMap.InterpolationAnalystParameters
  41394. * @category iServer SpatialAnalyst InterpolationAnalyst
  41395. * @classdesc 插值分析参数类。
  41396. * @param {Object} options - 参数。
  41397. * @param {(SuperMap.Bounds|L.Bounds|L.LatLngBounds|ol.extent|mapboxgl.LngLatBounds|GeoJSONObject)} options.bounds - 插值分析的范围,用于确定结果栅格数据集的范围。
  41398. * @param {string} options.outputDatasetName - 插值分析结果数据集的名称。
  41399. * @param {string} options.outputDatasourceName - 插值分析结果数据源的名称。
  41400. * @param {string} [options.zValueFieldName] - 进行插值分析的字段名称,插值分析不支持文本类型的字段。
  41401. * @param {string} [options.dataset] - 待分析的数据集名称。当插值分析类型(InterpolationAnalystType)为 dataset 时,此为必选参数。
  41402. * @param {Array.<GeometryPoint|L.LatLng|L.Point|ol.geom.Point|mapboxgl.LngLat|Array.<number>>} [options.inputPoints] - 用于做插值分析的离散点集合。当插值分析类型(InterpolationAnalystType)为 geometry 时,此参数为必设参数。
  41403. * @param {number} [options.searchRadius=0] - 查找半径,即参与运算点的查找范围,与点数据集单位相同。
  41404. * @param {number} [options.zValueScale=1] - 进行插值分析值的缩放比率。
  41405. * @param {number} [options.resolution] - 插值结果栅格数据集的分辨率,即一个像元所代表的实地距离,与点数据集单位相同。
  41406. * @param {FilterParameter} [options.filterQueryParameter] - 属性过滤条件。
  41407. * @param {PixelFormat} [options.pixelFormat] - 指定结果栅格数据集存储的像素格式。
  41408. * @param {string} [options.InterpolationAnalystType="dataset"] - 插值分析类型("dataset" 或 "geometry")。
  41409. * @usage
  41410. */
  41411. var InterpolationAnalystParameters = /*#__PURE__*/function () {
  41412. function InterpolationAnalystParameters(options) {
  41413. InterpolationAnalystParameters_classCallCheck(this, InterpolationAnalystParameters);
  41414. if (!options) {
  41415. return;
  41416. }
  41417. /**
  41418. * @member {(SuperMap.Bounds|L.Bounds|L.LatLngBounds|ol.extent|mapboxgl.LngLatBounds|GeoJSONObject)} InterpolationAnalystParameters.prototype.bounds
  41419. * @description 插值分析的范围,用于确定结果栅格数据集的范围。
  41420. * 如果缺省,则默认为原数据集的范围。鉴于此插值方法为内插方法,原数据集的范围内的插值结果才相对有参考价值,
  41421. * 因此建议此参数不大于原数据集范围。
  41422. */
  41423. this.bounds = null;
  41424. /**
  41425. * @member {number} [InterpolationAnalystParameters.prototype.searchRadius=0]
  41426. * @description 查找半径,即参与运算点的查找范围,与点数据集单位相同。
  41427. * 计算某个位置的 Z 值时,会以该位置为圆心,以查找范围的值为半径,落在这个范围内的采样点都将参与运算。
  41428. * 该值需要根据待插值点数据的分布状况和点数据集范围进行设置。
  41429. */
  41430. this.searchRadius = 0;
  41431. /**
  41432. * @member {string} InterpolationAnalystParameters.prototype.zValueFieldName
  41433. * @description 数据集插值分析中,用于指定进行插值分析的目标字段名,插值分析不支持文本类型的字段。
  41434. * 含义为每个插值点在插值过程中的权重,可以将所有点此字段值设置为 1,即所有点在整体插值中权重相同。
  41435. * 当插值分析类型(InterpolationAnalystType)为 dataset 时,此为必选参数。
  41436. */
  41437. this.zValueFieldName = null;
  41438. /**
  41439. * @member {number} [InterpolationAnalystParameters.prototype.zValueScale=1]
  41440. * @description 用于进行插值分析值的缩放比率。
  41441. * 参加插值分析的值将乘以该参数值后再进行插值,也就是对进行插值分析的值进行统一的扩大或缩小。
  41442. */
  41443. this.zValueScale = 1;
  41444. /**
  41445. * @member {number} InterpolationAnalystParameters.prototype.resolution
  41446. * @description 插值结果栅格数据集的分辨率,即一个像元所代表的实地距离,与点数据集单位相同。
  41447. * 该值不能超过待分析数据集的范围边长。
  41448. * 且该值设置时,应该考虑点数据集范围大小来取值,一般为结果栅格行列值(即结果栅格数据集范围除以分辨率),在 500 以内可以较好地体现密度走势。
  41449. */
  41450. this.resolution = null;
  41451. /**
  41452. * @member {FilterParameter} [InterpolationAnalystParameters.prototype.filterQueryParameter]
  41453. * @description 过滤条件,对分析数据集中的点进行过滤,设置为 null 表示对数据集中的所有点进行分析。
  41454. */
  41455. this.filterQueryParameter = null;
  41456. /**
  41457. * @member {string} InterpolationAnalystParameters.prototype.outputDatasetName
  41458. * @description 插值分析结果数据集的名称。
  41459. */
  41460. this.outputDatasetName = null;
  41461. /**
  41462. * @member {string} InterpolationAnalystParameters.prototype.outputDatasourceName
  41463. * @description 插值分析结果数据源的名称。
  41464. */
  41465. this.outputDatasourceName = null;
  41466. /**
  41467. * @member {PixelFormat} [InterpolationAnalystParameters.prototype.pixelFormat]
  41468. * @description 指定结果栅格数据集存储的像素格式。支持存储的像素格式有 BIT16、BIT32、DOUBLE、SINGLE、UBIT1、UBIT4、UBIT8、UBIT24、UBIT32。
  41469. */
  41470. this.pixelFormat = null;
  41471. /**
  41472. * @member {string} [InterpolationAnalystParameters.prototype.dataset]
  41473. * @description 用来做插值分析的数据源中数据集的名称,该名称用形如 "数据集名称@数据源别名" 形式来表示。
  41474. * 当插值分析类型(InterpolationAnalystType)为 dataset 时,此为必选参数。
  41475. */
  41476. this.dataset = null;
  41477. /**
  41478. * @member {Array.<GeometryPoint|L.LatLng|L.Point|ol.geom.Point|mapboxgl.LngLat|Array.<number>>} [InterpolationAnalystParameters.prototype.inputPoints]
  41479. * @description 用于做插值分析的离散点(离散点包括Z值)集合。
  41480. * 当插值分析类型(InterpolationAnalystType)为 geometry 时,此参数为必设参数。
  41481. * 通过离散点直接进行插值分析不需要指定输入数据集inputDatasourceName,inputDatasetName以及zValueFieldName。
  41482. */
  41483. this.inputPoints = null;
  41484. /**
  41485. * @member {string} [InterpolationAnalystParameters.prototype.InterpolationAnalystType="dataset"]
  41486. * @description 插值分析类型。插值分析包括数据集插值分析和几何插值分析两类,
  41487. * "dataset" 表示对数据集进行插值分析,"geometry" 表示对离散点数组进行插值分析。
  41488. */
  41489. this.InterpolationAnalystType = "dataset";
  41490. /**
  41491. * @member {ClipParameter} InterpolationAnalystParameters.prototype.clipParam
  41492. * @description 对插值分析结果进行裁剪的参数。
  41493. */
  41494. this.clipParam = null;
  41495. Util_Util.extend(this, options);
  41496. this.CLASS_NAME = "SuperMap.InterpolationAnalystParameters";
  41497. }
  41498. /**
  41499. * @function InterpolationAnalystParameters.prototype.destroy
  41500. * @description 释放资源,将引用资源的属性置空。
  41501. */
  41502. InterpolationAnalystParameters_createClass(InterpolationAnalystParameters, [{
  41503. key: "destroy",
  41504. value: function destroy() {
  41505. var me = this;
  41506. me.bounds = null;
  41507. me.searchRadius = null;
  41508. me.zValueFieldName = null;
  41509. me.zValueScale = null;
  41510. me.resolution = null;
  41511. me.filterQueryParameter = null;
  41512. me.outputDatasetName = null;
  41513. me.pixelFormat = null;
  41514. }
  41515. /**
  41516. * @function InterpolationAnalystParameters.toObject
  41517. * @param {InterpolationAnalystParameters} interpolationAnalystParameters - 插值分析参数类。
  41518. * @param {InterpolationAnalystParameters} tempObj - 插值分析参数对象。
  41519. * @description 将插值分析参数对象转换成 JSON 对象。
  41520. * @returns JSON 对象。
  41521. */
  41522. }], [{
  41523. key: "toObject",
  41524. value: function toObject(interpolationAnalystParameters, tempObj) {
  41525. for (var name in interpolationAnalystParameters) {
  41526. if (name === "inputPoints" && interpolationAnalystParameters.InterpolationAnalystType === "geometry") {
  41527. var objs = [];
  41528. for (var i = 0; i < interpolationAnalystParameters.inputPoints.length; i++) {
  41529. var item = interpolationAnalystParameters.inputPoints[i];
  41530. var obj = {
  41531. x: item.x,
  41532. y: item.y,
  41533. z: item.tag
  41534. };
  41535. objs.push(obj);
  41536. }
  41537. tempObj[name] = objs;
  41538. } else {
  41539. tempObj[name] = interpolationAnalystParameters[name];
  41540. }
  41541. }
  41542. }
  41543. }]);
  41544. return InterpolationAnalystParameters;
  41545. }();
  41546. ;// CONCATENATED MODULE: ./src/common/iServer/InterpolationRBFAnalystParameters.js
  41547. function InterpolationRBFAnalystParameters_typeof(obj) { "@babel/helpers - typeof"; return InterpolationRBFAnalystParameters_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, InterpolationRBFAnalystParameters_typeof(obj); }
  41548. function InterpolationRBFAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  41549. function InterpolationRBFAnalystParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  41550. function InterpolationRBFAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) InterpolationRBFAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) InterpolationRBFAnalystParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  41551. function InterpolationRBFAnalystParameters_get() { if (typeof Reflect !== "undefined" && Reflect.get) { InterpolationRBFAnalystParameters_get = Reflect.get.bind(); } else { InterpolationRBFAnalystParameters_get = function _get(target, property, receiver) { var base = InterpolationRBFAnalystParameters_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return InterpolationRBFAnalystParameters_get.apply(this, arguments); }
  41552. function InterpolationRBFAnalystParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = InterpolationRBFAnalystParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  41553. function InterpolationRBFAnalystParameters_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) InterpolationRBFAnalystParameters_setPrototypeOf(subClass, superClass); }
  41554. function InterpolationRBFAnalystParameters_setPrototypeOf(o, p) { InterpolationRBFAnalystParameters_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return InterpolationRBFAnalystParameters_setPrototypeOf(o, p); }
  41555. function InterpolationRBFAnalystParameters_createSuper(Derived) { var hasNativeReflectConstruct = InterpolationRBFAnalystParameters_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = InterpolationRBFAnalystParameters_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = InterpolationRBFAnalystParameters_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return InterpolationRBFAnalystParameters_possibleConstructorReturn(this, result); }; }
  41556. function InterpolationRBFAnalystParameters_possibleConstructorReturn(self, call) { if (call && (InterpolationRBFAnalystParameters_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return InterpolationRBFAnalystParameters_assertThisInitialized(self); }
  41557. function InterpolationRBFAnalystParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  41558. function InterpolationRBFAnalystParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  41559. function InterpolationRBFAnalystParameters_getPrototypeOf(o) { InterpolationRBFAnalystParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return InterpolationRBFAnalystParameters_getPrototypeOf(o); }
  41560. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  41561. * This program are made available under the terms of the Apache License, Version 2.0
  41562. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  41563. /**
  41564. * @class InterpolationRBFAnalystParameters
  41565. * @deprecatedclass SuperMap.InterpolationRBFAnalystParameters
  41566. * @category iServer SpatialAnalyst InterpolationAnalyst
  41567. * @classdesc 样条插值(径向基函数插值法)分析参数类。
  41568. * @extends {InterpolationAnalystParameters}
  41569. * @param {Object} options - 参数。
  41570. * @param {(SuperMap.Bounds|L.Bounds|L.LatLngBounds|ol.extent|mapboxgl.LngLatBounds|GeoJSONObject)} options.bounds - 插值分析的范围,用于确定结果栅格数据集的范围。
  41571. * @param {string} options.searchMode - 插值运算时,查找参与运算点的方式,有固定点数查找、定长查找、块查找。
  41572. * @param {string} options.outputDatasetName - 插值分析结果数据集的名称。
  41573. * @param {string} options.outputDatasourceName - 插值分析结果数据源的名称。
  41574. * @param {string} [options.zValueFieldName] - 存储用于进行插值分析的字段名称,插值分析不支持文本类型的字段。当插值分析类型(SuperMap.InterpolationAnalystType)为 dataset 时,此为必选参数。
  41575. * @param {number} [options.smooth=0.1] - 光滑系数,该值表示插值函数曲线与点的逼近程度,值域为0到1。
  41576. * @param {number} [options.tension=40] - 张力系数,用于调整结果栅格数据表面的特性。
  41577. * @param {number} [options.expectedCount=12] - 【固定点数查找】方式下,设置参与插值运算的点数。
  41578. * @param {number} [options.searchRadius=0] - 【定长查找】方式下,设置参与运算点的查找范围。
  41579. * @param {number} [options.maxPointCountForInterpolation=200] - 【块查找】方式下,设置最多参与插值的点数。
  41580. * @param {number} [options.maxPointCountInNode=50] - 【块查找】方式下,设置单个块内最多参与运算点数。
  41581. * @param {number} [options.zValueScale=1] - 用于进行插值分析值的缩放比率。
  41582. * @param {number} [options.resolution] - 插值结果栅格数据集的分辨率,即一个像元所代表的实地距离,与点数据集单位相同。
  41583. * @param {FilterParameter} [options.filterQueryParameter] - 属性过滤条件。
  41584. * @param {string} [options.pixelFormat] - 指定结果栅格数据集存储的像素格式。
  41585. * @param {string} [options.dataset] - 要用来做插值分析的数据源中数据集的名称。该名称用形如”数据集名称@数据源别名”形式来表示。当插值分析类型(InterpolationAnalystType)为 dataset 时。此为必选参数。
  41586. * @param {Array.<GeometryPoint|L.LatLng|L.Point|ol.geom.Point|mapboxgl.LngLat|Array.<number>>} [options.inputPoints] - 用于做插值分析的离散点集合。当插值分析类型(InterpolationAnalystType)为 geometry 时。此为必选参数。
  41587. * @example
  41588. * var myInterpolationRBFAnalystParameters = new InterpolationRBFAnalystParameters({
  41589. * dataset:"SamplesP@Interpolation",
  41590. * smooth: 0.1,
  41591. * tension: 40,
  41592. * searchMode: "QUADTREE",
  41593. * maxPointCountForInterpolation: 20,
  41594. * maxPointCountInNode: 5,
  41595. * pixelFormat: "BIT16",
  41596. * zValueFieldName: "AVG_TMP",
  41597. * resolution: 3000,
  41598. * filterQueryParameter: {
  41599. * attributeFilter: ""
  41600. * },
  41601. * outputDatasetName: "myRBF"
  41602. * });
  41603. * @usage
  41604. */
  41605. var InterpolationRBFAnalystParameters = /*#__PURE__*/function (_InterpolationAnalyst) {
  41606. InterpolationRBFAnalystParameters_inherits(InterpolationRBFAnalystParameters, _InterpolationAnalyst);
  41607. var _super = InterpolationRBFAnalystParameters_createSuper(InterpolationRBFAnalystParameters);
  41608. function InterpolationRBFAnalystParameters(options) {
  41609. var _this;
  41610. InterpolationRBFAnalystParameters_classCallCheck(this, InterpolationRBFAnalystParameters);
  41611. _this = _super.call(this, options);
  41612. /**
  41613. * @member {number} [InterpolationRBFAnalystParameters.prototype.smooth=0.1]
  41614. * @description 光滑系数,值域为 0 到 1,常用取值如 0、0.001、0.01、0.1、和 0.5。
  41615. * 该值表示插值函数曲线与点的逼近程度,此数值越大,函数曲线与点的偏差越大,反之越小。
  41616. */
  41617. _this.smooth = 0.1;
  41618. /**
  41619. * @member {number} [InterpolationRBFAnalystParameters.prototype.tension=40]
  41620. * @description 张力系数,常用取值如 0、1、5 和 10。
  41621. * 用于调整结果栅格数据表面的特性,张力越大,插值时每个点对计算结果影响越小,反之越大。
  41622. */
  41623. _this.tension = 40;
  41624. /**
  41625. * @member {SearchMode} InterpolationRBFAnalystParameters.prototype.searchMode
  41626. * @description 插值运算时,查找参与运算点的方式,有固定点数查找、定长查找、块查找。必设参数。
  41627. * 具体如下:
  41628. * {KDTREE_FIXED_COUNT} 使用 KDTREE 的固定点数方式查找参与内插分析的点。
  41629. * {KDTREE_FIXED_RADIUS} 使用 KDTREE 的定长方式查找参与内插分析的点。
  41630. * {QUADTREE} 使用 QUADTREE 方式查找参与内插分析的点(块查找)。
  41631. */
  41632. _this.searchMode = null;
  41633. /**
  41634. * @member {number} [InterpolationRBFAnalystParameters.prototype.expectedCount=12]
  41635. * @description 【固定点数查找】方式下,设置待查找的点数,即参与插值运算的点数。
  41636. */
  41637. _this.expectedCount = 12;
  41638. /**
  41639. * @member {number} [InterpolationRBFAnalystParameters.prototype.maxPointCountForInterpolation=200]
  41640. * @description 【块查找】方式下,最多参与插值的点数。
  41641. */
  41642. _this.maxPointCountForInterpolation = 200;
  41643. /**
  41644. * @member {number} [InterpolationRBFAnalystParameters.prototype.maxPointCountInNode=50]
  41645. * @description 【块查找】方式下,单个块内最多参与运算点数。
  41646. */
  41647. _this.maxPointCountInNode = 50;
  41648. if (options) {
  41649. Util_Util.extend(InterpolationRBFAnalystParameters_assertThisInitialized(_this), options);
  41650. }
  41651. _this.CLASS_NAME = "SuperMap.InterpolationRBFAnalystParameters";
  41652. return _this;
  41653. }
  41654. /**
  41655. * @function InterpolationRBFAnalystParameters.prototype.destroy
  41656. * @description 释放资源,将引用资源的属性置空。
  41657. */
  41658. InterpolationRBFAnalystParameters_createClass(InterpolationRBFAnalystParameters, [{
  41659. key: "destroy",
  41660. value: function destroy() {
  41661. InterpolationRBFAnalystParameters_get(InterpolationRBFAnalystParameters_getPrototypeOf(InterpolationRBFAnalystParameters.prototype), "destroy", this).call(this);
  41662. var me = this;
  41663. me.smooth = null;
  41664. me.tension = null;
  41665. me.searchMode = null;
  41666. me.expectedCount = null;
  41667. me.maxPointCountForInterpolation = null;
  41668. me.maxPointCountInNode = null;
  41669. }
  41670. /**
  41671. * @function InterpolationRBFAnalystParameters.toObject
  41672. * @param {InterpolationRBFAnalystParameters} datasetInterpolationRBFAnalystParameters - 样条插值(径向基函数插值法)分析参数类。
  41673. * @param {InterpolationRBFAnalystParameters} tempObj - 样条插值(径向基函数插值法)分析参数对象。
  41674. * @description 将样条插值(径向基函数插值法)分析参数对象转换为 JSON 对象。
  41675. * @returns JSON 对象。
  41676. */
  41677. }], [{
  41678. key: "toObject",
  41679. value: function toObject(datasetInterpolationRBFAnalystParameters, tempObj) {
  41680. for (var name in datasetInterpolationRBFAnalystParameters) {
  41681. tempObj[name] = datasetInterpolationRBFAnalystParameters[name];
  41682. }
  41683. }
  41684. }]);
  41685. return InterpolationRBFAnalystParameters;
  41686. }(InterpolationAnalystParameters);
  41687. ;// CONCATENATED MODULE: ./src/common/iServer/InterpolationDensityAnalystParameters.js
  41688. function InterpolationDensityAnalystParameters_typeof(obj) { "@babel/helpers - typeof"; return InterpolationDensityAnalystParameters_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, InterpolationDensityAnalystParameters_typeof(obj); }
  41689. function InterpolationDensityAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  41690. function InterpolationDensityAnalystParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  41691. function InterpolationDensityAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) InterpolationDensityAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) InterpolationDensityAnalystParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  41692. function InterpolationDensityAnalystParameters_get() { if (typeof Reflect !== "undefined" && Reflect.get) { InterpolationDensityAnalystParameters_get = Reflect.get.bind(); } else { InterpolationDensityAnalystParameters_get = function _get(target, property, receiver) { var base = InterpolationDensityAnalystParameters_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return InterpolationDensityAnalystParameters_get.apply(this, arguments); }
  41693. function InterpolationDensityAnalystParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = InterpolationDensityAnalystParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  41694. function InterpolationDensityAnalystParameters_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) InterpolationDensityAnalystParameters_setPrototypeOf(subClass, superClass); }
  41695. function InterpolationDensityAnalystParameters_setPrototypeOf(o, p) { InterpolationDensityAnalystParameters_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return InterpolationDensityAnalystParameters_setPrototypeOf(o, p); }
  41696. function InterpolationDensityAnalystParameters_createSuper(Derived) { var hasNativeReflectConstruct = InterpolationDensityAnalystParameters_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = InterpolationDensityAnalystParameters_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = InterpolationDensityAnalystParameters_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return InterpolationDensityAnalystParameters_possibleConstructorReturn(this, result); }; }
  41697. function InterpolationDensityAnalystParameters_possibleConstructorReturn(self, call) { if (call && (InterpolationDensityAnalystParameters_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return InterpolationDensityAnalystParameters_assertThisInitialized(self); }
  41698. function InterpolationDensityAnalystParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  41699. function InterpolationDensityAnalystParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  41700. function InterpolationDensityAnalystParameters_getPrototypeOf(o) { InterpolationDensityAnalystParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return InterpolationDensityAnalystParameters_getPrototypeOf(o); }
  41701. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  41702. * This program are made available under the terms of the Apache License, Version 2.0
  41703. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  41704. /**
  41705. * @class InterpolationDensityAnalystParameters
  41706. * @deprecatedclass SuperMap.InterpolationDensityAnalystParameters
  41707. * @category iServer SpatialAnalyst InterpolationAnalyst
  41708. * @classdesc 点密度插值分析参数类。
  41709. * @param {Object} options - 参数。
  41710. * @param {(SuperMap.Bounds|L.Bounds|L.LatLngBounds|ol.extent|mapboxgl.LngLatBounds|GeoJSONObject)} options.bounds - 插值分析的范围,用于确定结果栅格数据集的范围。
  41711. * @param {string} options.outputDatasourceName - 插值分析结果数据源的名称。
  41712. * @param {string} options.outputDatasetName - 插值分析结果数据集的名称。
  41713. * @param {number} [options.searchRadius=0] - 查找半径,即参与运算点的查找范围,与点数据集单位相同。
  41714. * @param {string} [options.zValueFieldName] - 进行插值分析的字段名称,插值分析不支持文本类型的字段。当插值分析类型(InterpolationAnalystParameters.prototype.InterpolationAnalystType)为 dataset 时。此为必选参数。
  41715. * @param {number} [options.zValueScale=1] - 进行插值分析值的缩放比率。
  41716. * @param {number} [options.resolution] - 插值结果栅格数据集的分辨率,即一个像元所代表的实地距离,与点数据集单位相同。
  41717. * @param {FilterParameter} [options.filterQueryParameter] - 属性过滤条件。
  41718. * @param {string} [options.pixelFormat] - 指定结果栅格数据集存储的像素格式。
  41719. * @param {string} [options.dataset] - 用来做插值分析的数据源中数据集的名称,该名称用形如 "数据集名称@数据源别名" 形式来表示。当插值分析类型(InterpolationAnalystParameters.prototype.InterpolationAnalystType)为 dataset 时,此为必选参数。
  41720. * @param {Array.<GeometryPoint|L.LatLng|L.Point|ol.geom.Point|mapboxgl.LngLat|Array.<number>>} [options.inputPoints] - 用于做插值分析的离散点集合。当插值分析类型(InterpolationAnalystParameters.prototype.InterpolationAnalystType)为 geometry 时,此为必选参数。
  41721. * @extends {InterpolationAnalystParameters}
  41722. * @example
  41723. * var myInterpolationDensityAnalystParameters = new InterpolationDensityAnalystParameters({
  41724. * dataset: "SamplesP@Interpolation",
  41725. * searchRadius: "100000",
  41726. * pixelFormat: "BIT16",
  41727. * zValueFieldName: "AVG_TMP",
  41728. * resolution: 3000,
  41729. * filterQueryParameter: {
  41730. * attributeFilter: ""
  41731. * },
  41732. * outputDatasetName: "myDensity"
  41733. * });
  41734. * @usage
  41735. */
  41736. var InterpolationDensityAnalystParameters = /*#__PURE__*/function (_InterpolationAnalyst) {
  41737. InterpolationDensityAnalystParameters_inherits(InterpolationDensityAnalystParameters, _InterpolationAnalyst);
  41738. var _super = InterpolationDensityAnalystParameters_createSuper(InterpolationDensityAnalystParameters);
  41739. function InterpolationDensityAnalystParameters(options) {
  41740. var _this;
  41741. InterpolationDensityAnalystParameters_classCallCheck(this, InterpolationDensityAnalystParameters);
  41742. _this = _super.call(this, options);
  41743. if (options) {
  41744. Util_Util.extend(InterpolationDensityAnalystParameters_assertThisInitialized(_this), options);
  41745. }
  41746. _this.CLASS_NAME = "SuperMap.InterpolationDensityAnalystParameters";
  41747. return _this;
  41748. }
  41749. /**
  41750. * @function InterpolationDensityAnalystParameters.prototype.destroy
  41751. * @description 释放资源,将引用资源的属性置空。
  41752. */
  41753. InterpolationDensityAnalystParameters_createClass(InterpolationDensityAnalystParameters, [{
  41754. key: "destroy",
  41755. value: function destroy() {
  41756. InterpolationDensityAnalystParameters_get(InterpolationDensityAnalystParameters_getPrototypeOf(InterpolationDensityAnalystParameters.prototype), "destroy", this).call(this);
  41757. }
  41758. }]);
  41759. return InterpolationDensityAnalystParameters;
  41760. }(InterpolationAnalystParameters);
  41761. ;// CONCATENATED MODULE: ./src/common/iServer/InterpolationIDWAnalystParameters.js
  41762. function InterpolationIDWAnalystParameters_typeof(obj) { "@babel/helpers - typeof"; return InterpolationIDWAnalystParameters_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, InterpolationIDWAnalystParameters_typeof(obj); }
  41763. function InterpolationIDWAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  41764. function InterpolationIDWAnalystParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  41765. function InterpolationIDWAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) InterpolationIDWAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) InterpolationIDWAnalystParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  41766. function InterpolationIDWAnalystParameters_get() { if (typeof Reflect !== "undefined" && Reflect.get) { InterpolationIDWAnalystParameters_get = Reflect.get.bind(); } else { InterpolationIDWAnalystParameters_get = function _get(target, property, receiver) { var base = InterpolationIDWAnalystParameters_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return InterpolationIDWAnalystParameters_get.apply(this, arguments); }
  41767. function InterpolationIDWAnalystParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = InterpolationIDWAnalystParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  41768. function InterpolationIDWAnalystParameters_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) InterpolationIDWAnalystParameters_setPrototypeOf(subClass, superClass); }
  41769. function InterpolationIDWAnalystParameters_setPrototypeOf(o, p) { InterpolationIDWAnalystParameters_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return InterpolationIDWAnalystParameters_setPrototypeOf(o, p); }
  41770. function InterpolationIDWAnalystParameters_createSuper(Derived) { var hasNativeReflectConstruct = InterpolationIDWAnalystParameters_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = InterpolationIDWAnalystParameters_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = InterpolationIDWAnalystParameters_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return InterpolationIDWAnalystParameters_possibleConstructorReturn(this, result); }; }
  41771. function InterpolationIDWAnalystParameters_possibleConstructorReturn(self, call) { if (call && (InterpolationIDWAnalystParameters_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return InterpolationIDWAnalystParameters_assertThisInitialized(self); }
  41772. function InterpolationIDWAnalystParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  41773. function InterpolationIDWAnalystParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  41774. function InterpolationIDWAnalystParameters_getPrototypeOf(o) { InterpolationIDWAnalystParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return InterpolationIDWAnalystParameters_getPrototypeOf(o); }
  41775. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  41776. * This program are made available under the terms of the Apache License, Version 2.0
  41777. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  41778. /**
  41779. * @class InterpolationIDWAnalystParameters
  41780. * @deprecatedclass SuperMap.InterpolationIDWAnalystParameters
  41781. * @category iServer SpatialAnalyst InterpolationAnalyst
  41782. * @classdesc 反距离加权插值(IDW)分析参数类。
  41783. * @param {Object} options - 参数。
  41784. * @param {(SuperMap.Bounds|L.Bounds|L.LatLngBounds|ol.extent|mapboxgl.LngLatBounds|GeoJSONObject)} options.bounds - 插值分析的范围,用于确定结果栅格数据集的范围。
  41785. * @param {string} options.searchMode - 插值运算时,查找参与运算点的方式,支持固定点数查找、定长查找。
  41786. * @param {string} options.outputDatasetName - 插值分析结果数据集的名称。
  41787. * @param {string} options.outputDatasourceName - 插值分析结果数据源的名称。
  41788. * @param {string} [options.zValueFieldName] - 进行插值分析的字段名称,插值分析不支持文本类型的字段。当插值分析类型(SuperMap.InterpolationAnalystType)为 dataset 时,此为必选参数。
  41789. * @param {number} [options.expectedCount=12] - 【固定点数查找】方式下,设置待查找的点数,即参与插值运算的点数。
  41790. * @param {number} [options.searchRadius=0] - 【定长查找】方式下,设置查找半径,即参与运算点的查找范围,与点数据集单位相同。
  41791. * @param {number} [options.power=2] - 距离权重计算的幂次。
  41792. * @param {number} [options.zValueScale=1] - 用于进行插值分析值的缩放比率。
  41793. * @param {number} [options.resolution] - 插值结果栅格数据集的分辨率,即一个像元所代表的实地距离,与点数据集单位相同。
  41794. * @param {FilterParameter} [options.filterQueryParameter] - 属性过滤条件。
  41795. * @param {string} [options.pixelFormat] - 指定结果栅格数据集存储的像素格式。
  41796. * @param {string} [options.dataset] - 要用来做插值分析的数据源中数据集的名称。该名称用形如”数据集名称@数据源别名”形式来表示。当插值分析类型(SuperMap.InterpolationAnalystType)为 dataset 时,此为必选参数。
  41797. * @param {Array.<GeometryPoint|L.LatLng|L.Point|ol.geom.Point|mapboxgl.LngLat|Array.<number>>} [options.inputPoints] - 用于做插值分析的离散点集合。当插值分析类型(SuperMap.InterpolationAnalystType)为 geometry 时,此为必选参数。
  41798. * @extends {InterpolationAnalystParameters}
  41799. * @example 例如:
  41800. * var myInterpolationIDWAnalystParameters = new InterpolationIDWAnalystParameters({
  41801. * dataset:"SamplesP@Interpolation",
  41802. * power: 2,
  41803. * searchMode: "KDTREE_FIXED_COUNT",
  41804. * expectedCount: 12,
  41805. * pixelFormat: "BIT16",
  41806. * zValueFieldName: "AVG_TMP",
  41807. * resolution: 3000,
  41808. * filterQueryParameter: {
  41809. * attributeFilter: ""
  41810. * },
  41811. * outputDatasetName: "myIDW"
  41812. * });
  41813. * @usage
  41814. */
  41815. var InterpolationIDWAnalystParameters = /*#__PURE__*/function (_InterpolationAnalyst) {
  41816. InterpolationIDWAnalystParameters_inherits(InterpolationIDWAnalystParameters, _InterpolationAnalyst);
  41817. var _super = InterpolationIDWAnalystParameters_createSuper(InterpolationIDWAnalystParameters);
  41818. function InterpolationIDWAnalystParameters(options) {
  41819. var _this;
  41820. InterpolationIDWAnalystParameters_classCallCheck(this, InterpolationIDWAnalystParameters);
  41821. _this = _super.call(this, options);
  41822. /**
  41823. * @member {number} [InterpolationIDWAnalystParameters.prototype.power=2]
  41824. * @description 距离权重计算的幂次。
  41825. * 该值决定了权值下降的速度,幂次越大,随距离的增大权值下降越快,距离预测点越远的点的权值也越小。
  41826. * 理论上,参数值必须大于0,但是0.5到3之间时运算结果更合理,因此推荐值为0.5~3。
  41827. */
  41828. _this.power = 2;
  41829. /**
  41830. * @member {SearchMode} InterpolationIDWAnalystParameters.prototype.searchMode
  41831. * @description 插值运算时,查找参与运算点的方式,支持固定点数查找、定长查找。
  41832. * 具体如下:
  41833. * {KDTREE_FIXED_COUNT} 使用 KDTREE 的固定点数方式查找参与内插分析的点。
  41834. * {KDTREE_FIXED_RADIUS} 使用 KDTREE 的定长方式查找参与内插分析的点。
  41835. */
  41836. _this.searchMode = null;
  41837. /**
  41838. * @member {number} [InterpolationIDWAnalystParameters.prototype.expectedCount=12]
  41839. * @description 【固定点数查找】方式下,设置待查找的点数,即参与插值运算的点数。
  41840. */
  41841. _this.expectedCount = 12;
  41842. if (options) {
  41843. Util_Util.extend(InterpolationIDWAnalystParameters_assertThisInitialized(_this), options);
  41844. }
  41845. _this.CLASS_NAME = "SuperMap.InterpolationIDWAnalystParameters";
  41846. return _this;
  41847. }
  41848. /**
  41849. * @function InterpolationIDWAnalystParameters.prototype.destroy
  41850. * @description 释放资源,将引用资源的属性置空。
  41851. */
  41852. InterpolationIDWAnalystParameters_createClass(InterpolationIDWAnalystParameters, [{
  41853. key: "destroy",
  41854. value: function destroy() {
  41855. InterpolationIDWAnalystParameters_get(InterpolationIDWAnalystParameters_getPrototypeOf(InterpolationIDWAnalystParameters.prototype), "destroy", this).call(this);
  41856. var me = this;
  41857. me.power = null;
  41858. me.searchMode = null;
  41859. me.expectedCount = null;
  41860. }
  41861. }]);
  41862. return InterpolationIDWAnalystParameters;
  41863. }(InterpolationAnalystParameters);
  41864. ;// CONCATENATED MODULE: ./src/common/iServer/ThiessenAnalystParameters.js
  41865. function ThiessenAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  41866. function ThiessenAnalystParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  41867. function ThiessenAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThiessenAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThiessenAnalystParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  41868. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  41869. * This program are made available under the terms of the Apache License, Version 2.0
  41870. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  41871. /**
  41872. * @class ThiessenAnalystParameters
  41873. * @deprecatedclass SuperMap.ThiessenAnalystParameters
  41874. * @category iServer SpatialAnalyst ThiessenPolygonAnalyst
  41875. * @classdesc 泰森多边形分析参数基类。
  41876. * @param {Object} options - 可选参数。
  41877. * @param {GeometryPolygon|L.Polygon|ol.geom.Polygon|GeoJSONObject} [options.clipRegion] - 结果数据裁剪区域,可以为 null,表示不对结果进行裁剪。
  41878. * @param {boolean} [options.createResultDataset=false] - 是否返回结果数据集。
  41879. * @param {string} [options.resultDatasetName] - 指定结果数据集名称。
  41880. * @param {string} [options.resultDatasourceName] - 指定结果数据集所在数据源,默认为当前数据源。
  41881. * @param {boolean} [options.returnResultRegion=true] - 是否返回分析得到的多边形面数组。
  41882. * @usage
  41883. */
  41884. var ThiessenAnalystParameters = /*#__PURE__*/function () {
  41885. function ThiessenAnalystParameters(options) {
  41886. ThiessenAnalystParameters_classCallCheck(this, ThiessenAnalystParameters);
  41887. if (!options) {
  41888. return;
  41889. }
  41890. /**
  41891. * @member {GeometryPolygon|L.Polygon|ol.geom.Polygon|GeoJSONObject} [ThiessenAnalystParameters.prototype.clipRegion]
  41892. * @description 结果数据裁剪区域,可以为 null,表示不对结果进行裁剪。
  41893. */
  41894. this.clipRegion = null;
  41895. /**
  41896. * @member {boolean} [ThiessenAnalystParameters.prototype.createResultDataset=false]
  41897. * @description 是否返回结果数据集。如果为 true,则必须设置属性 resultDatasetName 和 resultDatasourceName。
  41898. */
  41899. this.createResultDataset = false;
  41900. /**
  41901. * @member {string} ThiessenAnalystParameters.prototype.resultDatasetName
  41902. * @description 指定结果数据集名称。
  41903. */
  41904. this.resultDatasetName = null;
  41905. /**
  41906. * @member {string} ThiessenAnalystParameters.prototype.resultDatasourceName
  41907. * @description 指定结果数据集所在数据源。
  41908. */
  41909. this.resultDatasourceName = null;
  41910. /**
  41911. * @member {boolean} ThiessenAnalystParameters.prototype.returnResultRegion
  41912. * @description 是否返回分析得到的多边形面数组。
  41913. */
  41914. this.returnResultRegion = true;
  41915. Util_Util.extend(this, options);
  41916. this.CLASS_NAME = "SuperMap.ThiessenAnalystParameters";
  41917. }
  41918. /**
  41919. * @function ThiessenAnalystParameters.prototype.destroy
  41920. * @description 释放资源,将引用资源的属性置空。
  41921. */
  41922. ThiessenAnalystParameters_createClass(ThiessenAnalystParameters, [{
  41923. key: "destroy",
  41924. value: function destroy() {
  41925. var me = this;
  41926. if (me.clipRegion) {
  41927. me.clipRegion.destroy();
  41928. me.clipRegion = null;
  41929. }
  41930. me.createResultDataset = null;
  41931. me.resultDatasetName = null;
  41932. me.resultDatasourceName = null;
  41933. me.returnResultRegion = null;
  41934. }
  41935. }]);
  41936. return ThiessenAnalystParameters;
  41937. }();
  41938. ;// CONCATENATED MODULE: ./src/common/iServer/InterpolationKrigingAnalystParameters.js
  41939. function InterpolationKrigingAnalystParameters_typeof(obj) { "@babel/helpers - typeof"; return InterpolationKrigingAnalystParameters_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, InterpolationKrigingAnalystParameters_typeof(obj); }
  41940. function InterpolationKrigingAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  41941. function InterpolationKrigingAnalystParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  41942. function InterpolationKrigingAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) InterpolationKrigingAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) InterpolationKrigingAnalystParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  41943. function InterpolationKrigingAnalystParameters_get() { if (typeof Reflect !== "undefined" && Reflect.get) { InterpolationKrigingAnalystParameters_get = Reflect.get.bind(); } else { InterpolationKrigingAnalystParameters_get = function _get(target, property, receiver) { var base = InterpolationKrigingAnalystParameters_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return InterpolationKrigingAnalystParameters_get.apply(this, arguments); }
  41944. function InterpolationKrigingAnalystParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = InterpolationKrigingAnalystParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  41945. function InterpolationKrigingAnalystParameters_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) InterpolationKrigingAnalystParameters_setPrototypeOf(subClass, superClass); }
  41946. function InterpolationKrigingAnalystParameters_setPrototypeOf(o, p) { InterpolationKrigingAnalystParameters_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return InterpolationKrigingAnalystParameters_setPrototypeOf(o, p); }
  41947. function InterpolationKrigingAnalystParameters_createSuper(Derived) { var hasNativeReflectConstruct = InterpolationKrigingAnalystParameters_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = InterpolationKrigingAnalystParameters_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = InterpolationKrigingAnalystParameters_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return InterpolationKrigingAnalystParameters_possibleConstructorReturn(this, result); }; }
  41948. function InterpolationKrigingAnalystParameters_possibleConstructorReturn(self, call) { if (call && (InterpolationKrigingAnalystParameters_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return InterpolationKrigingAnalystParameters_assertThisInitialized(self); }
  41949. function InterpolationKrigingAnalystParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  41950. function InterpolationKrigingAnalystParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  41951. function InterpolationKrigingAnalystParameters_getPrototypeOf(o) { InterpolationKrigingAnalystParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return InterpolationKrigingAnalystParameters_getPrototypeOf(o); }
  41952. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  41953. * This program are made available under the terms of the Apache License, Version 2.0
  41954. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  41955. /**
  41956. * @class InterpolationKrigingAnalystParameters
  41957. * @deprecatedclass SuperMap.InterpolationKrigingAnalystParameters
  41958. * @category iServer SpatialAnalyst InterpolationAnalyst
  41959. * @classdesc 克吕金插值分析参数类。通过该类可以设置克吕金插值分析所需的参数。
  41960. * 克吕金(Kriging)法为地统计学上一种空间数据内插处理方法,主要的目的是利用各数据点间变异数(variance)的大小来推求某一未知点与各已知点的权重关系,
  41961. * 再由各数据点的值和其与未知点的权重关系推求未知点的值。Kriging 法最大的特色不仅是提供一个最小估计误差的预测值,并且可明确地指出误差值的大小。
  41962. * 一般而言,许多地质参数,如地形面,本身即具有连续性,故在一段距离内的任两点必有空间上的关系。反之,在一不规则面上的两点若相距甚远,
  41963. * 则在统计意义上可视为互为独立 (stastically indepedent)。这种随距离而改变的空间上连续性,可用半变异图 (semivariogram) 来表现。
  41964. * 因此,若想由已知的散乱点来推求某一未知点的值,则可利用半变异图推求各已知点与未知点的空间关系,即以下四个参数:<br>
  41965. * 1.块金值(nugget):当采样点间距为0时,理论上半变异函数值为0,但时间上两采样点非常接近时半变异函数值并不为0,即产生了块金效应,
  41966. * 对应的半变异函数值为块金值。块金值可能由于测量误差或者空间变异产生。<br>
  41967. * 2.基台值(sill):随着采样点间距的不断增大,半变异函数的值趋向一个稳定的常数,该常数成为基台值。到达基台值后,半变异函数的值不再随采样点间距而改变,
  41968. * 即大于此间距的采样点不再具有空间相关性。<br>
  41969. * 3.偏基台值:基台值与块金值的差值。<br>
  41970. * 4.自相关阈值(range):也称变程,是半变异函数值达到基台值时,采样点的间距。超过自相关阈值的采样点不再具有空间相关性,将不对预测结果产生影响。<br>
  41971. * 然后,由此空间参数推求半变异数,由各数据点间的半变异数可推求未知点与已知点间的权重关系,进而推求出未知点的值。
  41972. * 克吕金法的优点是以空间统计学作为其坚实的理论基础,物理含义明确;不但能估计测定参数的空间变异分布,而且还可以估算参数的方差分布。克吕金法的缺点是计算步骤较烦琐,
  41973. * 计算量大,且变异函数有时需要根据经验人为选定。
  41974. *
  41975. * 由上述可知,半变异函数是克吕金插值的关键,因此选择合适的半变异函数模型非常重要,SuperMap 提供了以下三种半变异函数模型:<br>
  41976. * 1.指数型(EXPONENTIAL):适用于空间相关关系随样本间距的增加呈指数递减的情况,其空间自相关关系在样本间距的无穷远处完全消失。<br>
  41977. * 2.球型(SPHERICAL):适用于空间自相关关系随样本间距的增加而逐渐减少,直到超出一定的距离时空间自相关关系消失的情况。<br>
  41978. * 3.高斯型(GAUSSIAN):适用于半变异函数值渐进地逼近基台值的情况。<br>
  41979. *
  41980. * 半变异函数中,有一个关键参数即插值的字段值的期望(平均值),由于对于此参数的不同处理方法而衍生出了不同的 Kriging 方法。SuperMap的插值功能基于以下三种常用 Kriging 算法:<br>
  41981. * 1.简单克吕金(Simple Kriging):该方法假定用于插值的字段值的期望(平均值)为已知的某一常数。<br>
  41982. * 2.普通克吕金(Kriging):该方法假定用于插值的字段值的期望(平均值)未知且恒定。它利用一定的数学函数,通过对给定的空间点进行拟合来估算单元格的值,
  41983. * 生成格网数据集。它不仅可以生成一个表面,还可以给出预测结果的精度或者确定性的度量。因此,此方法计算精度较高,常用于地学领域。<br>
  41984. * 3.泛克吕金(Universal Kriging):该方法假定用于插值的字段值的期望(平均值)是未知的变量。在样点数据中存在某种主导趋势且该趋势可以通过某一个确定
  41985. * 的函数或者多项式进行拟合的情况下,适用泛克吕金插值法。<br>
  41986. * @param {Object} options - 参数。
  41987. * @param {string} options.type - 克吕金插值的类型。
  41988. * @param {(SuperMap.Bounds|L.Bounds|L.LatLngBounds|ol.extent|mapboxgl.LngLatBounds|GeoJSONObject)} options.bounds - 插值分析的范围,用于确定结果栅格数据集的范围。
  41989. * @param {string} options.searchMode - 插值运算时,查找参与运算点的方式,有固定点数查找、定长查找、块查找。
  41990. * @param {string} options.outputDatasetName - 插值分析结果数据集的名称。
  41991. * @param {string} options.outputDatasourceName - 插值分析结果数据源的名称。
  41992. * @param {string} [options.zValueFieldName] - 存储用于进行插值分析的字段名称,插值分析不支持文本类型的字段。当插值分析类型(InterpolationAnalystParameters.prototype.InterpolationAnalystType)为 dataset 时,此为必选参数。
  41993. * @param {number} [options.mean] - 【简单克吕金】类型下,插值字段的平均值。
  41994. * @param {number} [options.angle=0] - 克吕金算法中旋转角度值。
  41995. * @param {number} [options.nugget=0] - 克吕金算法中块金效应值。
  41996. * @param {number} [options.range=0] - 克吕金算法中自相关阈值,单位与原数据集单位相同。
  41997. * @param {number} [options.sill=0] - 克吕金算法中基台值。
  41998. * @param {string} [options.variogramMode="SPHERICAL"] - 克吕金插值时的半变函数类型。
  41999. * @param {string} [options.exponent='exp1'] - 【泛克吕金】类型下,用于插值的样点数据中趋势面方程的阶数,可选值为 exp1、exp2。
  42000. * @param {number} [options.expectedCount=12] - 【固定点数查找】方式下,设置待查找的点数;【定长查找】方式下,设置查找的最小点数。
  42001. * @param {number} [options.searchRadius=0] - 【定长查找】方式下,设置参与运算点的查找范围。
  42002. * @param {number} [options.maxPointCountForInterpolation=200] - 【块查找】方式下,设置最多参与插值的点数。
  42003. * @param {number} [options.maxPointCountInNode=50] - 【块查找】方式下,设置单个块内最多参与运算点数。
  42004. * @param {number} [options.zValueScale=1] - 用于进行插值分析值的缩放比率。
  42005. * @param {number} [options.resolution] - 插值结果栅格数据集的分辨率,即一个像元所代表的实地距离,与点数据集单位相同。
  42006. * @param {FilterParameter} [options.filterQueryParameter] - 属性过滤条件。
  42007. * @param {string} [options.pixelFormat] - 指定结果栅格数据集存储的像素格式。
  42008. * @param {string} [options.dataset] - 要用来做插值分析的数据源中数据集的名称。该名称用形如 ”数据集名称@数据源别名” 形式来表示。当插值分析类型(InterpolationAnalystParameters.prototype.InterpolationAnalystType)为 dataset 时。
  42009. * @param {Array.<GeometryPoint|L.LatLng|L.Point|ol.geom.Point|mapboxgl.LngLat|Array.<number>>} [options.inputPoints] - 用于做插值分析的离散点集合。当插值分析类型(InterpolationAnalystParameters.prototype.InterpolationAnalystType)为 geometry 时。
  42010. * @extends {InterpolationAnalystParameters}
  42011. * @example 例如:
  42012. * var myInterpolationKrigingAnalystParameters = new InterpolationKrigingAnalystParameters({
  42013. * dataset:"SamplesP@Interpolation",
  42014. * type: "KRIGING",
  42015. * angle: 0,
  42016. * mean: 5,
  42017. * nugget: 30,
  42018. * range: 50,
  42019. * sill: 300,
  42020. * variogramMode: "EXPONENTIAL",
  42021. * searchMode: "QUADTREE",
  42022. * maxPointCountForInterpolation: 20,
  42023. * maxPointCountInNode: 5,
  42024. * pixelFormat: "BIT16",
  42025. * zValueFieldName: "AVG_TMP",
  42026. * resolution: 30000,
  42027. * filterQueryParameter: {
  42028. * attributeFilter: ""
  42029. * },
  42030. * outputDatasetName: "myKriging"
  42031. * });
  42032. * @usage
  42033. */
  42034. var InterpolationKrigingAnalystParameters = /*#__PURE__*/function (_InterpolationAnalyst) {
  42035. InterpolationKrigingAnalystParameters_inherits(InterpolationKrigingAnalystParameters, _InterpolationAnalyst);
  42036. var _super = InterpolationKrigingAnalystParameters_createSuper(InterpolationKrigingAnalystParameters);
  42037. function InterpolationKrigingAnalystParameters(options) {
  42038. var _this;
  42039. InterpolationKrigingAnalystParameters_classCallCheck(this, InterpolationKrigingAnalystParameters);
  42040. _this = _super.call(this, options);
  42041. /**
  42042. * @member {InterpolationAlgorithmType} InterpolationKrigingAnalystParameters.prototype.type
  42043. * @description 克吕金插值的类型。
  42044. * 具体如下:<br>
  42045. * {KRIGING} 普通克吕金插值法。
  42046. * {SimpleKriging} 简单克吕金插值法。
  42047. * {UniversalKriging} 泛克吕金插值法。
  42048. */
  42049. _this.type = null;
  42050. /**
  42051. * @member {number} InterpolationKrigingAnalystParameters.prototype.mean
  42052. * @description 【简单克吕金】方式下,插值字段的平均值。
  42053. * 即采样点插值字段值总和除以采样点数目。
  42054. */
  42055. _this.mean = null;
  42056. /**
  42057. * @member {number} [InterpolationKrigingAnalystParameters.prototype.angle=0]
  42058. * @description 克吕金算法中旋转角度值。
  42059. * 此角度值指示了每个查找邻域相对于水平方向逆时针旋转的角度。
  42060. */
  42061. _this.angle = 0;
  42062. /**
  42063. * @member {number} [InterpolationKrigingAnalystParameters.prototype.nugget=0]
  42064. * @description 克吕金算法中块金效应值。
  42065. */
  42066. _this.nugget = 0;
  42067. /**
  42068. * @member {number} [InterpolationKrigingAnalystParameters.prototype.range=0]
  42069. * @description 克吕金算法中自相关阈值,单位与原数据集单位相同。
  42070. */
  42071. _this.range = 0;
  42072. /**
  42073. * @member {number} [InterpolationKrigingAnalystParameters.prototype.sill=0]
  42074. * @description 克吕金算法中基台值。
  42075. */
  42076. _this.sill = 0;
  42077. /**
  42078. * @member {VariogramMode} [InterpolationKrigingAnalystParameters.prototype.variogramMode=VariogramMode.SPHERICAL]
  42079. * @description 克吕金插值时的半变函数类型。
  42080. * 用户所选择的半变函数类型会影响未知点的预测,特别是曲线在原点处的不同形状有重要意义。
  42081. * 曲线在原点处越陡,则较近领域对该预测值的影响就越大,因此输出表面就会越不光滑。
  42082. */
  42083. _this.variogramMode = VariogramMode.SPHERICAL;
  42084. /**
  42085. * @member {Exponent} [InterpolationKrigingAnalystParameters.prototype.exponent=Exponent.EXP1]
  42086. * @description 【泛克吕金】类型下,用于插值的样点数据中趋势面方程的阶数。
  42087. */
  42088. _this.exponent = Exponent.EXP1;
  42089. /**
  42090. * @member {SearchMode} InterpolationKrigingAnalystParameters.prototype.searchMode
  42091. * @description 插值运算时,查找参与运算点的方式,有固定点数查找、定长查找、块查找。此为必选参数。
  42092. * 简单克吕金和泛克吕金不支持块查找。
  42093. * 具体如下:<br>
  42094. * {KDTREE_FIXED_COUNT} 使用 KDTREE 的固定点数方式查找参与内插分析的点。<br>
  42095. * {KDTREE_FIXED_RADIUS} 使用 KDTREE 的定长方式查找参与内插分析的点。<br>
  42096. * {QUADTREE} 使用 QUADTREE 方式查找参与内插分析的点(块查找)。
  42097. */
  42098. _this.searchMode = null;
  42099. /**
  42100. * @member {number} [InterpolationKrigingAnalystParameters.prototype.expectedCount=12]
  42101. * @description 【固定点数查找】方式下,设置待查找的点数,即参与插值运算的点数,默认值为12。
  42102. * 【定长查找】方式下,设置查找的最小点数,默认值为12。
  42103. */
  42104. _this.expectedCount = 12;
  42105. /**
  42106. * @member {number} [InterpolationKrigingAnalystParameters.prototype.maxPointCountForInterpolation=200]
  42107. * @description 【块查找】方式下,最多参与插值的点数。
  42108. * 仅用于普通克吕金插值,简单克吕金和泛克吕金不支持块查找。
  42109. */
  42110. _this.maxPointCountForInterpolation = 200;
  42111. /**
  42112. * @member {number} [InterpolationKrigingAnalystParameters.prototype.maxPointCountInNode=50]
  42113. * @description 【块查找】方式下,设置单个块内最多参与运算点数。
  42114. * 仅用于普通克吕金插值,简单克吕金和泛克吕金不支持块查找。
  42115. */
  42116. _this.maxPointCountInNode = 50;
  42117. if (options) {
  42118. Util_Util.extend(InterpolationKrigingAnalystParameters_assertThisInitialized(_this), options);
  42119. }
  42120. _this.CLASS_NAME = "SuperMap.InterpolationKrigingAnalystParameters";
  42121. return _this;
  42122. }
  42123. /**
  42124. * @function InterpolationKrigingAnalystParameters.prototype.destroy
  42125. * @description 释放资源,将引用资源的属性置空。
  42126. */
  42127. InterpolationKrigingAnalystParameters_createClass(InterpolationKrigingAnalystParameters, [{
  42128. key: "destroy",
  42129. value: function destroy() {
  42130. InterpolationKrigingAnalystParameters_get(InterpolationKrigingAnalystParameters_getPrototypeOf(InterpolationKrigingAnalystParameters.prototype), "destroy", this).call(this);
  42131. var me = this;
  42132. me.type = null;
  42133. me.mean = null;
  42134. me.angle = null;
  42135. me.nugget = null;
  42136. me.range = null;
  42137. me.sill = null;
  42138. me.variogramMode = null;
  42139. me.exponent = null;
  42140. me.searchMode = null;
  42141. me.expectedCount = null;
  42142. me.maxPointCountForInterpolation = null;
  42143. me.maxPointCountInNode = null;
  42144. }
  42145. }]);
  42146. return InterpolationKrigingAnalystParameters;
  42147. }(InterpolationAnalystParameters);
  42148. ;// CONCATENATED MODULE: ./src/common/iServer/InterpolationAnalystService.js
  42149. function InterpolationAnalystService_typeof(obj) { "@babel/helpers - typeof"; return InterpolationAnalystService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, InterpolationAnalystService_typeof(obj); }
  42150. function InterpolationAnalystService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  42151. function InterpolationAnalystService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  42152. function InterpolationAnalystService_createClass(Constructor, protoProps, staticProps) { if (protoProps) InterpolationAnalystService_defineProperties(Constructor.prototype, protoProps); if (staticProps) InterpolationAnalystService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  42153. function InterpolationAnalystService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { InterpolationAnalystService_get = Reflect.get.bind(); } else { InterpolationAnalystService_get = function _get(target, property, receiver) { var base = InterpolationAnalystService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return InterpolationAnalystService_get.apply(this, arguments); }
  42154. function InterpolationAnalystService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = InterpolationAnalystService_getPrototypeOf(object); if (object === null) break; } return object; }
  42155. function InterpolationAnalystService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) InterpolationAnalystService_setPrototypeOf(subClass, superClass); }
  42156. function InterpolationAnalystService_setPrototypeOf(o, p) { InterpolationAnalystService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return InterpolationAnalystService_setPrototypeOf(o, p); }
  42157. function InterpolationAnalystService_createSuper(Derived) { var hasNativeReflectConstruct = InterpolationAnalystService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = InterpolationAnalystService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = InterpolationAnalystService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return InterpolationAnalystService_possibleConstructorReturn(this, result); }; }
  42158. function InterpolationAnalystService_possibleConstructorReturn(self, call) { if (call && (InterpolationAnalystService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return InterpolationAnalystService_assertThisInitialized(self); }
  42159. function InterpolationAnalystService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  42160. function InterpolationAnalystService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  42161. function InterpolationAnalystService_getPrototypeOf(o) { InterpolationAnalystService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return InterpolationAnalystService_getPrototypeOf(o); }
  42162. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  42163. * This program are made available under the terms of the Apache License, Version 2.0
  42164. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  42165. /**
  42166. * @class InterpolationAnalystService
  42167. * @deprecatedclass SuperMap.InterpolationAnalystService
  42168. * @category iServer SpatialAnalyst InterpolationAnalyst
  42169. * @classdesc 插值分析服务类。
  42170. * 插值分析可以将有限的采样点数据,通过插值算法对采样点周围的数值情况进行预测,可以掌握研究区域内数据的总体分布状况,从而使采样的离散点不仅仅反映其所在位置的数值情况,
  42171. * 还可以反映区域的数值分布。目前SuperMap iServer的插值功能提供从点数据集插值得到栅格数据集的功能,支持以下常用的内插方法,
  42172. * 包括:反距离加权插值、克吕金(Kriging)插值法、样条(径向基函数,Radial Basis Function)插值、点密度插值。
  42173. * @param {string} url - 服务地址。如 http://localhost:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst。
  42174. * @param {Object} options - 参数。
  42175. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  42176. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  42177. * @param {Object} [options.headers] - 请求头。
  42178. * @extends {SpatialAnalystBase}
  42179. * @example 例如:
  42180. * (start code)
  42181. * var myTInterpolationAnalystService = new InterpolationAnalystService(url);
  42182. * myTInterpolationAnalystService.events.on({
  42183. * "processCompleted": processCompleted,
  42184. * "processFailed": processFailed
  42185. * }
  42186. * );
  42187. * (end)
  42188. * @usage
  42189. */
  42190. var InterpolationAnalystService = /*#__PURE__*/function (_SpatialAnalystBase) {
  42191. InterpolationAnalystService_inherits(InterpolationAnalystService, _SpatialAnalystBase);
  42192. var _super = InterpolationAnalystService_createSuper(InterpolationAnalystService);
  42193. function InterpolationAnalystService(url, options) {
  42194. var _this;
  42195. InterpolationAnalystService_classCallCheck(this, InterpolationAnalystService);
  42196. _this = _super.call(this, url, options);
  42197. /**
  42198. * @member {string} InterpolationAnalystService.prototype.mode
  42199. * @description 插值分析类型。
  42200. */
  42201. _this.mode = null;
  42202. if (options) {
  42203. Util_Util.extend(InterpolationAnalystService_assertThisInitialized(_this), options);
  42204. }
  42205. return _this;
  42206. }
  42207. /**
  42208. * @function InterpolationAnalystService.prototype.destroy
  42209. * @description 释放资源,将引用资源的属性置空。
  42210. */
  42211. InterpolationAnalystService_createClass(InterpolationAnalystService, [{
  42212. key: "destroy",
  42213. value: function destroy() {
  42214. InterpolationAnalystService_get(InterpolationAnalystService_getPrototypeOf(InterpolationAnalystService.prototype), "destroy", this).call(this);
  42215. this.mode = null;
  42216. this.CLASS_NAME = "SuperMap.InterpolationAnalystService";
  42217. }
  42218. /**
  42219. * @function InterpolationAnalystService.prototype.processAsync
  42220. * @description 负责将客户端的查询参数传递到服务端。
  42221. * @param {InterpolationDensityAnalystParameters|InterpolationIDWAnalystParameters|InterpolationRBFAnalystParameters|InterpolationKrigingAnalystParameters} parameter - 插值分析参数类。
  42222. */
  42223. }, {
  42224. key: "processAsync",
  42225. value: function processAsync(parameter) {
  42226. var parameterObject = {};
  42227. var me = this;
  42228. if (parameter instanceof InterpolationDensityAnalystParameters) {
  42229. me.mode = 'Density';
  42230. if (parameter.InterpolationAnalystType === 'geometry') {
  42231. me.url = Util_Util.urlPathAppend(me.url, 'geometry/interpolation/density');
  42232. } else {
  42233. me.url = Util_Util.urlPathAppend(me.url, 'datasets/' + parameter.dataset + '/interpolation/density');
  42234. }
  42235. } else if (parameter instanceof InterpolationIDWAnalystParameters) {
  42236. me.mode = 'IDW';
  42237. if (parameter.InterpolationAnalystType === 'geometry') {
  42238. me.url = Util_Util.urlPathAppend(me.url, 'geometry/interpolation/idw');
  42239. } else {
  42240. me.url = Util_Util.urlPathAppend(me.url, 'datasets/' + parameter.dataset + '/interpolation/idw');
  42241. }
  42242. } else if (parameter instanceof InterpolationRBFAnalystParameters) {
  42243. me.mode = 'RBF';
  42244. if (parameter.InterpolationAnalystType === 'geometry') {
  42245. me.url = Util_Util.urlPathAppend(me.url, 'geometry/interpolation/rbf');
  42246. } else {
  42247. me.url = Util_Util.urlPathAppend(me.url, 'datasets/' + parameter.dataset + '/interpolation/rbf');
  42248. }
  42249. } else if (parameter instanceof InterpolationKrigingAnalystParameters) {
  42250. me.mode = 'Kriging';
  42251. if (parameter.InterpolationAnalystType === 'geometry') {
  42252. me.url = Util_Util.urlPathAppend(me.url, 'geometry/interpolation/kriging');
  42253. } else {
  42254. me.url = Util_Util.urlPathAppend(me.url, 'datasets/' + parameter.dataset + '/interpolation/kriging');
  42255. }
  42256. }
  42257. InterpolationAnalystParameters.toObject(parameter, parameterObject);
  42258. var jsonParameters = Util_Util.toJSON(parameterObject);
  42259. me.url = Util_Util.urlAppend(me.url, 'returnContent=true');
  42260. me.request({
  42261. method: "POST",
  42262. data: jsonParameters,
  42263. scope: me,
  42264. success: me.serviceProcessCompleted,
  42265. failure: me.serviceProcessFailed
  42266. });
  42267. }
  42268. }]);
  42269. return InterpolationAnalystService;
  42270. }(SpatialAnalystBase);
  42271. ;// CONCATENATED MODULE: ./src/common/iServer/MathExpressionAnalysisParameters.js
  42272. function MathExpressionAnalysisParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  42273. function MathExpressionAnalysisParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  42274. function MathExpressionAnalysisParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) MathExpressionAnalysisParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) MathExpressionAnalysisParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  42275. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  42276. * This program are made available under the terms of the Apache License, Version 2.0
  42277. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  42278. /**
  42279. * @class MathExpressionAnalysisParameters
  42280. * @deprecatedclass SuperMap.MathExpressionAnalysisParameters
  42281. * @category iServer SpatialAnalyst GridMathAnalyst
  42282. * @classdesc 栅格代数运算参数类。
  42283. * @param {Object} options - 参数。
  42284. * @param {string} options.dataset - 指定栅格代数运算数据源中数据集的名称。该名称用形如"数据集名称@数据源别名"形式来表示,例如:BaseMap_P@Jingjin。
  42285. * @param {string} options.resultGridName - 指定结果数据集名称。
  42286. * @param {string} options.expression - 指定的栅格运算表达式。如:[DatasourceAlias1.Raster1]*2-10。
  42287. * @param {string} options.targetDatasource - 指定存储结果数据集的数据源。
  42288. * @param {GeometryPolygon|L.Polygon|ol.geom.Polygon|GeoJSONObject} [options.extractRegion] - 栅格代数运算的范围,指定数据集中参与栅格代数运算的区域。
  42289. * 如果缺省,则计算全部区域,如果参与运算的数据集范围不一致,将使用所有数据集的范围的交集作为计算区域 。
  42290. * @param {boolean} [options.isZip=false] - 是否对结果数据集进行压缩处理。
  42291. * @param {boolean} [options.ignoreNoValue=false] - 是否忽略无值栅格数据。true 表示忽略无值数据,即无值栅格不参与运算。
  42292. * @param {boolean} [options.deleteExistResultDataset=false] - 如果用户命名的结果数据集名称与已有的数据集重名,是否删除已有的数据集。
  42293. * @usage
  42294. */
  42295. var MathExpressionAnalysisParameters = /*#__PURE__*/function () {
  42296. function MathExpressionAnalysisParameters(options) {
  42297. MathExpressionAnalysisParameters_classCallCheck(this, MathExpressionAnalysisParameters);
  42298. if (!options) {
  42299. return;
  42300. }
  42301. /**
  42302. * @member {string} MathExpressionAnalysisParameters.prototype.dataset
  42303. * @description 要用来做栅格代数运算数据源中数据集的名称。
  42304. * 该名称用形如"数据集名称@数据源别名"形式来表示,例如:JingjinTerrain@Jingjin。
  42305. *
  42306. */
  42307. this.dataset = null;
  42308. /**
  42309. * @member {GeometryPolygon|L.Polygon|ol.geom.Polygon|GeoJSONObject} [MathExpressionAnalysisParameters.prototype.extractRegion]
  42310. * @description 栅格代数运算的范围,指定数据集中参与栅格代数运算的区域。
  42311. * 如果缺省,则计算全部区域,如果参与运算的数据集范围不一致,将使用所有数据集的范围的交集作为计算区域 。
  42312. */
  42313. this.extractRegion = null;
  42314. /**
  42315. * @member {string} MathExpressionAnalysisParameters.prototype.expression
  42316. * @description 指定的栅格运算表达式。如:"[DatasourceAlias1.Raster1]*2-10"。
  42317. */
  42318. this.expression = null;
  42319. /**
  42320. * @member {boolean} [MathExpressionAnalysisParameters.prototype.isZip=false]
  42321. * @description 是否对结果数据集进行压缩处理。
  42322. */
  42323. this.isZip = false;
  42324. /**
  42325. * @member {boolean} [MathExpressionAnalysisParameters.prototype.ignoreNoValue=false]
  42326. * @description 是否忽略无值栅格数据。
  42327. */
  42328. this.ignoreNoValue = false;
  42329. /**
  42330. * @member {string} MathExpressionAnalysisParameters.prototype.targetDatasource
  42331. * @description 指定存储结果数据集的数据源。
  42332. */
  42333. this.targetDatasource = null;
  42334. /**
  42335. * @member {string} MathExpressionAnalysisParameters.prototype.resultGridName
  42336. * @description 指定结果数据集名称。
  42337. */
  42338. this.resultGridName = null;
  42339. /**
  42340. * @member {boolean} [MathExpressionAnalysisParameters.prototype.deleteExistResultDataset=false]
  42341. * @description 如果用户命名的结果数据集名称与已有的数据集重名,是否删除已有的数据集。
  42342. */
  42343. this.deleteExistResultDataset = false;
  42344. Util_Util.extend(this, options);
  42345. this.CLASS_NAME = "SuperMap.MathExpressionAnalysisParameters";
  42346. }
  42347. /**
  42348. * @function MathExpressionAnalysisParameters.prototype.destroy
  42349. * @description 释放资源,将引用资源的属性置空。
  42350. */
  42351. MathExpressionAnalysisParameters_createClass(MathExpressionAnalysisParameters, [{
  42352. key: "destroy",
  42353. value: function destroy() {
  42354. var me = this;
  42355. me.dataset = null;
  42356. me.bounds = null;
  42357. me.expression = null;
  42358. me.isZip = true;
  42359. me.ignoreNoValue = true;
  42360. me.targetDatasource = null;
  42361. me.resultGridName = null;
  42362. me.deleteExistResultDataset = null;
  42363. }
  42364. /**
  42365. * @function MathExpressionAnalysisParameters.toObject
  42366. * @param {Object} mathExpressionAnalysisParameters - 栅格代数运算参数。
  42367. * @param {Object} tempObj - 目标对象。
  42368. * @description 生成栅格代数运算对象。
  42369. */
  42370. }], [{
  42371. key: "toObject",
  42372. value: function toObject(mathExpressionAnalysisParameters, tempObj) {
  42373. for (var name in mathExpressionAnalysisParameters) {
  42374. if (name !== "dataset") {
  42375. tempObj[name] = mathExpressionAnalysisParameters[name];
  42376. }
  42377. if (name === "extractRegion") {
  42378. if (mathExpressionAnalysisParameters[name]) {
  42379. var bs = mathExpressionAnalysisParameters[name].components[0].components;
  42380. var region = {},
  42381. points = [],
  42382. type = "REGION";
  42383. var len = bs.length;
  42384. for (var i = 0; i < len - 1; i++) {
  42385. var poi = {};
  42386. poi["x"] = bs[i].x;
  42387. poi["y"] = bs[i].y;
  42388. points.push(poi);
  42389. }
  42390. region["points"] = points;
  42391. region["type"] = type;
  42392. tempObj[name] = region;
  42393. }
  42394. }
  42395. }
  42396. }
  42397. }]);
  42398. return MathExpressionAnalysisParameters;
  42399. }();
  42400. ;// CONCATENATED MODULE: ./src/common/iServer/MathExpressionAnalysisService.js
  42401. function MathExpressionAnalysisService_typeof(obj) { "@babel/helpers - typeof"; return MathExpressionAnalysisService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, MathExpressionAnalysisService_typeof(obj); }
  42402. function MathExpressionAnalysisService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  42403. function MathExpressionAnalysisService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  42404. function MathExpressionAnalysisService_createClass(Constructor, protoProps, staticProps) { if (protoProps) MathExpressionAnalysisService_defineProperties(Constructor.prototype, protoProps); if (staticProps) MathExpressionAnalysisService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  42405. function MathExpressionAnalysisService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { MathExpressionAnalysisService_get = Reflect.get.bind(); } else { MathExpressionAnalysisService_get = function _get(target, property, receiver) { var base = MathExpressionAnalysisService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return MathExpressionAnalysisService_get.apply(this, arguments); }
  42406. function MathExpressionAnalysisService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = MathExpressionAnalysisService_getPrototypeOf(object); if (object === null) break; } return object; }
  42407. function MathExpressionAnalysisService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) MathExpressionAnalysisService_setPrototypeOf(subClass, superClass); }
  42408. function MathExpressionAnalysisService_setPrototypeOf(o, p) { MathExpressionAnalysisService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return MathExpressionAnalysisService_setPrototypeOf(o, p); }
  42409. function MathExpressionAnalysisService_createSuper(Derived) { var hasNativeReflectConstruct = MathExpressionAnalysisService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = MathExpressionAnalysisService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = MathExpressionAnalysisService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return MathExpressionAnalysisService_possibleConstructorReturn(this, result); }; }
  42410. function MathExpressionAnalysisService_possibleConstructorReturn(self, call) { if (call && (MathExpressionAnalysisService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return MathExpressionAnalysisService_assertThisInitialized(self); }
  42411. function MathExpressionAnalysisService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  42412. function MathExpressionAnalysisService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  42413. function MathExpressionAnalysisService_getPrototypeOf(o) { MathExpressionAnalysisService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return MathExpressionAnalysisService_getPrototypeOf(o); }
  42414. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  42415. * This program are made available under the terms of the Apache License, Version 2.0
  42416. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  42417. /**
  42418. * @class MathExpressionAnalysisService
  42419. * @deprecatedclass SuperMap.MathExpressionAnalysisService
  42420. * @category iServer SpatialAnalyst GridMathAnalyst
  42421. * @classdesc 栅格代数运算服务类。
  42422. * @param {string} url - 服务地址。如 http://localhost:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst
  42423. * @param {Object} options - 参数。
  42424. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  42425. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  42426. * @param {Object} [options.headers] - 请求头。
  42427. * @extends {SpatialAnalystBase}
  42428. * @example 例如:
  42429. * (start code)
  42430. * var myMathExpressionAnalysisService = new MathExpressionAnalysisService(url);
  42431. * myMathExpressionAnalysisService.on({
  42432. * "processCompleted": processCompleted,
  42433. * "processFailed": processFailed
  42434. * }
  42435. * );
  42436. * (end)
  42437. * @usage
  42438. */
  42439. var MathExpressionAnalysisService = /*#__PURE__*/function (_SpatialAnalystBase) {
  42440. MathExpressionAnalysisService_inherits(MathExpressionAnalysisService, _SpatialAnalystBase);
  42441. var _super = MathExpressionAnalysisService_createSuper(MathExpressionAnalysisService);
  42442. function MathExpressionAnalysisService(url, options) {
  42443. var _this;
  42444. MathExpressionAnalysisService_classCallCheck(this, MathExpressionAnalysisService);
  42445. _this = _super.call(this, url, options);
  42446. _this.CLASS_NAME = "SuperMap.MathExpressionAnalysisService";
  42447. return _this;
  42448. }
  42449. /**
  42450. * @override
  42451. */
  42452. MathExpressionAnalysisService_createClass(MathExpressionAnalysisService, [{
  42453. key: "destroy",
  42454. value: function destroy() {
  42455. MathExpressionAnalysisService_get(MathExpressionAnalysisService_getPrototypeOf(MathExpressionAnalysisService.prototype), "destroy", this).call(this);
  42456. }
  42457. /**
  42458. * @function MathExpressionAnalysisService.prototype.processAsync
  42459. * @description 负责将客户端的查询参数传递到服务端。
  42460. * @param {MathExpressionAnalysisParameters} parameter - 栅格代数运算参数类。
  42461. */
  42462. }, {
  42463. key: "processAsync",
  42464. value: function processAsync(parameter) {
  42465. var me = this;
  42466. var parameterObject = {};
  42467. if (parameter instanceof MathExpressionAnalysisParameters) {
  42468. me.url = Util_Util.urlPathAppend(me.url, 'datasets/' + parameter.dataset + '/mathanalyst');
  42469. }
  42470. MathExpressionAnalysisParameters.toObject(parameter, parameterObject);
  42471. var jsonParameters = Util_Util.toJSON(parameterObject);
  42472. me.url = Util_Util.urlAppend(me.url, 'returnContent=true');
  42473. me.request({
  42474. method: "POST",
  42475. data: jsonParameters,
  42476. scope: me,
  42477. success: me.serviceProcessCompleted,
  42478. failure: me.serviceProcessFailed
  42479. });
  42480. }
  42481. }]);
  42482. return MathExpressionAnalysisService;
  42483. }(SpatialAnalystBase);
  42484. ;// CONCATENATED MODULE: ./src/common/iServer/OverlayAnalystParameters.js
  42485. function OverlayAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  42486. function OverlayAnalystParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  42487. function OverlayAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) OverlayAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) OverlayAnalystParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  42488. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  42489. * This program are made available under the terms of the Apache License, Version 2.0
  42490. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  42491. /**
  42492. * @class OverlayAnalystParameters
  42493. * @deprecatedclass SuperMap.OverlayAnalystParameters
  42494. * @category iServer SpatialAnalyst OverlayAnalyst
  42495. * @classdesc 叠加分析参数基类。数据集叠加分析参数和几何对象叠加分析参数均继承此基类。
  42496. * @param {Object} options - 参数。
  42497. * @usage
  42498. */
  42499. var OverlayAnalystParameters = /*#__PURE__*/function () {
  42500. function OverlayAnalystParameters(options) {
  42501. OverlayAnalystParameters_classCallCheck(this, OverlayAnalystParameters);
  42502. /**
  42503. * @member {OverlayOperationType} [OverlayAnalystParameters.prototype.operation=OverlayOperationType.UNION]
  42504. * @description 指定叠加分析操作类型。
  42505. */
  42506. this.operation = OverlayOperationType.UNION;
  42507. if (options) {
  42508. Util_Util.extend(this, options);
  42509. }
  42510. this.CLASS_NAME = "SuperMap.OverlayAnalystParameters";
  42511. }
  42512. /**
  42513. * @function OverlayAnalystParameters.prototype.destroy
  42514. * @description 释放资源,将引用资源的属性置空。
  42515. */
  42516. OverlayAnalystParameters_createClass(OverlayAnalystParameters, [{
  42517. key: "destroy",
  42518. value: function destroy() {
  42519. var me = this;
  42520. me.operation = null;
  42521. }
  42522. }]);
  42523. return OverlayAnalystParameters;
  42524. }();
  42525. ;// CONCATENATED MODULE: ./src/common/iServer/DatasetOverlayAnalystParameters.js
  42526. function DatasetOverlayAnalystParameters_typeof(obj) { "@babel/helpers - typeof"; return DatasetOverlayAnalystParameters_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, DatasetOverlayAnalystParameters_typeof(obj); }
  42527. function DatasetOverlayAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  42528. function DatasetOverlayAnalystParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  42529. function DatasetOverlayAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) DatasetOverlayAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) DatasetOverlayAnalystParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  42530. function DatasetOverlayAnalystParameters_get() { if (typeof Reflect !== "undefined" && Reflect.get) { DatasetOverlayAnalystParameters_get = Reflect.get.bind(); } else { DatasetOverlayAnalystParameters_get = function _get(target, property, receiver) { var base = DatasetOverlayAnalystParameters_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return DatasetOverlayAnalystParameters_get.apply(this, arguments); }
  42531. function DatasetOverlayAnalystParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = DatasetOverlayAnalystParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  42532. function DatasetOverlayAnalystParameters_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) DatasetOverlayAnalystParameters_setPrototypeOf(subClass, superClass); }
  42533. function DatasetOverlayAnalystParameters_setPrototypeOf(o, p) { DatasetOverlayAnalystParameters_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return DatasetOverlayAnalystParameters_setPrototypeOf(o, p); }
  42534. function DatasetOverlayAnalystParameters_createSuper(Derived) { var hasNativeReflectConstruct = DatasetOverlayAnalystParameters_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = DatasetOverlayAnalystParameters_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = DatasetOverlayAnalystParameters_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return DatasetOverlayAnalystParameters_possibleConstructorReturn(this, result); }; }
  42535. function DatasetOverlayAnalystParameters_possibleConstructorReturn(self, call) { if (call && (DatasetOverlayAnalystParameters_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return DatasetOverlayAnalystParameters_assertThisInitialized(self); }
  42536. function DatasetOverlayAnalystParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  42537. function DatasetOverlayAnalystParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  42538. function DatasetOverlayAnalystParameters_getPrototypeOf(o) { DatasetOverlayAnalystParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return DatasetOverlayAnalystParameters_getPrototypeOf(o); }
  42539. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  42540. * This program are made available under the terms of the Apache License, Version 2.0
  42541. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  42542. /**
  42543. * @class DatasetOverlayAnalystParameters
  42544. * @deprecatedclass SuperMap.DatasetOverlayAnalystParameters
  42545. * @category iServer SpatialAnalyst OverlayAnalyst
  42546. * @classdesc 数据集叠加分析参数类。
  42547. * @param {Object} options - 参数。
  42548. * @param {string} options.operateDataset -数据集名称。
  42549. * @param {string} options.sourceDataset - 源数据集名称。
  42550. * @param {Array.<string>} [options.operateDatasetFields] - 叠加分析中操作数据集保留在结果数据集中的字段名列表。
  42551. * @param {FilterParameter} [options.operateDatasetFilter] - 设置操作数据集中空间对象过滤条件。
  42552. * @param {Array.<GeometryPolygon|L.Polygon|ol.geom.Polygon|GeoJSONObject>} [options.operateRegions] - 操作面对象集合,表示与这些面对象进行叠加分析。与 operateDataset 参数互斥,冲突时以 operateDataset 为准。
  42553. * @param {Array.<string>} [options.sourceDatasetFields] - 叠加分析中源数据集保留在结果数据集中的字段名列表。
  42554. * @param {FilterParameter} [options.sourceDatasetFilter] - 设置源数据集中空间对象过滤条件。
  42555. * @param {number} [options.tolerance=0] - 容限。
  42556. * @param {OverlayOperationType} options.operation - 叠加操作枚举值。
  42557. * @param {DataReturnOption} [options.resultSetting] - 结果返回设置类。
  42558. * @extends {GetFeaturesParametersBase}
  42559. * @usage
  42560. */
  42561. var DatasetOverlayAnalystParameters = /*#__PURE__*/function (_OverlayAnalystParame) {
  42562. DatasetOverlayAnalystParameters_inherits(DatasetOverlayAnalystParameters, _OverlayAnalystParame);
  42563. var _super = DatasetOverlayAnalystParameters_createSuper(DatasetOverlayAnalystParameters);
  42564. function DatasetOverlayAnalystParameters(options) {
  42565. var _this;
  42566. DatasetOverlayAnalystParameters_classCallCheck(this, DatasetOverlayAnalystParameters);
  42567. _this = _super.call(this, options);
  42568. /**
  42569. * @member {string} DatasetOverlayAnalystParameters.prototype.operateDataset
  42570. * @description 叠加分析中操作数据集的名称。
  42571. */
  42572. _this.operateDataset = null;
  42573. /**
  42574. * @member {Array.<string>} [DatasetOverlayAnalystParameters.prototype.operateDatasetFields]
  42575. * @description 叠加分析中操作数据集保留在结果数据集中的字段名列表。
  42576. */
  42577. _this.operateDatasetFields = [];
  42578. /**
  42579. * @member {FilterParameter} DatasetOverlayAnalystParameters.prototype.operateDatasetFilter
  42580. * @description 设置操作数据集中空间对象过滤条件。
  42581. */
  42582. _this.operateDatasetFilter = new FilterParameter();
  42583. /**
  42584. * @member {Array.<GeometryPolygon|L.Polygon|ol.geom.Polygon|GeoJSONObject>} [DatasetOverlayAnalystParameters.prototype.operateRegions]
  42585. * @description 操作面对象集合,表示与这些面对象进行叠加分析。与 operateDataset 参数互斥,冲突时以 operateDataset 为准。
  42586. */
  42587. _this.operateRegions = [];
  42588. /**
  42589. * @member {string} DatasetOverlayAnalystParameters.prototype.sourceDataset
  42590. * @description 叠加分析中源数据集的名称。
  42591. */
  42592. _this.sourceDataset = null;
  42593. /**
  42594. * @member {Array.<string>} [DatasetOverlayAnalystParameters.prototype.sourceDatasetFields]
  42595. * @description 叠加分析中源数据集保留在结果数据集中的字段名列表。
  42596. */
  42597. _this.sourceDatasetFields = [];
  42598. /**
  42599. * @member {FilterParameter} [DatasetOverlayAnalystParameters.prototype.filterQueryParameter]
  42600. * @description 设置源数据集中空间对象过滤条件。
  42601. */
  42602. _this.sourceDatasetFilter = new FilterParameter();
  42603. /**
  42604. * @member {number} [DatasetOverlayAnalystParameters.prototype.tolerance=0]
  42605. * @description 容限。
  42606. */
  42607. _this.tolerance = 0;
  42608. /**
  42609. * @member {DataReturnOption} [DatasetOverlayAnalystParameters.prototype.resultSetting]
  42610. * @description 结果返回设置类。
  42611. */
  42612. _this.resultSetting = new DataReturnOption();
  42613. Util_Util.extend(DatasetOverlayAnalystParameters_assertThisInitialized(_this), options);
  42614. _this.CLASS_NAME = "SuperMap.DatasetOverlayAnalystParameters";
  42615. return _this;
  42616. }
  42617. /**
  42618. * @function DatasetOverlayAnalystParameters.prototype.destroy
  42619. * @override
  42620. */
  42621. DatasetOverlayAnalystParameters_createClass(DatasetOverlayAnalystParameters, [{
  42622. key: "destroy",
  42623. value: function destroy() {
  42624. DatasetOverlayAnalystParameters_get(DatasetOverlayAnalystParameters_getPrototypeOf(DatasetOverlayAnalystParameters.prototype), "destroy", this).call(this);
  42625. var me = this;
  42626. me.operateDataset = null;
  42627. me.operateDatasetFields = null;
  42628. if (me.operateDatasetFilter) {
  42629. me.operateDatasetFilter.destroy();
  42630. me.operateDatasetFilter = null;
  42631. }
  42632. if (me.operateRegions) {
  42633. for (var i = 0, opRegions = me.operateRegions, len = opRegions.length; i < len; i++) {
  42634. opRegions[i].destroy();
  42635. }
  42636. me.operateRegions = null;
  42637. }
  42638. me.sourceDataset = null;
  42639. me.sourceDatasetFields = null;
  42640. if (me.sourceDatasetFilter) {
  42641. me.sourceDatasetFilter.destroy();
  42642. me.sourceDatasetFilter = null;
  42643. }
  42644. me.tolerance = null;
  42645. if (me.resultSetting) {
  42646. me.resultSetting.destroy();
  42647. me.resultSetting = null;
  42648. }
  42649. }
  42650. /**
  42651. * @function DatasetOverlayAnalystParameters.toObject
  42652. * @param {DatasetOverlayAnalystParameters} datasetOverlayAnalystParameters - 数据集叠加分析参数类。
  42653. * @param {DatasetOverlayAnalystParameters} tempObj - 数据集叠加分析参数对象。
  42654. * @description 将数据集叠加分析参数类转换为 JSON 对象。
  42655. * @returns {Object} JSON 对象。
  42656. */
  42657. }], [{
  42658. key: "toObject",
  42659. value: function toObject(datasetOverlayAnalystParameters, tempObj) {
  42660. for (var name in datasetOverlayAnalystParameters) {
  42661. if (name === "sourceDataset") {
  42662. continue;
  42663. } else if (name === "operateRegions") {
  42664. tempObj.operateRegions = [];
  42665. var ors = datasetOverlayAnalystParameters.operateRegions;
  42666. for (var index in ors) {
  42667. if (ors.hasOwnProperty(index)) {
  42668. //icl542
  42669. tempObj.operateRegions[index] = ServerGeometry.fromGeometry(ors[index]);
  42670. }
  42671. }
  42672. } else if (name === "resultSetting") {
  42673. tempObj.dataReturnOption = datasetOverlayAnalystParameters.resultSetting;
  42674. } else {
  42675. tempObj[name] = datasetOverlayAnalystParameters[name];
  42676. }
  42677. }
  42678. }
  42679. }]);
  42680. return DatasetOverlayAnalystParameters;
  42681. }(OverlayAnalystParameters);
  42682. ;// CONCATENATED MODULE: ./src/common/iServer/GeometryOverlayAnalystParameters.js
  42683. function GeometryOverlayAnalystParameters_typeof(obj) { "@babel/helpers - typeof"; return GeometryOverlayAnalystParameters_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, GeometryOverlayAnalystParameters_typeof(obj); }
  42684. function GeometryOverlayAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  42685. function GeometryOverlayAnalystParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  42686. function GeometryOverlayAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) GeometryOverlayAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) GeometryOverlayAnalystParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  42687. function GeometryOverlayAnalystParameters_get() { if (typeof Reflect !== "undefined" && Reflect.get) { GeometryOverlayAnalystParameters_get = Reflect.get.bind(); } else { GeometryOverlayAnalystParameters_get = function _get(target, property, receiver) { var base = GeometryOverlayAnalystParameters_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return GeometryOverlayAnalystParameters_get.apply(this, arguments); }
  42688. function GeometryOverlayAnalystParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GeometryOverlayAnalystParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  42689. function GeometryOverlayAnalystParameters_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) GeometryOverlayAnalystParameters_setPrototypeOf(subClass, superClass); }
  42690. function GeometryOverlayAnalystParameters_setPrototypeOf(o, p) { GeometryOverlayAnalystParameters_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GeometryOverlayAnalystParameters_setPrototypeOf(o, p); }
  42691. function GeometryOverlayAnalystParameters_createSuper(Derived) { var hasNativeReflectConstruct = GeometryOverlayAnalystParameters_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = GeometryOverlayAnalystParameters_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = GeometryOverlayAnalystParameters_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return GeometryOverlayAnalystParameters_possibleConstructorReturn(this, result); }; }
  42692. function GeometryOverlayAnalystParameters_possibleConstructorReturn(self, call) { if (call && (GeometryOverlayAnalystParameters_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return GeometryOverlayAnalystParameters_assertThisInitialized(self); }
  42693. function GeometryOverlayAnalystParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  42694. function GeometryOverlayAnalystParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  42695. function GeometryOverlayAnalystParameters_getPrototypeOf(o) { GeometryOverlayAnalystParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GeometryOverlayAnalystParameters_getPrototypeOf(o); }
  42696. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  42697. * This program are made available under the terms of the Apache License, Version 2.0
  42698. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  42699. /**
  42700. * @class GeometryOverlayAnalystParameters
  42701. * @deprecatedclass SuperMap.GeometryOverlayAnalystParameters
  42702. * @category iServer SpatialAnalyst OverlayAnalyst
  42703. * @classdesc
  42704. * 几何对象叠加分析参数类。对指定的某两个几何对象做叠加分析。通过该类可以指定要做叠加分析的几何对象、叠加操作类型。
  42705. * @param {Object} options - 参数。
  42706. * @param {GeoJSONObject} options.operateGeometry - 叠加分析的操作几何对象。<br>
  42707. * 点类型可以是:{@link GeometryPoint}|{@link L.Marker}|{@link L.CircleMarker}|{@link L.Circle}|{@link L.GeoJSON}|{@link ol.geom.Point}|{@link ol.format.GeoJSON}|{@link GeoJSONObject}。<br>
  42708. * 线类型可以是:{@link GeometryLineString}|{@link GeometryLinearRing}|{@link L.Polyline}|{@link L.GeoJSON}|{@link ol.geom.LineString}|{@link GeoJSONObject}。<br>
  42709. * 面类型可以是:{@link GeometryPolygon}|{@link L.Polygon}|{@link L.GeoJSON}|{@link ol.geom.Polygon}|{@link GeoJSONObject}。<br>
  42710. * @param {GeoJSONObject} options.sourceGeometry - 叠加分析的源几何对象。
  42711. * @param {Array.<GeoJSONFeature>} [options.operateGeometries] - 批量叠加分析的操作几何对象数组。
  42712. * @param {Array.<GeoJSONFeature>} [options.sourceGeometries] -批量叠加分析的源几何对象数组。
  42713. * @param {OverlayOperationType} [options.operation] - 叠加操作枚举值。
  42714. * @extends {OverlayAnalystParameters}
  42715. * @usage
  42716. */
  42717. var GeometryOverlayAnalystParameters = /*#__PURE__*/function (_OverlayAnalystParame) {
  42718. GeometryOverlayAnalystParameters_inherits(GeometryOverlayAnalystParameters, _OverlayAnalystParame);
  42719. var _super = GeometryOverlayAnalystParameters_createSuper(GeometryOverlayAnalystParameters);
  42720. function GeometryOverlayAnalystParameters(options) {
  42721. var _this;
  42722. GeometryOverlayAnalystParameters_classCallCheck(this, GeometryOverlayAnalystParameters);
  42723. _this = _super.call(this, options);
  42724. if (options && options.operateGeometry) {
  42725. _this.operateGeometry = options.operateGeometry;
  42726. }
  42727. if (options && options.sourceGeometry) {
  42728. _this.sourceGeometry = options.sourceGeometry;
  42729. }
  42730. if (options && options.operateGeometries) {
  42731. _this.operateGeometries = options.operateGeometries;
  42732. }
  42733. if (options && options.sourceGeometries) {
  42734. _this.sourceGeometries = options.sourceGeometries;
  42735. }
  42736. if (options) {
  42737. Util_Util.extend(GeometryOverlayAnalystParameters_assertThisInitialized(_this), options);
  42738. }
  42739. _this.CLASS_NAME = "SuperMap.GeometryOverlayAnalystParameters";
  42740. return _this;
  42741. }
  42742. /**
  42743. * @function GeometryOverlayAnalystParameters.prototype.destroy
  42744. * @override
  42745. */
  42746. GeometryOverlayAnalystParameters_createClass(GeometryOverlayAnalystParameters, [{
  42747. key: "destroy",
  42748. value: function destroy() {
  42749. GeometryOverlayAnalystParameters_get(GeometryOverlayAnalystParameters_getPrototypeOf(GeometryOverlayAnalystParameters.prototype), "destroy", this).call(this);
  42750. var me = this;
  42751. if (me.sourceGeometry) {
  42752. me.sourceGeometry.destroy();
  42753. me.sourceGeometry = null;
  42754. }
  42755. if (me.sourceGeometries) {
  42756. me.sourceGeometries.destroy();
  42757. me.sourceGeometries = null;
  42758. }
  42759. if (me.sourceGeometry) {
  42760. me.sourceGeometry.destroy();
  42761. me.sourceGeometry = null;
  42762. }
  42763. if (me.operateGeometries) {
  42764. me.operateGeometries.destroy();
  42765. me.operateGeometries = null;
  42766. }
  42767. }
  42768. /**
  42769. * @function GeometryOverlayAnalystParameters.toObject
  42770. * @param {GeometryOverlayAnalystParameters} geometryOverlayAnalystParameters - 几何对象叠加分析参数类。
  42771. * @param {GeometryOverlayAnalystParameters} tempObj - 几何对象叠加分析参数对象。
  42772. * @description 将几何对象叠加分析参数对象转换为 JSON 对象。
  42773. * @returns {Object} JSON 对象。
  42774. */
  42775. }], [{
  42776. key: "toObject",
  42777. value: function toObject(geometryOverlayAnalystParameters, tempObj) {
  42778. for (var name in geometryOverlayAnalystParameters) {
  42779. if (name === "sourceGeometry") {
  42780. tempObj.sourceGeometry = ServerGeometry.fromGeometry(geometryOverlayAnalystParameters.sourceGeometry);
  42781. } else if (name === "sourceGeometries") {
  42782. var sourceGeometries = [];
  42783. for (var i = 0; i < geometryOverlayAnalystParameters.sourceGeometries.length; i++) {
  42784. sourceGeometries.push(ServerGeometry.fromGeometry(geometryOverlayAnalystParameters.sourceGeometries[i]));
  42785. }
  42786. tempObj.sourceGeometries = sourceGeometries;
  42787. } else if (name === "operateGeometry") {
  42788. tempObj.operateGeometry = ServerGeometry.fromGeometry(geometryOverlayAnalystParameters.operateGeometry);
  42789. } else if (name === "operateGeometries") {
  42790. var operateGeometries = [];
  42791. for (var j = 0; j < geometryOverlayAnalystParameters.operateGeometries.length; j++) {
  42792. operateGeometries.push(ServerGeometry.fromGeometry(geometryOverlayAnalystParameters.operateGeometries[j]));
  42793. }
  42794. tempObj.operateGeometries = operateGeometries;
  42795. } else {
  42796. tempObj[name] = geometryOverlayAnalystParameters[name];
  42797. }
  42798. }
  42799. }
  42800. }]);
  42801. return GeometryOverlayAnalystParameters;
  42802. }(OverlayAnalystParameters);
  42803. ;// CONCATENATED MODULE: ./src/common/iServer/OverlayAnalystService.js
  42804. function OverlayAnalystService_typeof(obj) { "@babel/helpers - typeof"; return OverlayAnalystService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, OverlayAnalystService_typeof(obj); }
  42805. function OverlayAnalystService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  42806. function OverlayAnalystService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  42807. function OverlayAnalystService_createClass(Constructor, protoProps, staticProps) { if (protoProps) OverlayAnalystService_defineProperties(Constructor.prototype, protoProps); if (staticProps) OverlayAnalystService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  42808. function OverlayAnalystService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { OverlayAnalystService_get = Reflect.get.bind(); } else { OverlayAnalystService_get = function _get(target, property, receiver) { var base = OverlayAnalystService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return OverlayAnalystService_get.apply(this, arguments); }
  42809. function OverlayAnalystService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = OverlayAnalystService_getPrototypeOf(object); if (object === null) break; } return object; }
  42810. function OverlayAnalystService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) OverlayAnalystService_setPrototypeOf(subClass, superClass); }
  42811. function OverlayAnalystService_setPrototypeOf(o, p) { OverlayAnalystService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return OverlayAnalystService_setPrototypeOf(o, p); }
  42812. function OverlayAnalystService_createSuper(Derived) { var hasNativeReflectConstruct = OverlayAnalystService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = OverlayAnalystService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = OverlayAnalystService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return OverlayAnalystService_possibleConstructorReturn(this, result); }; }
  42813. function OverlayAnalystService_possibleConstructorReturn(self, call) { if (call && (OverlayAnalystService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return OverlayAnalystService_assertThisInitialized(self); }
  42814. function OverlayAnalystService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  42815. function OverlayAnalystService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  42816. function OverlayAnalystService_getPrototypeOf(o) { OverlayAnalystService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return OverlayAnalystService_getPrototypeOf(o); }
  42817. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  42818. * This program are made available under the terms of the Apache License, Version 2.0
  42819. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  42820. /**
  42821. * @class OverlayAnalystService
  42822. * @deprecatedclass SuperMap.OverlayAnalystService
  42823. * @category iServer SpatialAnalyst OverlayAnalyst
  42824. * @classdesc 叠加分析服务类。
  42825. * 该类负责将客户设置的叠加分析参数传递给服务端,并接收服务端返回的叠加分析结果数据。
  42826. * 叠加分析结果通过该类支持的事件的监听函数参数获取
  42827. * @param {string} url - 服务地址。如http://localhost:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst。
  42828. * @param {Object} options - 参数。
  42829. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  42830. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  42831. * @param {DataFormat} [options.format=DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON、GeoJSON、FGB 三种格式。参数格式为 "ISERVER","GEOJSON","FGB"。
  42832. * @param {Object} [options.headers] - 请求头。
  42833. * @extends {CommonServiceBase}
  42834. * @example 例如:
  42835. * (start code)
  42836. * var myOverlayAnalystService = new OverlayAnalystService(url, {
  42837. * eventListeners: {
  42838. * "processCompleted": OverlayCompleted,
  42839. * "processFailed": OverlayFailed
  42840. * }
  42841. * });
  42842. * (end)
  42843. * @usage
  42844. */
  42845. var OverlayAnalystService = /*#__PURE__*/function (_SpatialAnalystBase) {
  42846. OverlayAnalystService_inherits(OverlayAnalystService, _SpatialAnalystBase);
  42847. var _super = OverlayAnalystService_createSuper(OverlayAnalystService);
  42848. function OverlayAnalystService(url, options) {
  42849. var _this;
  42850. OverlayAnalystService_classCallCheck(this, OverlayAnalystService);
  42851. _this = _super.call(this, url, options);
  42852. /**
  42853. * @member {string} OverlayAnalystService.prototype.mode
  42854. * @description 叠加分析类型
  42855. */
  42856. _this.mode = null;
  42857. if (options) {
  42858. Util_Util.extend(OverlayAnalystService_assertThisInitialized(_this), options);
  42859. }
  42860. _this.CLASS_NAME = "SuperMap.OverlayAnalystService";
  42861. return _this;
  42862. }
  42863. /**
  42864. * @override
  42865. */
  42866. OverlayAnalystService_createClass(OverlayAnalystService, [{
  42867. key: "destroy",
  42868. value: function destroy() {
  42869. OverlayAnalystService_get(OverlayAnalystService_getPrototypeOf(OverlayAnalystService.prototype), "destroy", this).call(this);
  42870. this.mode = null;
  42871. }
  42872. /**
  42873. * @function OverlayAnalystService.prototype.processAsync
  42874. * @description 负责将客户端的查询参数传递到服务端。
  42875. * @param {OverlayAnalystParameters} parameter - 叠加分析参数类。
  42876. */
  42877. }, {
  42878. key: "processAsync",
  42879. value: function processAsync(parameter) {
  42880. var parameterObject = {};
  42881. var me = this;
  42882. if (parameter instanceof DatasetOverlayAnalystParameters) {
  42883. me.mode = "datasets";
  42884. me.url = Util_Util.urlPathAppend(me.url, 'datasets/' + parameter.sourceDataset + '/overlay');
  42885. DatasetOverlayAnalystParameters.toObject(parameter, parameterObject);
  42886. } else if (parameter instanceof GeometryOverlayAnalystParameters) {
  42887. me.mode = "geometry";
  42888. //支持传入多个几何要素进行叠加分析
  42889. if (parameter.operateGeometries && parameter.sourceGeometries) {
  42890. me.url = Util_Util.urlPathAppend(me.url, 'geometry/overlay/batch');
  42891. me.url = Util_Util.urlAppend(me.url, 'ignoreAnalystParam=true');
  42892. } else {
  42893. me.url = Util_Util.urlPathAppend(me.url, 'geometry/overlay');
  42894. }
  42895. GeometryOverlayAnalystParameters.toObject(parameter, parameterObject);
  42896. }
  42897. this.returnContent = true;
  42898. var jsonParameters = Util_Util.toJSON(parameterObject);
  42899. me.request({
  42900. method: "POST",
  42901. data: jsonParameters,
  42902. scope: me,
  42903. success: me.serviceProcessCompleted,
  42904. failure: me.serviceProcessFailed
  42905. });
  42906. }
  42907. }, {
  42908. key: "dataFormat",
  42909. value: function dataFormat() {
  42910. return [DataFormat.GEOJSON, DataFormat.ISERVER, DataFormat.FGB];
  42911. }
  42912. }]);
  42913. return OverlayAnalystService;
  42914. }(SpatialAnalystBase);
  42915. ;// CONCATENATED MODULE: ./src/common/iServer/RouteCalculateMeasureParameters.js
  42916. function RouteCalculateMeasureParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  42917. function RouteCalculateMeasureParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  42918. function RouteCalculateMeasureParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) RouteCalculateMeasureParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) RouteCalculateMeasureParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  42919. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  42920. * This program are made available under the terms of the Apache License, Version 2.0
  42921. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  42922. /**
  42923. * @class RouteCalculateMeasureParameters
  42924. * @deprecatedclass SuperMap.RouteCalculateMeasureParameters
  42925. * @category iServer SpatialAnalyst RouteCalculateMeasure
  42926. * @classdesc 基于路由对象计算指定点 M 值操作的参数类。通过该类提供参数信息。
  42927. * @param {Object} options - 参数。
  42928. * @param {(Route|L.Polyline|ol.geom.LineString|GeoJSONObject)} options.sourceRoute - 路由对象。该对象可以是用户自己生成或在数据源中查询得到的符合标准的路由对象。
  42929. * @param {GeometryPoint|L.LatLng|L.Point|ol.geom.Point|mapboxgl.LngLat|Array.<number>} options.point - 二维地理坐标点对象,包含 x,y 坐标值属性的对象。
  42930. * @param {number} [options.tolerance] - 容限值。
  42931. * @param {boolean} [options.isIgnoreGap=false] - 是否忽略子对象之间的距离。
  42932. * @usage
  42933. */
  42934. var RouteCalculateMeasureParameters = /*#__PURE__*/function () {
  42935. function RouteCalculateMeasureParameters(options) {
  42936. RouteCalculateMeasureParameters_classCallCheck(this, RouteCalculateMeasureParameters);
  42937. if (!options) {
  42938. return this;
  42939. }
  42940. /**
  42941. * @member {(Route|L.Polyline|ol.geom.LineString|GeoJSONObject)} RouteCalculateMeasureParameters.prototype.sourceRoute
  42942. * @description 路由对象。该对象可以是用户自己生成或在数据源中查询得到的符合标准的路由对象。
  42943. */
  42944. this.sourceRoute = null;
  42945. /**
  42946. * @member {GeometryPoint|L.LatLng|L.Point|ol.geom.Point|mapboxgl.LngLat|Array.<number>} RouteCalculateMeasureParameters.prototype.point
  42947. * @description 二维地理坐标点对象,包含 x,y 坐标值属性的对象。
  42948. */
  42949. this.point = null;
  42950. /**
  42951. * @member {number} [RouteCalculateMeasureParameters.prototype.tolerance]
  42952. * @description 容限值。
  42953. */
  42954. this.tolerance = null;
  42955. /**
  42956. * @member {boolean} [RouteCalculateMeasureParameters.prototype.isIgnoreGap=false]
  42957. * @description 是否忽略子对象之间的距离。
  42958. */
  42959. this.isIgnoreGap = false;
  42960. Util_Util.extend(this, options);
  42961. this.CLASS_NAME = "SuperMap.RouteCalculateMeasureParameters";
  42962. }
  42963. /**
  42964. * @function RouteCalculateMeasureParameters.prototype.destroy
  42965. * @description 释放资源,将引用资源的属性置空。
  42966. */
  42967. RouteCalculateMeasureParameters_createClass(RouteCalculateMeasureParameters, [{
  42968. key: "destroy",
  42969. value: function destroy() {
  42970. var me = this;
  42971. me.sourceRoute = null;
  42972. me.point = null;
  42973. if (me.tolerance) {
  42974. me.tolerance = null;
  42975. }
  42976. if (me.isIgnoreGap) {
  42977. me.isIgnoreGap = false;
  42978. }
  42979. }
  42980. }]);
  42981. return RouteCalculateMeasureParameters;
  42982. }();
  42983. ;// CONCATENATED MODULE: ./src/common/iServer/RouteCalculateMeasureService.js
  42984. function RouteCalculateMeasureService_typeof(obj) { "@babel/helpers - typeof"; return RouteCalculateMeasureService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, RouteCalculateMeasureService_typeof(obj); }
  42985. function RouteCalculateMeasureService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  42986. function RouteCalculateMeasureService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  42987. function RouteCalculateMeasureService_createClass(Constructor, protoProps, staticProps) { if (protoProps) RouteCalculateMeasureService_defineProperties(Constructor.prototype, protoProps); if (staticProps) RouteCalculateMeasureService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  42988. function RouteCalculateMeasureService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { RouteCalculateMeasureService_get = Reflect.get.bind(); } else { RouteCalculateMeasureService_get = function _get(target, property, receiver) { var base = RouteCalculateMeasureService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return RouteCalculateMeasureService_get.apply(this, arguments); }
  42989. function RouteCalculateMeasureService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = RouteCalculateMeasureService_getPrototypeOf(object); if (object === null) break; } return object; }
  42990. function RouteCalculateMeasureService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) RouteCalculateMeasureService_setPrototypeOf(subClass, superClass); }
  42991. function RouteCalculateMeasureService_setPrototypeOf(o, p) { RouteCalculateMeasureService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return RouteCalculateMeasureService_setPrototypeOf(o, p); }
  42992. function RouteCalculateMeasureService_createSuper(Derived) { var hasNativeReflectConstruct = RouteCalculateMeasureService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = RouteCalculateMeasureService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = RouteCalculateMeasureService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return RouteCalculateMeasureService_possibleConstructorReturn(this, result); }; }
  42993. function RouteCalculateMeasureService_possibleConstructorReturn(self, call) { if (call && (RouteCalculateMeasureService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return RouteCalculateMeasureService_assertThisInitialized(self); }
  42994. function RouteCalculateMeasureService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  42995. function RouteCalculateMeasureService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  42996. function RouteCalculateMeasureService_getPrototypeOf(o) { RouteCalculateMeasureService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return RouteCalculateMeasureService_getPrototypeOf(o); }
  42997. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  42998. * This program are made available under the terms of the Apache License, Version 2.0
  42999. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  43000. /**
  43001. * @class RouteCalculateMeasureService
  43002. * @deprecatedclass SuperMap.RouteCalculateMeasureService
  43003. * @category iServer SpatialAnalyst RouteCalculateMeasure
  43004. * @classdesc 基于路由对象计算指定点 M 值操作的服务类。
  43005. * 该类负责将客户设置的计算指定点的 M 值参数传递给服务端,并接收服务端返回的
  43006. * 指定点的 M 值。通过该类支持的事件的监听函数参数获取。
  43007. * @extends {SpatialAnalystBase}
  43008. * @param {string} url - 服务地址。如 http://localhost:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst
  43009. * @param {Object} options - 参数。
  43010. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  43011. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  43012. * @param {Object} [options.headers] - 请求头。
  43013. * @example 实例化该类如下例所示:
  43014. * (start code)
  43015. * var parameters = new RouteCalculateMeasureParameters({
  43016. * "sourceRoute":{
  43017. * "type":"LINEM",
  43018. * "parts":[4],
  43019. * "points":[
  43020. * {
  43021. * "measure":0,
  43022. * "y":-6674.466867067764,
  43023. * "x":3817.3527876130133
  43024. * },
  43025. * {
  43026. * "measure":199.57954019411724,
  43027. * "y":-6670.830929417594,
  43028. * "x":3617.806369901496
  43029. * },
  43030. * {
  43031. * "measure":609.3656478634477,
  43032. * "y":-6877.837541432356,
  43033. * "x":3264.1498746678444
  43034. * },
  43035. * {
  43036. * "measure":936.0174126282958,
  43037. * "y":-7038.687780615184,
  43038. * "x":2979.846206068903
  43039. * }
  43040. * ]
  43041. * },
  43042. * "tolerance":1,
  43043. * "point":{
  43044. * "x":3330.7754269417,
  43045. * "y":-6838.8394457216
  43046. * },
  43047. * "isIgnoreGap":false
  43048. * });
  43049. *
  43050. * var routeCalculateMeasureService = new RouteCalculateMeasureService(spatialAnalystURL, {
  43051. * eventListeners:{
  43052. * processCompleted:calculateCompleted,
  43053. * processFailed:calculateFailded
  43054. * }
  43055. * );
  43056. * routeCalculateMeasureService.processAsync(parameters);
  43057. *
  43058. * //执行
  43059. * function calculateCompleted(){todo}
  43060. * function calculateFailded(){todo}
  43061. * (end)
  43062. * @usage
  43063. */
  43064. var RouteCalculateMeasureService = /*#__PURE__*/function (_SpatialAnalystBase) {
  43065. RouteCalculateMeasureService_inherits(RouteCalculateMeasureService, _SpatialAnalystBase);
  43066. var _super = RouteCalculateMeasureService_createSuper(RouteCalculateMeasureService);
  43067. function RouteCalculateMeasureService(url, options) {
  43068. var _this;
  43069. RouteCalculateMeasureService_classCallCheck(this, RouteCalculateMeasureService);
  43070. _this = _super.call(this, url, options);
  43071. _this.CLASS_NAME = "SuperMap.RouteCalculateMeasureService";
  43072. return _this;
  43073. }
  43074. /**
  43075. * @override
  43076. */
  43077. RouteCalculateMeasureService_createClass(RouteCalculateMeasureService, [{
  43078. key: "destroy",
  43079. value: function destroy() {
  43080. RouteCalculateMeasureService_get(RouteCalculateMeasureService_getPrototypeOf(RouteCalculateMeasureService.prototype), "destroy", this).call(this);
  43081. }
  43082. /**
  43083. * @function RouteCalculateMeasureService.prototype.processAsync
  43084. * @description 负责将客户端的基于路由对象计算指定点 M 值操作的参数传递到服务端。
  43085. * @param {RouteCalculateMeasureParameters} params - 基于路由对象计算指定点 M 值操作的参数类。
  43086. */
  43087. }, {
  43088. key: "processAsync",
  43089. value: function processAsync(params) {
  43090. if (!(params instanceof RouteCalculateMeasureParameters)) {
  43091. return;
  43092. }
  43093. var me = this,
  43094. jsonParameters;
  43095. jsonParameters = me.getJsonParameters(params);
  43096. me.request({
  43097. method: "POST",
  43098. data: jsonParameters,
  43099. scope: me,
  43100. success: me.serviceProcessCompleted,
  43101. failure: me.serviceProcessFailed
  43102. });
  43103. }
  43104. /**
  43105. * @function RouteCalculateMeasureService.prototype.getJsonParameters
  43106. * @description 将参数转化为 JSON 字符串。
  43107. * @param {RouteCalculateMeasureParameters} params - 基于路由对象计算指定点 M 值操作的参数类。
  43108. * @returns {Object} 转化后的 JSON 字符串。
  43109. */
  43110. }, {
  43111. key: "getJsonParameters",
  43112. value: function getJsonParameters(params) {
  43113. var jsonParameters,
  43114. jsonStr = "geometry/calculatemeasure",
  43115. me = this;
  43116. me.url = Util_Util.urlPathAppend(me.url, jsonStr);
  43117. me.url = Util_Util.urlAppend(me.url, 'returnContent=true');
  43118. jsonParameters = Util_Util.toJSON(params);
  43119. return jsonParameters;
  43120. }
  43121. }]);
  43122. return RouteCalculateMeasureService;
  43123. }(SpatialAnalystBase);
  43124. ;// CONCATENATED MODULE: ./src/common/iServer/RouteLocatorParameters.js
  43125. function RouteLocatorParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  43126. function RouteLocatorParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  43127. function RouteLocatorParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) RouteLocatorParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) RouteLocatorParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  43128. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  43129. * This program are made available under the terms of the Apache License, Version 2.0
  43130. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  43131. /**
  43132. * @class RouteLocatorParameters
  43133. * @deprecatedclass SuperMap.RouteLocatorParameters
  43134. * @category iServer SpatialAnalyst RouteLocator
  43135. * @classdesc 路由对象定位空间对象的参数类。
  43136. * 参数有两种方式,分别为 Geometry 和 Dataset 两种,前者需要指定 sourceRoute 对象作为参数,后者需要 dataset,routeIDField,routeID 三个参数。如果用户两种参数均设置,优先选择 Dataset 方式。
  43137. * @param {Object} options - 参数。
  43138. * @param {(Route|L.Polyline|ol.geom.LineString|GeoJSONObject)} options.sourceRoute - 路由对象。
  43139. * @param {number} options.measure - 定位点的 M 值。只当路由对象定位点时有意义。
  43140. * @param {string} [options.type] - 类型:点 or 线。
  43141. * @param {number} [options.offset=0] - 定位点偏移量。只当路由对象定位点时有意义。
  43142. * @param {boolean} [options.isIgnoreGap=false] - 是否忽略子对象之间的距离。即不忽略子对象之间的距离。
  43143. * @param {number} [options.startMeasure] - 定位线的起始 M 值。只当路由对象定位线时有意义。
  43144. * @param {number} [options.endMeasure] - 定位线的终止 M 值。只当路由对象定位线时有意义。
  43145. * @usage
  43146. */
  43147. var RouteLocatorParameters = /*#__PURE__*/function () {
  43148. function RouteLocatorParameters(options) {
  43149. RouteLocatorParameters_classCallCheck(this, RouteLocatorParameters);
  43150. if (!options) {
  43151. return this;
  43152. }
  43153. /**
  43154. * @member {(Route|L.Polyline|ol.geom.LineString|GeoJSONObject)} RouteLocatorParameters.prototype.sourceRoute
  43155. * @description 路由对象。
  43156. */
  43157. this.sourceRoute = null;
  43158. /**
  43159. * @member {string} RouteLocatorParameters.prototype.dataset
  43160. * @description 要用来做缓冲区分析的数据源中数据集的名称。该名称用形如"数据集名称@数据源别名"形式来表示。
  43161. */
  43162. this.dataset = null;
  43163. /**
  43164. * @member {string} RouteLocatorParameters.prototype.routeIDField
  43165. * @description 路由对象所在的字段名称。
  43166. *
  43167. */
  43168. this.routeIDField = null;
  43169. /**
  43170. * @member {number} RouteLocatorParameters.prototype.routeID
  43171. * @description 路由对象标识。
  43172. *
  43173. */
  43174. this.routeID = null;
  43175. /**
  43176. * @member {string} [RouteLocatorParameters.prototype.type]
  43177. * @description 类型:点 or 线。
  43178. * 可选值为:
  43179. * LINE :根据起始 M 值及终止 M 值定位线对象。
  43180. * POINT : 根据 M 值定位点对象。
  43181. */
  43182. this.type = null;
  43183. /**
  43184. * @member {number} RouteLocatorParameters.prototype.measure
  43185. * @description 定位点的 M 值。只当路由对象定位点时有意义。
  43186. */
  43187. this.measure = null;
  43188. /**
  43189. * @member {number} [RouteLocatorParameters.prototype.offset=0]
  43190. * @description 定位点偏移量。只当路由对象定位点时有意义。
  43191. */
  43192. this.offset = 0;
  43193. /**
  43194. * @member {boolean} [RouteLocatorParameters.prototype.isIgnoreGap=false]
  43195. * @description 是否忽略子对象之间的距离。
  43196. */
  43197. this.isIgnoreGap = false;
  43198. /**
  43199. * @member {number} [RouteLocatorParameters.prototype.startMeasure]
  43200. * @description 定位线的起始 M 值。只当路由对象定位线时有意义。
  43201. */
  43202. this.startMeasure = null;
  43203. /**
  43204. * @member {number} [RouteLocatorParameters.prototype.endMeasure]
  43205. * @description 定位线的终止 M 值。只当路由对象定位线时有意义。
  43206. */
  43207. this.endMeasure = null;
  43208. var routeFromClient = options.sourceRoute;
  43209. var routeHandle = {};
  43210. if (routeFromClient && routeFromClient instanceof Geometry_Geometry && routeFromClient.components) {
  43211. routeHandle.type = routeFromClient.type;
  43212. routeHandle.parts = routeFromClient.parts;
  43213. var parts = [];
  43214. for (var i = 0, len = routeFromClient.components.length; i < len; i++) {
  43215. parts = parts.concat(routeFromClient.components[i].components);
  43216. }
  43217. routeHandle.points = parts;
  43218. options.sourceRoute = routeHandle;
  43219. }
  43220. Util_Util.extend(this, options);
  43221. this.CLASS_NAME = "SuperMap.RouteLocatorParameters";
  43222. }
  43223. /**
  43224. * @function RouteLocatorParameters.prototype.destroy
  43225. * @description 释放资源,将引用资源的属性置空。
  43226. */
  43227. RouteLocatorParameters_createClass(RouteLocatorParameters, [{
  43228. key: "destroy",
  43229. value: function destroy() {
  43230. var me = this;
  43231. me.sourceRoute = null;
  43232. me.type = null;
  43233. me.measure = null;
  43234. me.offset = 0;
  43235. me.isIgnoreGap = false;
  43236. me.startMeasure = null;
  43237. me.endMeasure = null;
  43238. me.dataset = null;
  43239. me.routeID = null;
  43240. me.routeIDField = null;
  43241. }
  43242. }]);
  43243. return RouteLocatorParameters;
  43244. }();
  43245. ;// CONCATENATED MODULE: ./src/common/iServer/RouteLocatorService.js
  43246. function RouteLocatorService_typeof(obj) { "@babel/helpers - typeof"; return RouteLocatorService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, RouteLocatorService_typeof(obj); }
  43247. function RouteLocatorService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  43248. function RouteLocatorService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  43249. function RouteLocatorService_createClass(Constructor, protoProps, staticProps) { if (protoProps) RouteLocatorService_defineProperties(Constructor.prototype, protoProps); if (staticProps) RouteLocatorService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  43250. function RouteLocatorService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { RouteLocatorService_get = Reflect.get.bind(); } else { RouteLocatorService_get = function _get(target, property, receiver) { var base = RouteLocatorService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return RouteLocatorService_get.apply(this, arguments); }
  43251. function RouteLocatorService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = RouteLocatorService_getPrototypeOf(object); if (object === null) break; } return object; }
  43252. function RouteLocatorService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) RouteLocatorService_setPrototypeOf(subClass, superClass); }
  43253. function RouteLocatorService_setPrototypeOf(o, p) { RouteLocatorService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return RouteLocatorService_setPrototypeOf(o, p); }
  43254. function RouteLocatorService_createSuper(Derived) { var hasNativeReflectConstruct = RouteLocatorService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = RouteLocatorService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = RouteLocatorService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return RouteLocatorService_possibleConstructorReturn(this, result); }; }
  43255. function RouteLocatorService_possibleConstructorReturn(self, call) { if (call && (RouteLocatorService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return RouteLocatorService_assertThisInitialized(self); }
  43256. function RouteLocatorService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  43257. function RouteLocatorService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  43258. function RouteLocatorService_getPrototypeOf(o) { RouteLocatorService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return RouteLocatorService_getPrototypeOf(o); }
  43259. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  43260. * This program are made available under the terms of the Apache License, Version 2.0
  43261. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  43262. /**
  43263. * @class RouteLocatorService
  43264. * @deprecatedclass SuperMap.RouteLocatorService
  43265. * @category iServer SpatialAnalyst RouteLocator
  43266. * @classdesc 路由对象定位空间对象的服务类。
  43267. * @extends {SpatialAnalystBase}
  43268. * @param {string} url -服务地址。如 http://localhost:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst。
  43269. * @param {Object} options - 参数。
  43270. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  43271. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  43272. * @param {Object} [options.headers] - 请求头。
  43273. * @example 实例化该类如下例所示:
  43274. * (start code)
  43275. * var routeLocatorParameters_point = new RouteLocatorParameters({
  43276. * "sourceRoute":{
  43277. * "type":"LINEM",
  43278. * "parts":[4],
  43279. * "points":[
  43280. * {
  43281. * "measure":0,
  43282. * "y":-6674.466867067764,
  43283. * "x":3817.3527876130133
  43284. * },
  43285. * {
  43286. * "measure":199.57954019411724,
  43287. * "y":-6670.830929417594,
  43288. * "x":3617.806369901496
  43289. * },
  43290. * {
  43291. * "measure":609.3656478634477,
  43292. * "y":-6877.837541432356,
  43293. * "x":3264.1498746678444
  43294. * },
  43295. * {
  43296. * "measure":936.0174126282958,
  43297. * "y":-7038.687780615184,
  43298. * "x":2979.846206068903
  43299. * }
  43300. * ]
  43301. * },
  43302. * "type":"POINT",
  43303. * "measure":10,
  43304. * "offset":3,
  43305. * "isIgnoreGap":true
  43306. * });
  43307. * var routeLocatorService = new RouteLocatorService(spatialAnalystURL, {
  43308. * eventListeners:{
  43309. * processCompleted:routeLocatorCompleted,
  43310. * processFailed:routeLocatorFailded
  43311. * }
  43312. * );
  43313. * routeLocatorService.processAsync(routeLocatorParameters_point);
  43314. *
  43315. * //执行
  43316. * function routeLocatorCompleted(){todo}
  43317. * function routeLocatorFailded(){todo}
  43318. * (end)
  43319. * @usage
  43320. */
  43321. var RouteLocatorService = /*#__PURE__*/function (_SpatialAnalystBase) {
  43322. RouteLocatorService_inherits(RouteLocatorService, _SpatialAnalystBase);
  43323. var _super = RouteLocatorService_createSuper(RouteLocatorService);
  43324. function RouteLocatorService(url, options) {
  43325. var _this;
  43326. RouteLocatorService_classCallCheck(this, RouteLocatorService);
  43327. _this = _super.call(this, url, options);
  43328. _this.CLASS_NAME = "SuperMap.RouteLocatorService";
  43329. return _this;
  43330. }
  43331. /**
  43332. * @override
  43333. */
  43334. RouteLocatorService_createClass(RouteLocatorService, [{
  43335. key: "destroy",
  43336. value: function destroy() {
  43337. RouteLocatorService_get(RouteLocatorService_getPrototypeOf(RouteLocatorService.prototype), "destroy", this).call(this);
  43338. }
  43339. /**
  43340. * @function RouteLocatorService.prototype.processAsync
  43341. * @description 负责将客户端的基于路由对象计算指定点 M 值操作的参数传递到服务端。
  43342. * @param {RouteLocatorParameters} params - 路由对象定位空间对象的参数类。
  43343. */
  43344. }, {
  43345. key: "processAsync",
  43346. value: function processAsync(params) {
  43347. if (!(params instanceof RouteLocatorParameters)) {
  43348. return;
  43349. }
  43350. var me = this,
  43351. jsonParameters;
  43352. jsonParameters = me.getJsonParameters(params);
  43353. me.request({
  43354. method: "POST",
  43355. data: jsonParameters,
  43356. scope: me,
  43357. success: me.serviceProcessCompleted,
  43358. failure: me.serviceProcessFailed
  43359. });
  43360. }
  43361. /**
  43362. * @function RouteLocatorService.prototype.processAsync
  43363. * @description 将参数转化为 JSON 字符串。
  43364. * @param {RouteLocatorParameters} params - 路由对象定位空间对象的参数类。
  43365. * @returns {Object} 转化后的JSON字符串。
  43366. */
  43367. }, {
  43368. key: "getJsonParameters",
  43369. value: function getJsonParameters(params) {
  43370. var jsonParameters,
  43371. jsonStr = "geometry/routelocator",
  43372. me = this;
  43373. if (params.dataset) {
  43374. jsonStr = "datasets/" + params.dataset + "/linearreferencing/routelocator";
  43375. params.sourceRoute = null;
  43376. }
  43377. me.url = Util_Util.urlPathAppend(me.url, jsonStr);
  43378. me.url = Util_Util.urlAppend(me.url, 'returnContent=true');
  43379. jsonParameters = Util_Util.toJSON(params);
  43380. return jsonParameters;
  43381. }
  43382. }]);
  43383. return RouteLocatorService;
  43384. }(SpatialAnalystBase);
  43385. ;// CONCATENATED MODULE: ./src/common/iServer/SurfaceAnalystParametersSetting.js
  43386. function SurfaceAnalystParametersSetting_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  43387. function SurfaceAnalystParametersSetting_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  43388. function SurfaceAnalystParametersSetting_createClass(Constructor, protoProps, staticProps) { if (protoProps) SurfaceAnalystParametersSetting_defineProperties(Constructor.prototype, protoProps); if (staticProps) SurfaceAnalystParametersSetting_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  43389. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  43390. * This program are made available under the terms of the Apache License, Version 2.0
  43391. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  43392. /**
  43393. * @class SurfaceAnalystParametersSetting
  43394. * @deprecatedclass SuperMap.SurfaceAnalystParametersSetting
  43395. * @category iServer SpatialAnalyst SurfaceAnalyst
  43396. * @classdesc 表面分析参数设置类。
  43397. * 通过该类可以设置表面分析提取等值线、提取等值面的一些参数,包括基准值、等值距、光滑度、光滑方法等。
  43398. * @param {Object} options - 参数。
  43399. * @param {GeometryPolygon|L.Polygon|ol.geom.Polygon|GeoJSONObject} [options.clipRegion] - 裁剪面对象,如果不需要对操作结果进行裁剪,可以使用 null 值取代该参数。
  43400. * @param {number} [options.datumValue=0] - 提取等值线、提取等值面的基准值。
  43401. * @param {Array.<number>} options.expectedZValues - 期望分析结果的 Z 值集合。
  43402. * @param {number} [options.interval=0] - 等值距。等值距是两条等值线之间的间隔值。
  43403. * @param {number} [options.resampleTolerance=0] - 重采样容限。
  43404. * @param {SmoothMethod} [options.smoothMethod=SmoothMethod.BSPLINE] - 光滑处理所使用的方法。
  43405. * @param {number} [options.smoothness=0] - 等值线或等值面的边界线的光滑度。
  43406. * @usage
  43407. */
  43408. var SurfaceAnalystParametersSetting = /*#__PURE__*/function () {
  43409. function SurfaceAnalystParametersSetting(options) {
  43410. SurfaceAnalystParametersSetting_classCallCheck(this, SurfaceAnalystParametersSetting);
  43411. /**
  43412. * @member {GeometryPolygon|L.Polygon|ol.geom.Polygon|GeoJSONObject} [SurfaceAnalystParametersSetting.prototype.clipRegion]
  43413. * @description 获取或设置裁剪面对象,如果不需要对操作结果进行裁剪,可以使用 null 值取代该参数。
  43414. */
  43415. this.clipRegion = null;
  43416. /**
  43417. * @member {number} [SurfaceAnalystParametersSetting.prototype.datumValue=0]
  43418. * @description 获取或设置表面分析中提取等值线、提取等值面的基准值。
  43419. * 基准值是作为一个生成等值线的初始起算值,并不一定是最小等值线的值。例如,高程范围为 220 -1550 的 DEM 栅格数据,
  43420. * 如果设基准值为 0,等值距为 50,则提取等值线时,以基准值 0 为起点,等值距 50 为间隔提取等值线,
  43421. * 因为给定高程的最小值是 220,所以,在给定范围内提取等值线的最小高程是 250。
  43422. * 提取等值线的结果是:最小等值线值为 250,最大等值线值为 1550。
  43423. */
  43424. this.datumValue = 0;
  43425. /**
  43426. * @member {Array.<number>} SurfaceAnalystParametersSetting.prototype.expectedZValues
  43427. * @description 获取或设置期望分析结果的 Z 值集合。
  43428. * Z 值集合存储一系列数值,该数值为待提取等值线的值。即仅高程值在 Z 值集合中的等值线会被提取。
  43429. */
  43430. this.expectedZValues = null;
  43431. /**
  43432. * @member {number} [SurfaceAnalystParametersSetting.prototype.interval=0]
  43433. * @description 获取或设置等值距。等值距是两条等值线之间的间隔值。
  43434. */
  43435. this.interval = 0;
  43436. /**
  43437. * @member {number} [SurfaceAnalystParametersSetting.prototype.resampleTolerance=0]
  43438. * @description 获取或设置重采样容限。
  43439. * 容限值越大,采样结果数据越简化。当分析结果出现交叉时,可通过调整重采样容限为较小的值来处理。
  43440. */
  43441. this.resampleTolerance = 0;
  43442. /**
  43443. * @member {SmoothMethod} [SurfaceAnalystParametersSetting.prototype.smoothMethod=SmoothMethod.BSPLINE]
  43444. * @description 获取或设置光滑处理所使用的方法。
  43445. */
  43446. this.smoothMethod = SmoothMethod.BSPLINE;
  43447. /**
  43448. * @member {number} [SurfaceAnalystParametersSetting.prototype.smoothness=0]
  43449. * @description 获取或设置表面分析中等值线或等值面的边界线的光滑度。
  43450. * 以为 0-5 为例,光滑度为 0 表示不进行光滑操作,值越大表示光滑度越高。
  43451. * 随着光滑度的增加,提取的等值线越光滑,当然光滑度越大,
  43452. * 计算所需的时间和占用的内存也就越大。而且,当等值距较小时,
  43453. * 光滑度太高会出现等值线相交的问题。
  43454. */
  43455. this.smoothness = 0;
  43456. if (options) {
  43457. Util_Util.extend(this, options);
  43458. }
  43459. this.CLASS_NAME = "SuperMap.SurfaceAnalystParametersSetting";
  43460. }
  43461. /**
  43462. * @function SurfaceAnalystParametersSetting.prototype.destroy
  43463. * @description 释放资源,将引用资源的属性置空。
  43464. */
  43465. SurfaceAnalystParametersSetting_createClass(SurfaceAnalystParametersSetting, [{
  43466. key: "destroy",
  43467. value: function destroy() {
  43468. var me = this;
  43469. if (me.clipRegion) {
  43470. me.clipRegion.destroy();
  43471. me.clipRegion = null;
  43472. }
  43473. me.datumValue = null;
  43474. me.expectedZValues = null;
  43475. me.interval = null;
  43476. me.resampleTolerance = null;
  43477. me.smoothMethod = null;
  43478. me.smoothness = null;
  43479. }
  43480. /**
  43481. * @function SurfaceAnalystParametersSetting.prototype.toJSON
  43482. * @description 将对象转化为 JSON 字符串。
  43483. * @returns {string} 对象 JSON 字符串。
  43484. */
  43485. }, {
  43486. key: "toJSON",
  43487. value: function toJSON() {
  43488. var json = "'datumValue':" + Util_Util.toJSON(this.datumValue);
  43489. json += ",'interval':" + Util_Util.toJSON(this.interval);
  43490. json += ",'resampleTolerance':" + Util_Util.toJSON(this.resampleTolerance);
  43491. json += ",'smoothMethod':" + Util_Util.toJSON(this.smoothMethod);
  43492. json += ",'smoothness':" + Util_Util.toJSON(this.smoothness);
  43493. if (this.expectedZValues != null) {
  43494. json += "," + "'expectedZValues':" + Util_Util.toJSON(this.expectedZValues);
  43495. }
  43496. if (this.clipRegion != null) {
  43497. var serverGeometry = this.clipRegion;
  43498. if (this.clipRegion instanceof Geometry_Geometry && this.clipRegion.components) {
  43499. serverGeometry = ServerGeometry.fromGeometry(this.clipRegion);
  43500. }
  43501. json += ",'clipRegion':" + Util_Util.toJSON(serverGeometry);
  43502. }
  43503. return "{" + json + "}";
  43504. }
  43505. }]);
  43506. return SurfaceAnalystParametersSetting;
  43507. }();
  43508. ;// CONCATENATED MODULE: ./src/common/iServer/SurfaceAnalystParameters.js
  43509. function SurfaceAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  43510. function SurfaceAnalystParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  43511. function SurfaceAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) SurfaceAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) SurfaceAnalystParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  43512. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  43513. * This program are made available under the terms of the Apache License, Version 2.0
  43514. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  43515. /**
  43516. * @class SurfaceAnalystParameters
  43517. * @deprecatedclass SuperMap.SurfaceAnalystParameters
  43518. * @category iServer SpatialAnalyst SurfaceAnalyst
  43519. * @classdesc 表面分析提取操作参数类。通过该类可以为进行表面分析提供参数信息,包括表面分析的方法提取等值线、提取等值面和中间结果的分辨率,
  43520. * {@link DatasetSurfaceAnalystParameters} 和 {@link GeometrySurfaceAnalystParameters} 继承自该类。
  43521. * @param {Object} options - 参数。
  43522. * @param {SurfaceAnalystParametersSetting} options.extractParameter - 表面分析参数设置类。
  43523. * @param {number} options.resolution - 指定中间结果(栅格数据集)的分辨率。
  43524. * @param {DataReturnOption} options.resultSetting - 结果返回设置类。
  43525. * @param {SurfaceAnalystMethod} [options.surfaceAnalystMethod=SurfaceAnalystMethod.ISOLINE] - 获取或设置表面分析的提取方法,提取等值线和提取等值面。
  43526. * @usage
  43527. */
  43528. var SurfaceAnalystParameters = /*#__PURE__*/function () {
  43529. function SurfaceAnalystParameters(options) {
  43530. SurfaceAnalystParameters_classCallCheck(this, SurfaceAnalystParameters);
  43531. /**
  43532. * @member {number} SurfaceAnalystParameters.prototype.resolution
  43533. * @description 获取或设置指定中间结果(栅格数据集)的分辨率。
  43534. */
  43535. this.resolution = 0;
  43536. /**
  43537. * @member {SurfaceAnalystParametersSetting} SurfaceAnalystParameters.prototype.extractParameter
  43538. * @description 获取或设置表面分析参数。
  43539. * 在进行点数据集进行提取等值面分析时,暂时不支持 SurfaceAnalystParametersSetting 类中的 expectedZValues 字段。
  43540. */
  43541. this.extractParameter = new SurfaceAnalystParametersSetting();
  43542. /**
  43543. * @member {DataReturnOption} SurfaceAnalystParameters.prototype.resultSetting
  43544. * @description 结果返回设置类。
  43545. */
  43546. this.resultSetting = new DataReturnOption();
  43547. /**
  43548. * @member {SurfaceAnalystMethod} [SurfaceAnalystParameters.prototype.surfaceAnalystMethod=SurfaceAnalystMethod.ISOLINE]
  43549. * @description 获取或设置表面分析的提取方法,提取等值线和提取等值面。
  43550. */
  43551. this.surfaceAnalystMethod = SurfaceAnalystMethod.ISOLINE;
  43552. if (options) {
  43553. Util_Util.extend(this, options);
  43554. }
  43555. this.CLASS_NAME = "SuperMap.SurfaceAnalystParameters";
  43556. }
  43557. /**
  43558. * @function SurfaceAnalystParameters.prototype.destroy
  43559. * @description 释放资源,将引用资源的属性置空。
  43560. */
  43561. SurfaceAnalystParameters_createClass(SurfaceAnalystParameters, [{
  43562. key: "destroy",
  43563. value: function destroy() {
  43564. var me = this;
  43565. me.resolution = null;
  43566. if (me.extractParameter) {
  43567. me.extractParameter.destroy();
  43568. me.extractParameter = null;
  43569. }
  43570. if (me.resultSetting) {
  43571. me.resultSetting.destroy();
  43572. me.resultSetting = null;
  43573. }
  43574. me.surfaceAnalystMethod = null;
  43575. }
  43576. }]);
  43577. return SurfaceAnalystParameters;
  43578. }();
  43579. ;// CONCATENATED MODULE: ./src/common/iServer/DatasetSurfaceAnalystParameters.js
  43580. function DatasetSurfaceAnalystParameters_typeof(obj) { "@babel/helpers - typeof"; return DatasetSurfaceAnalystParameters_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, DatasetSurfaceAnalystParameters_typeof(obj); }
  43581. function DatasetSurfaceAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  43582. function DatasetSurfaceAnalystParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  43583. function DatasetSurfaceAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) DatasetSurfaceAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) DatasetSurfaceAnalystParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  43584. function DatasetSurfaceAnalystParameters_get() { if (typeof Reflect !== "undefined" && Reflect.get) { DatasetSurfaceAnalystParameters_get = Reflect.get.bind(); } else { DatasetSurfaceAnalystParameters_get = function _get(target, property, receiver) { var base = DatasetSurfaceAnalystParameters_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return DatasetSurfaceAnalystParameters_get.apply(this, arguments); }
  43585. function DatasetSurfaceAnalystParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = DatasetSurfaceAnalystParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  43586. function DatasetSurfaceAnalystParameters_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) DatasetSurfaceAnalystParameters_setPrototypeOf(subClass, superClass); }
  43587. function DatasetSurfaceAnalystParameters_setPrototypeOf(o, p) { DatasetSurfaceAnalystParameters_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return DatasetSurfaceAnalystParameters_setPrototypeOf(o, p); }
  43588. function DatasetSurfaceAnalystParameters_createSuper(Derived) { var hasNativeReflectConstruct = DatasetSurfaceAnalystParameters_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = DatasetSurfaceAnalystParameters_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = DatasetSurfaceAnalystParameters_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return DatasetSurfaceAnalystParameters_possibleConstructorReturn(this, result); }; }
  43589. function DatasetSurfaceAnalystParameters_possibleConstructorReturn(self, call) { if (call && (DatasetSurfaceAnalystParameters_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return DatasetSurfaceAnalystParameters_assertThisInitialized(self); }
  43590. function DatasetSurfaceAnalystParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  43591. function DatasetSurfaceAnalystParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  43592. function DatasetSurfaceAnalystParameters_getPrototypeOf(o) { DatasetSurfaceAnalystParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return DatasetSurfaceAnalystParameters_getPrototypeOf(o); }
  43593. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  43594. * This program are made available under the terms of the Apache License, Version 2.0
  43595. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  43596. /**
  43597. * @class DatasetSurfaceAnalystParameters
  43598. * @deprecatedclass SuperMap.DatasetSurfaceAnalystParameters
  43599. * @category iServer SpatialAnalyst SurfaceAnalyst
  43600. * @classdesc 数据集表面分析参数类。该类对数据集表面分析所用到的参数进行设置。
  43601. * @param {Object} options - 参数。
  43602. * @param {string} options.dataset - 数据集名称。
  43603. * @param {string} options.zValueFieldName - 字段名称。
  43604. * @param {number} options.resolution - 指定中间结果(栅格数据集)的分辨率。
  43605. * @param {SurfaceAnalystParametersSetting} options.extractParameter - 表面分析参数设置类。获取或设置表面分析参数。
  43606. * @param {FilterParameter} [options.filterQueryParameter] - 查询过滤条件参数。
  43607. * @param {DataReturnOption} [options.resultSetting] - 结果返回设置类。
  43608. * @param {SurfaceAnalystMethod} [options.surfaceAnalystMethod=SurfaceAnalystMethod.ISOLINE] - 表面分析的提取方法,提取等值线和提取等值面。
  43609. * @extends {SurfaceAnalystParameters}
  43610. * @usage
  43611. */
  43612. var DatasetSurfaceAnalystParameters = /*#__PURE__*/function (_SurfaceAnalystParame) {
  43613. DatasetSurfaceAnalystParameters_inherits(DatasetSurfaceAnalystParameters, _SurfaceAnalystParame);
  43614. var _super = DatasetSurfaceAnalystParameters_createSuper(DatasetSurfaceAnalystParameters);
  43615. function DatasetSurfaceAnalystParameters(options) {
  43616. var _this;
  43617. DatasetSurfaceAnalystParameters_classCallCheck(this, DatasetSurfaceAnalystParameters);
  43618. _this = _super.call(this, options);
  43619. /**
  43620. * @member {string} DatasetSurfaceAnalystParameters.prototype.dataset
  43621. * @description 要用来做数据集表面分析的数据源中数据集的名称。该名称用形如 "数据集名称@数据源别名" 形式来表示,例如:Country@World。
  43622. */
  43623. _this.dataset = null;
  43624. /**
  43625. * @member {FilterParameter} DatasetSurfaceAnalystParameters.prototype.filterQueryParameter
  43626. * @description 获取或设置查询过滤条件参数。
  43627. */
  43628. _this.filterQueryParameter = new FilterParameter();
  43629. /**
  43630. * @member {string} DatasetSurfaceAnalystParameters.prototype.zValueFieldName
  43631. * @description 获取或设置用于提取操作的字段名称。提取等值线时,将使用该字段中的值,对点记录集中的点数据进行插值分析,得到栅格数据集(中间结果),接着从栅格数据集提取等值线。
  43632. */
  43633. _this.zValueFieldName = null;
  43634. if (options) {
  43635. Util_Util.extend(DatasetSurfaceAnalystParameters_assertThisInitialized(_this), options);
  43636. }
  43637. _this.CLASS_NAME = "SuperMap.DatasetSurfaceAnalystParameters";
  43638. return _this;
  43639. }
  43640. /**
  43641. * @function DatasetSurfaceAnalystParameters.prototype.destroy
  43642. * @override
  43643. */
  43644. DatasetSurfaceAnalystParameters_createClass(DatasetSurfaceAnalystParameters, [{
  43645. key: "destroy",
  43646. value: function destroy() {
  43647. DatasetSurfaceAnalystParameters_get(DatasetSurfaceAnalystParameters_getPrototypeOf(DatasetSurfaceAnalystParameters.prototype), "destroy", this).call(this);
  43648. var me = this;
  43649. me.dataset = null;
  43650. if (me.filterQueryParameter) {
  43651. me.filterQueryParameter.destroy();
  43652. me.filterQueryParameter = null;
  43653. }
  43654. me.zValueFieldName = null;
  43655. }
  43656. /**
  43657. * @function DatasetSurfaceAnalystParameters.toObject
  43658. * @param {DatasetSurfaceAnalystParameters} datasetSurfaceAnalystParameters - 数据集表面分析参数类。
  43659. * @param {DatasetSurfaceAnalystParameters} tempObj - 数据集表面分析参数对象。
  43660. * @description 将数据集表面分析参数对象转换为 JSON 对象。
  43661. * @returns JSON 对象。
  43662. */
  43663. }], [{
  43664. key: "toObject",
  43665. value: function toObject(datasetSurfaceAnalystParameters, tempObj) {
  43666. for (var name in datasetSurfaceAnalystParameters) {
  43667. if (name === "filterQueryParameter") {
  43668. tempObj.filterQueryParameter = datasetSurfaceAnalystParameters.filterQueryParameter;
  43669. }
  43670. if (name === "extractParameter") {
  43671. if (datasetSurfaceAnalystParameters.extractParameter.clipRegion instanceof Geometry_Geometry && datasetSurfaceAnalystParameters.extractParameter.clipRegion.components) {
  43672. datasetSurfaceAnalystParameters.extractParameter.clipRegion = ServerGeometry.fromGeometry(datasetSurfaceAnalystParameters.extractParameter.clipRegion);
  43673. }
  43674. tempObj.extractParameter = datasetSurfaceAnalystParameters.extractParameter;
  43675. } else if (name === "dataset") {
  43676. continue;
  43677. } else if (name === "surfaceAnalystMethod") {
  43678. continue;
  43679. } else {
  43680. tempObj[name] = datasetSurfaceAnalystParameters[name];
  43681. }
  43682. }
  43683. }
  43684. }]);
  43685. return DatasetSurfaceAnalystParameters;
  43686. }(SurfaceAnalystParameters);
  43687. ;// CONCATENATED MODULE: ./src/common/iServer/GeometrySurfaceAnalystParameters.js
  43688. function GeometrySurfaceAnalystParameters_typeof(obj) { "@babel/helpers - typeof"; return GeometrySurfaceAnalystParameters_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, GeometrySurfaceAnalystParameters_typeof(obj); }
  43689. function GeometrySurfaceAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  43690. function GeometrySurfaceAnalystParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  43691. function GeometrySurfaceAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) GeometrySurfaceAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) GeometrySurfaceAnalystParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  43692. function GeometrySurfaceAnalystParameters_get() { if (typeof Reflect !== "undefined" && Reflect.get) { GeometrySurfaceAnalystParameters_get = Reflect.get.bind(); } else { GeometrySurfaceAnalystParameters_get = function _get(target, property, receiver) { var base = GeometrySurfaceAnalystParameters_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return GeometrySurfaceAnalystParameters_get.apply(this, arguments); }
  43693. function GeometrySurfaceAnalystParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GeometrySurfaceAnalystParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  43694. function GeometrySurfaceAnalystParameters_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) GeometrySurfaceAnalystParameters_setPrototypeOf(subClass, superClass); }
  43695. function GeometrySurfaceAnalystParameters_setPrototypeOf(o, p) { GeometrySurfaceAnalystParameters_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GeometrySurfaceAnalystParameters_setPrototypeOf(o, p); }
  43696. function GeometrySurfaceAnalystParameters_createSuper(Derived) { var hasNativeReflectConstruct = GeometrySurfaceAnalystParameters_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = GeometrySurfaceAnalystParameters_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = GeometrySurfaceAnalystParameters_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return GeometrySurfaceAnalystParameters_possibleConstructorReturn(this, result); }; }
  43697. function GeometrySurfaceAnalystParameters_possibleConstructorReturn(self, call) { if (call && (GeometrySurfaceAnalystParameters_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return GeometrySurfaceAnalystParameters_assertThisInitialized(self); }
  43698. function GeometrySurfaceAnalystParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  43699. function GeometrySurfaceAnalystParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  43700. function GeometrySurfaceAnalystParameters_getPrototypeOf(o) { GeometrySurfaceAnalystParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GeometrySurfaceAnalystParameters_getPrototypeOf(o); }
  43701. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  43702. * This program are made available under the terms of the Apache License, Version 2.0
  43703. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  43704. /**
  43705. * @class GeometrySurfaceAnalystParameters
  43706. * @deprecatedclass SuperMap.GeometrySurfaceAnalystParameters
  43707. * @category iServer SpatialAnalyst SurfaceAnalyst
  43708. * @classdesc 几何对象表面分析参数类。该类对几何对象表面分析所用到的参数进行设置。
  43709. * @param {Object} options - 参数。
  43710. * @param {Array.<GeometryPoint|L.LatLng|L.Point|ol.geom.Point|mapboxgl.LngLat|Array.<number>>} options.points - 表面分析的坐标点数组。
  43711. * @param {Array.<number>} options.zValues - 表面分析的坐标点的 Z 值数组。
  43712. * @param {number} [options.resolution] - 获取或设置指定中间结果(栅格数据集)的分辨率。
  43713. * @param {DataReturnOption} [options.resultSetting] - 结果返回设置类。
  43714. * @param {SurfaceAnalystParametersSetting} options.extractParameter - 获取或设置表面分析参数。
  43715. * @param {SurfaceAnalystMethod} [options.surfaceAnalystMethod = SurfaceAnalystMethod.ISOLINE] - 获取或设置表面分析的提取方法,提取等值线和提取等值面。
  43716. * @extends {SurfaceAnalystParameters}
  43717. * @usage
  43718. */
  43719. var GeometrySurfaceAnalystParameters = /*#__PURE__*/function (_SurfaceAnalystParame) {
  43720. GeometrySurfaceAnalystParameters_inherits(GeometrySurfaceAnalystParameters, _SurfaceAnalystParame);
  43721. var _super = GeometrySurfaceAnalystParameters_createSuper(GeometrySurfaceAnalystParameters);
  43722. function GeometrySurfaceAnalystParameters(options) {
  43723. var _this;
  43724. GeometrySurfaceAnalystParameters_classCallCheck(this, GeometrySurfaceAnalystParameters);
  43725. _this = _super.call(this, options);
  43726. /**
  43727. * @member {Array.<GeometryPoint|L.LatLng|L.Point|ol.geom.Point|mapboxgl.LngLat|Array.<number>>} GeometrySurfaceAnalystParameters.prototype.points
  43728. * @description 获取或设置用于表面分析的坐标点数组。
  43729. */
  43730. _this.points = null;
  43731. /**
  43732. * @member {Array.<number>} GeometrySurfaceAnalystParameters.prototype.zValues
  43733. * @description 获取或设置用于提取操作的值。提取等值线时,将使用该数组中的值,
  43734. * 对几何对象中的坐标点数组进行插值分析,得到栅格数据集(中间结果),接着从栅格数据集提取等值线。
  43735. */
  43736. _this.zValues = null;
  43737. if (options) {
  43738. Util_Util.extend(GeometrySurfaceAnalystParameters_assertThisInitialized(_this), options);
  43739. }
  43740. _this.CLASS_NAME = "SuperMap.GeometrySurfaceAnalystParameters";
  43741. return _this;
  43742. }
  43743. /**
  43744. * @function GeometrySurfaceAnalystParameters.prototype.destroy
  43745. * @override
  43746. */
  43747. GeometrySurfaceAnalystParameters_createClass(GeometrySurfaceAnalystParameters, [{
  43748. key: "destroy",
  43749. value: function destroy() {
  43750. GeometrySurfaceAnalystParameters_get(GeometrySurfaceAnalystParameters_getPrototypeOf(GeometrySurfaceAnalystParameters.prototype), "destroy", this).call(this);
  43751. var me = this;
  43752. if (me.points) {
  43753. for (var i = 0, points = me.points, len = points.length; i < len; i++) {
  43754. points[i].destroy();
  43755. }
  43756. me.points = null;
  43757. }
  43758. me.zValues = null;
  43759. }
  43760. }]);
  43761. return GeometrySurfaceAnalystParameters;
  43762. }(SurfaceAnalystParameters);
  43763. ;// CONCATENATED MODULE: ./src/common/iServer/SurfaceAnalystService.js
  43764. function SurfaceAnalystService_typeof(obj) { "@babel/helpers - typeof"; return SurfaceAnalystService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, SurfaceAnalystService_typeof(obj); }
  43765. function SurfaceAnalystService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  43766. function SurfaceAnalystService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  43767. function SurfaceAnalystService_createClass(Constructor, protoProps, staticProps) { if (protoProps) SurfaceAnalystService_defineProperties(Constructor.prototype, protoProps); if (staticProps) SurfaceAnalystService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  43768. function SurfaceAnalystService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { SurfaceAnalystService_get = Reflect.get.bind(); } else { SurfaceAnalystService_get = function _get(target, property, receiver) { var base = SurfaceAnalystService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return SurfaceAnalystService_get.apply(this, arguments); }
  43769. function SurfaceAnalystService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SurfaceAnalystService_getPrototypeOf(object); if (object === null) break; } return object; }
  43770. function SurfaceAnalystService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) SurfaceAnalystService_setPrototypeOf(subClass, superClass); }
  43771. function SurfaceAnalystService_setPrototypeOf(o, p) { SurfaceAnalystService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SurfaceAnalystService_setPrototypeOf(o, p); }
  43772. function SurfaceAnalystService_createSuper(Derived) { var hasNativeReflectConstruct = SurfaceAnalystService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = SurfaceAnalystService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = SurfaceAnalystService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return SurfaceAnalystService_possibleConstructorReturn(this, result); }; }
  43773. function SurfaceAnalystService_possibleConstructorReturn(self, call) { if (call && (SurfaceAnalystService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return SurfaceAnalystService_assertThisInitialized(self); }
  43774. function SurfaceAnalystService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  43775. function SurfaceAnalystService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  43776. function SurfaceAnalystService_getPrototypeOf(o) { SurfaceAnalystService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SurfaceAnalystService_getPrototypeOf(o); }
  43777. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  43778. * This program are made available under the terms of the Apache License, Version 2.0
  43779. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  43780. /**
  43781. * @class SurfaceAnalystService
  43782. * @deprecatedclass SuperMap.SurfaceAnalystService
  43783. * @category iServer SpatialAnalyst SurfaceAnalyst
  43784. * @classdesc 表面分析服务类。
  43785. * 该类负责将客户设置的表面分析服务参数传递给服务端,并接收服务端返回的表面分析服务分析结果数据。
  43786. * 表面分析结果通过该类支持的事件的监听函数参数获取
  43787. * @param {string} url - 服务地址。如 http://localhost:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst
  43788. * @param {Object} options - 参数。
  43789. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  43790. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  43791. * @param {Object} [options.headers] - 请求头。
  43792. * @extends {SpatialAnalystBase}
  43793. * @example 例如:
  43794. * (start code)
  43795. * var mySurfaceAnalystService = new SurfaceAnalystService(url, {
  43796. * eventListeners: {
  43797. * "processCompleted": surfaceAnalysCompleted,
  43798. * "processFailed": surfaceAnalysFailed
  43799. * }
  43800. * });
  43801. * (end)
  43802. * @usage
  43803. */
  43804. var SurfaceAnalystService = /*#__PURE__*/function (_SpatialAnalystBase) {
  43805. SurfaceAnalystService_inherits(SurfaceAnalystService, _SpatialAnalystBase);
  43806. var _super = SurfaceAnalystService_createSuper(SurfaceAnalystService);
  43807. function SurfaceAnalystService(url, options) {
  43808. var _this;
  43809. SurfaceAnalystService_classCallCheck(this, SurfaceAnalystService);
  43810. _this = _super.call(this, url, options);
  43811. _this.CLASS_NAME = "SuperMap.SurfaceAnalystService";
  43812. return _this;
  43813. }
  43814. /**
  43815. * @function SurfaceAnalystService.prototype.destroy
  43816. * @description 释放资源,将引用的资源属性置空。
  43817. */
  43818. SurfaceAnalystService_createClass(SurfaceAnalystService, [{
  43819. key: "destroy",
  43820. value: function destroy() {
  43821. SurfaceAnalystService_get(SurfaceAnalystService_getPrototypeOf(SurfaceAnalystService.prototype), "destroy", this).call(this);
  43822. }
  43823. /**
  43824. * @function SurfaceAnalystService.prototype.processAsync
  43825. * @description 负责将客户端的表面分析服务参数传递到服务端。
  43826. * @param {SurfaceAnalystParameters} params - 表面分析提取操作参数类。
  43827. */
  43828. }, {
  43829. key: "processAsync",
  43830. value: function processAsync(params) {
  43831. if (!(params instanceof SurfaceAnalystParameters)) {
  43832. return;
  43833. }
  43834. var me = this,
  43835. jsonParameters;
  43836. jsonParameters = me.getJsonParameters(params);
  43837. me.request({
  43838. method: "POST",
  43839. data: jsonParameters,
  43840. scope: me,
  43841. success: me.serviceProcessCompleted,
  43842. failure: me.serviceProcessFailed
  43843. });
  43844. }
  43845. /**
  43846. * @function SurfaceAnalystService.prototype.getJsonParameters
  43847. * @description 将参数转化为 JSON 字符串。
  43848. * @param {SurfaceAnalystParameters} params - 表面分析提取操作参数类。
  43849. * @returns {Object} 转化后的JSON字符串。
  43850. */
  43851. }, {
  43852. key: "getJsonParameters",
  43853. value: function getJsonParameters(params) {
  43854. var jsonParameters = '';
  43855. var parameterObject = {};
  43856. var me = this;
  43857. if (params instanceof DatasetSurfaceAnalystParameters) {
  43858. me.url = Util_Util.urlPathAppend(me.url, 'datasets/' + params.dataset + '/' + params.surfaceAnalystMethod.toLowerCase());
  43859. DatasetSurfaceAnalystParameters.toObject(params, parameterObject);
  43860. jsonParameters = Util_Util.toJSON(parameterObject);
  43861. } else if (params instanceof GeometrySurfaceAnalystParameters) {
  43862. me.url = Util_Util.urlPathAppend(me.url, 'geometry/' + params.surfaceAnalystMethod.toLowerCase());
  43863. jsonParameters = Util_Util.toJSON(params);
  43864. } else {
  43865. return;
  43866. }
  43867. this.returnContent = true;
  43868. return jsonParameters;
  43869. }
  43870. }, {
  43871. key: "dataFormat",
  43872. value: function dataFormat() {
  43873. return [DataFormat.GEOJSON, DataFormat.ISERVER, DataFormat.FGB];
  43874. }
  43875. }]);
  43876. return SurfaceAnalystService;
  43877. }(SpatialAnalystBase);
  43878. ;// CONCATENATED MODULE: ./src/common/iServer/TerrainCurvatureCalculationParameters.js
  43879. function TerrainCurvatureCalculationParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  43880. function TerrainCurvatureCalculationParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  43881. function TerrainCurvatureCalculationParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) TerrainCurvatureCalculationParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) TerrainCurvatureCalculationParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  43882. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  43883. * This program are made available under the terms of the Apache License, Version 2.0
  43884. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  43885. /**
  43886. * @class TerrainCurvatureCalculationParameters
  43887. * @deprecatedclass SuperMap.TerrainCurvatureCalculationParameters
  43888. * @category iServer SpatialAnalyst TerrainCalculation
  43889. * @classdesc 地形曲率计算参数类。
  43890. * @param {Object} options - 参数。
  43891. * @param {string} options.dataset - 地形曲率计算数据源中数据集的名称。该名称用形如"数据集名称@数据源别名"形式来表示,例如:JingjinTerrain@Jingjin。
  43892. * @param {string} options.averageCurvatureName - 结果数据集:平均曲率数据集的名称。
  43893. * @param {string} options.profileCurvatureName - 结果数据集:剖面曲率数据集的名称。
  43894. * @param {string} options.planCurvatureName - 结果数据集:平面曲率数据集的名称。
  43895. * @param {number} [options.zFactor=1.0] - 指定的高程缩放系数。1.0 表示不缩放。
  43896. * @param {boolean} [options.deleteExistResultDataset=false] - 如果用户命名的结果数据集名称与已有的数据集重名,是否删除已有的数据集。
  43897. * @usage
  43898. */
  43899. var TerrainCurvatureCalculationParameters = /*#__PURE__*/function () {
  43900. function TerrainCurvatureCalculationParameters(options) {
  43901. TerrainCurvatureCalculationParameters_classCallCheck(this, TerrainCurvatureCalculationParameters);
  43902. if (!options) {
  43903. return;
  43904. }
  43905. /**
  43906. * @member {string} TerrainCurvatureCalculationParameters.prototype.dataset
  43907. * @description 要用来做地形曲率计算数据源中数据集的名称。
  43908. * 该名称用形如"数据集名称@数据源别名"形式来表示,例如:JingjinTerrain@Jingjin。
  43909. * 注:地形曲率计算必须为栅格数据集。
  43910. */
  43911. this.dataset = null;
  43912. /**
  43913. * @member {number} [TerrainCurvatureCalculationParameters.prototype.zFactor=1.0]
  43914. * @description 指定的高程缩放系数。1.0 表示不缩放。
  43915. * 该值是指在 DEM 栅格数据中,栅格值( Z 坐标,即高程值)相对于 X 和 Y 坐标的单位变换系数。
  43916. * 通常有 X,Y,Z 都参加的计算中,需要将高程值乘以一个高程缩放系数,使得三者单位一致。
  43917. * 例如,X、Y 方向上的单位是米,而 Z 方向的单位是英尺,由于 1 英尺等于 0.3048 米,则需要指定缩放系数为 0.3048。
  43918. */
  43919. this.zFactor = 1.0;
  43920. /**
  43921. * @member {string} TerrainCurvatureCalculationParameters.prototype.averageCurvatureName
  43922. * @description 结果数据集:平均曲率数据集的名称。
  43923. */
  43924. this.averageCurvatureName = null;
  43925. /**
  43926. * @member {string} TerrainCurvatureCalculationParameters.prototype.profileCurvatureName
  43927. * @description 结果数据集:剖面曲率数据集的名称。
  43928. */
  43929. this.profileCurvatureName = "";
  43930. /**
  43931. * @member {string} TerrainCurvatureCalculationParameters.prototype.planCurvatureName
  43932. * @description 结果数据集:平面曲率数据集的名称。
  43933. */
  43934. this.planCurvatureName = "";
  43935. /**
  43936. * @member {boolean} [TerrainCurvatureCalculationParameters.prototype.deleteExistResultDataset=false]
  43937. * @description 如果用户命名的结果数据集名称与已有的数据集重名,是否删除已有的数据集。
  43938. */
  43939. this.deleteExistResultDataset = false;
  43940. Util_Util.extend(this, options);
  43941. this.CLASS_NAME = "SuperMap.TerrainCurvatureCalculationParameters";
  43942. }
  43943. /**
  43944. * @function TerrainCurvatureCalculationParameters.prototype.destroy
  43945. * @description 释放资源,将引用资源的属性置空。
  43946. */
  43947. TerrainCurvatureCalculationParameters_createClass(TerrainCurvatureCalculationParameters, [{
  43948. key: "destroy",
  43949. value: function destroy() {
  43950. var me = this;
  43951. me.dataset = null;
  43952. me.zFactor = 1.0;
  43953. me.averageCurvatureName = null;
  43954. me.profileCurvatureName = null;
  43955. me.planCurvatureName = null;
  43956. me.deleteExistResultDataset = true;
  43957. }
  43958. /**
  43959. * @function TerrainCurvatureCalculationParameters.toObject
  43960. * @param {Object} derrainCurvatureCalculationParameters - 地形曲率计算参数。
  43961. * @param {Object} tempObj - 目标对象。
  43962. * @description 生成地形曲率计算对象。
  43963. */
  43964. }], [{
  43965. key: "toObject",
  43966. value: function toObject(derrainCurvatureCalculationParameters, tempObj) {
  43967. for (var name in derrainCurvatureCalculationParameters) {
  43968. if (name !== "dataset") {
  43969. tempObj[name] = derrainCurvatureCalculationParameters[name];
  43970. }
  43971. }
  43972. }
  43973. }]);
  43974. return TerrainCurvatureCalculationParameters;
  43975. }();
  43976. ;// CONCATENATED MODULE: ./src/common/iServer/TerrainCurvatureCalculationService.js
  43977. function TerrainCurvatureCalculationService_typeof(obj) { "@babel/helpers - typeof"; return TerrainCurvatureCalculationService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, TerrainCurvatureCalculationService_typeof(obj); }
  43978. function TerrainCurvatureCalculationService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  43979. function TerrainCurvatureCalculationService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  43980. function TerrainCurvatureCalculationService_createClass(Constructor, protoProps, staticProps) { if (protoProps) TerrainCurvatureCalculationService_defineProperties(Constructor.prototype, protoProps); if (staticProps) TerrainCurvatureCalculationService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  43981. function TerrainCurvatureCalculationService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { TerrainCurvatureCalculationService_get = Reflect.get.bind(); } else { TerrainCurvatureCalculationService_get = function _get(target, property, receiver) { var base = TerrainCurvatureCalculationService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return TerrainCurvatureCalculationService_get.apply(this, arguments); }
  43982. function TerrainCurvatureCalculationService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = TerrainCurvatureCalculationService_getPrototypeOf(object); if (object === null) break; } return object; }
  43983. function TerrainCurvatureCalculationService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) TerrainCurvatureCalculationService_setPrototypeOf(subClass, superClass); }
  43984. function TerrainCurvatureCalculationService_setPrototypeOf(o, p) { TerrainCurvatureCalculationService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return TerrainCurvatureCalculationService_setPrototypeOf(o, p); }
  43985. function TerrainCurvatureCalculationService_createSuper(Derived) { var hasNativeReflectConstruct = TerrainCurvatureCalculationService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = TerrainCurvatureCalculationService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = TerrainCurvatureCalculationService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return TerrainCurvatureCalculationService_possibleConstructorReturn(this, result); }; }
  43986. function TerrainCurvatureCalculationService_possibleConstructorReturn(self, call) { if (call && (TerrainCurvatureCalculationService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return TerrainCurvatureCalculationService_assertThisInitialized(self); }
  43987. function TerrainCurvatureCalculationService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  43988. function TerrainCurvatureCalculationService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  43989. function TerrainCurvatureCalculationService_getPrototypeOf(o) { TerrainCurvatureCalculationService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return TerrainCurvatureCalculationService_getPrototypeOf(o); }
  43990. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  43991. * This program are made available under the terms of the Apache License, Version 2.0
  43992. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  43993. /**
  43994. * @class TerrainCurvatureCalculationService
  43995. * @deprecatedclass SuperMap.TerrainCurvatureCalculationService
  43996. * @category iServer SpatialAnalyst TerrainCalculation
  43997. * @classdesc 地形曲率计算服务类。
  43998. * @extends {SpatialAnalystBase}
  43999. * @param {Object} options - 参数。
  44000. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  44001. * @param {string} options.url - 服务的访问地址。如 http://localhost:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst 。
  44002. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  44003. * @param {Object} [options.headers] - 请求头。
  44004. * @example 例如:
  44005. * (start code)
  44006. * var myTerrainCurvatureCalculationService = new TerrainCurvatureCalculationService(url);
  44007. * myTerrainCurvatureCalculationService.on({
  44008. * "processCompleted": processCompleted,
  44009. * "processFailed": processFailed
  44010. * }
  44011. * );
  44012. * (end)
  44013. * @usage
  44014. */
  44015. var TerrainCurvatureCalculationService = /*#__PURE__*/function (_SpatialAnalystBase) {
  44016. TerrainCurvatureCalculationService_inherits(TerrainCurvatureCalculationService, _SpatialAnalystBase);
  44017. var _super = TerrainCurvatureCalculationService_createSuper(TerrainCurvatureCalculationService);
  44018. function TerrainCurvatureCalculationService(url, options) {
  44019. var _this;
  44020. TerrainCurvatureCalculationService_classCallCheck(this, TerrainCurvatureCalculationService);
  44021. _this = _super.call(this, url, options);
  44022. _this.CLASS_NAME = "SuperMap.TerrainCurvatureCalculationService";
  44023. return _this;
  44024. }
  44025. /**
  44026. *@override
  44027. */
  44028. TerrainCurvatureCalculationService_createClass(TerrainCurvatureCalculationService, [{
  44029. key: "destroy",
  44030. value: function destroy() {
  44031. TerrainCurvatureCalculationService_get(TerrainCurvatureCalculationService_getPrototypeOf(TerrainCurvatureCalculationService.prototype), "destroy", this).call(this);
  44032. }
  44033. /**
  44034. * @function TerrainCurvatureCalculationService.prototype.processAsync
  44035. * @description 负责将客户端的查询参数传递到服务端。
  44036. * @param {TerrainCurvatureCalculationParameters} parameter - 地形曲率计算参数类。
  44037. */
  44038. }, {
  44039. key: "processAsync",
  44040. value: function processAsync(parameter) {
  44041. var me = this;
  44042. var parameterObject = {};
  44043. if (parameter instanceof TerrainCurvatureCalculationParameters) {
  44044. me.url = Util_Util.urlPathAppend(me.url, 'datasets/' + parameter.dataset + '/terraincalculation/curvature');
  44045. }
  44046. TerrainCurvatureCalculationParameters.toObject(parameter, parameterObject);
  44047. var jsonParameters = Util_Util.toJSON(parameterObject);
  44048. me.url = Util_Util.urlAppend(me.url, 'returnContent=true');
  44049. me.request({
  44050. method: "POST",
  44051. data: jsonParameters,
  44052. scope: me,
  44053. success: me.serviceProcessCompleted,
  44054. failure: me.serviceProcessFailed
  44055. });
  44056. }
  44057. }]);
  44058. return TerrainCurvatureCalculationService;
  44059. }(SpatialAnalystBase);
  44060. ;// CONCATENATED MODULE: ./src/common/iServer/DatasetThiessenAnalystParameters.js
  44061. function DatasetThiessenAnalystParameters_typeof(obj) { "@babel/helpers - typeof"; return DatasetThiessenAnalystParameters_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, DatasetThiessenAnalystParameters_typeof(obj); }
  44062. function DatasetThiessenAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  44063. function DatasetThiessenAnalystParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  44064. function DatasetThiessenAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) DatasetThiessenAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) DatasetThiessenAnalystParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  44065. function DatasetThiessenAnalystParameters_get() { if (typeof Reflect !== "undefined" && Reflect.get) { DatasetThiessenAnalystParameters_get = Reflect.get.bind(); } else { DatasetThiessenAnalystParameters_get = function _get(target, property, receiver) { var base = DatasetThiessenAnalystParameters_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return DatasetThiessenAnalystParameters_get.apply(this, arguments); }
  44066. function DatasetThiessenAnalystParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = DatasetThiessenAnalystParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  44067. function DatasetThiessenAnalystParameters_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) DatasetThiessenAnalystParameters_setPrototypeOf(subClass, superClass); }
  44068. function DatasetThiessenAnalystParameters_setPrototypeOf(o, p) { DatasetThiessenAnalystParameters_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return DatasetThiessenAnalystParameters_setPrototypeOf(o, p); }
  44069. function DatasetThiessenAnalystParameters_createSuper(Derived) { var hasNativeReflectConstruct = DatasetThiessenAnalystParameters_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = DatasetThiessenAnalystParameters_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = DatasetThiessenAnalystParameters_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return DatasetThiessenAnalystParameters_possibleConstructorReturn(this, result); }; }
  44070. function DatasetThiessenAnalystParameters_possibleConstructorReturn(self, call) { if (call && (DatasetThiessenAnalystParameters_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return DatasetThiessenAnalystParameters_assertThisInitialized(self); }
  44071. function DatasetThiessenAnalystParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  44072. function DatasetThiessenAnalystParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  44073. function DatasetThiessenAnalystParameters_getPrototypeOf(o) { DatasetThiessenAnalystParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return DatasetThiessenAnalystParameters_getPrototypeOf(o); }
  44074. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  44075. * This program are made available under the terms of the Apache License, Version 2.0
  44076. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  44077. /**
  44078. * @class DatasetThiessenAnalystParameters
  44079. * @deprecatedclass SuperMap.DatasetThiessenAnalystParameters
  44080. * @category iServer SpatialAnalyst ThiessenAnalyst
  44081. * @classdesc 数据集泰森多边形分析参数类。
  44082. * @param {Object} options - 参数。
  44083. * @param {FilterParameter} [options.filterQueryParameter] - 过滤参数类,即对数据集中的所有点进行分析。
  44084. * @extends {ThiessenAnalystParameters}
  44085. * @usage
  44086. */
  44087. var DatasetThiessenAnalystParameters = /*#__PURE__*/function (_ThiessenAnalystParam) {
  44088. DatasetThiessenAnalystParameters_inherits(DatasetThiessenAnalystParameters, _ThiessenAnalystParam);
  44089. var _super = DatasetThiessenAnalystParameters_createSuper(DatasetThiessenAnalystParameters);
  44090. function DatasetThiessenAnalystParameters(options) {
  44091. var _this;
  44092. DatasetThiessenAnalystParameters_classCallCheck(this, DatasetThiessenAnalystParameters);
  44093. _this = _super.call(this, options);
  44094. /**
  44095. * @member {FilterParameter} [DatasetThiessenAnalystParameters.prototype.filterQueryParameter]
  44096. * @description 过滤条件,对待分析数据集中的点进行过滤,即对数据集中的所有点进行分析。
  44097. * @example
  44098. * var filterQueryParameter = new FilterParameter({
  44099. * name: "Countries@World",
  44100. * attributeFilter: "SmID>100"
  44101. * });
  44102. */
  44103. _this.filterQueryParameter = null;
  44104. /**
  44105. * @member {string} DatasetThiessenAnalystParameters.prototype.dataset
  44106. * @description 数据集名称待分析的数据集名称,请使用 "datasetName@datasourceName" 格式来表示。
  44107. */
  44108. _this.dataset = null;
  44109. if (options) {
  44110. Util_Util.extend(DatasetThiessenAnalystParameters_assertThisInitialized(_this), options);
  44111. }
  44112. _this.CLASS_NAME = "SuperMap.DatasetThiessenAnalystParameters";
  44113. return _this;
  44114. }
  44115. /**
  44116. * @function DatasetThiessenAnalystParameters.prototype.destroy
  44117. * @override
  44118. */
  44119. DatasetThiessenAnalystParameters_createClass(DatasetThiessenAnalystParameters, [{
  44120. key: "destroy",
  44121. value: function destroy() {
  44122. DatasetThiessenAnalystParameters_get(DatasetThiessenAnalystParameters_getPrototypeOf(DatasetThiessenAnalystParameters.prototype), "destroy", this).call(this);
  44123. var me = this;
  44124. if (me.filterQueryParameter) {
  44125. me.filterQueryParameter.destroy();
  44126. me.filterQueryParameter = null;
  44127. }
  44128. }
  44129. /**
  44130. * @function DatasetThiessenAnalystParameters.toObject
  44131. * @param {DatasetThiessenAnalystParameters} datasetThiessenAnalystParameters - 泰森多边形分析服务参数类。
  44132. * @param {DatasetThiessenAnalystParameters} tempObj - 泰森多边形分析服务参数对象。
  44133. * @description 将泰森多边形分析服务参数对象转换为 JSON 对象。
  44134. * @returns JSON 对象。
  44135. */
  44136. }], [{
  44137. key: "toObject",
  44138. value: function toObject(datasetThiessenAnalystParameters, tempObj) {
  44139. for (var name in datasetThiessenAnalystParameters) {
  44140. if (name === "clipRegion") {
  44141. tempObj.clipRegion = ServerGeometry.fromGeometry(datasetThiessenAnalystParameters.clipRegion);
  44142. } else {
  44143. tempObj[name] = datasetThiessenAnalystParameters[name];
  44144. }
  44145. }
  44146. }
  44147. }]);
  44148. return DatasetThiessenAnalystParameters;
  44149. }(ThiessenAnalystParameters);
  44150. ;// CONCATENATED MODULE: ./src/common/iServer/GeometryThiessenAnalystParameters.js
  44151. function GeometryThiessenAnalystParameters_typeof(obj) { "@babel/helpers - typeof"; return GeometryThiessenAnalystParameters_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, GeometryThiessenAnalystParameters_typeof(obj); }
  44152. function GeometryThiessenAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  44153. function GeometryThiessenAnalystParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  44154. function GeometryThiessenAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) GeometryThiessenAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) GeometryThiessenAnalystParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  44155. function GeometryThiessenAnalystParameters_get() { if (typeof Reflect !== "undefined" && Reflect.get) { GeometryThiessenAnalystParameters_get = Reflect.get.bind(); } else { GeometryThiessenAnalystParameters_get = function _get(target, property, receiver) { var base = GeometryThiessenAnalystParameters_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return GeometryThiessenAnalystParameters_get.apply(this, arguments); }
  44156. function GeometryThiessenAnalystParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GeometryThiessenAnalystParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  44157. function GeometryThiessenAnalystParameters_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) GeometryThiessenAnalystParameters_setPrototypeOf(subClass, superClass); }
  44158. function GeometryThiessenAnalystParameters_setPrototypeOf(o, p) { GeometryThiessenAnalystParameters_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GeometryThiessenAnalystParameters_setPrototypeOf(o, p); }
  44159. function GeometryThiessenAnalystParameters_createSuper(Derived) { var hasNativeReflectConstruct = GeometryThiessenAnalystParameters_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = GeometryThiessenAnalystParameters_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = GeometryThiessenAnalystParameters_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return GeometryThiessenAnalystParameters_possibleConstructorReturn(this, result); }; }
  44160. function GeometryThiessenAnalystParameters_possibleConstructorReturn(self, call) { if (call && (GeometryThiessenAnalystParameters_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return GeometryThiessenAnalystParameters_assertThisInitialized(self); }
  44161. function GeometryThiessenAnalystParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  44162. function GeometryThiessenAnalystParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  44163. function GeometryThiessenAnalystParameters_getPrototypeOf(o) { GeometryThiessenAnalystParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GeometryThiessenAnalystParameters_getPrototypeOf(o); }
  44164. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  44165. * This program are made available under the terms of the Apache License, Version 2.0
  44166. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  44167. /**
  44168. * @class GeometryThiessenAnalystParameters
  44169. * @deprecatedclass SuperMap.GeometryThiessenAnalystParameters
  44170. * @constructs GeometryThiessenAnalystParameters
  44171. * @category iServer SpatialAnalyst ThiessenPolygonAnalyst
  44172. * @classdesc 几何对象泰森多边形分析参数类。对指定的某个几何对象做泰森多边形分析。通过该类可以指定要做泰森多边形分析的几何对象、返回数据集名称等。
  44173. * @param {Object} options - 参数。
  44174. * @param {Array.<GeometryPoint|L.LatLng|L.Point|ol.geom.Point|mapboxgl.LngLat|Array.<number>>} options.points - 使用点数组进行分析时使用的几何对象。
  44175. * @extends {ThiessenAnalystParameters}
  44176. * @usage
  44177. */
  44178. var GeometryThiessenAnalystParameters = /*#__PURE__*/function (_ThiessenAnalystParam) {
  44179. GeometryThiessenAnalystParameters_inherits(GeometryThiessenAnalystParameters, _ThiessenAnalystParam);
  44180. var _super = GeometryThiessenAnalystParameters_createSuper(GeometryThiessenAnalystParameters);
  44181. function GeometryThiessenAnalystParameters(options) {
  44182. var _this;
  44183. GeometryThiessenAnalystParameters_classCallCheck(this, GeometryThiessenAnalystParameters);
  44184. _this = _super.call(this, options);
  44185. /**
  44186. * @member {Array.<GeometryPoint|L.LatLng|L.Point|ol.geom.Point|mapboxgl.LngLat|Array.<number>>} GeometryThiessenAnalystParameters.prototype.points
  44187. * @description 使用点数组进行分析时使用的几何对象。
  44188. */
  44189. _this.points = null;
  44190. if (options) {
  44191. Util_Util.extend(GeometryThiessenAnalystParameters_assertThisInitialized(_this), options);
  44192. }
  44193. _this.CLASS_NAME = "SuperMap.GeometryThiessenAnalystParameters";
  44194. return _this;
  44195. }
  44196. /**
  44197. * @function GeometryThiessenAnalystParameters.prototype.destroy
  44198. * @override
  44199. */
  44200. GeometryThiessenAnalystParameters_createClass(GeometryThiessenAnalystParameters, [{
  44201. key: "destroy",
  44202. value: function destroy() {
  44203. GeometryThiessenAnalystParameters_get(GeometryThiessenAnalystParameters_getPrototypeOf(GeometryThiessenAnalystParameters.prototype), "destroy", this).call(this);
  44204. var me = this;
  44205. if (me.points) {
  44206. for (var i = me.points.length - 1; i >= 0; i--) {
  44207. me.points[i].destroy();
  44208. }
  44209. me.points = null;
  44210. }
  44211. }
  44212. /**
  44213. * @function GeometryThiessenAnalystParameters.toObject
  44214. * @param {GeometryThiessenAnalystParameters} geometryThiessenAnalystParameters - 几何对象泰森多边形分析参数类。
  44215. * @param {GeometryThiessenAnalystParameters} tempObj - 几何对象泰森多边形分析参数对象。
  44216. * @description 将几何对象泰森多边形分析参数对象转换为 JSON 对象。
  44217. * @returns {Object} JSON 对象。
  44218. */
  44219. }], [{
  44220. key: "toObject",
  44221. value: function toObject(geometryThiessenAnalystParameters, tempObj) {
  44222. for (var name in geometryThiessenAnalystParameters) {
  44223. if (name === "clipRegion") {
  44224. tempObj.clipRegion = ServerGeometry.fromGeometry(geometryThiessenAnalystParameters.clipRegion);
  44225. } else {
  44226. tempObj[name] = geometryThiessenAnalystParameters[name];
  44227. }
  44228. }
  44229. }
  44230. }]);
  44231. return GeometryThiessenAnalystParameters;
  44232. }(ThiessenAnalystParameters);
  44233. ;// CONCATENATED MODULE: ./src/common/iServer/ThiessenAnalystService.js
  44234. function ThiessenAnalystService_typeof(obj) { "@babel/helpers - typeof"; return ThiessenAnalystService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, ThiessenAnalystService_typeof(obj); }
  44235. function ThiessenAnalystService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  44236. function ThiessenAnalystService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  44237. function ThiessenAnalystService_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThiessenAnalystService_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThiessenAnalystService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  44238. function ThiessenAnalystService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { ThiessenAnalystService_get = Reflect.get.bind(); } else { ThiessenAnalystService_get = function _get(target, property, receiver) { var base = ThiessenAnalystService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return ThiessenAnalystService_get.apply(this, arguments); }
  44239. function ThiessenAnalystService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ThiessenAnalystService_getPrototypeOf(object); if (object === null) break; } return object; }
  44240. function ThiessenAnalystService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) ThiessenAnalystService_setPrototypeOf(subClass, superClass); }
  44241. function ThiessenAnalystService_setPrototypeOf(o, p) { ThiessenAnalystService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ThiessenAnalystService_setPrototypeOf(o, p); }
  44242. function ThiessenAnalystService_createSuper(Derived) { var hasNativeReflectConstruct = ThiessenAnalystService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = ThiessenAnalystService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = ThiessenAnalystService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return ThiessenAnalystService_possibleConstructorReturn(this, result); }; }
  44243. function ThiessenAnalystService_possibleConstructorReturn(self, call) { if (call && (ThiessenAnalystService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return ThiessenAnalystService_assertThisInitialized(self); }
  44244. function ThiessenAnalystService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  44245. function ThiessenAnalystService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  44246. function ThiessenAnalystService_getPrototypeOf(o) { ThiessenAnalystService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ThiessenAnalystService_getPrototypeOf(o); }
  44247. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  44248. * This program are made available under the terms of the Apache License, Version 2.0
  44249. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  44250. /**
  44251. * @class ThiessenAnalystService
  44252. * @deprecatedclass SuperMap.ThiessenAnalystService
  44253. * @category iServer SpatialAnalyst ThiessenPolygonAnalyst
  44254. * @classdesc
  44255. * 泰森多边形分析服务类
  44256. * 该类负责将客户设置的泰森多边形分析参数传递给服务端,并接收服务端返回的分析结果数据。
  44257. * 泰森多边形分析结果通过该类支持的事件的监听函数参数获取
  44258. * 泰森多边形分析的参数支持两种,当参数为 {@link DatasetThiessenAnalystParameters} 类型
  44259. * 时,执行数据集泰森多边形分析,当参数为 {@link GeometryThiessenAnalystParameters} 类型时,
  44260. * 执行几何对象泰森多边形分析。
  44261. * @param {string} url - 服务地址。如 http://localhost:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst。
  44262. * @param {Object} options - 参数。
  44263. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  44264. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  44265. * @param {Object} [options.headers] - 请求头。
  44266. * @extends {SpatialAnalystBase}
  44267. * @example 例如:
  44268. * (start code)
  44269. * var myThiessenAnalystService = new ThiessenAnalystService(url, {
  44270. * eventListeners: {
  44271. * "processCompleted": bufferCompleted,
  44272. * "processFailed": bufferFailed
  44273. * }
  44274. * });
  44275. * (end)
  44276. * @usage
  44277. */
  44278. var ThiessenAnalystService = /*#__PURE__*/function (_SpatialAnalystBase) {
  44279. ThiessenAnalystService_inherits(ThiessenAnalystService, _SpatialAnalystBase);
  44280. var _super = ThiessenAnalystService_createSuper(ThiessenAnalystService);
  44281. function ThiessenAnalystService(url, options) {
  44282. var _this;
  44283. ThiessenAnalystService_classCallCheck(this, ThiessenAnalystService);
  44284. _this = _super.call(this, url, options);
  44285. /**
  44286. * @member {string} ThiessenAnalystService.prototype.mode
  44287. * @description 缓冲区分析类型
  44288. */
  44289. _this.mode = null;
  44290. if (options) {
  44291. Util_Util.extend(ThiessenAnalystService_assertThisInitialized(_this), options);
  44292. }
  44293. _this.CLASS_NAME = "SuperMap.ThiessenAnalystService";
  44294. return _this;
  44295. }
  44296. /**
  44297. * @override
  44298. */
  44299. ThiessenAnalystService_createClass(ThiessenAnalystService, [{
  44300. key: "destroy",
  44301. value: function destroy() {
  44302. ThiessenAnalystService_get(ThiessenAnalystService_getPrototypeOf(ThiessenAnalystService.prototype), "destroy", this).call(this);
  44303. this.mode = null;
  44304. }
  44305. /**
  44306. * @function ThiessenAnalystService.prototype.processAsync
  44307. * @description 负责将客户端的查询参数传递到服务端。
  44308. * @param {DatasetThiessenAnalystParameters|GeometryThiessenAnalystParameters} parameter - 泰森多边形分析参数基类。
  44309. */
  44310. }, {
  44311. key: "processAsync",
  44312. value: function processAsync(parameter) {
  44313. var parameterObject = {};
  44314. var me = this;
  44315. if (parameter instanceof DatasetThiessenAnalystParameters) {
  44316. me.mode = "datasets";
  44317. me.url = Util_Util.urlPathAppend(me.url, 'datasets/' + parameter.dataset + '/thiessenpolygon');
  44318. DatasetThiessenAnalystParameters.toObject(parameter, parameterObject);
  44319. } else if (parameter instanceof GeometryThiessenAnalystParameters) {
  44320. me.mode = "geometry";
  44321. me.url = Util_Util.urlPathAppend(me.url, 'geometry/thiessenpolygon');
  44322. GeometryThiessenAnalystParameters.toObject(parameter, parameterObject);
  44323. }
  44324. var jsonParameters = Util_Util.toJSON(parameterObject);
  44325. this.returnContent = true;
  44326. me.request({
  44327. method: "POST",
  44328. data: jsonParameters,
  44329. scope: me,
  44330. success: me.serviceProcessCompleted,
  44331. failure: me.serviceProcessFailed
  44332. });
  44333. }
  44334. }, {
  44335. key: "dataFormat",
  44336. value: function dataFormat() {
  44337. return [DataFormat.GEOJSON, DataFormat.ISERVER, DataFormat.FGB];
  44338. }
  44339. }]);
  44340. return ThiessenAnalystService;
  44341. }(SpatialAnalystBase);
  44342. ;// CONCATENATED MODULE: ./src/common/iServer/GeometryBatchAnalystService.js
  44343. function GeometryBatchAnalystService_typeof(obj) { "@babel/helpers - typeof"; return GeometryBatchAnalystService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, GeometryBatchAnalystService_typeof(obj); }
  44344. function GeometryBatchAnalystService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  44345. function GeometryBatchAnalystService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  44346. function GeometryBatchAnalystService_createClass(Constructor, protoProps, staticProps) { if (protoProps) GeometryBatchAnalystService_defineProperties(Constructor.prototype, protoProps); if (staticProps) GeometryBatchAnalystService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  44347. function GeometryBatchAnalystService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { GeometryBatchAnalystService_get = Reflect.get.bind(); } else { GeometryBatchAnalystService_get = function _get(target, property, receiver) { var base = GeometryBatchAnalystService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return GeometryBatchAnalystService_get.apply(this, arguments); }
  44348. function GeometryBatchAnalystService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GeometryBatchAnalystService_getPrototypeOf(object); if (object === null) break; } return object; }
  44349. function GeometryBatchAnalystService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) GeometryBatchAnalystService_setPrototypeOf(subClass, superClass); }
  44350. function GeometryBatchAnalystService_setPrototypeOf(o, p) { GeometryBatchAnalystService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GeometryBatchAnalystService_setPrototypeOf(o, p); }
  44351. function GeometryBatchAnalystService_createSuper(Derived) { var hasNativeReflectConstruct = GeometryBatchAnalystService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = GeometryBatchAnalystService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = GeometryBatchAnalystService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return GeometryBatchAnalystService_possibleConstructorReturn(this, result); }; }
  44352. function GeometryBatchAnalystService_possibleConstructorReturn(self, call) { if (call && (GeometryBatchAnalystService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return GeometryBatchAnalystService_assertThisInitialized(self); }
  44353. function GeometryBatchAnalystService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  44354. function GeometryBatchAnalystService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  44355. function GeometryBatchAnalystService_getPrototypeOf(o) { GeometryBatchAnalystService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GeometryBatchAnalystService_getPrototypeOf(o); }
  44356. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  44357. * This program are made available under the terms of the Apache License, Version 2.0
  44358. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  44359. /**
  44360. * @class GeometryBatchAnalystService
  44361. * @deprecatedclass SuperMap.GeometryBatchAnalystService
  44362. * @category iServer SpatialAnalyst BatchAnalyst
  44363. * @classdesc 批量空间分析服务类
  44364. * @description 该类负责将客户设置的叠加分析参数传递给服务端,并接收服务端返回的叠加分析结果数据。
  44365. * 获取的结果数据包括 originResult 、result 两种,
  44366. * 其中,originResult 为服务端返回的用 JSON 对象表示的量算结果数据,result 为服务端返回的量算结果数据。
  44367. * @extends {SpatialAnalystBase}
  44368. * @param {string} url - 服务地址。如:http://localhost:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst。
  44369. * @param {Object} options - 参数。
  44370. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  44371. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  44372. * @param {Object} [options.headers] - 请求头。
  44373. * @example
  44374. * var myOverlayAnalystService = new GeometryBatchAnalystService(url, {
  44375. * eventListeners: {
  44376. * "processCompleted": OverlayCompleted,
  44377. * "processFailed": OverlayFailed
  44378. * }
  44379. * });
  44380. * @usage
  44381. */
  44382. var GeometryBatchAnalystService = /*#__PURE__*/function (_SpatialAnalystBase) {
  44383. GeometryBatchAnalystService_inherits(GeometryBatchAnalystService, _SpatialAnalystBase);
  44384. var _super = GeometryBatchAnalystService_createSuper(GeometryBatchAnalystService);
  44385. function GeometryBatchAnalystService(url, options) {
  44386. var _this;
  44387. GeometryBatchAnalystService_classCallCheck(this, GeometryBatchAnalystService);
  44388. _this = _super.call(this, url, options);
  44389. if (options) {
  44390. Util_Util.extend(GeometryBatchAnalystService_assertThisInitialized(_this), options);
  44391. }
  44392. _this.CLASS_NAME = "SuperMap.GeometryBatchAnalystService";
  44393. return _this;
  44394. }
  44395. /**
  44396. * @function GeometryBatchAnalystService.prototype.processAsync
  44397. * @description 负责将客户端的查询参数传递到服务端。
  44398. * @param {GeometryOverlayAnalystParameter} parameter - 批量几何对象叠加分析参数类
  44399. *
  44400. */
  44401. GeometryBatchAnalystService_createClass(GeometryBatchAnalystService, [{
  44402. key: "processAsync",
  44403. value: function processAsync(parameters) {
  44404. var me = this;
  44405. me.url = Util_Util.urlPathAppend(me.url, 'geometry/batchanalyst');
  44406. me.url = Util_Util.urlAppend(me.url, 'returnContent=true&ignoreAnalystParam=true');
  44407. var parameterObjects = me._processParams(parameters);
  44408. var jsonParameters = Util_Util.toJSON(parameterObjects);
  44409. me.request({
  44410. method: "POST",
  44411. data: jsonParameters,
  44412. scope: me,
  44413. success: me.serviceProcessCompleted,
  44414. failure: me.serviceProcessFailed
  44415. });
  44416. }
  44417. }, {
  44418. key: "_processParams",
  44419. value: function _processParams(parameters) {
  44420. var me = this;
  44421. if (!Util_Util.isArray(parameters)) {
  44422. return;
  44423. }
  44424. var processParams = [];
  44425. parameters.map(function (item) {
  44426. processParams.push(me._toJSON(item));
  44427. return item;
  44428. });
  44429. return processParams;
  44430. }
  44431. }, {
  44432. key: "_toJSON",
  44433. value: function _toJSON(parameter) {
  44434. var tempObj = {};
  44435. if (parameter.analystName === "buffer") {
  44436. tempObj.analystName = "buffer";
  44437. tempObj.param = {};
  44438. //几何对象的批量空间分析,
  44439. GeometryBufferAnalystParameters.toObject(parameter.param, tempObj.param);
  44440. } else if (parameter.analystName === "overlay") {
  44441. tempObj.analystName = "overlay";
  44442. tempObj.param = {};
  44443. GeometryOverlayAnalystParameters.toObject(parameter.param, tempObj.param);
  44444. } else if (parameter.analystName === "interpolationDensity") {
  44445. tempObj.analystName = "interpolationDensity";
  44446. tempObj.param = {};
  44447. InterpolationAnalystParameters.toObject(parameter.param, tempObj.param);
  44448. } else if (parameter.analystName === "interpolationidw") {
  44449. tempObj.analystName = "interpolationidw";
  44450. tempObj.param = {};
  44451. InterpolationAnalystParameters.toObject(parameter.param, tempObj.param);
  44452. } else if (parameter.analystName === "interpolationRBF") {
  44453. tempObj.analystName = "interpolationRBF";
  44454. tempObj.param = {};
  44455. InterpolationAnalystParameters.toObject(parameter.param, tempObj.param);
  44456. } else if (parameter.analystName === "interpolationKriging") {
  44457. tempObj.analystName = "interpolationKriging";
  44458. tempObj.param = {};
  44459. InterpolationAnalystParameters.toObject(parameter.param, tempObj.param);
  44460. } else if (parameter.analystName === "thiessenpolygon") {
  44461. tempObj.analystName = "thiessenpolygon";
  44462. tempObj.param = {};
  44463. GeometryThiessenAnalystParameters.toObject(parameter.param, tempObj.param);
  44464. } else {
  44465. //isoline; isoregion; calculatemeasure; routelocator 四种分析不需要再处理参数
  44466. return parameter;
  44467. }
  44468. return tempObj;
  44469. }
  44470. /**
  44471. * @override
  44472. */
  44473. }, {
  44474. key: "destroy",
  44475. value: function destroy() {
  44476. GeometryBatchAnalystService_get(GeometryBatchAnalystService_getPrototypeOf(GeometryBatchAnalystService.prototype), "destroy", this).call(this);
  44477. }
  44478. }]);
  44479. return GeometryBatchAnalystService;
  44480. }(SpatialAnalystBase);
  44481. ;// CONCATENATED MODULE: ./src/common/iServer/SpatialAnalystService.js
  44482. function SpatialAnalystService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  44483. function SpatialAnalystService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  44484. function SpatialAnalystService_createClass(Constructor, protoProps, staticProps) { if (protoProps) SpatialAnalystService_defineProperties(Constructor.prototype, protoProps); if (staticProps) SpatialAnalystService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  44485. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  44486. * This program are made available under the terms of the Apache License, Version 2.0
  44487. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  44488. /**
  44489. * @class SpatialAnalystService
  44490. * @extends {ServiceBase}
  44491. * @category iServer SpatialAnalyst
  44492. * @classdesc 空间分析服务类。提供:地区太阳辐射、缓冲区分析、点密度分析、动态分段分析、空间关系分析、插值分析、栅格代数运算、叠加分析、路由定位、路由测量计算、表面分析、地形曲率计算、泰森多边形分析。
  44493. * @example
  44494. * new SpatialAnalystService(url).bufferAnalysis(params,function(result){
  44495. * //doSomething
  44496. * })
  44497. * @param {string} url - 服务地址。
  44498. * @param {Object} options - 参数。
  44499. * @param {string} [options.proxy] - 服务代理地址。
  44500. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  44501. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  44502. * @param {Object} [options.headers] - 请求头。
  44503. * @usage
  44504. */
  44505. var SpatialAnalystService_SpatialAnalystService = /*#__PURE__*/function () {
  44506. function SpatialAnalystService(url, options) {
  44507. SpatialAnalystService_classCallCheck(this, SpatialAnalystService);
  44508. this.url = url;
  44509. this.options = options || {};
  44510. }
  44511. /**
  44512. * @function SpatialAnalystService.prototype.getAreaSolarRadiationResult
  44513. * @description 地区太阳辐射。
  44514. * @param {AreaSolarRadiationParameters} params - 地区太阳辐射参数类。
  44515. * @param {RequestCallback} callback 回调函数。
  44516. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回的结果类型。
  44517. */
  44518. SpatialAnalystService_createClass(SpatialAnalystService, [{
  44519. key: "getAreaSolarRadiationResult",
  44520. value: function getAreaSolarRadiationResult(params, callback, resultFormat) {
  44521. var me = this;
  44522. var areaSolarRadiationService = new AreaSolarRadiationService(me.url, {
  44523. proxy: me.options.proxy,
  44524. withCredentials: me.options.withCredentials,
  44525. crossOrigin: me.options.crossOrigin,
  44526. headers: me.options.headers,
  44527. eventListeners: {
  44528. scope: me,
  44529. processCompleted: callback,
  44530. processFailed: callback
  44531. },
  44532. format: me._processFormat(resultFormat)
  44533. });
  44534. areaSolarRadiationService.processAsync(params);
  44535. }
  44536. /**
  44537. * @function SpatialAnalystService.prototype.bufferAnalysis
  44538. * @description 缓冲区分析。
  44539. * @param {DatasetBufferAnalystParameters} params - 数据集缓冲区分析参数类。
  44540. * @param {RequestCallback} callback 回调函数。
  44541. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回的结果类型。
  44542. */
  44543. }, {
  44544. key: "bufferAnalysis",
  44545. value: function bufferAnalysis(params, callback, resultFormat) {
  44546. var me = this;
  44547. var bufferAnalystService = new BufferAnalystService(me.url, {
  44548. proxy: me.options.proxy,
  44549. withCredentials: me.options.withCredentials,
  44550. crossOrigin: me.options.crossOrigin,
  44551. headers: me.options.headers,
  44552. eventListeners: {
  44553. scope: me,
  44554. processCompleted: callback,
  44555. processFailed: callback
  44556. },
  44557. format: me._processFormat(resultFormat)
  44558. });
  44559. bufferAnalystService.processAsync(params);
  44560. }
  44561. /**
  44562. * @function SpatialAnalystService.prototype.densityAnalysis
  44563. * @description 点密度分析。
  44564. * @param {DensityKernelAnalystParameters} params - 核密度分析参数类。
  44565. * @param {RequestCallback} callback 回调函数。
  44566. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回的结果类型。
  44567. */
  44568. }, {
  44569. key: "densityAnalysis",
  44570. value: function densityAnalysis(params, callback, resultFormat) {
  44571. var me = this;
  44572. var densityAnalystService = new DensityAnalystService(me.url, {
  44573. proxy: me.options.proxy,
  44574. withCredentials: me.options.withCredentials,
  44575. crossOrigin: me.options.crossOrigin,
  44576. headers: me.options.headers,
  44577. eventListeners: {
  44578. scope: me,
  44579. processCompleted: callback,
  44580. processFailed: callback
  44581. },
  44582. format: me._processFormat(resultFormat)
  44583. });
  44584. densityAnalystService.processAsync(params);
  44585. }
  44586. /**
  44587. * @function SpatialAnalystService.prototype.generateSpatialData
  44588. * @description 动态分段分析。
  44589. * @param {GenerateSpatialDataParameters} params - 动态分段操作参数类。
  44590. * @param {RequestCallback} callback 回调函数。
  44591. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回的结果类型。
  44592. */
  44593. }, {
  44594. key: "generateSpatialData",
  44595. value: function generateSpatialData(params, callback, resultFormat) {
  44596. var me = this;
  44597. var generateSpatialDataService = new GenerateSpatialDataService(me.url, {
  44598. proxy: me.options.proxy,
  44599. withCredentials: me.options.withCredentials,
  44600. crossOrigin: me.options.crossOrigin,
  44601. headers: me.options.headers,
  44602. eventListeners: {
  44603. scope: me,
  44604. processCompleted: callback,
  44605. processFailed: callback
  44606. },
  44607. format: me._processFormat(resultFormat)
  44608. });
  44609. generateSpatialDataService.processAsync(params);
  44610. }
  44611. /**
  44612. * @function SpatialAnalystService.prototype.geoRelationAnalysis
  44613. * @description 空间关系分析。
  44614. * @param {GeoRelationAnalystParameters} params - 空间关系分析服务参数类。
  44615. * @param {RequestCallback} callback 回调函数。
  44616. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回的结果类型。
  44617. */
  44618. }, {
  44619. key: "geoRelationAnalysis",
  44620. value: function geoRelationAnalysis(params, callback, resultFormat) {
  44621. var me = this;
  44622. var geoRelationAnalystService = new GeoRelationAnalystService(me.url, {
  44623. proxy: me.options.proxy,
  44624. withCredentials: me.options.withCredentials,
  44625. crossOrigin: me.options.crossOrigin,
  44626. headers: me.options.headers,
  44627. eventListeners: {
  44628. scope: me,
  44629. processCompleted: callback,
  44630. processFailed: callback
  44631. },
  44632. format: me._processFormat(resultFormat)
  44633. });
  44634. geoRelationAnalystService.processAsync(params);
  44635. }
  44636. /**
  44637. * @function SpatialAnalystService.prototype.interpolationAnalysis
  44638. * @description 插值分析。
  44639. * @param {InterpolationRBFAnalystParameters|InterpolationDensityAnalystParameters|InterpolationIDWAnalystParameters|InterpolationKrigingAnalystParameters} params - 样条插值分析参数类。
  44640. * @param {RequestCallback} callback 回调函数。
  44641. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回的结果类型。
  44642. */
  44643. }, {
  44644. key: "interpolationAnalysis",
  44645. value: function interpolationAnalysis(params, callback, resultFormat) {
  44646. var me = this;
  44647. var interpolationAnalystService = new InterpolationAnalystService(me.url, {
  44648. proxy: me.options.proxy,
  44649. withCredentials: me.options.withCredentials,
  44650. crossOrigin: me.options.crossOrigin,
  44651. headers: me.options.headers,
  44652. eventListeners: {
  44653. scope: me,
  44654. processCompleted: callback,
  44655. processFailed: callback
  44656. },
  44657. format: me._processFormat(resultFormat)
  44658. });
  44659. interpolationAnalystService.processAsync(params);
  44660. }
  44661. /**
  44662. * @function SpatialAnalystService.prototype.mathExpressionAnalysis
  44663. * @description 栅格代数运算。
  44664. * @param {MathExpressionAnalysisParameters} params - 栅格代数运算参数类。
  44665. * @param {RequestCallback} callback 回调函数。
  44666. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回的结果类型。
  44667. */
  44668. }, {
  44669. key: "mathExpressionAnalysis",
  44670. value: function mathExpressionAnalysis(params, callback, resultFormat) {
  44671. var me = this;
  44672. var mathExpressionAnalysisService = new MathExpressionAnalysisService(me.url, {
  44673. proxy: me.options.proxy,
  44674. withCredentials: me.options.withCredentials,
  44675. crossOrigin: me.options.crossOrigin,
  44676. headers: me.options.headers,
  44677. eventListeners: {
  44678. scope: me,
  44679. processCompleted: callback,
  44680. processFailed: callback
  44681. },
  44682. format: me._processFormat(resultFormat)
  44683. });
  44684. mathExpressionAnalysisService.processAsync(params);
  44685. }
  44686. /**
  44687. * @function SpatialAnalystService.prototype.overlayAnalysis
  44688. * @description 叠加分析。
  44689. * @param {DatasetOverlayAnalystParameters|GeometryOverlayAnalystParameters} params - 数据集叠加分析参数类或几何对象叠加分析参数类。
  44690. * @param {RequestCallback} callback 回调函数。
  44691. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回的结果类型。
  44692. */
  44693. }, {
  44694. key: "overlayAnalysis",
  44695. value: function overlayAnalysis(params, callback, resultFormat) {
  44696. var me = this;
  44697. var overlayAnalystService = new OverlayAnalystService(me.url, {
  44698. proxy: me.options.proxy,
  44699. withCredentials: me.options.withCredentials,
  44700. crossOrigin: me.options.crossOrigin,
  44701. headers: me.options.headers,
  44702. eventListeners: {
  44703. scope: me,
  44704. processCompleted: callback,
  44705. processFailed: callback
  44706. },
  44707. format: me._processFormat(resultFormat)
  44708. });
  44709. overlayAnalystService.processAsync(params);
  44710. }
  44711. /**
  44712. * @function SpatialAnalystService.prototype.routeCalculateMeasure
  44713. * @description 路由测量计算。
  44714. * @param {RouteCalculateMeasureParameters} params - 基于路由对象计算指定点 M 值操作的参数类。
  44715. * @param {RequestCallback} callback 回调函数。
  44716. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回的结果类型。
  44717. */
  44718. }, {
  44719. key: "routeCalculateMeasure",
  44720. value: function routeCalculateMeasure(params, callback, resultFormat) {
  44721. var me = this;
  44722. var routeCalculateMeasureService = new RouteCalculateMeasureService(me.url, {
  44723. proxy: me.options.proxy,
  44724. withCredentials: me.options.withCredentials,
  44725. crossOrigin: me.options.crossOrigin,
  44726. headers: me.options.headers,
  44727. eventListeners: {
  44728. scope: me,
  44729. processCompleted: callback,
  44730. processFailed: callback
  44731. },
  44732. format: me._processFormat(resultFormat)
  44733. });
  44734. routeCalculateMeasureService.processAsync(params);
  44735. }
  44736. /**
  44737. * @function SpatialAnalystService.prototype.routeLocate
  44738. * @description 路由定位。
  44739. * @param {RouteLocatorParameters} params - 路由对象定位空间对象的参数类。
  44740. * @param {RequestCallback} callback 回调函数。
  44741. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回的结果类型。
  44742. */
  44743. }, {
  44744. key: "routeLocate",
  44745. value: function routeLocate(params, callback, resultFormat) {
  44746. var me = this;
  44747. var routeLocatorService = new RouteLocatorService(me.url, {
  44748. proxy: me.options.proxy,
  44749. withCredentials: me.options.withCredentials,
  44750. crossOrigin: me.options.crossOrigin,
  44751. headers: me.options.headers,
  44752. eventListeners: {
  44753. scope: me,
  44754. processCompleted: callback,
  44755. processFailed: callback
  44756. },
  44757. format: me._processFormat(resultFormat)
  44758. });
  44759. routeLocatorService.processAsync(params);
  44760. }
  44761. /**
  44762. * @function SpatialAnalystService.prototype.surfaceAnalysis
  44763. * @description 表面分析。
  44764. * @param {SurfaceAnalystParameters} params - 表面分析提取操作参数类。
  44765. * @param {RequestCallback} callback 回调函数。
  44766. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回的结果类型。
  44767. */
  44768. }, {
  44769. key: "surfaceAnalysis",
  44770. value: function surfaceAnalysis(params, callback, resultFormat) {
  44771. var me = this;
  44772. var surfaceAnalystService = new SurfaceAnalystService(me.url, {
  44773. proxy: me.options.proxy,
  44774. withCredentials: me.options.withCredentials,
  44775. crossOrigin: me.options.crossOrigin,
  44776. headers: me.options.headers,
  44777. eventListeners: {
  44778. scope: me,
  44779. processCompleted: callback,
  44780. processFailed: callback
  44781. },
  44782. format: me._processFormat(resultFormat)
  44783. });
  44784. surfaceAnalystService.processAsync(params);
  44785. }
  44786. /**
  44787. * @function SpatialAnalystService.prototype.terrainCurvatureCalculate
  44788. * @description 地形曲率计算。
  44789. * @param {TerrainCurvatureCalculationParameters} params - 地形曲率计算参数类。
  44790. * @param {RequestCallback} callback 回调函数。
  44791. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回的结果类型。
  44792. */
  44793. }, {
  44794. key: "terrainCurvatureCalculate",
  44795. value: function terrainCurvatureCalculate(params, callback, resultFormat) {
  44796. var me = this;
  44797. var terrainCurvatureCalculationService = new TerrainCurvatureCalculationService(me.url, {
  44798. proxy: me.options.proxy,
  44799. withCredentials: me.options.withCredentials,
  44800. crossOrigin: me.options.crossOrigin,
  44801. headers: me.options.headers,
  44802. eventListeners: {
  44803. scope: me,
  44804. processCompleted: callback,
  44805. processFailed: callback
  44806. },
  44807. format: me._processFormat(resultFormat)
  44808. });
  44809. terrainCurvatureCalculationService.processAsync(params);
  44810. }
  44811. /**
  44812. * @function SpatialAnalystService.prototype.thiessenAnalysis
  44813. * @description 泰森多边形分析。
  44814. * @param {DatasetThiessenAnalystParameters|GeometryThiessenAnalystParameters} params - 数据集泰森多边形分析参数类。
  44815. * @param {RequestCallback} callback 回调函数。
  44816. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回的结果类型。
  44817. */
  44818. }, {
  44819. key: "thiessenAnalysis",
  44820. value: function thiessenAnalysis(params, callback, resultFormat) {
  44821. var me = this;
  44822. var thiessenAnalystService = new ThiessenAnalystService(me.url, {
  44823. proxy: me.options.proxy,
  44824. withCredentials: me.options.withCredentials,
  44825. crossOrigin: me.options.crossOrigin,
  44826. headers: me.options.headers,
  44827. eventListeners: {
  44828. scope: me,
  44829. processCompleted: callback,
  44830. processFailed: callback
  44831. },
  44832. format: me._processFormat(resultFormat)
  44833. });
  44834. thiessenAnalystService.processAsync(params);
  44835. }
  44836. /**
  44837. * @function SpatialAnalystService.prototype.geometrybatchAnalysis
  44838. * @description 批量空间分析。
  44839. * @param {Array.<Object>} params - 批量分析参数对象数组。
  44840. * @param {Array.<Object>} params.analystName - 空间分析方法的名称。包括:</br>
  44841. * "buffer","overlay","interpolationDensity","interpolationidw","interpolationRBF","interpolationKriging","isoregion","isoline"。
  44842. * @param {Object} params.param - 空间分析类型对应的请求参数,包括:</br>
  44843. * {@link GeometryBufferAnalystParameters} 缓冲区分析参数类。</br>
  44844. * {@link GeometryOverlayAnalystParameters} 叠加分析参数类。</br>
  44845. * {@link InterpolationAnalystParameters} 插值分析参数类。</br>
  44846. * {@link SurfaceAnalystParameters} 表面分析参数类。</br>
  44847. * @param {RequestCallback} callback - 回调函数。
  44848. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回的结果类型。
  44849. */
  44850. }, {
  44851. key: "geometrybatchAnalysis",
  44852. value: function geometrybatchAnalysis(params, callback, resultFormat) {
  44853. var me = this;
  44854. var geometryBatchAnalystService = new GeometryBatchAnalystService(me.url, {
  44855. eventListeners: {
  44856. scope: me,
  44857. processCompleted: callback,
  44858. processFailed: callback
  44859. },
  44860. format: me._processFormat(resultFormat)
  44861. });
  44862. //处理批量分析中各个分类类型的参数:
  44863. var analystParameters = [];
  44864. for (var i = 0; i < params.length; i++) {
  44865. var tempParameter = params[i];
  44866. analystParameters.push({
  44867. analystName: tempParameter.analystName,
  44868. param: tempParameter.param
  44869. });
  44870. }
  44871. geometryBatchAnalystService.processAsync(analystParameters);
  44872. }
  44873. }, {
  44874. key: "_processFormat",
  44875. value: function _processFormat(resultFormat) {
  44876. return resultFormat ? resultFormat : DataFormat.GEOJSON;
  44877. }
  44878. }]);
  44879. return SpatialAnalystService;
  44880. }();
  44881. ;// CONCATENATED MODULE: ./src/maplibregl/services/SpatialAnalystService.js
  44882. function SpatialAnalystService_typeof(obj) { "@babel/helpers - typeof"; return SpatialAnalystService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, SpatialAnalystService_typeof(obj); }
  44883. function services_SpatialAnalystService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  44884. function services_SpatialAnalystService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  44885. function services_SpatialAnalystService_createClass(Constructor, protoProps, staticProps) { if (protoProps) services_SpatialAnalystService_defineProperties(Constructor.prototype, protoProps); if (staticProps) services_SpatialAnalystService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  44886. function SpatialAnalystService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) SpatialAnalystService_setPrototypeOf(subClass, superClass); }
  44887. function SpatialAnalystService_setPrototypeOf(o, p) { SpatialAnalystService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SpatialAnalystService_setPrototypeOf(o, p); }
  44888. function SpatialAnalystService_createSuper(Derived) { var hasNativeReflectConstruct = SpatialAnalystService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = SpatialAnalystService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = SpatialAnalystService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return SpatialAnalystService_possibleConstructorReturn(this, result); }; }
  44889. function SpatialAnalystService_possibleConstructorReturn(self, call) { if (call && (SpatialAnalystService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return SpatialAnalystService_assertThisInitialized(self); }
  44890. function SpatialAnalystService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  44891. function SpatialAnalystService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  44892. function SpatialAnalystService_getPrototypeOf(o) { SpatialAnalystService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SpatialAnalystService_getPrototypeOf(o); }
  44893. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  44894. * This program are made available under the terms of the Apache License, Version 2.0
  44895. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  44896. /**
  44897. * @class SpatialAnalystService
  44898. * @extends {ServiceBase}
  44899. * @category iServer SpatialAnalyst
  44900. * @version 11.1.0
  44901. * @modulecategory Services
  44902. * @classdesc 空间分析服务类。提供:地区太阳辐射、缓冲区分析、点密度分析、动态分段分析、空间关系分析、插值分析、栅格代数运算、叠加分析、路由定位、路由测量计算、表面分析、地形曲率计算、泰森多边形分析。
  44903. * @example
  44904. * new SpatialAnalystService(url)
  44905. * .bufferAnalysis(params,function(result){
  44906. * //doSomething
  44907. * })
  44908. * @param {string} url - 服务地址。
  44909. * @param {Object} options - 参数。
  44910. * @param {string} [options.proxy] - 服务代理地址。
  44911. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  44912. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  44913. * @param {Object} [options.headers] - 请求头。
  44914. * @usage
  44915. */
  44916. var SpatialAnalystService = /*#__PURE__*/function (_ServiceBase) {
  44917. SpatialAnalystService_inherits(SpatialAnalystService, _ServiceBase);
  44918. var _super = SpatialAnalystService_createSuper(SpatialAnalystService);
  44919. function SpatialAnalystService(url, options) {
  44920. var _this;
  44921. services_SpatialAnalystService_classCallCheck(this, SpatialAnalystService);
  44922. _this = _super.call(this, url, options);
  44923. _this._spatialAnalystService = new SpatialAnalystService_SpatialAnalystService(url, options);
  44924. return _this;
  44925. }
  44926. /**
  44927. * @function SpatialAnalystService.prototype.getAreaSolarRadiationResult
  44928. * @description 地区太阳辐射。
  44929. * @param {AreaSolarRadiationParameters} params -查询相关参数类。
  44930. * @param {RequestCallback} callback - 回调函数。
  44931. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  44932. */
  44933. services_SpatialAnalystService_createClass(SpatialAnalystService, [{
  44934. key: "getAreaSolarRadiationResult",
  44935. value: function getAreaSolarRadiationResult(params, callback, resultFormat) {
  44936. this._spatialAnalystService.getAreaSolarRadiationResult(params, callback, resultFormat);
  44937. }
  44938. /**
  44939. * @function SpatialAnalystService.prototype.bufferAnalysis
  44940. * @description 缓冲区分析。
  44941. * @param {DatasetBufferAnalystParameters} params - 数据集缓冲区分析参数类。
  44942. * @param {RequestCallback} callback - 回调函数。
  44943. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  44944. */
  44945. }, {
  44946. key: "bufferAnalysis",
  44947. value: function bufferAnalysis(params, callback, resultFormat) {
  44948. params = this._processParams(params);
  44949. this._spatialAnalystService.bufferAnalysis(params, callback, resultFormat);
  44950. }
  44951. /**
  44952. * @function SpatialAnalystService.prototype.densityAnalysis
  44953. * @description 点密度分析。
  44954. * @param {DensityKernelAnalystParameters} params - 核密度分析参数类。
  44955. * @param {RequestCallback} callback - 回调函数。
  44956. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  44957. */
  44958. }, {
  44959. key: "densityAnalysis",
  44960. value: function densityAnalysis(params, callback, resultFormat) {
  44961. params = this._processParams(params);
  44962. this._spatialAnalystService.densityAnalysis(params, callback, resultFormat);
  44963. }
  44964. /**
  44965. * @function SpatialAnalystService.prototype.generateSpatialData
  44966. * @description 动态分段分析。
  44967. * @param {GenerateSpatialDataParameters} params - 动态分段操作参数类。
  44968. * @param {RequestCallback} callback - 回调函数。
  44969. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  44970. */
  44971. }, {
  44972. key: "generateSpatialData",
  44973. value: function generateSpatialData(params, callback, resultFormat) {
  44974. this._spatialAnalystService.generateSpatialData(params, callback, resultFormat);
  44975. }
  44976. /**
  44977. * @function SpatialAnalystService.prototype.geoRelationAnalysis
  44978. * @description 空间关系分析。
  44979. * @param {GeoRelationAnalystParameters} params - 空间关系分析服务参数类。
  44980. * @param {RequestCallback} callback - 回调函数。
  44981. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  44982. */
  44983. }, {
  44984. key: "geoRelationAnalysis",
  44985. value: function geoRelationAnalysis(params, callback, resultFormat) {
  44986. params = this._processParams(params);
  44987. this._spatialAnalystService.geoRelationAnalysis(params, callback, resultFormat);
  44988. }
  44989. /**
  44990. * @function SpatialAnalystService.prototype.interpolationAnalysis
  44991. * @description 插值分析。
  44992. * @param {InterpolationDensityAnalystParameters|InterpolationIDWAnalystParameters|InterpolationRBFAnalystParameters|InterpolationKrigingAnalystParameters} params - 样条插值(径向基函数插值法)分析参数类。
  44993. * @param {RequestCallback} callback - 回调函数。
  44994. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  44995. */
  44996. }, {
  44997. key: "interpolationAnalysis",
  44998. value: function interpolationAnalysis(params, callback, resultFormat) {
  44999. params = this._processParams(params);
  45000. this._spatialAnalystService.interpolationAnalysis(params, callback, resultFormat);
  45001. }
  45002. /**
  45003. * @function SpatialAnalystService.prototype.mathExpressionAnalysis
  45004. * @description 栅格代数运算。
  45005. * @param {MathExpressionAnalysisParameters} params - 栅格代数运算参数类。
  45006. * @param {RequestCallback} callback - 回调函数。
  45007. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  45008. */
  45009. }, {
  45010. key: "mathExpressionAnalysis",
  45011. value: function mathExpressionAnalysis(params, callback, resultFormat) {
  45012. params = this._processParams(params);
  45013. this._spatialAnalystService.mathExpressionAnalysis(params, callback, resultFormat);
  45014. }
  45015. /**
  45016. * @function SpatialAnalystService.prototype.overlayAnalysis
  45017. * @description 叠加分析。
  45018. * @param {DatasetOverlayAnalystParameters|GeometryOverlayAnalystParameters} params - 数据集叠加分析参数类或者几何对象叠加分析参数类。
  45019. * @param {RequestCallback} callback - 回调函数。
  45020. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  45021. */
  45022. }, {
  45023. key: "overlayAnalysis",
  45024. value: function overlayAnalysis(params, callback, resultFormat) {
  45025. params = this._processParams(params);
  45026. this._spatialAnalystService.overlayAnalysis(params, callback, resultFormat);
  45027. }
  45028. /**
  45029. * @function SpatialAnalystService.prototype.routeCalculateMeasure
  45030. * @description 路由测量计算。
  45031. * @param {RouteCalculateMeasureParameters} params - 基于路由对象计算指定点 M 值操作的参数类。
  45032. * @param {RequestCallback} callback - 回调函数。
  45033. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  45034. */
  45035. }, {
  45036. key: "routeCalculateMeasure",
  45037. value: function routeCalculateMeasure(params, callback, resultFormat) {
  45038. params = this._processParams(params);
  45039. this._spatialAnalystService.routeCalculateMeasure(params, callback, resultFormat);
  45040. }
  45041. /**
  45042. * @function SpatialAnalystService.prototype.routeLocate
  45043. * @description 路由定位。
  45044. * @param {RouteLocatorParameters} params - 路由对象定位空间对象的参数类。
  45045. * @param {RequestCallback} callback - 回调函数。
  45046. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  45047. */
  45048. }, {
  45049. key: "routeLocate",
  45050. value: function routeLocate(params, callback, resultFormat) {
  45051. params = this._processParams(params);
  45052. this._spatialAnalystService.routeLocate(params, callback, resultFormat);
  45053. }
  45054. /**
  45055. * @function SpatialAnalystService.prototype.surfaceAnalysis
  45056. * @description 表面分析。
  45057. * @param {SurfaceAnalystParameters} params - 表面分析提取操作参数类。
  45058. * @param {RequestCallback} callback - 回调函数。
  45059. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  45060. */
  45061. }, {
  45062. key: "surfaceAnalysis",
  45063. value: function surfaceAnalysis(params, callback, resultFormat) {
  45064. params = this._processParams(params);
  45065. this._spatialAnalystService.surfaceAnalysis(params, callback, resultFormat);
  45066. }
  45067. /**
  45068. * @function SpatialAnalystService.prototype.terrainCurvatureCalculate
  45069. * @description 地形曲率计算。
  45070. * @param {TerrainCurvatureCalculationParameters} params - 地形曲率计算参数类。
  45071. * @param {RequestCallback} callback - 回调函数。
  45072. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  45073. */
  45074. }, {
  45075. key: "terrainCurvatureCalculate",
  45076. value: function terrainCurvatureCalculate(params, callback, resultFormat) {
  45077. this._spatialAnalystService.terrainCurvatureCalculate(params, callback, resultFormat);
  45078. }
  45079. /**
  45080. * @function SpatialAnalystService.prototype.thiessenAnalysis
  45081. * @description 泰森多边形分析。
  45082. * @param {DatasetThiessenAnalystParameters|GeometryThiessenAnalystParameters} params - 数据集泰森多边形分析参数类。
  45083. * @param {RequestCallback} callback - 回调函数。
  45084. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  45085. */
  45086. }, {
  45087. key: "thiessenAnalysis",
  45088. value: function thiessenAnalysis(params, callback, resultFormat) {
  45089. params = this._processParams(params);
  45090. this._spatialAnalystService.thiessenAnalysis(params, callback, resultFormat);
  45091. }
  45092. /**
  45093. * @function SpatialAnalystService.prototype.geometrybatchAnalysis
  45094. * @description 批量空间分析。
  45095. * @param {Array.<Object>} params - 批量分析参数对象数组,包括:
  45096. * @param {string} params.analystName - 空间分析方法的名称。包括:</br>
  45097. * "buffer","overlay","interpolationDensity","interpolationidw","interpolationRBF","interpolationKriging","isoregion","isoline"。
  45098. * @param {Object} params.param - 空间分析类型对应的请求参数,包括:</br>
  45099. * {@link GeometryBufferAnalystParameters} 缓冲区分析参数类。</br>
  45100. * {@link GeometryOverlayAnalystParameters} 叠加分析参数类。</br>
  45101. * {@link InterpolationAnalystParameters} 插值分析参数类。</br>
  45102. * {@link SurfaceAnalystParameters} 表面分析参数类。</br>
  45103. * @param {RequestCallback} callback - 回调函数。
  45104. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  45105. */
  45106. }, {
  45107. key: "geometrybatchAnalysis",
  45108. value: function geometrybatchAnalysis(params, callback, resultFormat) {
  45109. for (var i = 0; i < params.length; i++) {
  45110. params[i].param = this._processParams(params[i].param);
  45111. }
  45112. this._spatialAnalystService.geometrybatchAnalysis(params, callback, resultFormat);
  45113. }
  45114. }, {
  45115. key: "_processParams",
  45116. value: function _processParams(params) {
  45117. if (!params) {
  45118. return {};
  45119. }
  45120. if (params.bounds) {
  45121. params.bounds = core_Util_Util.toSuperMapBounds(params.bounds);
  45122. }
  45123. //插值分析点数组转换
  45124. if (params.inputPoints) {
  45125. for (var i = 0; i < params.inputPoints.length; i++) {
  45126. var inputPoint = params.inputPoints[i];
  45127. if (core_Util_Util.isArray(inputPoint)) {
  45128. params.inputPoints[i] = {
  45129. x: inputPoint[0],
  45130. y: inputPoint[1],
  45131. tag: inputPoint[2]
  45132. };
  45133. }
  45134. }
  45135. }
  45136. //点数组转换
  45137. if (params.points) {
  45138. for (var _i2 = 0; _i2 < params.points.length; _i2++) {
  45139. var point = params.points[_i2];
  45140. params.points[_i2] = core_Util_Util.toSuperMapPoint(point);
  45141. }
  45142. }
  45143. //maplibregl点对象转SuperMap点对象
  45144. if (params.point) {
  45145. params.point = core_Util_Util.toSuperMapPoint(params.point);
  45146. }
  45147. //初步判断maplibre数据就为geojson格式 ,进行转json格式即可
  45148. //栅格代数运算的范围
  45149. if (params.extractRegion) {
  45150. params.extractRegion = core_Util_Util.toSuperMapGeometry(params.extractRegion);
  45151. }
  45152. //获取或设置表面分析参数
  45153. if (params.extractParameter && params.extractParameter.clipRegion) {
  45154. params.extractParameter.clipRegion = core_Util_Util.toSuperMapGeometry(params.extractParameter.clipRegion);
  45155. }
  45156. if (params.clipParam && params.clipParam.clipRegion) {
  45157. params.clipParam.clipRegion = core_Util_Util.toSuperMapGeometry(params.clipParam.clipRegion);
  45158. }
  45159. //sourceRoute 路由对象。用于里程分析,该对象可以是用户自己生 成或在数据源中查询得到的符合标准的路由对象;geojson格式
  45160. if (params.sourceRoute) {
  45161. if (params.sourceRoute) {
  45162. var target = {};
  45163. target.type = "LINEM";
  45164. target.parts = [params.sourceRoute.geometry.coordinates.length];
  45165. target.points = [];
  45166. for (var _i4 = 0; _i4 < params.sourceRoute.geometry.coordinates.length; _i4++) {
  45167. var lnglat = params.sourceRoute.geometry.coordinates[_i4];
  45168. //measure 应该在传值时设置,
  45169. target.points = target.points.concat({
  45170. x: lnglat[0],
  45171. y: lnglat[1],
  45172. measure: lnglat[2]
  45173. });
  45174. }
  45175. params.sourceRoute = target;
  45176. }
  45177. }
  45178. //operateRegions 操作面对象集合,数据集叠加分析,表示与这些面对象进行叠加分析
  45179. if (params.operateRegions && core_Util_Util.isArray(params.operateRegions)) {
  45180. params.operateRegions.map(function (geometry, key) {
  45181. params.operateRegions[key] = core_Util_Util.toSuperMapGeometry(geometry);
  45182. return params.operateRegions[key];
  45183. });
  45184. }
  45185. //叠加分析,几何数据源 支持格式:GeoJson
  45186. if (params.sourceGeometry) {
  45187. var SRID = null;
  45188. if (params.sourceGeometrySRID) {
  45189. SRID = params.sourceGeometrySRID;
  45190. }
  45191. params.sourceGeometry = core_Util_Util.toSuperMapGeometry(params.sourceGeometry);
  45192. if (SRID) {
  45193. params.sourceGeometry.SRID = SRID;
  45194. }
  45195. delete params.sourceGeometry.sourceGeometrySRID;
  45196. }
  45197. if (params.operateGeometry) {
  45198. params.operateGeometry = core_Util_Util.toSuperMapGeometry(params.operateGeometry);
  45199. }
  45200. //支持传入多个几何要素进行叠加分析:
  45201. if (params.sourceGeometries) {
  45202. var sourceGeometries = [];
  45203. for (var k = 0; k < params.sourceGeometries.length; k++) {
  45204. sourceGeometries.push(core_Util_Util.toSuperMapGeometry(params.sourceGeometries[k]));
  45205. }
  45206. params.sourceGeometries = sourceGeometries;
  45207. }
  45208. //支持传入多个几何要素进行叠加分析:
  45209. if (params.operateGeometries) {
  45210. var operateGeometries = [];
  45211. for (var j = 0; j < params.operateGeometries.length; j++) {
  45212. operateGeometries.push(core_Util_Util.toSuperMapGeometry(params.operateGeometries[j]));
  45213. }
  45214. params.operateGeometries = operateGeometries;
  45215. }
  45216. //components 几何对象数组 Route
  45217. if (params.sourceRoute && params.sourceRoute.components && core_Util_Util.isArray(params.sourceRoute.components)) {
  45218. params.sourceRoute.components.map(function (geometry, key) {
  45219. params.sourceRoute.components[key] = core_Util_Util.toSuperMapGeometry(geometry);
  45220. return params.sourceRoute.components[key];
  45221. });
  45222. }
  45223. return params;
  45224. }
  45225. }, {
  45226. key: "_processFormat",
  45227. value: function _processFormat(resultFormat) {
  45228. return resultFormat ? resultFormat : DataFormat.GEOJSON;
  45229. }
  45230. }]);
  45231. return SpatialAnalystService;
  45232. }(ServiceBase);
  45233. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeParameters.js
  45234. function ThemeParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  45235. function ThemeParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  45236. function ThemeParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  45237. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  45238. * This program are made available under the terms of the Apache License, Version 2.0
  45239. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  45240. /**
  45241. * @class ThemeParameters
  45242. * @deprecatedclass SuperMap.ThemeParameters
  45243. * @category iServer Map Theme
  45244. * @classdesc 专题图参数类。
  45245. * 该类存储了制作专题所需的参数,包括数据源、数据集名称和专题图对象。
  45246. * @param {Object} options - 参数。
  45247. * @param {Array.<string>} options.datasetNames - 数据集数组。
  45248. * @param {Array.<string>} options.dataSourceNames - 数据源数组。
  45249. * @param {Array.<JoinItem>} [options.joinItems] - 专题图外部表的连接信息 JoinItem 数组。
  45250. * @param {Array.<CommonTheme>} options.themes - 专题图对象列表。
  45251. * @param {Array.<string>} [options.displayFilters] - 专题图属性过滤条件。
  45252. * @param {Array.<string>} [options.displayOrderBys] - 专题图对象生成符号叠加次序排序字段。
  45253. * @param {Object} [options.fieldValuesDisplayFilter] - 图层要素的显示和隐藏的过滤属性,其带有三个属性,分别是:values、fieldName、fieldValuesDisplayMode。
  45254. * @usage
  45255. */
  45256. var ThemeParameters = /*#__PURE__*/function () {
  45257. function ThemeParameters(options) {
  45258. ThemeParameters_classCallCheck(this, ThemeParameters);
  45259. /**
  45260. * @member {Array.<string>} ThemeParameters.prototype.datasetNames
  45261. * @description 要制作专题图的数据集数组。
  45262. */
  45263. this.datasetNames = null;
  45264. /**
  45265. * @member {Array.<string>} ThemeParameters.prototype.dataSourceNames
  45266. * @description 要制作专题图的数据集所在的数据源数组。
  45267. */
  45268. this.dataSourceNames = null;
  45269. /**
  45270. * @member {Array.<JoinItem>} [ThemeParameters.prototype.joinItems]
  45271. * @description 设置与外部表的连接信息 JoinItem 数组。
  45272. * 使用此属性可以制作与外部表连接的专题图。
  45273. */
  45274. this.joinItems = null;
  45275. /**
  45276. * @member {Array.<CommonTheme>} ThemeParameters.prototype.themes
  45277. * @description 专题图对象列表。
  45278. * 该参数为实例化的各类专题图对象的集合。
  45279. */
  45280. this.themes = null;
  45281. /**
  45282. * @member {Array.<string>} [ThemeParameters.prototype.displayFilters]
  45283. * @description 专题图属性过滤条件。
  45284. */
  45285. this.displayFilters = null;
  45286. /**
  45287. * @member {Array.<string>} [ThemeParameters.prototype.displayOrderBys]
  45288. * @description 专题图对象生成符号叠加次序排序字段。
  45289. */
  45290. this.displayOrderBys = null;
  45291. /**
  45292. * @member {Object} [ThemeParameters.prototype.fieldValuesDisplayFilter]
  45293. * @property {Array.<number>} values - 待过滤的值。
  45294. * @property {string} fieldName - 待过滤的字段名称只支持数字类型的字段。
  45295. * @property {string} fieldValuesDisplayMode - 目前为 DISPLAY/DISABLE。当为 DISPLAY 时,表示只显示以上设置的相应属性值的要素,否则表示不显示以上设置的相应属性值的要素。
  45296. */
  45297. this.fieldValuesDisplayFilter = null;
  45298. if (options) {
  45299. Util_Util.extend(this, options);
  45300. }
  45301. this.CLASS_NAME = "SuperMap.ThemeParameters";
  45302. }
  45303. /**
  45304. * @function ThemeParameters.prototype.destroy
  45305. * @description 释放资源,将引用资源的属性置空。
  45306. */
  45307. ThemeParameters_createClass(ThemeParameters, [{
  45308. key: "destroy",
  45309. value: function destroy() {
  45310. var me = this;
  45311. me.datasetNames = null;
  45312. me.dataSourceNames = null;
  45313. if (me.joinItems) {
  45314. for (var i = 0, joinItems = me.joinItems, len = joinItems.length; i < len; i++) {
  45315. joinItems[i].destroy();
  45316. }
  45317. me.joinItems = null;
  45318. }
  45319. if (me.themes) {
  45320. for (var _i2 = 0, themes = me.themes, _len2 = themes.length; _i2 < _len2; _i2++) {
  45321. themes[_i2].destroy();
  45322. }
  45323. me.themes = null;
  45324. }
  45325. }
  45326. }]);
  45327. return ThemeParameters;
  45328. }();
  45329. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeService.js
  45330. function ThemeService_typeof(obj) { "@babel/helpers - typeof"; return ThemeService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, ThemeService_typeof(obj); }
  45331. function ThemeService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  45332. function ThemeService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  45333. function ThemeService_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeService_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  45334. function ThemeService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { ThemeService_get = Reflect.get.bind(); } else { ThemeService_get = function _get(target, property, receiver) { var base = ThemeService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return ThemeService_get.apply(this, arguments); }
  45335. function ThemeService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ThemeService_getPrototypeOf(object); if (object === null) break; } return object; }
  45336. function ThemeService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) ThemeService_setPrototypeOf(subClass, superClass); }
  45337. function ThemeService_setPrototypeOf(o, p) { ThemeService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ThemeService_setPrototypeOf(o, p); }
  45338. function ThemeService_createSuper(Derived) { var hasNativeReflectConstruct = ThemeService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = ThemeService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = ThemeService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return ThemeService_possibleConstructorReturn(this, result); }; }
  45339. function ThemeService_possibleConstructorReturn(self, call) { if (call && (ThemeService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return ThemeService_assertThisInitialized(self); }
  45340. function ThemeService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  45341. function ThemeService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  45342. function ThemeService_getPrototypeOf(o) { ThemeService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ThemeService_getPrototypeOf(o); }
  45343. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  45344. * This program are made available under the terms of the Apache License, Version 2.0
  45345. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  45346. /**
  45347. * @class ThemeService
  45348. * @deprecatedclass SuperMap.ThemeService
  45349. * @category iServer Map Theme
  45350. * @classdesc 专题图服务类。
  45351. * @extends {CommonServiceBase}
  45352. * @example
  45353. * var myThemeService = new ThemeService(url, {
  45354. * eventListeners: {
  45355. * "processCompleted": themeCompleted,
  45356. * "processFailed": themeFailed
  45357. * }
  45358. * });
  45359. * @param {string} url - 服务地址。如:http://localhost:8090/iserver/services/map-world/rest/maps/World+Map 。
  45360. * @param {Object} options - 参数。
  45361. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  45362. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  45363. * @param {Object} [options.headers] - 请求头。
  45364. * @usage
  45365. */
  45366. var ThemeService_ThemeService = /*#__PURE__*/function (_CommonServiceBase) {
  45367. ThemeService_inherits(ThemeService, _CommonServiceBase);
  45368. var _super = ThemeService_createSuper(ThemeService);
  45369. function ThemeService(url, options) {
  45370. var _this;
  45371. ThemeService_classCallCheck(this, ThemeService);
  45372. _this = _super.call(this, url, options);
  45373. if (options) {
  45374. Util_Util.extend(ThemeService_assertThisInitialized(_this), options);
  45375. }
  45376. _this.eventCount = 0;
  45377. _this.url = Util_Util.urlPathAppend(_this.url, 'tempLayersSet');
  45378. _this.CLASS_NAME = 'SuperMap.ThemeService';
  45379. return _this;
  45380. }
  45381. /**
  45382. * @override
  45383. */
  45384. ThemeService_createClass(ThemeService, [{
  45385. key: "destroy",
  45386. value: function destroy() {
  45387. ThemeService_get(ThemeService_getPrototypeOf(ThemeService.prototype), "destroy", this).call(this);
  45388. }
  45389. /**
  45390. * @function ThemeService.prototype.processAsync
  45391. * @description 负责将客户端的专题图参数传递到服务端。
  45392. * @param {ThemeParameters} params - 专题图参数类。
  45393. */
  45394. }, {
  45395. key: "processAsync",
  45396. value: function processAsync(params, callback) {
  45397. if (!(params instanceof ThemeParameters)) {
  45398. return;
  45399. }
  45400. var me = this,
  45401. jsonParameters = null;
  45402. jsonParameters = me.getJsonParameters(params);
  45403. var eventId = ++this.eventCount;
  45404. var eventListeners = {
  45405. scope: this,
  45406. processCompleted: function processCompleted(result) {
  45407. if (eventId === result.result.eventId && callback) {
  45408. delete result.result.eventId;
  45409. callback(result);
  45410. this.events && this.events.un(eventListeners);
  45411. return false;
  45412. }
  45413. },
  45414. processFailed: function processFailed(result) {
  45415. if ((eventId === result.error.eventId || eventId === result.eventId) && callback) {
  45416. callback(result);
  45417. this.events && this.events.un(eventListeners);
  45418. return false;
  45419. }
  45420. }
  45421. };
  45422. this.events.on(eventListeners);
  45423. me.request({
  45424. method: "POST",
  45425. data: jsonParameters,
  45426. scope: me,
  45427. success: function success(result, options) {
  45428. result.eventId = eventId;
  45429. this.serviceProcessCompleted(result, options);
  45430. },
  45431. failure: function failure(result, options) {
  45432. if (result.error) {
  45433. result.error.eventId = eventId;
  45434. }
  45435. result.eventId = eventId;
  45436. this.serviceProcessFailed(result, options);
  45437. }
  45438. });
  45439. }
  45440. /**
  45441. * @function ThemeService.prototype.getJsonParameters
  45442. * @description 将专题图参数参数转化为 JSON 字符串。
  45443. * @param {ThemeParameters} parameter - 专题图参数类。
  45444. * @returns {Object} 转化后的JSON字符串。
  45445. */
  45446. }, {
  45447. key: "getJsonParameters",
  45448. value: function getJsonParameters(parameter) {
  45449. var jsonParameters = "",
  45450. themeObj = null,
  45451. filters = null,
  45452. orderBys = null,
  45453. fieldValuesDisplayFilter;
  45454. jsonParameters += "[{'type': 'UGC','subLayers': {'layers': [";
  45455. for (var i = 0; i < parameter.themes.length; i++) {
  45456. themeObj = parameter.themes[i];
  45457. var jsonTheme = Util_Util.toJSON(themeObj);
  45458. jsonTheme = jsonTheme.slice(0, -1);
  45459. jsonParameters += "{'theme': " + jsonTheme + "},'type': 'UGC','ugcLayerType': 'THEME',";
  45460. filters = parameter.displayFilters;
  45461. if (filters && filters.length > 0) {
  45462. if (filters.length === 1) {
  45463. jsonParameters += "'displayFilter':\"" + filters[0] + "\",";
  45464. } else {
  45465. jsonParameters += "'displayFilter':\"" + filters[i] + "\",";
  45466. }
  45467. }
  45468. orderBys = parameter.displayOrderBy;
  45469. if (orderBys && orderBys.length > 0) {
  45470. if (orderBys.length === 1) {
  45471. jsonParameters += "'displayOrderBy':'" + orderBys[0] + "',";
  45472. } else {
  45473. jsonParameters += "'displayOrderBy':'" + orderBys[i] + "',";
  45474. }
  45475. }
  45476. fieldValuesDisplayFilter = parameter.fieldValuesDisplayFilter;
  45477. if (fieldValuesDisplayFilter) {
  45478. jsonParameters += "'fieldValuesDisplayFilter':" + Util_Util.toJSON(fieldValuesDisplayFilter) + ",";
  45479. }
  45480. if (parameter.joinItems && parameter.joinItems.length > 0 && parameter.joinItems[i]) {
  45481. jsonParameters += "'joinItems':[" + Util_Util.toJSON(parameter.joinItems[i]) + "],";
  45482. }
  45483. if (parameter.datasetNames && parameter.dataSourceNames) {
  45484. var datasetID = parameter.datasetNames[i] ? i : parameter.datasetNames.length - 1;
  45485. var dataSourceID = parameter.dataSourceNames[i] ? i : parameter.dataSourceNames.length - 1;
  45486. jsonParameters += "'datasetInfo': {'name': '" + parameter.datasetNames[datasetID] + "','dataSourceName': '" + parameter.dataSourceNames[dataSourceID] + "'}},";
  45487. } else {
  45488. jsonParameters += "},";
  45489. }
  45490. }
  45491. //去除多余的逗号
  45492. if (parameter.themes && parameter.themes.length > 0) {
  45493. jsonParameters = jsonParameters.substring(0, jsonParameters.length - 1);
  45494. }
  45495. jsonParameters += "]},";
  45496. var urlArray = this.url.split("/");
  45497. var jsonMapName = urlArray[urlArray.length - 2];
  45498. jsonParameters += "'name': '" + jsonMapName + "'}]";
  45499. return jsonParameters;
  45500. }
  45501. }]);
  45502. return ThemeService;
  45503. }(CommonServiceBase);
  45504. ;// CONCATENATED MODULE: ./src/maplibregl/services/ThemeService.js
  45505. function services_ThemeService_typeof(obj) { "@babel/helpers - typeof"; return services_ThemeService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, services_ThemeService_typeof(obj); }
  45506. function services_ThemeService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  45507. function services_ThemeService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  45508. function services_ThemeService_createClass(Constructor, protoProps, staticProps) { if (protoProps) services_ThemeService_defineProperties(Constructor.prototype, protoProps); if (staticProps) services_ThemeService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  45509. function services_ThemeService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) services_ThemeService_setPrototypeOf(subClass, superClass); }
  45510. function services_ThemeService_setPrototypeOf(o, p) { services_ThemeService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return services_ThemeService_setPrototypeOf(o, p); }
  45511. function services_ThemeService_createSuper(Derived) { var hasNativeReflectConstruct = services_ThemeService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = services_ThemeService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = services_ThemeService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return services_ThemeService_possibleConstructorReturn(this, result); }; }
  45512. function services_ThemeService_possibleConstructorReturn(self, call) { if (call && (services_ThemeService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return services_ThemeService_assertThisInitialized(self); }
  45513. function services_ThemeService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  45514. function services_ThemeService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  45515. function services_ThemeService_getPrototypeOf(o) { services_ThemeService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return services_ThemeService_getPrototypeOf(o); }
  45516. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  45517. * This program are made available under the terms of the Apache License, Version 2.0
  45518. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  45519. /**
  45520. * @class ThemeService
  45521. * @category iServer Map Theme
  45522. * @classdesc 专题图服务类。
  45523. * @version 11.1.0
  45524. * @extends {ServiceBase}
  45525. * @example
  45526. * new ThemeService(url,{
  45527. * projection:projection
  45528. * }).getThemeInfo(params,function(result){
  45529. * //doSomething
  45530. * });
  45531. * @param {string} url - 服务地址。
  45532. * @param {Object} options - 参数。
  45533. * @param {string} [options.proxy] - 服务代理地址。
  45534. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  45535. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  45536. * @param {Object} [options.headers] - 请求头。
  45537. * @usage
  45538. */
  45539. var ThemeService = /*#__PURE__*/function (_ServiceBase) {
  45540. services_ThemeService_inherits(ThemeService, _ServiceBase);
  45541. var _super = services_ThemeService_createSuper(ThemeService);
  45542. function ThemeService(url, options) {
  45543. var _this;
  45544. services_ThemeService_classCallCheck(this, ThemeService);
  45545. _this = _super.call(this, url, options);
  45546. _this._commonThemeService = new ThemeService_ThemeService(url, options);
  45547. return _this;
  45548. }
  45549. /**
  45550. * @function ThemeService.prototype.getThemeInfo
  45551. * @description 获取专题图信息。
  45552. * @param {ThemeParameters} params - 专题图参数类。
  45553. * @param {RequestCallback} callback - 回调函数。
  45554. */
  45555. services_ThemeService_createClass(ThemeService, [{
  45556. key: "getThemeInfo",
  45557. value: function getThemeInfo(params, callback) {
  45558. this._commonThemeService.processAsync(params, callback);
  45559. }
  45560. }]);
  45561. return ThemeService;
  45562. }(ServiceBase);
  45563. ;// CONCATENATED MODULE: ./src/common/iServer/StopQueryParameters.js
  45564. function StopQueryParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  45565. function StopQueryParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  45566. function StopQueryParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) StopQueryParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) StopQueryParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  45567. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  45568. * This program are made available under the terms of the Apache License, Version 2.0
  45569. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  45570. /**
  45571. * @class StopQueryParameters
  45572. * @deprecatedclass SuperMap.StopQueryParameters
  45573. * @category iServer TrafficTransferAnalyst TransferStops
  45574. * @classdesc 站点查询参数类。
  45575. * @param {Object} options - 参数。
  45576. * @param {string} options.keyWord - 站点名称关键字。
  45577. * @param {boolean} [options.returnPosition=false] - 是否返回站点坐标信息。
  45578. * @usage
  45579. */
  45580. var StopQueryParameters = /*#__PURE__*/function () {
  45581. function StopQueryParameters(options) {
  45582. StopQueryParameters_classCallCheck(this, StopQueryParameters);
  45583. options = options || {};
  45584. /**
  45585. * @member {string} StopQueryParameters.prototype.keyWord
  45586. * @description 站点名称关键字。
  45587. */
  45588. this.keyWord = null;
  45589. /**
  45590. * @member {boolean} [StopQueryParameters.prototype.returnPosition=false]
  45591. * @description 是否返回站点坐标信息。
  45592. */
  45593. this.returnPosition = false;
  45594. Util_Util.extend(this, options);
  45595. this.CLASS_NAME = "SuperMap.StopQueryParameters";
  45596. }
  45597. /**
  45598. * @function StopQueryParameters.prototype.destroy
  45599. * @description 释放资源,将引用资源的属性置空。
  45600. */
  45601. StopQueryParameters_createClass(StopQueryParameters, [{
  45602. key: "destroy",
  45603. value: function destroy() {
  45604. Util_Util.reset(this);
  45605. }
  45606. }]);
  45607. return StopQueryParameters;
  45608. }();
  45609. ;// CONCATENATED MODULE: ./src/common/iServer/StopQueryService.js
  45610. function StopQueryService_typeof(obj) { "@babel/helpers - typeof"; return StopQueryService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, StopQueryService_typeof(obj); }
  45611. function StopQueryService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  45612. function StopQueryService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  45613. function StopQueryService_createClass(Constructor, protoProps, staticProps) { if (protoProps) StopQueryService_defineProperties(Constructor.prototype, protoProps); if (staticProps) StopQueryService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  45614. function StopQueryService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { StopQueryService_get = Reflect.get.bind(); } else { StopQueryService_get = function _get(target, property, receiver) { var base = StopQueryService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return StopQueryService_get.apply(this, arguments); }
  45615. function StopQueryService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = StopQueryService_getPrototypeOf(object); if (object === null) break; } return object; }
  45616. function StopQueryService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) StopQueryService_setPrototypeOf(subClass, superClass); }
  45617. function StopQueryService_setPrototypeOf(o, p) { StopQueryService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return StopQueryService_setPrototypeOf(o, p); }
  45618. function StopQueryService_createSuper(Derived) { var hasNativeReflectConstruct = StopQueryService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = StopQueryService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = StopQueryService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return StopQueryService_possibleConstructorReturn(this, result); }; }
  45619. function StopQueryService_possibleConstructorReturn(self, call) { if (call && (StopQueryService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return StopQueryService_assertThisInitialized(self); }
  45620. function StopQueryService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  45621. function StopQueryService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  45622. function StopQueryService_getPrototypeOf(o) { StopQueryService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return StopQueryService_getPrototypeOf(o); }
  45623. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  45624. * This program are made available under the terms of the Apache License, Version 2.0
  45625. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  45626. /**
  45627. * @class StopQueryService
  45628. * @deprecatedclass SuperMap.StopQueryService
  45629. * @category iServer TrafficTransferAnalyst TransferStops
  45630. * @classdesc 站点查询服务类。
  45631. * 返回结果通过该类支持的事件的监听函数参数获取
  45632. * @extends {CommonServiceBase}
  45633. * @param {string} url - 服务地址。
  45634. * 例如:</br>"http://localhost:8090/iserver/services/traffictransferanalyst-sample/restjsr/traffictransferanalyst/Traffic-Changchun"。
  45635. * @param {Object} options - 参数。
  45636. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  45637. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  45638. * @param {Object} [options.headers] - 请求头。
  45639. * @example 例如:
  45640. * (start code)
  45641. * var myService = new StopQueryService(url, {eventListeners: {
  45642. * "processCompleted": StopQueryCompleted,
  45643. * "processFailed": StopQueryError
  45644. * }
  45645. * };
  45646. * (end)
  45647. * @usage
  45648. *
  45649. */
  45650. var StopQueryService = /*#__PURE__*/function (_CommonServiceBase) {
  45651. StopQueryService_inherits(StopQueryService, _CommonServiceBase);
  45652. var _super = StopQueryService_createSuper(StopQueryService);
  45653. function StopQueryService(url, options) {
  45654. var _this;
  45655. StopQueryService_classCallCheck(this, StopQueryService);
  45656. _this = _super.call(this, url, options);
  45657. options = options || {};
  45658. Util_Util.extend(StopQueryService_assertThisInitialized(_this), options);
  45659. _this.CLASS_NAME = "SuperMap.StopQueryService";
  45660. return _this;
  45661. }
  45662. /**
  45663. *@override
  45664. */
  45665. StopQueryService_createClass(StopQueryService, [{
  45666. key: "destroy",
  45667. value: function destroy() {
  45668. StopQueryService_get(StopQueryService_getPrototypeOf(StopQueryService.prototype), "destroy", this).call(this);
  45669. Util_Util.reset(this);
  45670. }
  45671. /**
  45672. * @function StopQueryService.prototype.processAsync
  45673. * @description 负责将客户端的更新参数传递到服务端。
  45674. * @param {StopQueryParameters} params - 交通换乘参数。
  45675. */
  45676. }, {
  45677. key: "processAsync",
  45678. value: function processAsync(params) {
  45679. if (!(params instanceof StopQueryParameters)) {
  45680. return;
  45681. }
  45682. var me = this;
  45683. me.url = Util_Util.urlPathAppend(me.url, 'stops/keyword/' + params.keyWord);
  45684. me.request({
  45685. method: "GET",
  45686. params: {
  45687. returnPosition: params.returnPosition
  45688. },
  45689. scope: me,
  45690. success: me.serviceProcessCompleted,
  45691. failure: me.serviceProcessFailed
  45692. });
  45693. }
  45694. }]);
  45695. return StopQueryService;
  45696. }(CommonServiceBase);
  45697. ;// CONCATENATED MODULE: ./src/common/iServer/TransferPathParameters.js
  45698. function TransferPathParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  45699. function TransferPathParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  45700. function TransferPathParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) TransferPathParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) TransferPathParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  45701. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  45702. * This program are made available under the terms of the Apache License, Version 2.0
  45703. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  45704. /**
  45705. * @class TransferPathParameters
  45706. * @deprecatedclass SuperMap.TransferPathParameters
  45707. * @category iServer TrafficTransferAnalyst TransferPath
  45708. * @classdesc 交通换乘线路查询参数类。
  45709. * @param {Object} options - 参数。
  45710. * @param {Array.<TransferLine>} options.transferLines - 本换乘分段内可乘车的路线集合。
  45711. * @param {Array.<GeometryPoint|L.Point|L.LatLng|ol.geom.Point|mapboxgl.LngLat|Array.<number>|number>} options.points - 两种查询方式:按照公交站点的起止 ID 进行查询和按照起止点的坐标进行查询。
  45712. * @usage
  45713. */
  45714. var TransferPathParameters = /*#__PURE__*/function () {
  45715. function TransferPathParameters(options) {
  45716. TransferPathParameters_classCallCheck(this, TransferPathParameters);
  45717. options = options || {};
  45718. /**
  45719. * @member {Array.<TransferLine>} TransferPathParameters.prototype.transferLines
  45720. * @description 本换乘分段内可乘车的路线集合,通过交通换乘方案查询得到。
  45721. */
  45722. this.transferLines = null;
  45723. /**
  45724. * @member {Array.<GeometryPoint|L.Point|L.LatLng|ol.geom.Point|mapboxgl.LngLat|Array.<number>|number>} TransferPathParameters.prototype.points
  45725. * @description 两种查询方式:<br>
  45726. * 1. 按照公交站点的起止ID进行查询,则 points 参数的类型为 int[],形如:[起点ID、终点ID],公交站点的 ID 对应服务提供者配置中的站点 ID 字段;
  45727. * 2. 按照起止点的坐标进行查询,则 points 参数的类型为 Point2D[],形如:[{"x":44,"y":39},{"x":45,"y":40}]。
  45728. */
  45729. this.points = null;
  45730. Util_Util.extend(this, options);
  45731. this.CLASS_NAME = "SuperMap.TransferPathParameters";
  45732. }
  45733. /**
  45734. * @function TransferPathParameters.prototype.destroy
  45735. * @description 释放资源,将引用资源的属性置空。
  45736. */
  45737. TransferPathParameters_createClass(TransferPathParameters, [{
  45738. key: "destroy",
  45739. value: function destroy() {
  45740. Util_Util.reset(this);
  45741. }
  45742. /**
  45743. * @function TransferPathParameters.toJson
  45744. * @description 将 {@link TransferPathParameters} 对象参数转换为 JSON 字符串。
  45745. * @param {TransferPathParameters} params - 交通换乘参数。
  45746. * @returns {string} 转化后的 JSON 字符串。
  45747. */
  45748. }], [{
  45749. key: "toJson",
  45750. value: function toJson(params) {
  45751. if (params) {
  45752. return Util_Util.toJSON(params);
  45753. }
  45754. }
  45755. }]);
  45756. return TransferPathParameters;
  45757. }();
  45758. ;// CONCATENATED MODULE: ./src/common/iServer/TransferPathService.js
  45759. function TransferPathService_typeof(obj) { "@babel/helpers - typeof"; return TransferPathService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, TransferPathService_typeof(obj); }
  45760. function TransferPathService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  45761. function TransferPathService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  45762. function TransferPathService_createClass(Constructor, protoProps, staticProps) { if (protoProps) TransferPathService_defineProperties(Constructor.prototype, protoProps); if (staticProps) TransferPathService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  45763. function TransferPathService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { TransferPathService_get = Reflect.get.bind(); } else { TransferPathService_get = function _get(target, property, receiver) { var base = TransferPathService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return TransferPathService_get.apply(this, arguments); }
  45764. function TransferPathService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = TransferPathService_getPrototypeOf(object); if (object === null) break; } return object; }
  45765. function TransferPathService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) TransferPathService_setPrototypeOf(subClass, superClass); }
  45766. function TransferPathService_setPrototypeOf(o, p) { TransferPathService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return TransferPathService_setPrototypeOf(o, p); }
  45767. function TransferPathService_createSuper(Derived) { var hasNativeReflectConstruct = TransferPathService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = TransferPathService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = TransferPathService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return TransferPathService_possibleConstructorReturn(this, result); }; }
  45768. function TransferPathService_possibleConstructorReturn(self, call) { if (call && (TransferPathService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return TransferPathService_assertThisInitialized(self); }
  45769. function TransferPathService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  45770. function TransferPathService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  45771. function TransferPathService_getPrototypeOf(o) { TransferPathService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return TransferPathService_getPrototypeOf(o); }
  45772. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  45773. * This program are made available under the terms of the Apache License, Version 2.0
  45774. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  45775. /**
  45776. * @class TransferPathService
  45777. * @deprecatedclass SuperMap.TransferPathService
  45778. * @category iServer TrafficTransferAnalyst TransferPath
  45779. * @classdesc 交通换乘线路查询服务类,根据交通换乘分析结果(TransferSolutionResult),获取某一条乘车路线的详细信息。
  45780. * 返回结果通过该类支持的事件的监听函数参数获取
  45781. * @extends {CommonServiceBase}
  45782. * @example 例如:
  45783. * var myService = new TransferPathService(url, {eventListeners: {
  45784. * "processCompleted": TrafficTransferCompleted,
  45785. * "processFailed": TrafficTransferError
  45786. * }
  45787. * };
  45788. * @param {string} url - 服务地址。
  45789. * 例如:</br>"http://localhost:8090/iserver/services/traffictransferanalyst-sample/restjsr/traffictransferanalyst/Traffic-Changchun"。
  45790. * @param {Object} options - 参数。
  45791. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  45792. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  45793. * @param {Object} [options.headers] - 请求头。
  45794. * @usage
  45795. */
  45796. var TransferPathService = /*#__PURE__*/function (_CommonServiceBase) {
  45797. TransferPathService_inherits(TransferPathService, _CommonServiceBase);
  45798. var _super = TransferPathService_createSuper(TransferPathService);
  45799. function TransferPathService(url, options) {
  45800. var _this;
  45801. TransferPathService_classCallCheck(this, TransferPathService);
  45802. _this = _super.call(this, url, options);
  45803. _this.CLASS_NAME = "SuperMap.TransferPathService";
  45804. return _this;
  45805. }
  45806. /**
  45807. * @override
  45808. */
  45809. TransferPathService_createClass(TransferPathService, [{
  45810. key: "destroy",
  45811. value: function destroy() {
  45812. TransferPathService_get(TransferPathService_getPrototypeOf(TransferPathService.prototype), "destroy", this).call(this);
  45813. }
  45814. /**
  45815. * @function TransferPathService.prototype.processAsync
  45816. * @description 负责将客户端的更新参数传递到服务端。
  45817. * @param {TransferPathParameters} params - 交通换乘参数。
  45818. */
  45819. }, {
  45820. key: "processAsync",
  45821. value: function processAsync(params) {
  45822. if (!(params instanceof TransferPathParameters)) {
  45823. return;
  45824. }
  45825. var me = this,
  45826. method = "GET",
  45827. jsonParameters;
  45828. me.url = Util_Util.urlPathAppend(me.url, 'path');
  45829. jsonParameters = {
  45830. points: Util_Util.toJSON(params.points),
  45831. transferLines: Util_Util.toJSON(params['transferLines'])
  45832. };
  45833. me.request({
  45834. method: method,
  45835. params: jsonParameters,
  45836. scope: me,
  45837. success: me.serviceProcessCompleted,
  45838. failure: me.serviceProcessFailed
  45839. });
  45840. }
  45841. }]);
  45842. return TransferPathService;
  45843. }(CommonServiceBase);
  45844. ;// CONCATENATED MODULE: ./src/common/iServer/TransferSolutionParameters.js
  45845. function TransferSolutionParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  45846. function TransferSolutionParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  45847. function TransferSolutionParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) TransferSolutionParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) TransferSolutionParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  45848. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  45849. * This program are made available under the terms of the Apache License, Version 2.0
  45850. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  45851. /**
  45852. * @class TransferSolutionParameters
  45853. * @deprecatedclass SuperMap.TransferSolutionParameters
  45854. * @category iServer TrafficTransferAnalyst TransferSolutions
  45855. * @classdesc 交通换乘方案查询参数类。
  45856. * @param {Object} options - 参数。
  45857. * @param {Array.<GeometryPoint|L.Point|L.LatLng|ol.geom.Point|mapboxgl.LngLat|Array.<number>|number>} options.points - 两种查询方式:按照公交站点的起止ID进行查询和按照起止点的坐标进行查询。
  45858. * @param {number} [options.solutionCount=6] - 乘车方案的数量。
  45859. * @param {TransferTactic} [options.transferTactic=TransferTactic.LESS_TIME] - 交通换乘策略类型,包括时间最短、距离最短、最少换乘、最少步行四种选择。
  45860. * @param {TransferPreference} [options.transferPreference=TransferPreference.NONE] - 乘车偏好枚举。
  45861. * @param {number} [options.walkingRatio=10] - 步行与公交的消耗权重比。
  45862. * @param {Array.<number>} [options.evadeLines] - 避让路线的 ID。
  45863. * @param {Array.<number>} [options.evadeStops] - 避让站点的 ID。
  45864. * @param {Array.<number>} [options.priorLines] - 优先路线的 ID。
  45865. * @param {Array.<number>} [options.priorStops] - 优先站点的 ID。
  45866. * @param {string} [options.travelTime] - 出行的时间。
  45867. * @usage
  45868. */
  45869. var TransferSolutionParameters = /*#__PURE__*/function () {
  45870. function TransferSolutionParameters(options) {
  45871. TransferSolutionParameters_classCallCheck(this, TransferSolutionParameters);
  45872. options = options || {};
  45873. /**
  45874. * @member {number} [TransferSolutionParameters.prototype.solutionCount=6]
  45875. * @description 乘车方案的数量。
  45876. */
  45877. this.solutionCount = 6;
  45878. /**
  45879. * @member {TransferPreference} [TransferSolutionParameters.prototype.transferPreference=TransferPreference.NONE]
  45880. * @description 乘车偏好枚举。
  45881. */
  45882. this.transferPreference = TransferPreference.NONE;
  45883. /**
  45884. * @member {TransferTactic} [TransferSolutionParameters.prototype.transferTactic=TransferTactic|TransferTactic.LESS_TIME]
  45885. * @description 交通换乘策略类型,包括时间最短、距离最短、最少换乘、最少步行四种选择。
  45886. */
  45887. this.transferTactic = TransferTactic.LESS_TIME;
  45888. /**
  45889. * @member {number} [TransferSolutionParameters.prototype.walkingRatio=10]
  45890. * @description 步行与公交的消耗权重比。此值越大,则步行因素对于方案选择的影响越大。例如:</br>
  45891. * 例如现在有两种换乘方案(在仅考虑消耗因素的情况下):</br>
  45892. * 方案1:坐车 10 公里,走路 1 公里;</br>
  45893. * 方案2:坐车 15 公里,走路 0.5 公里;</br>
  45894. * 1. 假设权重比为 15:</br>
  45895. * •方案 1 的总消耗为:10 + 1*15 = 25</br>
  45896. * •方案 2 的总消耗为:15 + 0.5*15 = 22.5</br>
  45897. * 此时方案 2 消耗更低。</br>
  45898. * 2. 假设权重比为2:</br>
  45899. * •方案 1 的总消耗为:10+1*2 = 12</br>
  45900. * •方案 2 的总消耗为:15+0.5*2 = 17</br>
  45901. * 此时方案 1 消耗更低。</br>
  45902. */
  45903. this.walkingRatio = null;
  45904. /**
  45905. * @member {Array.<GeometryPoint|L.Point|L.LatLng|ol.geom.Point|mapboxgl.LngLat|Array.<number>|number>} TransferSolutionParameters.prototype.points
  45906. * @description 两种查询方式:</br>
  45907. * 1. 按照公交站点的起止 ID 进行查询,则 points 参数的类型为 int[],形如:[起点 ID、终点 ID],公交站点的 ID 对应服务提供者配置中的站点 ID 字段;
  45908. * 2. 按照起止点的坐标进行查询,则 points 参数的类型为 Point2D[],形如:[{"x":44,"y":39},{"x":45,"y":40}]。
  45909. */
  45910. this.points = false;
  45911. /**
  45912. * @member {Array.<number>} [TransferSolutionParameters.prototype.evadeLinesnull]
  45913. * @description 避让路线 ID。
  45914. * */
  45915. this.evadeLines = null;
  45916. /**
  45917. * @member {Array.<number>} [TransferSolutionParameters.prototype.evadeStops=TransferLine]
  45918. * @description 避让站点 ID。
  45919. * */
  45920. this.evadeStops = null;
  45921. /**
  45922. * @member {Array.<number>} [TransferSolutionParameters.prototype.priorLines]
  45923. * @description 优先路线 ID。
  45924. * */
  45925. this.priorLines = null;
  45926. /**
  45927. * @member {Array.<number>} [TransferSolutionParameters.prototype.priorStops]
  45928. * @description 优先站点 ID。
  45929. * */
  45930. this.priorStops = null;
  45931. /**
  45932. * @member {string} TransferSolutionParameters.prototype.travelTime
  45933. * @description 出行的时间;格式是:"小时:分钟",如:"08:30"。如果设置了该参数,在分析时,则会考虑线路的首末班车时间的限制,即在返回的结果中会提示公交的首末班发车时间。
  45934. */
  45935. this.travelTime = null;
  45936. Util_Util.extend(this, options);
  45937. this.CLASS_NAME = "SuperMap.TransferSolutionParameters";
  45938. }
  45939. /**
  45940. * @function TransferSolutionParameters.prototype.destroy
  45941. * @description 释放资源,将引用资源的属性置空。
  45942. */
  45943. TransferSolutionParameters_createClass(TransferSolutionParameters, [{
  45944. key: "destroy",
  45945. value: function destroy() {
  45946. Util_Util.reset(this);
  45947. }
  45948. /**
  45949. * @function TransferSolutionParameters.toJsonParameters
  45950. * @description 将 {@link TransferSolutionParameters} 对象参数转换为 JSON 字符串。
  45951. * @param {TransferSolutionParameters} params - 交通换乘参数。
  45952. * @returns {string} 转化后的 JSON 字符串。
  45953. */
  45954. }], [{
  45955. key: "toJson",
  45956. value: function toJson(params) {
  45957. if (params) {
  45958. return Util_Util.toJSON(params);
  45959. }
  45960. }
  45961. }]);
  45962. return TransferSolutionParameters;
  45963. }();
  45964. ;// CONCATENATED MODULE: ./src/common/iServer/TransferSolutionService.js
  45965. function TransferSolutionService_typeof(obj) { "@babel/helpers - typeof"; return TransferSolutionService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, TransferSolutionService_typeof(obj); }
  45966. function TransferSolutionService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  45967. function TransferSolutionService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  45968. function TransferSolutionService_createClass(Constructor, protoProps, staticProps) { if (protoProps) TransferSolutionService_defineProperties(Constructor.prototype, protoProps); if (staticProps) TransferSolutionService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  45969. function TransferSolutionService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { TransferSolutionService_get = Reflect.get.bind(); } else { TransferSolutionService_get = function _get(target, property, receiver) { var base = TransferSolutionService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return TransferSolutionService_get.apply(this, arguments); }
  45970. function TransferSolutionService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = TransferSolutionService_getPrototypeOf(object); if (object === null) break; } return object; }
  45971. function TransferSolutionService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) TransferSolutionService_setPrototypeOf(subClass, superClass); }
  45972. function TransferSolutionService_setPrototypeOf(o, p) { TransferSolutionService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return TransferSolutionService_setPrototypeOf(o, p); }
  45973. function TransferSolutionService_createSuper(Derived) { var hasNativeReflectConstruct = TransferSolutionService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = TransferSolutionService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = TransferSolutionService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return TransferSolutionService_possibleConstructorReturn(this, result); }; }
  45974. function TransferSolutionService_possibleConstructorReturn(self, call) { if (call && (TransferSolutionService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return TransferSolutionService_assertThisInitialized(self); }
  45975. function TransferSolutionService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  45976. function TransferSolutionService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  45977. function TransferSolutionService_getPrototypeOf(o) { TransferSolutionService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return TransferSolutionService_getPrototypeOf(o); }
  45978. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  45979. * This program are made available under the terms of the Apache License, Version 2.0
  45980. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  45981. /**
  45982. * @class TransferSolutionService
  45983. * @deprecatedclass SuperMap.TransferSolutionService
  45984. * @category iServer TrafficTransferAnalyst TransferSolutions
  45985. * @classdesc 交通换乘方案查询服务类。
  45986. * 返回结果通过该类支持的事件的监听函数参数获取。
  45987. * @param {string} url - 服务地址。
  45988. * 例如:</br>"http://localhost:8090/iserver/services/traffictransferanalyst-sample/restjsr/traffictransferanalyst/Traffic-Changchun"。
  45989. * @param {Object} options - 参数。</br>
  45990. * @param {Object} options.eventListeners - 需要被注册的监听器对象。</br>
  45991. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  45992. * @param {Object} [options.headers] - 请求头。
  45993. * @extends {CommonServiceBase}
  45994. * @example 例如:
  45995. * (start code)
  45996. * var myService = new TransferSolutionService(url, {eventListeners: {
  45997. * "processCompleted": trafficTransferCompleted,
  45998. * "processFailed": trafficTransferError
  45999. * }
  46000. * };
  46001. * (end)
  46002. * @usage
  46003. */
  46004. var TransferSolutionService = /*#__PURE__*/function (_CommonServiceBase) {
  46005. TransferSolutionService_inherits(TransferSolutionService, _CommonServiceBase);
  46006. var _super = TransferSolutionService_createSuper(TransferSolutionService);
  46007. function TransferSolutionService(url, options) {
  46008. var _this;
  46009. TransferSolutionService_classCallCheck(this, TransferSolutionService);
  46010. _this = _super.call(this, url, options);
  46011. _this.CLASS_NAME = "SuperMap.TransferSolutionService";
  46012. return _this;
  46013. }
  46014. /**
  46015. * @override
  46016. */
  46017. TransferSolutionService_createClass(TransferSolutionService, [{
  46018. key: "destroy",
  46019. value: function destroy() {
  46020. TransferSolutionService_get(TransferSolutionService_getPrototypeOf(TransferSolutionService.prototype), "destroy", this).call(this);
  46021. }
  46022. /**
  46023. * @function TransferSolutionService.prototype.processAsync
  46024. * @description 负责将客户端的更新参数传递到服务端。
  46025. * @param {TransferSolutionParameters} params - 交通换乘参数。
  46026. */
  46027. }, {
  46028. key: "processAsync",
  46029. value: function processAsync(params) {
  46030. if (!(params instanceof TransferSolutionParameters)) {
  46031. return;
  46032. }
  46033. var me = this,
  46034. method = "GET",
  46035. jsonParameters;
  46036. me.url = Util_Util.urlPathAppend(me.url, 'solutions');
  46037. jsonParameters = {
  46038. points: Util_Util.toJSON(params.points),
  46039. walkingRatio: params['walkingRatio'],
  46040. transferTactic: params['transferTactic'],
  46041. solutionCount: params['solutionCount'],
  46042. transferPreference: params["transferPreference"]
  46043. };
  46044. if (params.evadeLines) {
  46045. jsonParameters["evadeLines"] = Util_Util.toJSON(params.evadeLines);
  46046. }
  46047. if (params.evadeStops) {
  46048. jsonParameters["evadeStops"] = Util_Util.toJSON(params.evadeStops);
  46049. }
  46050. if (params.priorLines) {
  46051. jsonParameters["priorLines"] = Util_Util.toJSON(params.priorLines);
  46052. }
  46053. if (params.priorStops) {
  46054. jsonParameters["priorStops"] = Util_Util.toJSON(params.priorStops);
  46055. }
  46056. if (params.travelTime) {
  46057. jsonParameters["travelTime"] = params.travelTime;
  46058. }
  46059. me.request({
  46060. method: method,
  46061. params: jsonParameters,
  46062. scope: me,
  46063. success: me.serviceProcessCompleted,
  46064. failure: me.serviceProcessFailed
  46065. });
  46066. }
  46067. }]);
  46068. return TransferSolutionService;
  46069. }(CommonServiceBase);
  46070. ;// CONCATENATED MODULE: ./src/common/iServer/TrafficTransferAnalystService.js
  46071. function TrafficTransferAnalystService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  46072. function TrafficTransferAnalystService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  46073. function TrafficTransferAnalystService_createClass(Constructor, protoProps, staticProps) { if (protoProps) TrafficTransferAnalystService_defineProperties(Constructor.prototype, protoProps); if (staticProps) TrafficTransferAnalystService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  46074. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  46075. * This program are made available under the terms of the Apache License, Version 2.0
  46076. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  46077. /**
  46078. * @class TrafficTransferAnalystService
  46079. * @extends {ServiceBase}
  46080. * @category iServer TrafficTransferAnalyst
  46081. * @classdesc 交通换乘分析服务类。
  46082. * @example
  46083. * new TrafficTransferAnalystService(url).queryStop(params,function(result){
  46084. * //doSomething
  46085. * })
  46086. * @param {string} url - 服务地址。
  46087. * @param {Object} options - 参数。
  46088. * @param {string} [options.proxy] - 服务代理地址。
  46089. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  46090. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  46091. * @param {Object} [options.headers] - 请求头。
  46092. * @usage
  46093. */
  46094. var TrafficTransferAnalystService_TrafficTransferAnalystService = /*#__PURE__*/function () {
  46095. function TrafficTransferAnalystService(url, options) {
  46096. TrafficTransferAnalystService_classCallCheck(this, TrafficTransferAnalystService);
  46097. this.url = url;
  46098. this.options = options || {};
  46099. }
  46100. /**
  46101. * @function TrafficTransferAnalystService.prototype.queryStop
  46102. * @description 站点查询服务。
  46103. * @param {StopQueryParameters} params - 查询相关参数类。
  46104. * @param {RequestCallback} callback - 回调函数。
  46105. */
  46106. TrafficTransferAnalystService_createClass(TrafficTransferAnalystService, [{
  46107. key: "queryStop",
  46108. value: function queryStop(params, callback) {
  46109. var me = this;
  46110. var stopQueryService = new StopQueryService(me.url, {
  46111. proxy: me.options.proxy,
  46112. withCredentials: me.options.withCredentials,
  46113. crossOrigin: me.options.crossOrigin,
  46114. headers: me.options.headers,
  46115. eventListeners: {
  46116. scope: me,
  46117. processCompleted: callback,
  46118. processFailed: callback
  46119. }
  46120. });
  46121. stopQueryService.processAsync(params);
  46122. }
  46123. /**
  46124. * @function TrafficTransferAnalystService.prototype.analysisTransferPath
  46125. * @description 交通换乘线路查询服务。
  46126. * @param {TransferPathParameters} params - 查询相关参数类。
  46127. * @param {RequestCallback} callback - 回调函数。
  46128. */
  46129. }, {
  46130. key: "analysisTransferPath",
  46131. value: function analysisTransferPath(params, callback) {
  46132. var me = this;
  46133. var transferPathService = new TransferPathService(me.url, {
  46134. proxy: me.options.proxy,
  46135. withCredentials: me.options.withCredentials,
  46136. crossOrigin: me.options.crossOrigin,
  46137. headers: me.options.headers,
  46138. eventListeners: {
  46139. scope: me,
  46140. processCompleted: callback,
  46141. processFailed: callback
  46142. }
  46143. });
  46144. transferPathService.processAsync(params);
  46145. }
  46146. /**
  46147. * @function TrafficTransferAnalystService.prototype.analysisTransferSolution
  46148. * @description 交通换乘方案查询服务。
  46149. * @param {TransferSolutionParameters} params - 查询相关参数类。
  46150. * @param {RequestCallback} callback - 回调函数。
  46151. */
  46152. }, {
  46153. key: "analysisTransferSolution",
  46154. value: function analysisTransferSolution(params, callback) {
  46155. var me = this;
  46156. var transferSolutionService = new TransferSolutionService(me.url, {
  46157. proxy: me.options.proxy,
  46158. withCredentials: me.options.withCredentials,
  46159. crossOrigin: me.options.crossOrigin,
  46160. headers: me.options.headers,
  46161. eventListeners: {
  46162. scope: me,
  46163. processCompleted: callback,
  46164. processFailed: callback
  46165. }
  46166. });
  46167. transferSolutionService.processAsync(params);
  46168. }
  46169. }]);
  46170. return TrafficTransferAnalystService;
  46171. }();
  46172. ;// CONCATENATED MODULE: ./src/maplibregl/services/TrafficTransferAnalystService.js
  46173. function TrafficTransferAnalystService_typeof(obj) { "@babel/helpers - typeof"; return TrafficTransferAnalystService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, TrafficTransferAnalystService_typeof(obj); }
  46174. function services_TrafficTransferAnalystService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  46175. function services_TrafficTransferAnalystService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  46176. function services_TrafficTransferAnalystService_createClass(Constructor, protoProps, staticProps) { if (protoProps) services_TrafficTransferAnalystService_defineProperties(Constructor.prototype, protoProps); if (staticProps) services_TrafficTransferAnalystService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  46177. function TrafficTransferAnalystService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) TrafficTransferAnalystService_setPrototypeOf(subClass, superClass); }
  46178. function TrafficTransferAnalystService_setPrototypeOf(o, p) { TrafficTransferAnalystService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return TrafficTransferAnalystService_setPrototypeOf(o, p); }
  46179. function TrafficTransferAnalystService_createSuper(Derived) { var hasNativeReflectConstruct = TrafficTransferAnalystService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = TrafficTransferAnalystService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = TrafficTransferAnalystService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return TrafficTransferAnalystService_possibleConstructorReturn(this, result); }; }
  46180. function TrafficTransferAnalystService_possibleConstructorReturn(self, call) { if (call && (TrafficTransferAnalystService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return TrafficTransferAnalystService_assertThisInitialized(self); }
  46181. function TrafficTransferAnalystService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  46182. function TrafficTransferAnalystService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  46183. function TrafficTransferAnalystService_getPrototypeOf(o) { TrafficTransferAnalystService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return TrafficTransferAnalystService_getPrototypeOf(o); }
  46184. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  46185. * This program are made available under the terms of the Apache License, Version 2.0
  46186. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  46187. /**
  46188. * @class TrafficTransferAnalystService
  46189. * @extends ServiceBase
  46190. * @category iServer TrafficTransferAnalyst
  46191. * @classdesc 交通换乘分析服务类。
  46192. * @version 11.1.0
  46193. * @modulecategory Services
  46194. * @example
  46195. * new TrafficTransferAnalystService(url)
  46196. * .queryStop(params,function(result){
  46197. * //doSomething
  46198. * })
  46199. * @param {string} url - 服务地址。
  46200. * @param {Object} options - 参数。
  46201. * @param {string} [options.proxy] - 服务代理地址。
  46202. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  46203. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  46204. * @param {Object} [options.headers] - 请求头。
  46205. * @usage
  46206. */
  46207. var TrafficTransferAnalystService = /*#__PURE__*/function (_ServiceBase) {
  46208. TrafficTransferAnalystService_inherits(TrafficTransferAnalystService, _ServiceBase);
  46209. var _super = TrafficTransferAnalystService_createSuper(TrafficTransferAnalystService);
  46210. function TrafficTransferAnalystService(url, options) {
  46211. var _this;
  46212. services_TrafficTransferAnalystService_classCallCheck(this, TrafficTransferAnalystService);
  46213. _this = _super.call(this, url, options);
  46214. _this._trafficTransferAnalystServiceBase = new TrafficTransferAnalystService_TrafficTransferAnalystService(url, options);
  46215. return _this;
  46216. }
  46217. /**
  46218. * @function TrafficTransferAnalystService.prototype.queryStop
  46219. * @description 站点查询服务。
  46220. * @param {StopQueryParameters} params - 站点查询参数类。
  46221. * @param {RequestCallback} callback - 回调函数。
  46222. */
  46223. services_TrafficTransferAnalystService_createClass(TrafficTransferAnalystService, [{
  46224. key: "queryStop",
  46225. value: function queryStop(params, callback) {
  46226. this._trafficTransferAnalystServiceBase.queryStop(params, callback);
  46227. }
  46228. /**
  46229. * @function TrafficTransferAnalystService.prototype.analysisTransferPath
  46230. * @description 交通换乘线路查询服务。
  46231. * @param {TransferPathParameters} params - 交通换乘线路查询参数类。
  46232. * @param {RequestCallback} callback - 回调函数。
  46233. */
  46234. }, {
  46235. key: "analysisTransferPath",
  46236. value: function analysisTransferPath(params, callback) {
  46237. this._trafficTransferAnalystServiceBase.analysisTransferPath(params, callback);
  46238. }
  46239. /**
  46240. * @function TrafficTransferAnalystService.prototype.analysisTransferSolution
  46241. * @description 交通换乘方案查询服务。
  46242. * @param {TransferSolutionParameters} params - 交通换乘方案查询参数类。
  46243. * @param {RequestCallback} callback - 回调函数。
  46244. */
  46245. }, {
  46246. key: "analysisTransferSolution",
  46247. value: function analysisTransferSolution(params, callback) {
  46248. this._trafficTransferAnalystServiceBase.analysisTransferSolution(params, callback);
  46249. }
  46250. }, {
  46251. key: "_processParams",
  46252. value: function _processParams(params) {
  46253. if (!params) {
  46254. return {};
  46255. }
  46256. if (params.transferLines && !core_Util_Util.isArray(params.transferLines)) {
  46257. params.transferLines = [params.transferLines];
  46258. }
  46259. if (params.points && core_Util_Util.isArray(params.points)) {
  46260. params.points.map(function (point, key) {
  46261. params.points[key] = point instanceof (external_maplibregl_default()).LngLat ? {
  46262. x: point.lng,
  46263. y: point.lat
  46264. } : point;
  46265. return params.points[key];
  46266. });
  46267. }
  46268. return params;
  46269. }
  46270. }]);
  46271. return TrafficTransferAnalystService;
  46272. }(ServiceBase);
  46273. ;// CONCATENATED MODULE: ./src/common/iServer/WebPrintingService.js
  46274. function WebPrintingService_typeof(obj) { "@babel/helpers - typeof"; return WebPrintingService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, WebPrintingService_typeof(obj); }
  46275. function WebPrintingService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  46276. function WebPrintingService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  46277. function WebPrintingService_createClass(Constructor, protoProps, staticProps) { if (protoProps) WebPrintingService_defineProperties(Constructor.prototype, protoProps); if (staticProps) WebPrintingService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  46278. function WebPrintingService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { WebPrintingService_get = Reflect.get.bind(); } else { WebPrintingService_get = function _get(target, property, receiver) { var base = WebPrintingService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return WebPrintingService_get.apply(this, arguments); }
  46279. function WebPrintingService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = WebPrintingService_getPrototypeOf(object); if (object === null) break; } return object; }
  46280. function WebPrintingService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) WebPrintingService_setPrototypeOf(subClass, superClass); }
  46281. function WebPrintingService_setPrototypeOf(o, p) { WebPrintingService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return WebPrintingService_setPrototypeOf(o, p); }
  46282. function WebPrintingService_createSuper(Derived) { var hasNativeReflectConstruct = WebPrintingService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = WebPrintingService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = WebPrintingService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return WebPrintingService_possibleConstructorReturn(this, result); }; }
  46283. function WebPrintingService_possibleConstructorReturn(self, call) { if (call && (WebPrintingService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return WebPrintingService_assertThisInitialized(self); }
  46284. function WebPrintingService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  46285. function WebPrintingService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  46286. function WebPrintingService_getPrototypeOf(o) { WebPrintingService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return WebPrintingService_getPrototypeOf(o); }
  46287. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  46288. * This program are made available under the terms of the Apache License, Version 2.0
  46289. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  46290. /**
  46291. * @class WebPrintingService
  46292. * @deprecatedclass SuperMap.WebPrintingService
  46293. * @category iServer WebPrintingJob
  46294. * @version 10.1.0
  46295. * @classdesc 打印地图服务基类。
  46296. * @extends {CommonServiceBase}
  46297. * @param {string} url - 服务地址。请求打印地图服务的 URL 应为:http://{服务器地址}:{服务端口号}/iserver/services/webprinting/rest/webprinting/v1。
  46298. * @param {Object} options - 参数。
  46299. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  46300. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  46301. * @param {Object} [options.headers] - 请求头。
  46302. * @usage
  46303. */
  46304. var WebPrintingService = /*#__PURE__*/function (_CommonServiceBase) {
  46305. WebPrintingService_inherits(WebPrintingService, _CommonServiceBase);
  46306. var _super = WebPrintingService_createSuper(WebPrintingService);
  46307. function WebPrintingService(url, options) {
  46308. var _this;
  46309. WebPrintingService_classCallCheck(this, WebPrintingService);
  46310. _this = _super.call(this, url, options);
  46311. if (options) {
  46312. Util_Util.extend(WebPrintingService_assertThisInitialized(_this), options);
  46313. }
  46314. _this.eventCount = 0;
  46315. _this.CLASS_NAME = 'SuperMap.WebPrintingService';
  46316. if (!_this.url) {
  46317. return WebPrintingService_possibleConstructorReturn(_this);
  46318. }
  46319. return _this;
  46320. }
  46321. /**
  46322. * @function WebPrintingService.prototype.destroy
  46323. * @description 释放资源,将引用资源的属性置空。
  46324. */
  46325. WebPrintingService_createClass(WebPrintingService, [{
  46326. key: "destroy",
  46327. value: function destroy() {
  46328. WebPrintingService_get(WebPrintingService_getPrototypeOf(WebPrintingService.prototype), "destroy", this).call(this);
  46329. }
  46330. /**
  46331. * @function WebPrintingService.prototype.createWebPrintingJob
  46332. * @description 创建 Web 打印任务。
  46333. * @param {WebPrintingJobParameters} params - Web 打印的请求参数。
  46334. */
  46335. }, {
  46336. key: "createWebPrintingJob",
  46337. value: function createWebPrintingJob(params, callback) {
  46338. if (!params) {
  46339. return;
  46340. }
  46341. if (params.layoutOptions) {
  46342. if (params.layoutOptions.legendOptions) {
  46343. !params.layoutOptions.legendOptions.title && (params.layoutOptions.legendOptions.title = '');
  46344. params.layoutOptions.legendOptions.picAsBase64 = params.layoutOptions.legendOptions.picAsBase64 && params.layoutOptions.legendOptions.picAsBase64.replace(/^data:.+;base64,/, '');
  46345. if (params.layoutOptions.legendOptions.customItems && params.layoutOptions.legendOptions.customItems.hasOwnProperty('picAsBase64')) {
  46346. params.layoutOptions.legendOptions.customItems.picAsBase64 = params.layoutOptions.legendOptions.customItems.picAsBase64.replace(/^data:.+;base64,/, '');
  46347. }
  46348. }
  46349. }
  46350. this.processAsync('jobs', 'POST', callback, params);
  46351. }
  46352. /**
  46353. * @function WebPrintingService.prototype.getPrintingJob
  46354. * @description 获取 Web 打印输出文档任务。
  46355. * @param {string} jobId - Web 打印任务 ID
  46356. */
  46357. }, {
  46358. key: "getPrintingJob",
  46359. value: function getPrintingJob(jobId, callback) {
  46360. var me = this;
  46361. me.processAsync("jobs/".concat(jobId), 'GET', function (result) {
  46362. me.rollingProcess(result, me._processUrl("jobs/".concat(jobId)), callback);
  46363. });
  46364. }
  46365. /**
  46366. * @function WebPrintingService.prototype.getPrintingJobResult
  46367. * @description 获取 Web 打印任务的输出文档。
  46368. * @param {string} jobId - Web 打印输入文档任务 ID。
  46369. */
  46370. }, {
  46371. key: "getPrintingJobResult",
  46372. value: function getPrintingJobResult(jobId, callback) {
  46373. this.processAsync("jobs/".concat(jobId, "/result"), 'GET', callback);
  46374. }
  46375. /**
  46376. * @function WebPrintingService.prototype.getLayoutTemplates
  46377. * @description 查询 Web 打印服务所有可用的模板信息。
  46378. */
  46379. }, {
  46380. key: "getLayoutTemplates",
  46381. value: function getLayoutTemplates(callback) {
  46382. this.processAsync('layouts', 'GET', callback);
  46383. }
  46384. /**
  46385. * @function WebPrintingService.prototype.rollingProcess
  46386. * @description 轮询查询 Web 打印任务。
  46387. * @param {Object} result - 服务器返回的结果对象。
  46388. */
  46389. }, {
  46390. key: "rollingProcess",
  46391. value: function rollingProcess(result, url, callback) {
  46392. var me = this;
  46393. if (!result) {
  46394. return;
  46395. }
  46396. var id = setInterval(function () {
  46397. var eventId = ++me.eventCount;
  46398. var eventListeners = {
  46399. scope: this,
  46400. processCompleted: function processCompleted(result) {
  46401. if (eventId === result.result.eventId && callback) {
  46402. delete result.result.eventId;
  46403. callback(result);
  46404. me.events.un(eventListeners);
  46405. return false;
  46406. }
  46407. },
  46408. processFailed: function processFailed(result) {
  46409. if ((eventId === result.error.eventId || eventId === result.eventId) && callback) {
  46410. callback(result);
  46411. me.events.un(eventListeners);
  46412. return false;
  46413. }
  46414. }
  46415. };
  46416. me.events.on(eventListeners);
  46417. me.request({
  46418. url: url,
  46419. method: 'GET',
  46420. scope: me,
  46421. success: function success(result, options) {
  46422. result.eventId = eventId;
  46423. switch (result.status) {
  46424. case 'FINISHED':
  46425. clearInterval(id);
  46426. me.serviceProcessCompleted(result, options);
  46427. break;
  46428. case 'ERROR':
  46429. clearInterval(id);
  46430. me.serviceProcessFailed(result, options);
  46431. break;
  46432. case 'RUNNING':
  46433. me.events.triggerEvent('processRunning', result);
  46434. break;
  46435. }
  46436. },
  46437. failure: me.serviceProcessFailed
  46438. });
  46439. }, 1000);
  46440. }
  46441. }, {
  46442. key: "processAsync",
  46443. value: function processAsync(url, method, callback, params) {
  46444. var eventId = ++this.eventCount;
  46445. var eventListeners = {
  46446. scope: this,
  46447. processCompleted: function processCompleted(result) {
  46448. if (eventId === result.result.eventId && callback) {
  46449. delete result.result.eventId;
  46450. callback(result);
  46451. this.events && this.events.un(eventListeners);
  46452. return false;
  46453. }
  46454. },
  46455. processFailed: function processFailed(result) {
  46456. if (eventId === result.error.eventId || eventId === result.eventId) {
  46457. callback(result);
  46458. this.events && this.events.un(eventListeners);
  46459. return false;
  46460. }
  46461. }
  46462. };
  46463. this.events.on(eventListeners);
  46464. var me = this;
  46465. var requestConfig = {
  46466. url: me._processUrl(url),
  46467. method: method,
  46468. scope: me,
  46469. success: function success(result, options) {
  46470. result.eventId = eventId;
  46471. this.serviceProcessCompleted(result, options);
  46472. },
  46473. failure: function failure(result, options) {
  46474. if (result.error) {
  46475. result.error.eventId = eventId;
  46476. }
  46477. result.eventId = eventId;
  46478. this.serviceProcessFailed(result, options);
  46479. }
  46480. };
  46481. params && (requestConfig.data = Util_Util.toJSON(params));
  46482. me.request(requestConfig);
  46483. }
  46484. }, {
  46485. key: "_processUrl",
  46486. value: function _processUrl(appendContent) {
  46487. if (appendContent) {
  46488. return Util_Util.urlPathAppend(this.url, appendContent);
  46489. }
  46490. return this.url;
  46491. }
  46492. }]);
  46493. return WebPrintingService;
  46494. }(CommonServiceBase);
  46495. ;// CONCATENATED MODULE: ./src/maplibregl/services/WebPrintingJobService.js
  46496. function WebPrintingJobService_typeof(obj) { "@babel/helpers - typeof"; return WebPrintingJobService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, WebPrintingJobService_typeof(obj); }
  46497. function WebPrintingJobService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  46498. function WebPrintingJobService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  46499. function WebPrintingJobService_createClass(Constructor, protoProps, staticProps) { if (protoProps) WebPrintingJobService_defineProperties(Constructor.prototype, protoProps); if (staticProps) WebPrintingJobService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  46500. function WebPrintingJobService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) WebPrintingJobService_setPrototypeOf(subClass, superClass); }
  46501. function WebPrintingJobService_setPrototypeOf(o, p) { WebPrintingJobService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return WebPrintingJobService_setPrototypeOf(o, p); }
  46502. function WebPrintingJobService_createSuper(Derived) { var hasNativeReflectConstruct = WebPrintingJobService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = WebPrintingJobService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = WebPrintingJobService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return WebPrintingJobService_possibleConstructorReturn(this, result); }; }
  46503. function WebPrintingJobService_possibleConstructorReturn(self, call) { if (call && (WebPrintingJobService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return WebPrintingJobService_assertThisInitialized(self); }
  46504. function WebPrintingJobService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  46505. function WebPrintingJobService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  46506. function WebPrintingJobService_getPrototypeOf(o) { WebPrintingJobService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return WebPrintingJobService_getPrototypeOf(o); }
  46507. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  46508. * This program are made available under the terms of the Apache License, Version 2.0
  46509. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  46510. /**
  46511. * @class WebPrintingJobService
  46512. * @category iServer WebPrintingJob
  46513. * @version 11.1.0
  46514. * @modulecategory Services
  46515. * @classdesc Web 打印服务类。
  46516. * 提供:创建 Web 打印任务,获取 Web 打印任务内容,获取 Web 打印输出文档流,获取 Web 打印服务的布局模板信息。
  46517. * @extends {ServiceBase}
  46518. * @param {string} url - 资源根地址。请求打印地图服务的 URL 应为:http://{服务器地址}:{服务端口号}/iserver/services/webprinting/rest/webprinting/v1。
  46519. * @param {Object} options - 参数。
  46520. * @param {string} [options.proxy] - 服务代理地址。
  46521. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  46522. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  46523. * @param {Object} [options.headers] - 请求头。
  46524. * @example
  46525. * new WebPrintingJobService(url)
  46526. * .createWebPrintingJob(param,function(result){
  46527. * //doSomething
  46528. * })
  46529. * @usage
  46530. */
  46531. var WebPrintingJobService = /*#__PURE__*/function (_ServiceBase) {
  46532. WebPrintingJobService_inherits(WebPrintingJobService, _ServiceBase);
  46533. var _super = WebPrintingJobService_createSuper(WebPrintingJobService);
  46534. function WebPrintingJobService(url, options) {
  46535. var _this;
  46536. WebPrintingJobService_classCallCheck(this, WebPrintingJobService);
  46537. _this = _super.call(this, url, options);
  46538. _this._webPrintingService = new WebPrintingService(url, options);
  46539. return _this;
  46540. }
  46541. /**
  46542. * @function WebPrintingJobService.prototype.createWebPrintingJob
  46543. * @description 创建 Web 打印任务。
  46544. * @param {WebPrintingJobParameters} params - Web 打印参数类。
  46545. * @param {RequestCallback} callback - 回调函数。
  46546. */
  46547. WebPrintingJobService_createClass(WebPrintingJobService, [{
  46548. key: "createWebPrintingJob",
  46549. value: function createWebPrintingJob(params, callback) {
  46550. if (!params) {
  46551. return;
  46552. }
  46553. this._webPrintingService.createWebPrintingJob(this._processParams(params), callback);
  46554. }
  46555. /**
  46556. * @function WebPrintingJobService.prototype.getPrintingJob
  46557. * @description 获取 Web 打印输出文档任务。
  46558. * @param {string} jobId - Web 打印输入文档任务 ID。
  46559. * @param {RequestCallback} callback - 回调函数。
  46560. */
  46561. }, {
  46562. key: "getPrintingJob",
  46563. value: function getPrintingJob(jobId, callback) {
  46564. this._webPrintingService.getPrintingJob(jobId, callback);
  46565. }
  46566. /**
  46567. * @function WebPrintingJobService.prototype.getPrintingJobResult
  46568. * @description 获取 Web 打印任务的输出文档。
  46569. * @param {string} jobId - Web 打印输入文档任务 ID。
  46570. * @param {RequestCallback} callback - 回调函数。
  46571. */
  46572. }, {
  46573. key: "getPrintingJobResult",
  46574. value: function getPrintingJobResult(jobId, callback) {
  46575. this._webPrintingService.getPrintingJobResult(jobId, callback);
  46576. }
  46577. /**
  46578. * @function WebPrintingJobService.prototype.getLayoutTemplates
  46579. * @description 查询 Web 打印服务所有可用的模板信息。
  46580. * @param {RequestCallback} callback - 回调函数。
  46581. */
  46582. }, {
  46583. key: "getLayoutTemplates",
  46584. value: function getLayoutTemplates(callback) {
  46585. this._webPrintingService.getLayoutTemplates(callback);
  46586. }
  46587. }, {
  46588. key: "_processParams",
  46589. value: function _processParams(params) {
  46590. if (params.layoutOptions && params.layoutOptions.littleMapOptions) {
  46591. params.layoutOptions.littleMapOptions.center = this._toPointObject(params.layoutOptions.littleMapOptions.center);
  46592. }
  46593. if (params.exportOptions) {
  46594. params.exportOptions.center = this._toPointObject(params.exportOptions.center);
  46595. }
  46596. return params;
  46597. }
  46598. }, {
  46599. key: "_toPointObject",
  46600. value: function _toPointObject(point) {
  46601. if (core_Util_Util.isArray(point)) {
  46602. return {
  46603. x: point[0],
  46604. y: point[1]
  46605. };
  46606. } else if (point instanceof Point || point instanceof (external_maplibregl_default()).Point) {
  46607. return {
  46608. x: point.x,
  46609. y: point.y
  46610. };
  46611. } else if (point instanceof (external_maplibregl_default()).LngLat) {
  46612. return {
  46613. x: point.lng,
  46614. y: point.lat
  46615. };
  46616. }
  46617. return point;
  46618. }
  46619. }]);
  46620. return WebPrintingJobService;
  46621. }(ServiceBase);
  46622. ;// CONCATENATED MODULE: ./src/common/iServer/ImageService.js
  46623. function ImageService_typeof(obj) { "@babel/helpers - typeof"; return ImageService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, ImageService_typeof(obj); }
  46624. function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
  46625. function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
  46626. function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
  46627. function ImageService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  46628. function ImageService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  46629. function ImageService_createClass(Constructor, protoProps, staticProps) { if (protoProps) ImageService_defineProperties(Constructor.prototype, protoProps); if (staticProps) ImageService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  46630. function ImageService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { ImageService_get = Reflect.get.bind(); } else { ImageService_get = function _get(target, property, receiver) { var base = ImageService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return ImageService_get.apply(this, arguments); }
  46631. function ImageService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ImageService_getPrototypeOf(object); if (object === null) break; } return object; }
  46632. function ImageService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) ImageService_setPrototypeOf(subClass, superClass); }
  46633. function ImageService_setPrototypeOf(o, p) { ImageService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ImageService_setPrototypeOf(o, p); }
  46634. function ImageService_createSuper(Derived) { var hasNativeReflectConstruct = ImageService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = ImageService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = ImageService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return ImageService_possibleConstructorReturn(this, result); }; }
  46635. function ImageService_possibleConstructorReturn(self, call) { if (call && (ImageService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return ImageService_assertThisInitialized(self); }
  46636. function ImageService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  46637. function ImageService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  46638. function ImageService_getPrototypeOf(o) { ImageService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ImageService_getPrototypeOf(o); }
  46639. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  46640. * This program are made available under the terms of the Apache License, Version 2.0
  46641. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  46642. /**
  46643. * @class ImageService
  46644. * @deprecatedclass SuperMap.ImageService
  46645. * @classdesc 影像服务类。
  46646. * @version 10.2.0
  46647. * @category iServer Image
  46648. * @param {string} url - 服务地址。例如: http://{ip}:{port}/iserver/{imageservice-imageserviceName}/restjsr/
  46649. * @param {Object} options - 可选参数。
  46650. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  46651. * @param {Object} [options.headers] - 请求头。
  46652. * @extends {CommonServiceBase}
  46653. * @usage
  46654. */
  46655. var ImageService_ImageService = /*#__PURE__*/function (_CommonServiceBase) {
  46656. ImageService_inherits(ImageService, _CommonServiceBase);
  46657. var _super = ImageService_createSuper(ImageService);
  46658. function ImageService(url, options) {
  46659. var _this;
  46660. ImageService_classCallCheck(this, ImageService);
  46661. _this = _super.call(this, url, options);
  46662. _this.options = options || {};
  46663. if (options) {
  46664. Util_Util.extend(ImageService_assertThisInitialized(_this), options);
  46665. }
  46666. _this.eventCount = 0;
  46667. _this.CLASS_NAME = 'SuperMap.ImageService';
  46668. return _this;
  46669. }
  46670. /**
  46671. * @function ImageService.prototype.destroy
  46672. * @override
  46673. */
  46674. ImageService_createClass(ImageService, [{
  46675. key: "destroy",
  46676. value: function destroy() {
  46677. ImageService_get(ImageService_getPrototypeOf(ImageService.prototype), "destroy", this).call(this);
  46678. }
  46679. /**
  46680. * @function ImageService.prototype.getCollections
  46681. * @description 返回当前影像服务中的影像集合列表(Collections)。
  46682. */
  46683. }, {
  46684. key: "getCollections",
  46685. value: function getCollections(callback) {
  46686. var me = this;
  46687. var path = Util_Util.convertPath('/collections');
  46688. var url = Util_Util.urlPathAppend(me.url, path);
  46689. this._processAsync({
  46690. url: url,
  46691. mehtod: 'GET',
  46692. callback: callback
  46693. });
  46694. }
  46695. /**
  46696. * @function ImageService.prototype.getCollectionByID
  46697. * @description ID值等于`collectionId`参数值的影像集合(Collection)。ID值用于在服务中唯一标识该影像集合。
  46698. * @param {string} collectionId 影像集合(Collection)的ID,在一个影像服务中唯一标识影像集合。
  46699. */
  46700. }, {
  46701. key: "getCollectionByID",
  46702. value: function getCollectionByID(collectionId, callback) {
  46703. var pathParams = {
  46704. collectionId: collectionId
  46705. };
  46706. var me = this;
  46707. var path = Util_Util.convertPath('/collections/{collectionId}', pathParams);
  46708. var url = Util_Util.urlPathAppend(me.url, path);
  46709. this._processAsync({
  46710. url: url,
  46711. mehtod: 'GET',
  46712. callback: callback
  46713. });
  46714. }
  46715. /**
  46716. * @function ImageSearchService.prototype.search
  46717. * @description 查询与过滤条件匹配的影像数据。
  46718. * @param {ImageSearchParameter} [imageSearchParameter] 查询参数。
  46719. */
  46720. }, {
  46721. key: "search",
  46722. value: function search(imageSearchParameter, callback) {
  46723. var postBody = _objectSpread({}, imageSearchParameter || {});
  46724. var me = this;
  46725. var path = Util_Util.convertPath('/search');
  46726. var url = Util_Util.urlPathAppend(me.url, path);
  46727. this._processAsync({
  46728. url: url,
  46729. method: 'POST',
  46730. data: postBody,
  46731. callback: callback
  46732. });
  46733. }
  46734. }, {
  46735. key: "_processAsync",
  46736. value: function _processAsync(_ref) {
  46737. var url = _ref.url,
  46738. method = _ref.method,
  46739. callback = _ref.callback,
  46740. data = _ref.data;
  46741. var eventId = ++this.eventCount;
  46742. var me = this;
  46743. var eventListeners = {
  46744. scope: this,
  46745. processCompleted: function processCompleted(result) {
  46746. if (eventId === result.result.eventId && callback) {
  46747. delete result.result.eventId;
  46748. callback(result);
  46749. this.events && this.events.un(eventListeners);
  46750. return false;
  46751. }
  46752. },
  46753. processFailed: function processFailed(result) {
  46754. if ((eventId === result.error.eventId || eventId === result.eventId) && callback) {
  46755. callback(result);
  46756. this.events && this.events.un(eventListeners);
  46757. return false;
  46758. }
  46759. }
  46760. };
  46761. this.events.on(eventListeners);
  46762. this.request({
  46763. method: method || 'GET',
  46764. url: url,
  46765. data: data,
  46766. scope: this,
  46767. success: function success(result, options) {
  46768. result.eventId = eventId;
  46769. me.serviceProcessCompleted(result, options);
  46770. },
  46771. failure: function failure(result, options) {
  46772. if (result.error) {
  46773. result.error.eventId = eventId;
  46774. }
  46775. result.eventId = eventId;
  46776. me.serviceProcessFailed(result, options);
  46777. }
  46778. });
  46779. }
  46780. }]);
  46781. return ImageService;
  46782. }(CommonServiceBase);
  46783. ;// CONCATENATED MODULE: ./src/maplibregl/services/ImageService.js
  46784. function services_ImageService_typeof(obj) { "@babel/helpers - typeof"; return services_ImageService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, services_ImageService_typeof(obj); }
  46785. function services_ImageService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  46786. function services_ImageService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  46787. function services_ImageService_createClass(Constructor, protoProps, staticProps) { if (protoProps) services_ImageService_defineProperties(Constructor.prototype, protoProps); if (staticProps) services_ImageService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  46788. function services_ImageService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) services_ImageService_setPrototypeOf(subClass, superClass); }
  46789. function services_ImageService_setPrototypeOf(o, p) { services_ImageService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return services_ImageService_setPrototypeOf(o, p); }
  46790. function services_ImageService_createSuper(Derived) { var hasNativeReflectConstruct = services_ImageService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = services_ImageService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = services_ImageService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return services_ImageService_possibleConstructorReturn(this, result); }; }
  46791. function services_ImageService_possibleConstructorReturn(self, call) { if (call && (services_ImageService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return services_ImageService_assertThisInitialized(self); }
  46792. function services_ImageService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  46793. function services_ImageService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  46794. function services_ImageService_getPrototypeOf(o) { services_ImageService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return services_ImageService_getPrototypeOf(o); }
  46795. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  46796. * This program are made available under the terms of the Apache License, Version 2.0
  46797. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  46798. /**
  46799. * @class ImageService
  46800. * @version 11.1.0
  46801. * @constructs ImageService
  46802. * @classdesc 影像服务类。
  46803. * @category iServer Image
  46804. * @modulecategory Services
  46805. * @example
  46806. * new ImageService(url,options)
  46807. * .getCollections(function(result){
  46808. * //doSomething
  46809. * })
  46810. * @param {string} url - 服务地址。例如: http://{ip}:{port}/iserver/{imageservice-imageserviceName}/restjsr/
  46811. * @param {Object} options - 参数。
  46812. * @param {string} [options.proxy] - 服务代理地址。
  46813. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  46814. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  46815. * @param {Object} [options.headers] - 请求头。
  46816. * @extends {ServiceBase}
  46817. * @usage
  46818. */
  46819. var ImageService = /*#__PURE__*/function (_ServiceBase) {
  46820. services_ImageService_inherits(ImageService, _ServiceBase);
  46821. var _super = services_ImageService_createSuper(ImageService);
  46822. function ImageService(url, options) {
  46823. var _this;
  46824. services_ImageService_classCallCheck(this, ImageService);
  46825. _this = _super.call(this, url, options);
  46826. _this._imageService = new ImageService_ImageService(_this.url, {
  46827. proxy: _this.options.proxy,
  46828. withCredentials: _this.options.withCredentials,
  46829. crossOrigin: _this.options.crossOrigin,
  46830. headers: _this.options.headers
  46831. });
  46832. return _this;
  46833. }
  46834. /**
  46835. * @function ImageService.prototype.getCollections
  46836. * @description 返回当前影像服务中的影像集合列表(Collections)。
  46837. * @param {RequestCallback} callback - 回调函数。
  46838. */
  46839. services_ImageService_createClass(ImageService, [{
  46840. key: "getCollections",
  46841. value: function getCollections(callback) {
  46842. this._imageService.getCollections(callback);
  46843. }
  46844. /**
  46845. * @function ImageService.prototype.getCollectionByID
  46846. * @description ID值等于`collectionId`参数值的影像集合(Collection)。ID值用于在服务中唯一标识该影像集合。
  46847. * @param {string} collectionId 影像集合(Collection)的ID,在一个影像服务中唯一标识影像集合。
  46848. * @param {RequestCallback} callback - 回调函数。
  46849. */
  46850. }, {
  46851. key: "getCollectionByID",
  46852. value: function getCollectionByID(collectionId, callback) {
  46853. this._imageService.getCollectionByID(collectionId, callback);
  46854. }
  46855. /**
  46856. * @function ImageService.prototype.search
  46857. * @description 查询与过滤条件匹配的影像数据。
  46858. * @param {ImageSearchParameter} [itemSearch] 影像服务查询参数类。
  46859. * @param {RequestCallback} callback - 回调函数。
  46860. */
  46861. }, {
  46862. key: "search",
  46863. value: function search(itemSearch, callback) {
  46864. this._imageService.search(itemSearch, callback);
  46865. }
  46866. }]);
  46867. return ImageService;
  46868. }(ServiceBase);
  46869. ;// CONCATENATED MODULE: ./src/common/iServer/ImageCollectionService.js
  46870. function ImageCollectionService_typeof(obj) { "@babel/helpers - typeof"; return ImageCollectionService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, ImageCollectionService_typeof(obj); }
  46871. function ImageCollectionService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  46872. function ImageCollectionService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  46873. function ImageCollectionService_createClass(Constructor, protoProps, staticProps) { if (protoProps) ImageCollectionService_defineProperties(Constructor.prototype, protoProps); if (staticProps) ImageCollectionService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  46874. function ImageCollectionService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { ImageCollectionService_get = Reflect.get.bind(); } else { ImageCollectionService_get = function _get(target, property, receiver) { var base = ImageCollectionService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return ImageCollectionService_get.apply(this, arguments); }
  46875. function ImageCollectionService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ImageCollectionService_getPrototypeOf(object); if (object === null) break; } return object; }
  46876. function ImageCollectionService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) ImageCollectionService_setPrototypeOf(subClass, superClass); }
  46877. function ImageCollectionService_setPrototypeOf(o, p) { ImageCollectionService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ImageCollectionService_setPrototypeOf(o, p); }
  46878. function ImageCollectionService_createSuper(Derived) { var hasNativeReflectConstruct = ImageCollectionService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = ImageCollectionService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = ImageCollectionService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return ImageCollectionService_possibleConstructorReturn(this, result); }; }
  46879. function ImageCollectionService_possibleConstructorReturn(self, call) { if (call && (ImageCollectionService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return ImageCollectionService_assertThisInitialized(self); }
  46880. function ImageCollectionService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  46881. function ImageCollectionService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  46882. function ImageCollectionService_getPrototypeOf(o) { ImageCollectionService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ImageCollectionService_getPrototypeOf(o); }
  46883. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  46884. * This program are made available under the terms of the Apache License, Version 2.0
  46885. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  46886. /**
  46887. * @class ImageCollectionService
  46888. * @deprecatedclass SuperMap.ImageCollectionService
  46889. * @classdesc 影像集合服务类。
  46890. * @version 10.2.0
  46891. * @category iServer Image
  46892. * @param {string} url - 服务地址。例如: http://{ip}:{port}/iserver/{imageservice-imageserviceName}/restjsr/
  46893. * @param {Object} options - 参数。
  46894. * @param {string} options.collectionId 影像集合(Collection)的ID,在一个影像服务中唯一标识影像集合。
  46895. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  46896. * @param {Object} [options.headers] - 请求头。
  46897. * @extends {CommonServiceBase}
  46898. * @usage
  46899. */
  46900. var ImageCollectionService_ImageCollectionService = /*#__PURE__*/function (_CommonServiceBase) {
  46901. ImageCollectionService_inherits(ImageCollectionService, _CommonServiceBase);
  46902. var _super = ImageCollectionService_createSuper(ImageCollectionService);
  46903. function ImageCollectionService(url, options) {
  46904. var _this;
  46905. ImageCollectionService_classCallCheck(this, ImageCollectionService);
  46906. _this = _super.call(this, url, options);
  46907. _this.options = options || {};
  46908. if (options) {
  46909. Util_Util.extend(ImageCollectionService_assertThisInitialized(_this), options);
  46910. }
  46911. _this.eventCount = 0;
  46912. _this.CLASS_NAME = 'SuperMap.ImageCollectionService';
  46913. return _this;
  46914. }
  46915. /**
  46916. * @function ImageCollectionService.prototype.destroy
  46917. * @override
  46918. */
  46919. ImageCollectionService_createClass(ImageCollectionService, [{
  46920. key: "destroy",
  46921. value: function destroy() {
  46922. ImageCollectionService_get(ImageCollectionService_getPrototypeOf(ImageCollectionService.prototype), "destroy", this).call(this);
  46923. }
  46924. /**
  46925. * @function ImageCollectionService.prototype.getLegend
  46926. * @description 返回当前影像集合的图例信息。默认为服务发布所配置的风格,支持根据风格参数生成新的图例。
  46927. * @param {Object} queryParams query参数。
  46928. * @param {ImageRenderingRule} [queryParams.renderingRule] renderingRule 对象,用来指定影像的渲染风格,从而确定图例内容。影像的渲染风格包含拉伸显示方式、颜色表、波段组合以及应用栅格函数进行快速处理等。该参数未设置时,将使用发布服务时所配置的风格。
  46929. */
  46930. }, {
  46931. key: "getLegend",
  46932. value: function getLegend(queryParams, callback) {
  46933. var me = this;
  46934. var pathParams = {
  46935. collectionId: me.options.collectionId
  46936. };
  46937. var path = Util_Util.convertPath('/collections/{collectionId}/legend', pathParams);
  46938. var url = Util_Util.urlPathAppend(me.url, path);
  46939. this._processAsync({
  46940. url: url,
  46941. method: 'GET',
  46942. params: queryParams,
  46943. callback: callback
  46944. });
  46945. }
  46946. /**
  46947. * @function ImageCollectionService.prototype.getStatistics
  46948. * @description 返回当前影像集合的统计信息。包括文件数量,文件大小等信息。
  46949. */
  46950. }, {
  46951. key: "getStatistics",
  46952. value: function getStatistics(callback) {
  46953. var me = this;
  46954. var pathParams = {
  46955. collectionId: me.options.collectionId
  46956. };
  46957. var path = Util_Util.convertPath('/collections/{collectionId}/statistics', pathParams);
  46958. var url = Util_Util.urlPathAppend(me.url, path);
  46959. this._processAsync({
  46960. url: url,
  46961. method: 'GET',
  46962. callback: callback
  46963. });
  46964. }
  46965. /**
  46966. * @function ImageCollectionService.prototype.getTileInfo
  46967. * @description 返回影像集合所提供的服务瓦片的信息,包括:每层瓦片的分辨率,比例尺等信息,方便前端进行图层叠加。
  46968. */
  46969. }, {
  46970. key: "getTileInfo",
  46971. value: function getTileInfo(callback) {
  46972. var me = this;
  46973. var pathParams = {
  46974. collectionId: me.options.collectionId
  46975. };
  46976. var path = Util_Util.convertPath('/collections/{collectionId}/tileInfo', pathParams);
  46977. var url = Util_Util.urlPathAppend(me.url, path);
  46978. this._processAsync({
  46979. url: url,
  46980. method: 'GET',
  46981. callback: callback
  46982. });
  46983. }
  46984. /**
  46985. * @function ImageCollectionService.prototype.deleteItemByID
  46986. * @description 删除影像集合中指定 ID 的 Item,即从影像集合中删除指定的影像。
  46987. * @param {string} featureId Feature 的本地标识符。
  46988. */
  46989. }, {
  46990. key: "deleteItemByID",
  46991. value: function deleteItemByID(featureId, callback) {
  46992. var me = this;
  46993. var pathParams = {
  46994. collectionId: me.options.collectionId,
  46995. featureId: featureId
  46996. };
  46997. var path = Util_Util.convertPath('/collections/{collectionId}/items/{featureId}', pathParams);
  46998. var url = Util_Util.urlPathAppend(me.url, path);
  46999. this._processAsync({
  47000. url: url,
  47001. method: 'DELETE',
  47002. callback: callback
  47003. });
  47004. }
  47005. /**
  47006. * @function ImageCollectionService.prototype.getItemByID
  47007. * @description 返回指定ID(`collectionId`)的影像集合中的指定ID(`featureId`)的Item对象,即返回影像集合中指定的影像。
  47008. * @param {string} featureId Feature 的本地标识符。
  47009. */
  47010. }, {
  47011. key: "getItemByID",
  47012. value: function getItemByID(featureId, callback) {
  47013. var me = this;
  47014. var pathParams = {
  47015. collectionId: me.options.collectionId,
  47016. featureId: featureId
  47017. };
  47018. var path = Util_Util.convertPath('/collections/{collectionId}/items/{featureId}', pathParams);
  47019. var url = Util_Util.urlPathAppend(me.url, path);
  47020. this._processAsync({
  47021. url: url,
  47022. method: 'GET',
  47023. callback: callback
  47024. });
  47025. }
  47026. }, {
  47027. key: "_processAsync",
  47028. value: function _processAsync(_ref) {
  47029. var url = _ref.url,
  47030. method = _ref.method,
  47031. callback = _ref.callback,
  47032. params = _ref.params;
  47033. var eventId = ++this.eventCount;
  47034. var eventListeners = {
  47035. scope: this,
  47036. processCompleted: function processCompleted(result) {
  47037. if (eventId === result.result.eventId && callback) {
  47038. delete result.result.eventId;
  47039. callback(result);
  47040. this.events && this.events.un(eventListeners);
  47041. return false;
  47042. }
  47043. },
  47044. processFailed: function processFailed(result) {
  47045. if ((eventId === result.error.eventId || eventId === result.eventId) && callback) {
  47046. callback(result);
  47047. this.events && this.events.un(eventListeners);
  47048. return false;
  47049. }
  47050. }
  47051. };
  47052. this.events.on(eventListeners);
  47053. this.request({
  47054. method: method || 'GET',
  47055. url: url,
  47056. params: params,
  47057. scope: this,
  47058. success: function success(result, options) {
  47059. result.eventId = eventId;
  47060. this.serviceProcessCompleted(result, options);
  47061. },
  47062. failure: function failure(result, options) {
  47063. if (result.error) {
  47064. result.error.eventId = eventId;
  47065. }
  47066. result.eventId = eventId;
  47067. this.serviceProcessFailed(result, options);
  47068. }
  47069. });
  47070. }
  47071. }]);
  47072. return ImageCollectionService;
  47073. }(CommonServiceBase);
  47074. ;// CONCATENATED MODULE: ./src/maplibregl/services/ImageCollectionService.js
  47075. function services_ImageCollectionService_typeof(obj) { "@babel/helpers - typeof"; return services_ImageCollectionService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, services_ImageCollectionService_typeof(obj); }
  47076. function services_ImageCollectionService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  47077. function services_ImageCollectionService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  47078. function services_ImageCollectionService_createClass(Constructor, protoProps, staticProps) { if (protoProps) services_ImageCollectionService_defineProperties(Constructor.prototype, protoProps); if (staticProps) services_ImageCollectionService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  47079. function services_ImageCollectionService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) services_ImageCollectionService_setPrototypeOf(subClass, superClass); }
  47080. function services_ImageCollectionService_setPrototypeOf(o, p) { services_ImageCollectionService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return services_ImageCollectionService_setPrototypeOf(o, p); }
  47081. function services_ImageCollectionService_createSuper(Derived) { var hasNativeReflectConstruct = services_ImageCollectionService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = services_ImageCollectionService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = services_ImageCollectionService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return services_ImageCollectionService_possibleConstructorReturn(this, result); }; }
  47082. function services_ImageCollectionService_possibleConstructorReturn(self, call) { if (call && (services_ImageCollectionService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return services_ImageCollectionService_assertThisInitialized(self); }
  47083. function services_ImageCollectionService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  47084. function services_ImageCollectionService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  47085. function services_ImageCollectionService_getPrototypeOf(o) { services_ImageCollectionService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return services_ImageCollectionService_getPrototypeOf(o); }
  47086. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  47087. * This program are made available under the terms of the Apache License, Version 2.0
  47088. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  47089. /**
  47090. * @class ImageCollectionService
  47091. * @version 11.1.0
  47092. * @constructs ImageCollectionService
  47093. * @classdesc 影像集合服务类。
  47094. * @category iServer Image
  47095. * @modulecategory Services
  47096. * @extends {ServiceBase}
  47097. * @example
  47098. * new ImageCollectionService(url,options)
  47099. * .getLegend(collectionId, queryParams, function(result){
  47100. * //doSomething
  47101. * })
  47102. * @param {string} url - 服务地址。例如: http://{ip}:{port}/iserver/{imageservice-imageserviceName}/restjsr/
  47103. * @param {Object} options - 参数。
  47104. * @param {string} options.collectionId 影像集合(Collection)的ID,在一个影像服务中唯一标识影像集合。
  47105. * @param {string} [options.proxy] - 服务代理地址。
  47106. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  47107. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  47108. * @param {Object} [options.headers] - 请求头。
  47109. * @usage
  47110. */
  47111. var ImageCollectionService = /*#__PURE__*/function (_ServiceBase) {
  47112. services_ImageCollectionService_inherits(ImageCollectionService, _ServiceBase);
  47113. var _super = services_ImageCollectionService_createSuper(ImageCollectionService);
  47114. function ImageCollectionService(url, options) {
  47115. var _this;
  47116. services_ImageCollectionService_classCallCheck(this, ImageCollectionService);
  47117. _this = _super.call(this, url, options);
  47118. _this._imageCollectionService = new ImageCollectionService_ImageCollectionService(_this.url, {
  47119. collectionId: _this.options.collectionId,
  47120. proxy: _this.options.proxy,
  47121. withCredentials: _this.options.withCredentials,
  47122. crossOrigin: _this.options.crossOrigin,
  47123. headers: _this.options.headers
  47124. });
  47125. return _this;
  47126. }
  47127. /**
  47128. * @function ImageCollectionService.prototype.getLegend
  47129. * @param {Object} queryParams query参数。
  47130. * @param {ImageRenderingRule} [queryParams.renderingRule] 指定影像显示的风格,包含拉伸显示方式、颜色表、波段组合以及应用栅格函数进行快速处理等。不指定时,使用发布服务时所配置的风格。
  47131. * @param {RequestCallback} callback - 回调函数。
  47132. */
  47133. services_ImageCollectionService_createClass(ImageCollectionService, [{
  47134. key: "getLegend",
  47135. value: function getLegend(queryParams, callback) {
  47136. this._imageCollectionService.getLegend(queryParams, callback);
  47137. }
  47138. /**
  47139. * @function ImageCollectionService.prototype.getStatistics
  47140. * @description 返回当前影像集合的统计信息。包括文件数量,文件大小等信息。
  47141. * @param {RequestCallback} callback - 回调函数。
  47142. */
  47143. }, {
  47144. key: "getStatistics",
  47145. value: function getStatistics(callback) {
  47146. this._imageCollectionService.getStatistics(callback);
  47147. }
  47148. /**
  47149. * @function ImageCollectionService.prototype.getTileInfo
  47150. * @description 返回影像集合所提供的服务瓦片的信息,包括:每层瓦片的分辨率,比例尺等信息,方便前端进行图层叠加。
  47151. * @param {RequestCallback} callback - 回调函数。
  47152. */
  47153. }, {
  47154. key: "getTileInfo",
  47155. value: function getTileInfo(callback) {
  47156. this._imageCollectionService.getTileInfo(callback);
  47157. }
  47158. /**
  47159. * @function ImageCollectionService.prototype.deleteItemByID
  47160. * @description 删除影像集合中指定ID (`featureId`) 的Item对象,即从影像集合中删除指定的影像。
  47161. * @param {string} featureId Feature 的本地标识符。
  47162. * @param {RequestCallback} callback - 回调函数。
  47163. */
  47164. }, {
  47165. key: "deleteItemByID",
  47166. value: function deleteItemByID(featureId, callback) {
  47167. this._imageCollectionService.deleteItemByID(featureId, callback);
  47168. }
  47169. /**
  47170. * @function ImageCollectionService.prototype.getItemByID
  47171. * @description 返回影像集合中的指定ID(`featureId`)的Item对象,即返回影像集合中指定的影像。
  47172. * @param {string} featureId Feature 的本地标识符。
  47173. * @param {RequestCallback} callback - 回调函数。
  47174. */
  47175. }, {
  47176. key: "getItemByID",
  47177. value: function getItemByID(featureId, callback) {
  47178. this._imageCollectionService.getItemByID(featureId, callback);
  47179. }
  47180. }]);
  47181. return ImageCollectionService;
  47182. }(ServiceBase);
  47183. ;// CONCATENATED MODULE: ./src/common/iServer/KnowledgeGraphService.js
  47184. function KnowledgeGraphService_typeof(obj) { "@babel/helpers - typeof"; return KnowledgeGraphService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, KnowledgeGraphService_typeof(obj); }
  47185. function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == KnowledgeGraphService_typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
  47186. function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
  47187. function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
  47188. function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
  47189. function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
  47190. function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
  47191. function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
  47192. function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
  47193. function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
  47194. function KnowledgeGraphService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  47195. function KnowledgeGraphService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  47196. function KnowledgeGraphService_createClass(Constructor, protoProps, staticProps) { if (protoProps) KnowledgeGraphService_defineProperties(Constructor.prototype, protoProps); if (staticProps) KnowledgeGraphService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  47197. function KnowledgeGraphService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { KnowledgeGraphService_get = Reflect.get.bind(); } else { KnowledgeGraphService_get = function _get(target, property, receiver) { var base = KnowledgeGraphService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return KnowledgeGraphService_get.apply(this, arguments); }
  47198. function KnowledgeGraphService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = KnowledgeGraphService_getPrototypeOf(object); if (object === null) break; } return object; }
  47199. function KnowledgeGraphService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) KnowledgeGraphService_setPrototypeOf(subClass, superClass); }
  47200. function KnowledgeGraphService_setPrototypeOf(o, p) { KnowledgeGraphService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return KnowledgeGraphService_setPrototypeOf(o, p); }
  47201. function KnowledgeGraphService_createSuper(Derived) { var hasNativeReflectConstruct = KnowledgeGraphService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = KnowledgeGraphService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = KnowledgeGraphService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return KnowledgeGraphService_possibleConstructorReturn(this, result); }; }
  47202. function KnowledgeGraphService_possibleConstructorReturn(self, call) { if (call && (KnowledgeGraphService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return KnowledgeGraphService_assertThisInitialized(self); }
  47203. function KnowledgeGraphService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  47204. function KnowledgeGraphService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  47205. function KnowledgeGraphService_getPrototypeOf(o) { KnowledgeGraphService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return KnowledgeGraphService_getPrototypeOf(o); }
  47206. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  47207. * This program are made available under the terms of the Apache License, Version 2.0
  47208. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  47209. /**
  47210. * @class KnowledgeGraphService
  47211. * @category iServer KnowledgeGraph
  47212. * @classdesc 知识图谱服务类
  47213. * @version 11.1.0
  47214. * @extends {ProcessingServiceBase}
  47215. * @param {string} url - 服务地址。
  47216. * @param {Object} options - 可选参数。
  47217. * @param {string} [options.proxy] - 服务代理地址。
  47218. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  47219. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  47220. * @param {Object} [options.headers] - 请求头。
  47221. * @usage
  47222. */
  47223. var KnowledgeGraphService_KnowledgeGraphService = /*#__PURE__*/function (_CommonServiceBase) {
  47224. KnowledgeGraphService_inherits(KnowledgeGraphService, _CommonServiceBase);
  47225. var _super = KnowledgeGraphService_createSuper(KnowledgeGraphService);
  47226. function KnowledgeGraphService(url, options) {
  47227. var _this;
  47228. KnowledgeGraphService_classCallCheck(this, KnowledgeGraphService);
  47229. _this = _super.call(this, url, options);
  47230. _this.options = options || {};
  47231. _this.eventCount = 0;
  47232. _this.CLASS_NAME = 'SuperMap.KnowledgeGraphService';
  47233. return _this;
  47234. }
  47235. /**
  47236. * @function KnowledgeGraphService.prototype.destroy
  47237. * @override
  47238. */
  47239. KnowledgeGraphService_createClass(KnowledgeGraphService, [{
  47240. key: "destroy",
  47241. value: function destroy() {
  47242. KnowledgeGraphService_get(KnowledgeGraphService_getPrototypeOf(KnowledgeGraphService.prototype), "destroy", this).call(this);
  47243. }
  47244. /**
  47245. * @function KnowledgeGraphService.prototype.query
  47246. * @description 通过查询语句查询知识图谱数据。
  47247. * @param {string} params - 查询条件。
  47248. * @param {RequestCallback} callback 回调函数。
  47249. */
  47250. }, {
  47251. key: "query",
  47252. value: function query(params, callback) {
  47253. var paramKey = 'cypherQuery';
  47254. var url = Util_Util.urlAppend(this.url + '/query.json', "".concat(paramKey, "=").concat(params));
  47255. this.processAsync({
  47256. url: url,
  47257. method: 'GET',
  47258. callback: callback
  47259. });
  47260. }
  47261. // /**
  47262. // * @function KnowledgeGraphService.prototype.queryById
  47263. // * @description 根据实体id查询关联节点。
  47264. // * @param {string} id - 实体id。
  47265. // * @param {RequestCallback} callback 回调函数。
  47266. // */
  47267. // queryById(id, callback) {
  47268. // const paramKey = 'cypherQuery';
  47269. // const url = Util.urlAppend(this.url + '/query.json', `${paramKey}=match p=(n)-[]-(m) where id(n)=${id} return p;`);
  47270. // this.processAsync({ url, method: 'GET', callback });
  47271. // }
  47272. // /**
  47273. // * @function KnowledgeGraphService.prototype.getMetaData
  47274. // * @description 获取元信息(展示所有实体类型和关系类型。)
  47275. // * @param {RequestCallback} callback 回调函数。
  47276. // */
  47277. // getMetaData(callback) {
  47278. // const url = this.url + 'management/metadata.json';
  47279. // this.processAsync({ url, method: 'GET', callback });
  47280. // }
  47281. /**
  47282. * @function KnowledgeGraphService.prototype.getGraphMaps
  47283. * @description 获取图谱列表
  47284. * @param {RequestCallback} callback 回调函数。
  47285. */
  47286. }, {
  47287. key: "getGraphMaps",
  47288. value: function getGraphMaps(callback) {
  47289. var url = this.url + '/graphmaps.json';
  47290. this.processAsync({
  47291. url: url,
  47292. method: 'GET',
  47293. callback: callback
  47294. });
  47295. }
  47296. /**
  47297. * @function KnowledgeGraphService.prototype.getGraphMap
  47298. * @description 获取图谱图序列化数据
  47299. * @param {string} graphMapName 图谱名称
  47300. * @param {RequestCallback} callback 回调函数
  47301. */
  47302. }, {
  47303. key: "getGraphMap",
  47304. value: function getGraphMap(graphMapName, callback) {
  47305. var url = this.url + "/graphmaps/".concat(graphMapName, ".json");
  47306. this.processAsync({
  47307. url: url,
  47308. method: 'GET',
  47309. callback: callback
  47310. });
  47311. }
  47312. /**
  47313. * @function KnowledgeGraphService.prototype.getGraphMapData
  47314. * @description 将iServer GraphMap服务的数据格式转换为KnowledgeGraph的数据格式。
  47315. * @param {string} graphMapName - 图谱名称
  47316. * @returns {Promise} Promise 对象。
  47317. */
  47318. }, {
  47319. key: "getGraphMapData",
  47320. value: function () {
  47321. var _getGraphMapData2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(graphMapName) {
  47322. var data, graphMap, query, queries, expandQueries, _queries, j, cypherQuery, res;
  47323. return _regeneratorRuntime().wrap(function _callee$(_context) {
  47324. while (1) switch (_context.prev = _context.next) {
  47325. case 0:
  47326. data = [];
  47327. _context.next = 3;
  47328. return this._getGraphMapData(graphMapName);
  47329. case 3:
  47330. graphMap = _context.sent;
  47331. if (graphMap) {
  47332. _context.next = 6;
  47333. break;
  47334. }
  47335. return _context.abrupt("return");
  47336. case 6:
  47337. query = graphMap.dataContent.queries && graphMap.dataContent.queries.query || [];
  47338. queries = [];
  47339. if (typeof query === 'string') {
  47340. queries = [query];
  47341. } else {
  47342. queries = query;
  47343. }
  47344. expandQueries = this._getGraphMapExpandQuery(graphMap);
  47345. if (expandQueries.length) {
  47346. (_queries = queries).push.apply(_queries, _toConsumableArray(expandQueries));
  47347. }
  47348. j = 0;
  47349. case 12:
  47350. if (!(j < queries.length)) {
  47351. _context.next = 21;
  47352. break;
  47353. }
  47354. cypherQuery = queries[j];
  47355. _context.next = 16;
  47356. return this._queryDataBySql(cypherQuery);
  47357. case 16:
  47358. res = _context.sent;
  47359. data = data.concat([], res);
  47360. case 18:
  47361. j++;
  47362. _context.next = 12;
  47363. break;
  47364. case 21:
  47365. return _context.abrupt("return", {
  47366. data: data,
  47367. graphMap: graphMap
  47368. });
  47369. case 22:
  47370. case "end":
  47371. return _context.stop();
  47372. }
  47373. }, _callee, this);
  47374. }));
  47375. function getGraphMapData(_x) {
  47376. return _getGraphMapData2.apply(this, arguments);
  47377. }
  47378. return getGraphMapData;
  47379. }()
  47380. /**
  47381. * @private
  47382. * @function KnowledgeGraphService.prototype._getGraphMapExpandQuery
  47383. * @description 获取graphMap图谱展开节点的query条件
  47384. * @param {Object} graphMap -将iServer GraphMap图谱服务的数据
  47385. * @param {Array.<string>} 查询条件
  47386. */
  47387. }, {
  47388. key: "_getGraphMapExpandQuery",
  47389. value: function _getGraphMapExpandQuery(graphMap) {
  47390. var queries = [];
  47391. var expandIds = graphMap.dataContent.expand && JSON.parse(graphMap.dataContent.expand) || [];
  47392. expandIds.forEach(function (id) {
  47393. queries.push("match p=(n)-[]-(m) where id(n)=".concat(id, " return p;"));
  47394. });
  47395. return queries;
  47396. }
  47397. // /**
  47398. // * @private
  47399. // * @function KnowledgeGraphService.prototype.getEntities
  47400. // * @description 获取实体。
  47401. // * @param {Object} params - 查询条件。{type:'院落', count:1}
  47402. // * @param {number} [params.count] - 返回个数
  47403. // * @param {RequestCallback} callback 回调函数
  47404. // */
  47405. // getEntities(params, callback) {
  47406. // const url = Util.urlAppend(this.url + '/entities.json', params);
  47407. // this.processAsync({ url, params, method: 'GET', callback });
  47408. // }
  47409. // /**
  47410. // * @private
  47411. // * @function KnowledgeGraphService.prototype.getEdges
  47412. // * @description 获取实体。
  47413. // * @param {Object} params - 查询条件。{type:'院落', count:1}
  47414. // * @param {number} [params.count] - 返回个数
  47415. // * @param {RequestCallback} callback 回调函数
  47416. // */
  47417. // getEdges(params, callback) {
  47418. // const url = Util.urlAppend(this.url + '/edges.json', params);
  47419. // this.processAsync({ url, params, method: 'GET', callback });
  47420. // }
  47421. // /**
  47422. // * @private
  47423. // * @function KnowledgeGraphService.prototype.getEntities
  47424. // * @description 获取实体。
  47425. // * @param {number} id - 查询条件。{type:'院落', count:1}
  47426. // * @param {RequestCallback} callback 回调函数
  47427. // */
  47428. // deleteEntitiy(id, callback) {
  47429. // const url = Util.urlAppend(this.url + '/entities.json', `id=${id}`);
  47430. // this.processAsync({ url, method: 'DELETE', callback });
  47431. // }
  47432. // /**
  47433. // * @private
  47434. // * @function KnowledgeGraphService.prototype.addNode
  47435. // * @description 获取实体。
  47436. // * @param {Object} params - 查询条件
  47437. // * @param {number} [params.count] - 返回个数
  47438. // * @param {RequestCallback} callback 回调函数
  47439. // */
  47440. // addNode(params, callback) {
  47441. // if (!(params instanceof KnowledgeGraphNodeParameter)) {
  47442. // return;
  47443. // }
  47444. // const url = Util.urlAppend(this.url + '/entities.json', params);
  47445. // this.processAsync({ url, params, method: 'PUT', callback });
  47446. // }
  47447. // /**
  47448. // * @private
  47449. // * @function KnowledgeGraphService.prototype.addEdge
  47450. // * @description 获取实体。
  47451. // * @param {Object} params - 查询条件
  47452. // * @param {number} [params.count] - 返回个数
  47453. // * @param {RequestCallback} callback 回调函数
  47454. // */
  47455. // addEdge(params, callback) {
  47456. // if (!(params instanceof KnowledgeGraphEdgeParameter)) {
  47457. // return;
  47458. // }
  47459. // const url = Util.urlAppend(this.url + '/edges.json', params);
  47460. // this.processAsync({ url, params, method: 'PUT', callback });
  47461. // }
  47462. /**
  47463. * @function KnowledgeGraphService.prototype.processAsync
  47464. * @description 负责将客户端的动态分段服务参数传递到服务端。
  47465. * @param {string} url - 服务地址
  47466. * @param {Object} params - 参数
  47467. */
  47468. }, {
  47469. key: "processAsync",
  47470. value: function processAsync(_ref) {
  47471. var url = _ref.url,
  47472. params = _ref.params,
  47473. method = _ref.method,
  47474. callback = _ref.callback;
  47475. var eventId = ++this.eventCount;
  47476. var eventListeners = {
  47477. scope: this,
  47478. processCompleted: function processCompleted(result) {
  47479. if (eventId === result.result.eventId && callback) {
  47480. delete result.result.eventId;
  47481. callback(result);
  47482. this.events && this.events.un(eventListeners);
  47483. return false;
  47484. }
  47485. },
  47486. processFailed: function processFailed(result) {
  47487. if ((eventId === result.error.eventId || eventId === result.eventId) && callback) {
  47488. delete result.eventId;
  47489. callback(result);
  47490. this.events && this.events.un(eventListeners);
  47491. return false;
  47492. }
  47493. }
  47494. };
  47495. this.events.on(eventListeners);
  47496. var requestParams = {
  47497. method: method,
  47498. url: url,
  47499. scope: this,
  47500. success: function success(result, options) {
  47501. result.eventId = eventId;
  47502. this.serviceProcessCompleted(result, options);
  47503. },
  47504. failure: function failure(result, options) {
  47505. result.eventId = eventId;
  47506. this.serviceProcessFailed(result, options);
  47507. }
  47508. };
  47509. if (params) {
  47510. requestParams.params = params;
  47511. }
  47512. this.request(requestParams);
  47513. }
  47514. /**
  47515. * @private
  47516. * @function _getGraphMapData
  47517. * @description 获取图谱信息
  47518. * @param {string} graphMapName - 图谱名称
  47519. * @returns {Promise} Promise 对象
  47520. */
  47521. }, {
  47522. key: "_getGraphMapData",
  47523. value: function _getGraphMapData(graphMapName) {
  47524. var _this2 = this;
  47525. return new Promise(function (resolve, reject) {
  47526. _this2.getGraphMap(graphMapName, function (res) {
  47527. if (res.type === 'processFailed') {
  47528. reject(res.error);
  47529. } else {
  47530. if (res.result.data === '') {
  47531. reject('无数据');
  47532. } else {
  47533. resolve(res.result.graphMap);
  47534. }
  47535. }
  47536. });
  47537. });
  47538. }
  47539. /**
  47540. * @private
  47541. * @function _queryDataBySql
  47542. * @description 查询实体和关系数据。
  47543. * @param {string} cypherQuery - 查询语句
  47544. * @returns {Promise} Promise 对象。
  47545. */
  47546. }, {
  47547. key: "_queryDataBySql",
  47548. value: function _queryDataBySql(cypherQuery) {
  47549. var _this3 = this;
  47550. return new Promise(function (resolve, reject) {
  47551. _this3.query(cypherQuery, function (res) {
  47552. if (res.type === 'processFailed') {
  47553. reject(res.error);
  47554. } else {
  47555. resolve(res.result);
  47556. }
  47557. });
  47558. });
  47559. }
  47560. }]);
  47561. return KnowledgeGraphService;
  47562. }(CommonServiceBase);
  47563. ;// CONCATENATED MODULE: ./src/maplibregl/services/KnowledgeGraphService.js
  47564. function services_KnowledgeGraphService_typeof(obj) { "@babel/helpers - typeof"; return services_KnowledgeGraphService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, services_KnowledgeGraphService_typeof(obj); }
  47565. function KnowledgeGraphService_regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ KnowledgeGraphService_regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == services_KnowledgeGraphService_typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
  47566. function KnowledgeGraphService_asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
  47567. function KnowledgeGraphService_asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { KnowledgeGraphService_asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { KnowledgeGraphService_asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
  47568. function services_KnowledgeGraphService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  47569. function services_KnowledgeGraphService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  47570. function services_KnowledgeGraphService_createClass(Constructor, protoProps, staticProps) { if (protoProps) services_KnowledgeGraphService_defineProperties(Constructor.prototype, protoProps); if (staticProps) services_KnowledgeGraphService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  47571. function services_KnowledgeGraphService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) services_KnowledgeGraphService_setPrototypeOf(subClass, superClass); }
  47572. function services_KnowledgeGraphService_setPrototypeOf(o, p) { services_KnowledgeGraphService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return services_KnowledgeGraphService_setPrototypeOf(o, p); }
  47573. function services_KnowledgeGraphService_createSuper(Derived) { var hasNativeReflectConstruct = services_KnowledgeGraphService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = services_KnowledgeGraphService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = services_KnowledgeGraphService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return services_KnowledgeGraphService_possibleConstructorReturn(this, result); }; }
  47574. function services_KnowledgeGraphService_possibleConstructorReturn(self, call) { if (call && (services_KnowledgeGraphService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return services_KnowledgeGraphService_assertThisInitialized(self); }
  47575. function services_KnowledgeGraphService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  47576. function services_KnowledgeGraphService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  47577. function services_KnowledgeGraphService_getPrototypeOf(o) { services_KnowledgeGraphService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return services_KnowledgeGraphService_getPrototypeOf(o); }
  47578. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  47579. * This program are made available under the terms of the Apache License, Version 2.0
  47580. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  47581. /**
  47582. * @class KnowledgeGraphService
  47583. * @category iServer KnowledgeGraph
  47584. * @classdesc 知识图谱服务类。
  47585. * @version 11.1.0
  47586. * @example
  47587. * new KnowledgeGraphService(url)
  47588. * .query(param,function(result){
  47589. * //doSomething
  47590. * })
  47591. * @extends {ServiceBase}
  47592. * @param {string} url - 服务地址。
  47593. * @param {Object} options -参数。
  47594. * @param {string} [options.proxy] - 服务代理地址。
  47595. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  47596. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  47597. * @param {Object} [options.headers] - 请求头。
  47598. * @usage
  47599. */
  47600. var KnowledgeGraphService = /*#__PURE__*/function (_ServiceBase) {
  47601. services_KnowledgeGraphService_inherits(KnowledgeGraphService, _ServiceBase);
  47602. var _super = services_KnowledgeGraphService_createSuper(KnowledgeGraphService);
  47603. function KnowledgeGraphService(url, options) {
  47604. var _this;
  47605. services_KnowledgeGraphService_classCallCheck(this, KnowledgeGraphService);
  47606. _this = _super.call(this, url, options);
  47607. _this._knowledgeGraphService = new KnowledgeGraphService_KnowledgeGraphService(url, options);
  47608. return _this;
  47609. }
  47610. /**
  47611. * @function KnowledgeGraphService.prototype.query
  47612. * @description 通过查询语句查询知识图谱数据。
  47613. * @param {string} cypherQuery - 查询条件。
  47614. * @param {RequestCallback} callback - 回调函数。
  47615. */
  47616. services_KnowledgeGraphService_createClass(KnowledgeGraphService, [{
  47617. key: "query",
  47618. value: function query(cypherQuery, callback) {
  47619. this._knowledgeGraphService.query(cypherQuery, callback);
  47620. }
  47621. // /**
  47622. // * @function KnowledgeGraphService.prototype.getMetaData
  47623. // * @description 获取元信息(展示所有实体类型和关系类型)。
  47624. // * @param {RequestCallback} callback 回调函数。
  47625. // */
  47626. // getMetaData(callback) {
  47627. // this._knowledgeGraphService.getMetaData(callback);
  47628. // }
  47629. /**
  47630. * @function KnowledgeGraphService.prototype.getGraphMaps
  47631. * @description 获取图谱列表。
  47632. * @param {RequestCallback} callback 回调函数。
  47633. */
  47634. }, {
  47635. key: "getGraphMaps",
  47636. value: function getGraphMaps(callback) {
  47637. this._knowledgeGraphService.getGraphMaps(callback);
  47638. }
  47639. /**
  47640. * @function KnowledgeGraphService.prototype.getGraphMap
  47641. * @description 获取图谱图序列化数据。
  47642. * @param {string} params 图谱名称。
  47643. * @param {RequestCallback} callback 回调函数。
  47644. */
  47645. }, {
  47646. key: "getGraphMap",
  47647. value: function getGraphMap(params, callback) {
  47648. this._knowledgeGraphService.getGraphMap(params, callback);
  47649. }
  47650. /**
  47651. * @function KnowledgeGraphService.prototype.getGraphMapData
  47652. * @description 将iServer GraphMap服务的数据格式转换为KnowledgeGraph的数据格式。
  47653. * @param {string} graphMapName - 图谱名称。
  47654. * @returns {Promise} Promise 对象。
  47655. */
  47656. }, {
  47657. key: "getGraphMapData",
  47658. value: function () {
  47659. var _getGraphMapData = KnowledgeGraphService_asyncToGenerator( /*#__PURE__*/KnowledgeGraphService_regeneratorRuntime().mark(function _callee(graphMapName) {
  47660. var res;
  47661. return KnowledgeGraphService_regeneratorRuntime().wrap(function _callee$(_context) {
  47662. while (1) switch (_context.prev = _context.next) {
  47663. case 0:
  47664. _context.next = 2;
  47665. return this._knowledgeGraphService.getGraphMapData(graphMapName);
  47666. case 2:
  47667. res = _context.sent;
  47668. return _context.abrupt("return", res);
  47669. case 4:
  47670. case "end":
  47671. return _context.stop();
  47672. }
  47673. }, _callee, this);
  47674. }));
  47675. function getGraphMapData(_x) {
  47676. return _getGraphMapData.apply(this, arguments);
  47677. }
  47678. return getGraphMapData;
  47679. }()
  47680. }]);
  47681. return KnowledgeGraphService;
  47682. }(ServiceBase);
  47683. ;// CONCATENATED MODULE: ./src/maplibregl/services/index.js
  47684. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  47685. * This program are made available under the terms of the Apache License, Version 2.0
  47686. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  47687. // EXTERNAL MODULE: ./node_modules/lodash.uniqby/index.js
  47688. var lodash_uniqby = __webpack_require__(9819);
  47689. var lodash_uniqby_default = /*#__PURE__*/__webpack_require__.n(lodash_uniqby);
  47690. ;// CONCATENATED MODULE: ./src/common/overlay/knowledge-graph/format.js
  47691. function format_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
  47692. function format_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? format_ownKeys(Object(source), !0).forEach(function (key) { format_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : format_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
  47693. function format_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
  47694. function format_toConsumableArray(arr) { return format_arrayWithoutHoles(arr) || format_iterableToArray(arr) || format_unsupportedIterableToArray(arr) || format_nonIterableSpread(); }
  47695. function format_nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
  47696. function format_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return format_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return format_arrayLikeToArray(o, minLen); }
  47697. function format_iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
  47698. function format_arrayWithoutHoles(arr) { if (Array.isArray(arr)) return format_arrayLikeToArray(arr); }
  47699. function format_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
  47700. function transformGraphMap(data, graphMap) {
  47701. var style = graphMap && graphMap.styles && graphMap.styles.style;
  47702. var captionField = graphMap && graphMap.captionFields && graphMap.captionFields.captionField;
  47703. var rst = {
  47704. nodes: [],
  47705. edges: []
  47706. };
  47707. data.forEach(function (item) {
  47708. var pathData = item.path;
  47709. if (pathData) {
  47710. var _rst$nodes, _rst$edges;
  47711. var _transformPath2 = transformPath(pathData, style, captionField),
  47712. nodes = _transformPath2.nodes,
  47713. edges = _transformPath2.edges;
  47714. (_rst$nodes = rst.nodes).push.apply(_rst$nodes, format_toConsumableArray(nodes));
  47715. (_rst$edges = rst.edges).push.apply(_rst$edges, format_toConsumableArray(edges));
  47716. } else if (isEdge(item)) {
  47717. var edge = edgeFromGraphMap(item, style);
  47718. rst.edges.push(edge);
  47719. } else {
  47720. var node = nodeFromGraphMap(item, style, captionField);
  47721. rst.nodes.push(node);
  47722. }
  47723. });
  47724. return {
  47725. nodes: uniqData(rst.nodes),
  47726. edges: uniqData(rst.edges, 'edgeId')
  47727. };
  47728. }
  47729. function uniqData(data) {
  47730. var paramName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'id';
  47731. return lodash_uniqby_default()(data, paramName);
  47732. }
  47733. function isEdge(entity) {
  47734. return entity.hasOwnProperty('start') && entity.hasOwnProperty('end');
  47735. }
  47736. function transformPath(pathData, style, captionField) {
  47737. var rst = {
  47738. nodes: [],
  47739. edges: []
  47740. };
  47741. pathData.forEach(function (item) {
  47742. if (isEdge(item)) {
  47743. var edge = edgeFromGraphMap(item, style);
  47744. rst.edges.push(edge);
  47745. } else {
  47746. var node = nodeFromGraphMap(item, style, captionField);
  47747. rst.nodes.push(node);
  47748. }
  47749. });
  47750. return rst;
  47751. }
  47752. function nodeFromGraphMap(entity, style, captionField) {
  47753. var id = entity.id,
  47754. properties = entity.properties,
  47755. lables = entity.lables;
  47756. var styleData = style ? getNodeStyle(entity, style) : {};
  47757. var label = getNodeLabel(entity, captionField);
  47758. var fillColor = styleData.fillColor || '';
  47759. var node = {
  47760. id: id + '',
  47761. label: label,
  47762. properties: properties,
  47763. lables: lables
  47764. };
  47765. if (styleData.size) {
  47766. node.size = styleData.size;
  47767. delete styleData.size;
  47768. }
  47769. if (styleData.fillColor) {
  47770. node.style = {
  47771. fill: fillColor,
  47772. stroke: fillColor
  47773. };
  47774. delete styleData.fillColor;
  47775. }
  47776. if (Object.keys(styleData).length !== 0) {
  47777. node.labelCfg = {
  47778. style: styleData
  47779. };
  47780. }
  47781. return node;
  47782. }
  47783. function edgeFromGraphMap(entity, style) {
  47784. var start = entity.start,
  47785. end = entity.end,
  47786. id = entity.id,
  47787. type = entity.type,
  47788. properties = entity.properties;
  47789. var styleData = style ? getEdgeStyle(entity, style) : {};
  47790. return {
  47791. source: start + '',
  47792. target: end + '',
  47793. edgeId: id + '',
  47794. label: type,
  47795. labelCfg: {
  47796. style: styleData
  47797. },
  47798. properties: properties
  47799. };
  47800. }
  47801. function getEdgeStyle(entity, style) {
  47802. if (!style) {
  47803. return {};
  47804. }
  47805. var id = entity.id,
  47806. type = entity.type;
  47807. var data = style.filter(function (item) {
  47808. return item.type === 'relationShip';
  47809. });
  47810. for (var i = 0; i < data.length; i++) {
  47811. var _data$i2 = data[i],
  47812. textColor = _data$i2.textColor,
  47813. font = _data$i2.font,
  47814. relationTypes = _data$i2.relationTypes,
  47815. relationIds = _data$i2.relationIds;
  47816. var ids = JSON.parse(relationIds || '[]');
  47817. var types = JSON.parse(relationTypes || '[]');
  47818. if (ids.includes(id) || types.includes(type)) {
  47819. return format_objectSpread({
  47820. fontSize: compileFontSize(font.fontSize),
  47821. fontFamily: font.fontName,
  47822. fill: textColor
  47823. }, formatFontStyle(font.fontStyle));
  47824. }
  47825. }
  47826. return {};
  47827. }
  47828. function getNodeStyle(entity, style) {
  47829. if (!style) {
  47830. return {};
  47831. }
  47832. var id = entity.id,
  47833. labels = entity.labels;
  47834. var data = style.filter(function (item) {
  47835. return item.type === 'entity';
  47836. });
  47837. for (var i = 0; i < data.length; i++) {
  47838. var _data$i4 = data[i],
  47839. color = _data$i4.color,
  47840. textColor = _data$i4.textColor,
  47841. font = _data$i4.font,
  47842. size = _data$i4.size,
  47843. entityTypes = _data$i4.entityTypes,
  47844. entityIds = _data$i4.entityIds;
  47845. var ids = JSON.parse(entityIds || '[]');
  47846. var types = JSON.parse(entityTypes || '[]');
  47847. if (ids.includes(id) || types.includes(labels[0])) {
  47848. return format_objectSpread({
  47849. fillColor: color,
  47850. fontSize: compileFontSize(font.fontSize),
  47851. fontFamily: font.fontName,
  47852. fill: textColor,
  47853. size: size
  47854. }, formatFontStyle(font.fontStyle));
  47855. }
  47856. }
  47857. return {};
  47858. }
  47859. function getNodeLabel(entity, captionField) {
  47860. var id = entity.id,
  47861. labels = entity.labels,
  47862. properties = entity.properties;
  47863. if (captionField) {
  47864. var data = captionField instanceof Array ? captionField : [captionField];
  47865. for (var i = 0; i < data.length; i++) {
  47866. var _data$i6 = data[i],
  47867. name = _data$i6.name,
  47868. entityTypes = _data$i6.entityTypes,
  47869. entityIds = _data$i6.entityIds;
  47870. var ids = JSON.parse(entityIds || '[]');
  47871. var types = JSON.parse(entityTypes || '[]');
  47872. if (ids.includes(id) || types.includes(labels[0])) {
  47873. return properties[name] || '';
  47874. }
  47875. }
  47876. }
  47877. return properties[properties._labelfieldname] || '';
  47878. }
  47879. function formatFontStyle(fontStyle) {
  47880. if (fontStyle === 1) {
  47881. return {
  47882. fontWeight: 600
  47883. };
  47884. }
  47885. if (fontStyle === 2) {
  47886. return {
  47887. fontStyle: 'italic'
  47888. };
  47889. }
  47890. return {};
  47891. }
  47892. function compileFontSize(fontSize) {
  47893. return fontSize * 0.8;
  47894. }
  47895. // 处理graphMap数据的展开 折叠 隐藏的实体数据
  47896. function transformExpandCollapseHiddenData(graphMap) {
  47897. var _graphMap$dataContent = graphMap.dataContent,
  47898. expand = _graphMap$dataContent.expand,
  47899. collapse = _graphMap$dataContent.collapse,
  47900. hidden = _graphMap$dataContent.hidden;
  47901. return {
  47902. expand: expand && JSON.parse(expand),
  47903. collapse: collapse && JSON.parse(collapse),
  47904. hidden: hidden && JSON.parse(hidden)
  47905. };
  47906. }
  47907. ;// CONCATENATED MODULE: external "function(){try{return G6}catch(e){return {}}}()"
  47908. var external_function_try_return_G6_catch_e_return_namespaceObject = function(){try{return G6}catch(e){return {}}}();
  47909. var external_function_try_return_G6_catch_e_return_default = /*#__PURE__*/__webpack_require__.n(external_function_try_return_G6_catch_e_return_namespaceObject);
  47910. // EXTERNAL MODULE: ./node_modules/insert-css/index.js
  47911. var insert_css = __webpack_require__(8813);
  47912. var insert_css_default = /*#__PURE__*/__webpack_require__.n(insert_css);
  47913. ;// CONCATENATED MODULE: ./src/common/overlay/knowledge-graph/G6Render.js
  47914. function G6Render_toConsumableArray(arr) { return G6Render_arrayWithoutHoles(arr) || G6Render_iterableToArray(arr) || G6Render_unsupportedIterableToArray(arr) || G6Render_nonIterableSpread(); }
  47915. function G6Render_nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
  47916. function G6Render_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return G6Render_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return G6Render_arrayLikeToArray(o, minLen); }
  47917. function G6Render_iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
  47918. function G6Render_arrayWithoutHoles(arr) { if (Array.isArray(arr)) return G6Render_arrayLikeToArray(arr); }
  47919. function G6Render_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
  47920. function G6Render_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
  47921. function G6Render_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? G6Render_ownKeys(Object(source), !0).forEach(function (key) { G6Render_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : G6Render_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
  47922. function G6Render_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
  47923. function G6Render_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  47924. function G6Render_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  47925. function G6Render_createClass(Constructor, protoProps, staticProps) { if (protoProps) G6Render_defineProperties(Constructor.prototype, protoProps); if (staticProps) G6Render_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  47926. /**
  47927. * @private
  47928. * @class G6Render
  47929. * @category iServer G6Render
  47930. * @classdesc G6Render
  47931. * @param {KnowledgeGraph.Data} data - 创建graph实例的数据项。
  47932. * @param {KnowledgeGraph.Config} [config] - 创建graph实例的配置项。
  47933. * @private
  47934. */
  47935. var G6Render = /*#__PURE__*/function () {
  47936. function G6Render() {
  47937. G6Render_classCallCheck(this, G6Render);
  47938. this.config = null;
  47939. this.graph = null;
  47940. this.data = null;
  47941. this.collpasedData = {};
  47942. this.importG6();
  47943. this.CLASS_NAME = 'SuperMap.G6Render';
  47944. }
  47945. G6Render_createClass(G6Render, [{
  47946. key: "importG6",
  47947. value: function importG6() {
  47948. if (!(external_function_try_return_G6_catch_e_return_default())) {
  47949. console.log('please import g6, eg:https://gw.alipayobjects.com/os/lib/antv/g6/4.3.2/dist/g6.min.js');
  47950. }
  47951. }
  47952. /**
  47953. * @function G6Render.prototype.initGraph
  47954. * @description 创建KnowledgeGraph实例
  47955. * @param {KnowledgeGraph.Config} config - graph配置项。
  47956. * @returns {Object} graph实例。
  47957. */
  47958. }, {
  47959. key: "initGraph",
  47960. value: function initGraph(config) {
  47961. var graph = new (external_function_try_return_G6_catch_e_return_default()).Graph(config);
  47962. this.graph = graph;
  47963. if (!config || config.highlightNode !== false) {
  47964. this.highlightNode(graph);
  47965. }
  47966. if (!config || config.highlightEdge !== false) {
  47967. this.highlightEdge(graph);
  47968. }
  47969. if (config.dragCanvas !== false || config.dragNode !== false) {
  47970. // 阻止事件冒泡
  47971. this.stopDefaultEventPropagation();
  47972. }
  47973. return graph;
  47974. }
  47975. }, {
  47976. key: "_getContextMenu",
  47977. value: function _getContextMenu() {
  47978. var _this = this;
  47979. var contextMenu = new (external_function_try_return_G6_catch_e_return_default()).Menu({
  47980. shouldBegin: function shouldBegin(evt) {
  47981. if (evt.target && evt.target.isCanvas && evt.target.isCanvas()) {
  47982. return true;
  47983. }
  47984. if (evt.item) {
  47985. return true;
  47986. }
  47987. return false;
  47988. },
  47989. getContent: function getContent(evt) {
  47990. var item = evt.item;
  47991. if (evt.target && evt.target.isCanvas && evt.target.isCanvas()) {
  47992. return;
  47993. }
  47994. if (!item) {
  47995. return;
  47996. }
  47997. var itemType = item.getType();
  47998. var model = item.getModel();
  47999. if (itemType && model) {
  48000. if (itemType === 'node') {
  48001. if (_this.isCollpased(model.id)) {
  48002. return "<ul>\n <li id='expand'>\u5C55\u5F00</li>\n <li id='hide'>\u9690\u85CF</li>\n </ul>";
  48003. } else {
  48004. return "<ul>\n <li id='collapse'>\u6298\u53E0</li>\n <li id='hide'>\u9690\u85CF</li>\n </ul>";
  48005. }
  48006. }
  48007. }
  48008. },
  48009. handleMenuClick: function handleMenuClick(target, item) {
  48010. var liIdStrs = target.id.split('-');
  48011. switch (liIdStrs[0]) {
  48012. case 'hide':
  48013. _this.hideItem(item);
  48014. break;
  48015. case 'expand':
  48016. _this.expandNode(item);
  48017. break;
  48018. case 'collapse':
  48019. _this.collapseNode(item);
  48020. break;
  48021. case 'show':
  48022. _this.showItem(item);
  48023. break;
  48024. default:
  48025. break;
  48026. }
  48027. },
  48028. // 需要加上父级容器的 padding-left 16 与自身偏移量 10
  48029. offsetX: 16 + 10,
  48030. // 需要加上父级容器的 padding-top 24 、画布兄弟元素高度、与自身偏移量 10
  48031. offsetY: 0,
  48032. // 在哪些类型的元素上响应
  48033. itemTypes: ['node', 'edge', 'canvas']
  48034. });
  48035. return contextMenu;
  48036. }
  48037. }, {
  48038. key: "_getGraphConfig",
  48039. value: function _getGraphConfig(config) {
  48040. var _this2 = this;
  48041. var animateConfig = {
  48042. speed: 120,
  48043. maxIteration: 83,
  48044. tick: function tick() {
  48045. _this2.refreshPositions();
  48046. }
  48047. };
  48048. var defaultLayout = {
  48049. type: 'fruchterman',
  48050. gravity: 5
  48051. };
  48052. var defaultNode = {};
  48053. var defaultEdge = {
  48054. type: 'line',
  48055. style: {
  48056. endArrow: {
  48057. path: 'M 0,0 L 2,1 L 2,-1 Z'
  48058. },
  48059. lineWidth: 0.5
  48060. },
  48061. labelCfg: {
  48062. autoRotate: true,
  48063. style: {
  48064. fontSize: 4,
  48065. fill: '#333'
  48066. }
  48067. }
  48068. };
  48069. var defaultMode = {
  48070. "default": ['drag-canvas', 'zoom-canvas', 'drag-node']
  48071. };
  48072. var contextMenu = this._getContextMenu();
  48073. var defaultPlugins = [new (external_function_try_return_G6_catch_e_return_default()).ToolBar(), contextMenu];
  48074. var hoverColor = '#b4d6ff';
  48075. var defaultNodeHighlightStyle = {
  48076. lineWidth: 3,
  48077. stroke: hoverColor
  48078. };
  48079. var defaultEdgeHighlightStyle = {
  48080. stroke: hoverColor,
  48081. lineWidth: 2,
  48082. endArrow: {
  48083. path: 'M 0,0 L 2,1 L 2,-1 Z',
  48084. fill: hoverColor
  48085. }
  48086. };
  48087. var defaultGraphConfig = function defaultGraphConfig() {
  48088. var container = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'knowledgeGraph';
  48089. var dom = document.querySelector("#".concat(container));
  48090. return {
  48091. container: container,
  48092. // String | HTMLElement,必须,在 Step 1 中创建的容器 id 或容器本身
  48093. width: dom.scrollWidth,
  48094. // Number,必须,图的宽度
  48095. height: dom.scrollHeight,
  48096. // Number,必须,图的高度
  48097. plugins: defaultPlugins,
  48098. modes: defaultMode,
  48099. layout: G6Render_objectSpread(G6Render_objectSpread({}, defaultLayout), animateConfig),
  48100. defaultNode: defaultNode,
  48101. defaultEdge: defaultEdge,
  48102. nodeStateStyles: {
  48103. hover: defaultNodeHighlightStyle
  48104. },
  48105. edgeStateStyles: {
  48106. hover: defaultEdgeHighlightStyle
  48107. }
  48108. };
  48109. };
  48110. if (!config) {
  48111. this._setToolBarStyle();
  48112. return defaultGraphConfig();
  48113. }
  48114. config.container = config.container || 'knowledgeGraph';
  48115. var dom = typeof config.container === 'string' ? document.querySelector("#".concat(config.container)) : config.container;
  48116. config.width = config.width || dom.scrollWidth;
  48117. config.height = config.height || dom.scrollHeight;
  48118. config.layout = G6Render_objectSpread(G6Render_objectSpread(G6Render_objectSpread({}, defaultLayout), config.layout || {}), config.animate !== false ? animateConfig : {});
  48119. config.defaultNode = G6Render_objectSpread(G6Render_objectSpread({}, defaultNode), config.defaultNode || {});
  48120. config.defaultEdge = G6Render_objectSpread(G6Render_objectSpread({}, defaultEdge), config.defaultEdge || {});
  48121. config.modes = {
  48122. "default": [config.dragCanvas !== false && 'drag-canvas', config.zoomCanvas !== false && 'zoom-canvas', config.dragNode !== false && 'drag-node']
  48123. };
  48124. config.nodeStateStyles = {
  48125. hover: G6Render_objectSpread(G6Render_objectSpread({}, defaultNodeHighlightStyle), config.nodeHighlightStyle || {})
  48126. };
  48127. config.edgeStateStyles = {
  48128. hover: G6Render_objectSpread(G6Render_objectSpread({}, defaultEdgeHighlightStyle), config.edgeHighlightStyle || {})
  48129. };
  48130. if (config.showToolBar !== false) {
  48131. config.plugins = [new (external_function_try_return_G6_catch_e_return_default()).ToolBar()];
  48132. this._setToolBarStyle();
  48133. }
  48134. if (config.showContextMenu !== false) {
  48135. config.plugins = [].concat(G6Render_toConsumableArray(config.plugins || []), [contextMenu]);
  48136. this._setToolBarStyle();
  48137. }
  48138. return config;
  48139. }
  48140. /**
  48141. * @function KnowledgeGraph.prototype.changeSize
  48142. * @description 当源数据中现有节点/边 的数据项发生配置的变更时,根据新数据刷新视图。
  48143. * @param {number} width - 宽度。
  48144. * @param {number} height - 高度。
  48145. */
  48146. }, {
  48147. key: "changeSize",
  48148. value: function changeSize(width, height) {
  48149. return this.graph.changeSize(width, height);
  48150. }
  48151. /**
  48152. * @function G6Render.prototype.autoResize
  48153. * @description 浏览器窗口大小发生改变时,重新渲染;
  48154. */
  48155. }, {
  48156. key: "autoResize",
  48157. value: function autoResize() {
  48158. var _this3 = this;
  48159. var dom = this.getContainer();
  48160. window.addEventListener('resize', function () {
  48161. var width = dom.scrollWidth;
  48162. var height = dom.scrollHeight;
  48163. _this3.graph.changeSize(width, height);
  48164. _this3.graph.refresh();
  48165. });
  48166. }
  48167. /**
  48168. * @function G6Render.prototype.zoom
  48169. * @description 改变视口的缩放比例,在当前画布比例下缩放,是相对比例。
  48170. * @param {number} ratio 缩放比例。
  48171. * @param {Object} [center] 以 center 的 x、y 坐标为中心缩放,如果省略了 center 参数,则以元素当前位置为中心缩放。
  48172. * @param {boolean} [animate] 是否开启动画。
  48173. * @param {KnowledgeGraph.AnimateConfig} [animateCfg] 若带有动画,可配置动画。若未配置,则跟随 graph 的 animateCfg 参数。
  48174. */
  48175. }, {
  48176. key: "zoom",
  48177. value: function zoom(ratio, center, animate, animateCfg) {
  48178. this.graph.zoom(ratio, center, animate, animateCfg);
  48179. }
  48180. /**
  48181. * @function G6Render.prototype.zoomTo
  48182. * @description 改变视口的缩放比例,在当前画布比例下缩放,是相对比例。
  48183. * @param {number} ratio 缩放比例。
  48184. * @param {Object} [center] 以 center 的 x、y 坐标为中心缩放,如果省略了 center 参数,则以元素当前位置为中心缩放。
  48185. * @param {boolean} [animate] 是否开启动画。
  48186. * @param {KnowledgeGraph.AnimateConfig} [animateCfg] 若带有动画,可配置动画。若未配置,则跟随 graph 的 animateCfg 参数。
  48187. */
  48188. }, {
  48189. key: "zoomTo",
  48190. value: function zoomTo(ratio, center, animate, animateCfg) {
  48191. this.graph.zoomTo(ratio, center, animate, animateCfg);
  48192. }
  48193. /**
  48194. * @function G6Render.prototype.fitView
  48195. * @description 让画布内容适应视口。
  48196. * @param {Array.<number>|number} [padding] [top, right, bottom, left] 四个方向上的间距值。
  48197. * @param {Object} [rules] fitView 的规则,参数如下:{ onlyOutOfViewPort?: boolean; direction?: 'x' / 'y' / 'both'; ratioRule?: 'max' / 'min}。
  48198. * @param {boolean} [animate] 是否开启动画。
  48199. * @param {KnowledgeGraph.AnimateConfig} [animateCfg] 若带有动画,可配置动画。若未配置,则跟随 graph 的 animateCfg 参数。
  48200. */
  48201. }, {
  48202. key: "fitView",
  48203. value: function fitView(padding, rules, animate, animateCfg) {
  48204. this.graph.fitView(padding, rules, animate, animateCfg);
  48205. }
  48206. /**
  48207. * @function G6Render.prototype.fitCenter
  48208. * @description 平移图到中心将对齐到画布中心,但不缩放。优先级低于 fitView。
  48209. * @param {boolean} [animate] 是否开启动画。
  48210. * @param {KnowledgeGraph.AnimateConfig} [animateCfg] 若带有动画,可配置动画,参见基础动画教程。若未配置,则跟随 graph 的 animateCfg 参数。
  48211. */
  48212. }, {
  48213. key: "fitCenter",
  48214. value: function fitCenter(animate, animateCfg) {
  48215. this.graph.fitCenter(animate, animateCfg);
  48216. }
  48217. /**
  48218. * @function G6Render.prototype.getGraphCenterPoint
  48219. * @description 获取图内容的中心绘制坐标。
  48220. * @return {Object} 包含的属性:x 和 y 属性,分别表示渲染坐标下的 x、y 值。
  48221. */
  48222. }, {
  48223. key: "getGraphCenterPoint",
  48224. value: function getGraphCenterPoint() {
  48225. return this.graph.getGraphCenterPoint();
  48226. }
  48227. /**
  48228. * @function G6Render.prototype.getViewPortCenterPoint
  48229. * @description 获取视口中心绘制坐标。
  48230. * @return {Object} 包含的属性:x 和 y 属性,分别表示渲染坐标下的 x、y 值。
  48231. */
  48232. }, {
  48233. key: "getViewPortCenterPoint",
  48234. value: function getViewPortCenterPoint() {
  48235. return this.graph.getViewPortCenterPoint();
  48236. }
  48237. /**
  48238. * @function G6Render.prototype.getZoom
  48239. * @description 获取当前视口的缩放比例。
  48240. * @return {number} 返回值表示当前视口的缩放比例, 默认值为 1。
  48241. */
  48242. }, {
  48243. key: "getZoom",
  48244. value: function getZoom() {
  48245. return this.graph.getZoom();
  48246. }
  48247. /**
  48248. * @function G6Render.prototype.getMinZoom
  48249. * @description 获取 graph 当前允许的最小缩放比例。
  48250. * @return {number} 返回值表示当前视口的最小缩放比例。
  48251. */
  48252. }, {
  48253. key: "getMinZoom",
  48254. value: function getMinZoom() {
  48255. return this.graph.getMinZoom();
  48256. }
  48257. /**
  48258. * @function G6Render.prototype.setMinZoom
  48259. * @description 设置 graph 当前允许的最小缩放比例。
  48260. * @param {number} ratio 缩放比例。
  48261. */
  48262. }, {
  48263. key: "setMinZoom",
  48264. value: function setMinZoom(ratio) {
  48265. this.graph.setMinZoom(ratio);
  48266. }
  48267. /**
  48268. * @function G6Render.prototype.getMaxZoom
  48269. * @description 获取 graph 当前允许的最大缩放比例。
  48270. * @return {number} 返回值表示当前视口的最大缩放比例。
  48271. */
  48272. }, {
  48273. key: "getMaxZoom",
  48274. value: function getMaxZoom() {
  48275. return this.graph.getMaxZoom();
  48276. }
  48277. /**
  48278. * @function G6Render.prototype.setMaxZoom
  48279. * @description 设置 graph 当前允许的最大缩放比例。
  48280. * @param {number} ratio 缩放比例。
  48281. */
  48282. }, {
  48283. key: "setMaxZoom",
  48284. value: function setMaxZoom(ratio) {
  48285. this.graph.setMaxZoom(ratio);
  48286. }
  48287. /**
  48288. * @function G6Render.prototype.getWidth
  48289. * @description获取 graph 当前的宽度。
  48290. * @return {number} graph 当前的宽度。
  48291. */
  48292. }, {
  48293. key: "getWidth",
  48294. value: function getWidth() {
  48295. return this.graph.getWidth();
  48296. }
  48297. /**
  48298. * @function G6Render.prototype.getHeight
  48299. * @description 获取 graph 当前的高度。
  48300. * @return {number} graph 当前的高度。
  48301. */
  48302. }, {
  48303. key: "getHeight",
  48304. value: function getHeight() {
  48305. return this.graph.getHeight();
  48306. }
  48307. }, {
  48308. key: "setCenter",
  48309. value: function setCenter(centerDrawPoint) {
  48310. var centerCanvasPointX = this.graph.getWidth() / 2;
  48311. var centerCanvasPointY = this.graph.getHeight() / 2;
  48312. var centerCanvasPointNew = this.graph.getCanvasByPoint(centerDrawPoint.x, centerDrawPoint.y);
  48313. this.graph.translate(centerCanvasPointX - centerCanvasPointNew.x, centerCanvasPointY - centerCanvasPointNew.y);
  48314. }
  48315. /**
  48316. * @function G6Render.prototype._setToolBarStyle
  48317. * @description 隐藏工具栏的redo undo realZoom按钮
  48318. * @private
  48319. */
  48320. }, {
  48321. key: "_setToolBarStyle",
  48322. value: function _setToolBarStyle() {
  48323. insert_css_default()("\n .g6-component-toolbar li[code='redo'],\n .g6-component-toolbar li[code='undo'],\n .g6-component-toolbar li[code='realZoom'] {\n display: none;\n }\n .g6-component-contextmenu {\n position: absolute;\n z-index: 2;\n list-style-type: none;\n border-radius: 6px;\n font-size: 14px;\n width: fit-content;\n transition: opacity .2s;\n text-align: center;\n box-shadow: 0 5px 18px 0 rgba(0, 0, 0, 0.6);\n border: 0px;\n }\n .g6-component-contextmenu ul {\n padding-left: 0px;\n margin: 0;\n }\n .g6-component-contextmenu li {\n cursor: pointer;\n list-style-type: none;\n list-style: none;\n margin-left: 0;\n line-height: 38px;\n padding: 0px 35px;\n }\n .g6-component-contextmenu li:hover {\n color: #333;\n background: #aaaaaa45;\n }\n ");
  48324. }
  48325. /**
  48326. * @function G6Render.prototype.highlightNode
  48327. * @description 鼠标移入节点,节点高亮
  48328. * @param {Object} graph - graph实例。
  48329. */
  48330. }, {
  48331. key: "highlightNode",
  48332. value: function highlightNode() {
  48333. var graph = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.graph;
  48334. function clearAllStats() {
  48335. graph.setAutoPaint(false);
  48336. graph.getNodes().forEach(function (node) {
  48337. graph.clearItemStates(node);
  48338. });
  48339. graph.paint();
  48340. graph.setAutoPaint(true);
  48341. }
  48342. graph.on('node:mouseenter', function (e) {
  48343. var item = e.item;
  48344. graph.setAutoPaint(false);
  48345. graph.getNodes().forEach(function (node) {
  48346. graph.clearItemStates(node);
  48347. });
  48348. graph.setItemState(item, 'hover', true);
  48349. graph.paint();
  48350. graph.setAutoPaint(true);
  48351. });
  48352. graph.on('node:mouseleave', clearAllStats);
  48353. }
  48354. /**
  48355. * @function G6Render.prototype.highlightNode
  48356. * @description 鼠标移入节点,节点高亮
  48357. * @param {Object} graph - graph实例。
  48358. */
  48359. }, {
  48360. key: "highlightEdge",
  48361. value: function highlightEdge() {
  48362. var graph = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.graph;
  48363. function clearAllStats() {
  48364. graph.setAutoPaint(false);
  48365. graph.getEdges().forEach(function (edge) {
  48366. graph.clearItemStates(edge);
  48367. });
  48368. graph.paint();
  48369. graph.setAutoPaint(true);
  48370. }
  48371. graph.on('edge:mouseenter', function (e) {
  48372. var item = e.item;
  48373. graph.setAutoPaint(false);
  48374. graph.getNodes().forEach(function (node) {
  48375. graph.clearItemStates(node);
  48376. });
  48377. graph.setItemState(item, 'hover', true);
  48378. graph.paint();
  48379. graph.setAutoPaint(true);
  48380. });
  48381. graph.on('edge:mouseleave', clearAllStats);
  48382. }
  48383. /**
  48384. * @function G6Render.prototype.setData
  48385. * @description 设置数据
  48386. * @param {KnowledgeGraph.Data} data - graph数据。
  48387. * @param {Object} [graph] - graph实例。
  48388. */
  48389. }, {
  48390. key: "setData",
  48391. value: function setData(data) {
  48392. var graph = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.graph;
  48393. if (!this.data) {
  48394. graph.data(data);
  48395. } else {
  48396. graph.changeData(data);
  48397. }
  48398. this.data = data;
  48399. }
  48400. /**
  48401. * @function G6Render.prototype.render
  48402. * @description 根据提供的数据渲染视图。
  48403. */
  48404. }, {
  48405. key: "render",
  48406. value: function render() {
  48407. var graph = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.graph;
  48408. return graph.render();
  48409. }
  48410. /**
  48411. * @function G6Render.prototype.updateGraph
  48412. * @description 更新数据
  48413. * @param {Object} graph - graph实例。
  48414. * @param {KnowledgeGraph.Data} data - graph数据。
  48415. */
  48416. }, {
  48417. key: "updateGraph",
  48418. value: function updateGraph(data) {
  48419. var graph = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.graph;
  48420. this.data = data;
  48421. graph.changeData(data);
  48422. }
  48423. /**
  48424. * @function G6Render.prototype.refresh
  48425. * @description 当源数据中现有节点/边的数据项发生配置的变更时,根据新数据刷新视图。
  48426. * @param {Object} graph - graph实例。
  48427. */
  48428. }, {
  48429. key: "refresh",
  48430. value: function refresh() {
  48431. var graph = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.graph;
  48432. graph.refresh();
  48433. }
  48434. /**
  48435. * @function G6Render.prototype.getContainer
  48436. * @description 获取 Graph 的 DOM 容器。
  48437. * @param {Object} graph - graph实例。
  48438. * @return {HTMLElement} DOM 容器。
  48439. */
  48440. }, {
  48441. key: "getContainer",
  48442. value: function getContainer() {
  48443. var graph = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.graph;
  48444. return graph.getContainer();
  48445. }
  48446. /**
  48447. * @function G6Render.prototype.getCanvas
  48448. * @description 获取canvas。
  48449. * @param {Object} graph - graph实例。
  48450. * @return {HTMLElement} canvas。
  48451. */
  48452. }, {
  48453. key: "getCanvas",
  48454. value: function getCanvas() {
  48455. var graph = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.graph;
  48456. return graph.get('canvas');
  48457. }
  48458. /**
  48459. * @function G6Render.prototype.getNodes
  48460. * @description 获取图中所有节点的实例。
  48461. * @param {Object} graph - graph实例。
  48462. * @return {Array} 返回值表示图中所有节点的实例。
  48463. */
  48464. }, {
  48465. key: "getNodes",
  48466. value: function getNodes() {
  48467. var graph = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.graph;
  48468. return graph.getNodes();
  48469. }
  48470. /**
  48471. * @function G6Render.prototype.getEdges
  48472. * @description 获取图中所有节点的实例。这里返回的是边的实例,而不是边的数据项。
  48473. * @param {Object} graph - graph实例。
  48474. * @return {Array} 返回值表示图中所有边的实例。
  48475. */
  48476. }, {
  48477. key: "getEdges",
  48478. value: function getEdges() {
  48479. var graph = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.graph;
  48480. return graph.getEdges();
  48481. }
  48482. /**
  48483. * @function G6Render.prototype.getNeighbors
  48484. * @description 获取邻居节点数组。
  48485. * @param {Object} graph - graph实例。
  48486. * @param {string | INode} node - 节点 ID 或节点实例。
  48487. * @param {string|undefined} type -['source'| 'target' |undefined] 邻居类型, 'source' 只获取当前节点的源节点,'target' 只获取当前节点指向的目标节点, 若不指定则返回所有类型的邻居。
  48488. * @return {Array} 返回值符合要求的节点数组。
  48489. */
  48490. }, {
  48491. key: "getNeighbors",
  48492. value: function getNeighbors(node, type) {
  48493. var graph = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.graph;
  48494. return graph.getNeighbors(node, type);
  48495. }
  48496. /**
  48497. * @function G6Render.prototype.findById
  48498. * @description 根据 ID,查询对应的元素实例。
  48499. * @param {Object} graph - graph实例。
  48500. * @param {string} id - 元素 ID
  48501. * @return {Object} 如果有符合规则的元素实例,则返回第一个匹配的元素实例,否则返回 undefined 。
  48502. */
  48503. }, {
  48504. key: "findById",
  48505. value: function findById(id) {
  48506. var graph = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.graph;
  48507. return graph.findById(id);
  48508. }
  48509. /**
  48510. * @function G6Render.prototype.find
  48511. * @description 获取邻居节点数组。
  48512. * @param {Object} graph - graph实例。
  48513. * @param {string} type - 元素类型,可选值为 'node'、'edge'
  48514. * @param {Function} fn - 查找的规则。
  48515. * @return {Object} 如果有符合规则的元素实例,则返回第一个匹配的元素实例,否则返回 undefined 。
  48516. */
  48517. }, {
  48518. key: "find",
  48519. value: function find(type, fn) {
  48520. var graph = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.graph;
  48521. return graph.find(type, fn);
  48522. }
  48523. /**
  48524. * @function G6Render.prototype.findAll
  48525. * @description 获取邻居节点数组。
  48526. * @param {Object} graph - graph实例。
  48527. * @param {string} type - 元素类型,可选值为 'node'、'edge'
  48528. * @param {Function} fn - 查找的规则。
  48529. * @return {Object} 如果有符合规则的元素实例,则返回所有元素实例,否则返回 undefined。
  48530. */
  48531. }, {
  48532. key: "findAll",
  48533. value: function findAll(type, fn) {
  48534. var graph = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.graph;
  48535. return graph.findAll(type, fn);
  48536. }
  48537. /**
  48538. * @function G6Render.prototype.getEdgesByNode
  48539. * @description 获取与当前节点有关联的所有边。
  48540. * @param {Object} node - node实例。
  48541. * @return {Array} edge实例数组。
  48542. */
  48543. }, {
  48544. key: "getEdgesByNode",
  48545. value: function getEdgesByNode(node) {
  48546. return node.getEdges();
  48547. }
  48548. /**
  48549. * @function G6Render.prototype.getEdgesByNode
  48550. * @description 获取与当前节点关联的所有入边。
  48551. * @param {Object} node - node实例。
  48552. * @return {Array} edge实例数组。
  48553. */
  48554. }, {
  48555. key: "getInEdges",
  48556. value: function getInEdges(node) {
  48557. return node.getInEdges();
  48558. }
  48559. /**
  48560. * @function G6Render.prototype.getEdgesByNode
  48561. * @description 获取与当前节点关联的所有出边。
  48562. * @param {Object} node - node实例。
  48563. * @return {Array} edge实例数组。
  48564. */
  48565. }, {
  48566. key: "getOutEdges",
  48567. value: function getOutEdges(node) {
  48568. return node.getOutEdges();
  48569. }
  48570. /**
  48571. * @function G6Render.prototype.getSourceByEdge
  48572. * @description 获取当前边的起始节点
  48573. * @param {Object} edge - node实例。
  48574. * @return {Object} 返回值为起始节点的实例。
  48575. */
  48576. }, {
  48577. key: "getSourceByEdge",
  48578. value: function getSourceByEdge(edge) {
  48579. return edge.getSource();
  48580. }
  48581. /**
  48582. * @function G6Render.prototype.getTargetByEdge
  48583. * @description 获取当前边的终止节点。
  48584. * @param {Object} edge - node实例。
  48585. * @return {Object} 终止节点的实例。
  48586. */
  48587. }, {
  48588. key: "getTargetByEdge",
  48589. value: function getTargetByEdge(edge) {
  48590. return edge.getTarget();
  48591. }
  48592. /**
  48593. * @function G6Render.prototype.expandNode
  48594. * @description 展开当前节点。
  48595. * @param {Object} item - 元素 ID 或元素实例。
  48596. */
  48597. }, {
  48598. key: "expandNode",
  48599. value: function expandNode(item) {
  48600. var id = item.getModel().id;
  48601. this._expandCollapseNode(this.collpasedData[id], 'show');
  48602. delete this.collpasedData[id];
  48603. }
  48604. /**
  48605. * @function G6Render.prototype.collapseNode
  48606. * @description 收起当前节点。
  48607. * @param {Object} item - 元素 ID 或元素实例。
  48608. * @param {Object} graph - graph实例。
  48609. */
  48610. }, {
  48611. key: "collapseNode",
  48612. value: function collapseNode(item) {
  48613. var id = item.getModel().id;
  48614. var result = [];
  48615. this._collapseFunc(item, result);
  48616. this.collpasedData[id] = result;
  48617. this._expandCollapseNode(result);
  48618. }
  48619. }, {
  48620. key: "isCollpased",
  48621. value: function isCollpased(id) {
  48622. return !!this.collpasedData[id];
  48623. }
  48624. }, {
  48625. key: "_collapseFunc",
  48626. value: function _collapseFunc(item) {
  48627. var res = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  48628. var sourceNodes = this.getNeighbors(item, 'target');
  48629. var targetNodes = this.getNeighbors(item, 'source');
  48630. // 指出节点, 如果没有其他链接,隐藏
  48631. for (var i = 0; i < sourceNodes.length; i++) {
  48632. var sourceNode = sourceNodes[i];
  48633. var model = sourceNode.getModel();
  48634. var nodes = this.getNeighbors(sourceNode);
  48635. // if (nodes && exceptNode) {
  48636. // nodes = nodes.filter((item) => item.id !== exceptNode);
  48637. // }
  48638. if (nodes.length === 1) {
  48639. res.push({
  48640. id: model.id
  48641. });
  48642. }
  48643. }
  48644. // 指入节点, 如果没有其他链接或者没有指入节点隐藏,隐藏
  48645. for (var _i2 = 0; _i2 < targetNodes.length; _i2++) {
  48646. var targetNode = targetNodes[_i2];
  48647. var _model = targetNode.getModel();
  48648. var _nodes = this.getNeighbors(targetNode);
  48649. var targetNodeNodes = this.getNeighbors(targetNode, 'source');
  48650. // if (nodes && exceptNode) {
  48651. // nodes = nodes.filter((item) => item.id !== exceptNode);
  48652. // }
  48653. // if (targetNodeNodes && exceptNode) {
  48654. // targetNodeNodes = targetNodeNodes.filter((item) => item.id !== exceptNode);
  48655. // }
  48656. if (_nodes.length === 1 || targetNodeNodes.length === 0) {
  48657. res.push({
  48658. id: _model.id
  48659. });
  48660. } else {
  48661. var result = [];
  48662. this._collapseFunc(targetNode, result);
  48663. res.push({
  48664. id: _model.id,
  48665. children: result
  48666. });
  48667. }
  48668. }
  48669. return res;
  48670. }
  48671. }, {
  48672. key: "_expandCollapseNode",
  48673. value: function _expandCollapseNode(data) {
  48674. var _this4 = this;
  48675. var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'hide';
  48676. if (!data) {
  48677. return;
  48678. }
  48679. data.forEach(function (item) {
  48680. if (type === 'hide') {
  48681. _this4.hideItem(item.id);
  48682. } else {
  48683. _this4.showItem(item.id);
  48684. // 如果是把之前的折叠也展开了, 就要把之前的折叠数据删除
  48685. if (_this4.isCollpased(item.id)) {
  48686. delete _this4.collpasedData[item.id];
  48687. }
  48688. }
  48689. if (item.children) {
  48690. _this4._expandCollapseNode(item.children, type);
  48691. }
  48692. });
  48693. }
  48694. /**
  48695. * @function G6Render.prototype.showItem
  48696. * @description 显示指定的元素。若 item 为节点,则相关边也会随之显示。而show() 则将只显示自身。
  48697. * @param {string|Object} item - 元素 ID 或元素实例。
  48698. * @param {boolean} [stack] - 操作是否入 undo & redo 栈,当实例化 Graph 时设置 enableStack 为 true 时,默认情况下会自动入栈,入栈以后,就支持 undo & redo 操作,如果不需要,则设置该参数为 false 即可。
  48699. * @param {Object} graph - graph实例。
  48700. */
  48701. }, {
  48702. key: "showItem",
  48703. value: function showItem(item, stack) {
  48704. var graph = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.graph;
  48705. graph.showItem(item, stack);
  48706. }
  48707. /**
  48708. * @function G6Render.prototype.showItem
  48709. * @description 隐藏指定元素。若 item 为节点,则相关边也会随之隐藏。而 hide() 则将只隐藏自身。
  48710. * @param {string|Object} item - 元素 ID 或元素实例。
  48711. * @param {boolean} [stack] -操作是否入 undo & redo 栈,当实例化 Graph 时设置 enableStack 为 true 时,默认情况下会自动入栈,入栈以后,就支持 undo & redo 操作,如果不需要,则设置该参数为 false 即可。
  48712. * @param {Object} graph - graph实例。
  48713. */
  48714. }, {
  48715. key: "hideItem",
  48716. value: function hideItem(item, stack) {
  48717. var graph = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.graph;
  48718. graph.hideItem(item, stack);
  48719. }
  48720. /**
  48721. * @function G6Render.prototype.show
  48722. * @description 显示元素。只显示 item 自身,若需要在显示节点的同时显示相关边,应调用showItem(item)。
  48723. * @param {Object} item - 元素实例。
  48724. */
  48725. }, {
  48726. key: "show",
  48727. value: function show(item) {
  48728. item.show();
  48729. }
  48730. /**
  48731. * @function G6Render.prototype.hide
  48732. * @description 隐藏元素。只隐藏 item 自身,若需要在隐藏节点的同时隐藏相关边,应调用 hideItem(item)。
  48733. * @param {Object} item - 元素实例。
  48734. */
  48735. }, {
  48736. key: "hide",
  48737. value: function hide(item) {
  48738. item.hide();
  48739. }
  48740. /**
  48741. * @function G6Render.prototype.changeVisibility
  48742. * @description 更改元素是否显示。
  48743. * @param {Object} item - 元素实例。
  48744. * @param {boolean} visible - 是否显示元素,true 为显示,false 为隐藏。
  48745. */
  48746. }, {
  48747. key: "changeVisibility",
  48748. value: function changeVisibility(item, visible) {
  48749. item.changeVisibility(visible);
  48750. }
  48751. /**
  48752. * @function G6Render.prototype.isVisible
  48753. * @description 查询元素显示状态。
  48754. * @param {Object} item - 元素实例。
  48755. * @return {boolean} - 返回值为 true,则表示当前元素处于显示状态,否则处于隐藏状态。
  48756. */
  48757. }, {
  48758. key: "isVisible",
  48759. value: function isVisible(item) {
  48760. return item.isVisible();
  48761. }
  48762. /**
  48763. * @function G6Render.prototype.getModel
  48764. * @description 获取元素的数据模型。
  48765. * @param {Object} item - 元素实例。
  48766. * @return {KnowledgeGraph.Data} - 返回值为节点的数据模型。
  48767. */
  48768. }, {
  48769. key: "getModel",
  48770. value: function getModel(item) {
  48771. return item.getModel();
  48772. }
  48773. /**
  48774. * @function G6Render.prototype.addItem
  48775. * @description 新增元素(节点和边)。
  48776. * @param {Object} graph - graph实例。
  48777. * @param {string} type - 元素类型,可选值为 'node'、'edge'
  48778. * @param {Object} model - 元素的数据模型,具体内容参见元素配置项。
  48779. */
  48780. }, {
  48781. key: "addItem",
  48782. value: function addItem(type, model) {
  48783. var graph = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.graph;
  48784. graph.addItem(type, model);
  48785. }
  48786. /**
  48787. * @function G6Render.prototype.addItem
  48788. * @description 删除元素。
  48789. * @param {string|Object} item - 元素 ID 或元素实例
  48790. * @param {Object} graph - graph实例。
  48791. */
  48792. }, {
  48793. key: "removeItem",
  48794. value: function removeItem(item) {
  48795. var graph = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.graph;
  48796. graph.removeItem(item);
  48797. }
  48798. /**
  48799. * @function G6Render.prototype.updateItem
  48800. * @description 更新元素,包括更新数据、样式等。
  48801. * @param {Object} graph - graph实例。
  48802. * @param {string|Object} item - 元素 ID 或元素实例。
  48803. * @param {Object} model - 元素的数据模型,具体内容参见元素配置项。
  48804. */
  48805. }, {
  48806. key: "updateItem",
  48807. value: function updateItem(item, model) {
  48808. var graph = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.graph;
  48809. graph.updateItem(item, model);
  48810. }
  48811. /**
  48812. * @function G6Render.prototype.refreshItem
  48813. * @description 刷新指定元素。
  48814. * @param {Object} graph - graph实例。
  48815. * @param {string|Object} item - 元素 ID 或元素实例。
  48816. */
  48817. }, {
  48818. key: "refreshItem",
  48819. value: function refreshItem(item) {
  48820. var graph = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.graph;
  48821. graph.refreshItem(item);
  48822. }
  48823. /**
  48824. * @function G6Render.prototype.refreshPositions
  48825. * @description 当节点位置发生变化时,刷新所有节点位置,并重计算边的位置。
  48826. * @param {Object} graph - graph实例。
  48827. */
  48828. }, {
  48829. key: "refreshPositions",
  48830. value: function refreshPositions() {
  48831. var graph = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.graph;
  48832. graph.refreshPositions();
  48833. }
  48834. /**
  48835. * @function G6Render.prototype.on
  48836. * @description graph监听事件
  48837. * @param {Object} graph - graph实例。
  48838. * @param {string} eventName - 事件名,可选事件名参见 Event。
  48839. * @param {Function} handler - 监听函数。
  48840. */
  48841. }, {
  48842. key: "on",
  48843. value: function on(eventName, handler) {
  48844. var graph = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.graph;
  48845. graph.on(eventName, handler);
  48846. }
  48847. /**
  48848. * @function G6Render.prototype.off
  48849. * @description graph关闭事件
  48850. * @param {Object} graph - graph实例。
  48851. * @param {string} eventName - 事件名,可选事件名参见 Event。
  48852. * @param {Function} handler - 监听函数。
  48853. */
  48854. }, {
  48855. key: "off",
  48856. value: function off(eventName, handler) {
  48857. var graph = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.graph;
  48858. graph.off(eventName, handler);
  48859. }
  48860. /**
  48861. * @function G6Render.prototype.toDataURL
  48862. * @description 转换成图片
  48863. * @param {Object} graph - graph实例。
  48864. * @param {string} type - 图片类型 'image/png' / 'image/jpeg' / 'image/webp' / 'image/bmp'。
  48865. * @param {string} [backgroundColor] - 图片的背景色,可选,不传值时将导出透明背景的图片。
  48866. * @return {string} 返回值表示生成的图片的 URL。
  48867. */
  48868. }, {
  48869. key: "toDataURL",
  48870. value: function toDataURL(type, backgroundColor) {
  48871. var graph = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.graph;
  48872. graph.toDataURL(type, backgroundColor);
  48873. }
  48874. /**
  48875. * @function G6Render.prototype.bindNodeDefaultDragEvent
  48876. * @description 给graph的节点绑定默认的拖拽事件
  48877. *
  48878. * @param {Object} graph - graph实例。
  48879. */
  48880. }, {
  48881. key: "bindNodeDefaultDragEvent",
  48882. value: function bindNodeDefaultDragEvent() {
  48883. var graph = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.graph;
  48884. graph.on('node:dragstart', function (e) {
  48885. refreshDragedNodePosition(e);
  48886. });
  48887. graph.on('node:drag', function (e) {
  48888. refreshDragedNodePosition(e);
  48889. });
  48890. graph.on('node:dragend', function (e) {
  48891. e.item.get('model').fx = null;
  48892. e.item.get('model').fy = null;
  48893. });
  48894. }
  48895. /**
  48896. * @function G6Render.prototype.stopDefaultEventPropagation
  48897. * @description 阻止点击事件冒泡
  48898. * @param {Object} graph - graph实例。
  48899. */
  48900. }, {
  48901. key: "stopDefaultEventPropagation",
  48902. value: function stopDefaultEventPropagation() {
  48903. var graph = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.graph;
  48904. graph.on('click', function (e) {
  48905. e.stopPropagation();
  48906. });
  48907. graph.on('mousedown', function (e) {
  48908. e.stopPropagation();
  48909. });
  48910. graph.on('mouseover', function (e) {
  48911. e.stopPropagation();
  48912. });
  48913. graph.on('mouseout', function (e) {
  48914. e.stopPropagation();
  48915. });
  48916. }
  48917. /**
  48918. * @function G6Render.prototype.clear
  48919. * @description 清除画布元素
  48920. * @param {Object} graph - graph实例。
  48921. */
  48922. }, {
  48923. key: "clear",
  48924. value: function clear() {
  48925. var graph = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.graph;
  48926. graph.clear();
  48927. }
  48928. /**
  48929. * @function G6Render.prototype.destroy
  48930. * @description 销毁画布
  48931. * @param {Object} graph - graph实例。
  48932. */
  48933. }, {
  48934. key: "destroy",
  48935. value: function destroy() {
  48936. var graph = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.graph;
  48937. graph.destroy();
  48938. }
  48939. }]);
  48940. return G6Render;
  48941. }();
  48942. /**
  48943. * @description 更新拖拽后节点的x ,y
  48944. */
  48945. function refreshDragedNodePosition(e) {
  48946. var model = e.item.get('model');
  48947. model.fx = e.x;
  48948. model.fy = e.y;
  48949. model.x = e.x;
  48950. model.y = e.y;
  48951. return model;
  48952. }
  48953. // EXTERNAL MODULE: ./node_modules/lodash.clonedeep/index.js
  48954. var lodash_clonedeep = __webpack_require__(2138);
  48955. var lodash_clonedeep_default = /*#__PURE__*/__webpack_require__.n(lodash_clonedeep);
  48956. ;// CONCATENATED MODULE: ./src/common/overlay/KnowledgeGraph.js
  48957. function KnowledgeGraph_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  48958. function KnowledgeGraph_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  48959. function KnowledgeGraph_createClass(Constructor, protoProps, staticProps) { if (protoProps) KnowledgeGraph_defineProperties(Constructor.prototype, protoProps); if (staticProps) KnowledgeGraph_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  48960. /**
  48961. * @class KnowledgeGraph
  48962. * @category iServer KnowledgeGraph
  48963. * @classdesc KnowledgeGraph知识图谱
  48964. * @version 11.1.0
  48965. * @param { KnowledgeGraph.Config } config - 创建graph实例的配置项。
  48966. * @usage
  48967. */
  48968. /**
  48969. * @typedef {Object} KnowledgeGraph.Data - 创建graph实例的数据项。
  48970. * @property {Array.<KnowledgeGraph.Node>} data.nodes - 创建graph节点。
  48971. * @property {Array.<KnowledgeGraph.Edge>} data.edges - 创建graph边。
  48972. */
  48973. /**
  48974. * @typedef {Object} KnowledgeGraph.Config - 创建graph实例的配置项。
  48975. * @property {string | HTMLElement} container - 创建的容器 id 或容器本身, 默认是'knowledgeGraph'。
  48976. * @property {number} width - 图的宽度, 默认是container的width。
  48977. * @property {number} height - 图的高度,默认是container的height。
  48978. * @property {Array.<number>} [center] - 中心点的渲染坐标。可以通过KnowledgeGraph.prototype.getViewPortCenterPoint获取。
  48979. * @property {number} [zoom] - 缩放比例。
  48980. * @property {number} [minZoom] - 最小缩放比例。若 fitView、zoom、zoomTo 等操作导致图的缩放比例小于该值,则将使用该值进行缩放,并返回 false。
  48981. * @property {number} [maxZoom] - 最大缩放比例。若 fitView、zoom、zoomTo 等操作导致图的缩放比例大于该值,则将使用该值进行缩放,并返回 false。
  48982. * @property {KnowledgeGraph.Layout} [layout] - 布局。
  48983. * @property {boolean} [animate=true] - 是否开启动画。
  48984. * @property {boolean} [autoResize=true] - 当视口变换时,是否自动重绘。
  48985. * @property {KnowledgeGraph.NodeStyle} [defaultNode] - 默认状态下节点的配置,比如 type, size, color。会被写入的 data 覆盖。
  48986. * @property {KnowledgeGraph.EdgeStyle} [defaultEdge] - 默认状态下边的配置,比如 type, size, color。会被写入的 data 覆盖。
  48987. * @property {KnowledgeGraph.NodeStyle} [nodeHighlightStyle] - 鼠标移入节点高亮样式。默认样式:{strokeColor: 'blue',stroke: 10, opacity: 0.8}。
  48988. * @property {KnowledgeGraph.EdgeStyle} [edgeHighlightStyle] - 鼠标移入边高亮样式。默认样式:{strokeColor: 'blue',stroke: 10, opacity: 0.8}。
  48989. * @property {boolean} [highlightNode = true] - 鼠标移入是否高亮节点。
  48990. * @property {boolean} [highlightEdge = true] - 鼠标移入是否高亮边。
  48991. * @property {boolean} [showToolBar = true] - 是否打开工具条, 包含放大,缩小,切换到实际大小功能。
  48992. * @property {boolean} [showContextMenu = true] - 是否打开节点的右键菜单, 包含展开\折叠、隐藏功能。
  48993. * @property {boolean} [dragCanvas = true] - 是否可以拖拽canvas。
  48994. * @property {boolean} [zoomCanvas = true] - 是否可以缩放canvas。
  48995. * @property {boolean} [dragNode = true] - 是否可以拖拽node节点。
  48996. * @property {number} [nodeLabelMaxWidth] - node节点的标签开启省略号配置项,大于该宽度使用省略号。
  48997. */
  48998. /**
  48999. * @typedef {Object} KnowledgeGraph.Layout - 布局。
  49000. * @property {string} [type='fruchterman'] - 布局类型, 可选值:['fruchterman']。 默认'fruchterman'。
  49001. */
  49002. /**
  49003. * @typedef {Object} KnowledgeGraph.Node - node节点配置项。
  49004. * @property {string} id - 元素的标识 ID,必须是唯一的 string
  49005. * @property {string} [category] - 分类。
  49006. * @property {number} [x] - x坐标。
  49007. * @property {number} [y] - y坐标。
  49008. * @property {number} [size=20] - 节点的大小。
  49009. * @property {Array.<number>|number} [anchorPoints=20] - 指定边连入节点的连接点的位置(相对于该节点而言),可以为空。例如: [0, 0],代表节点左上角的锚点,[1, 1],代表节点右下角的锚点。
  49010. * @property {string} [type] - 元素的类型,不传则使用默认值,节点默认类型为 'circle'。可选值['circle','rect','ellipse','diamond', 'image']
  49011. * @property {string} [label] - 元素的文本标签,有该字段时默认会渲染 label 。
  49012. * @property {KnowledgeGraph.NodeLabelCfg} [labelCfg] - 元素文本标签的配置项,详见各子模块内容。
  49013. * @property {KnowledgeGraph.NodeStyle} [style] - 样式属性。
  49014. */
  49015. /**
  49016. * @typedef {Object} KnowledgeGraph.Edge - edge边配置项。
  49017. * @property {string} [source] -起始点 id 。
  49018. * @property {string} [target] - 结束点 id 。
  49019. * @property {number} [sourceAnchor] - 边的起始节点上的锚点的索引值。
  49020. * @property {number} [targetAnchor] - 边的终止节点上的锚点的索引值。
  49021. * @property {string} [type='line'] - 指定边的类型,可以是内置边的类型名称,也可以是自定义边的名称。默认为 'line'。可选值['line','arc','polyline','quadratic']。
  49022. * @property {string} [label] - 文本文字,如果没有则不会显示。
  49023. * @property {KnowledgeGraph.EdgeLabelCfg} [labelCfg] - 配置标签文本。
  49024. * @property {KnowledgeGraph.EdgeStyle} [style] - 通过 style 配置来修改边的填充色、边框颜色、阴影等属性,具体配置属性见:图形样式属性。
  49025. */
  49026. /**
  49027. * @typedef {Object} KnowledgeGraph.NodeLabelCfg - node节点配置项。
  49028. * @property {string} [position] - 文本相对于节点的位置,目前支持的位置有:'center','top','left','right','bottom'。默认为 'center'。modelRect 节点不支持该属性。
  49029. * @property {KnowledgeGraph.TextStyle} [style] - 标签的样式属性。
  49030. * @property {number} [offset] - 文本的偏移,position 为 'bottom' 时,文本的上方偏移量;position 为 'left' 时,文本的右方偏移量;以此类推在其他 position 时的情况。modelRect 节点的 offset 为左边距。
  49031. */
  49032. /**
  49033. * @typedef {Object} KnowledgeGraph.NodeStyle - 节点样式通用配置项。
  49034. * @property {string} [fill] - 节点填充色。
  49035. * @property {string} [stroke] - 节点的描边颜色。
  49036. * @property {number} [lineWidth] - 描边宽度。
  49037. * @property {Array.<number>} [lineDash] -描边虚线,数组代表实、虚长度。
  49038. * @property {number} [fillOpacity] - 设置填充的 alpha 或透明值。
  49039. * @property {string} [shadowColor] - 阴影颜色。
  49040. * @property {number} [shadowBlur] - 阴影范围。
  49041. * @property {number} [shadowOffsetX] - 阴影 x 方向偏移量。
  49042. * @property {number} [shadowOffsetY] - 阴影 y 方向偏移量。
  49043. * @property {number} [opacity] - 设置绘图的当前 alpha 或透明值。
  49044. * @property {string} [cursor] - 鼠标在该边上时的鼠标样式,CSS 的 cursor 选项都支持。
  49045. */
  49046. /**
  49047. * @typedef {Object} KnowledgeGraph.TextStyle - 文本样式。
  49048. * @property {string} [textAlign] - 设置文本内容的当前对齐方式。支持的属性:center / end / left / right / start,默认值为 start。
  49049. * @property {string} [textBaseline] - 设置在绘制文本时使用的当前文本基线。支持的属性:top / middle / bottom / alphabetic / hanging。默认值为 bottom。
  49050. * @property {string} [fontStyle] - 字体样式。对应 font-style。
  49051. * @property {string} [fontVariant] - 设置为小型大写字母字体。对应 font-variant。
  49052. * @property {number} [fontWeight] - 字体粗细。对应 font-weight。
  49053. * @property {number} [fontSize] - 字体大小。对应 font-size, 边标签文本默认大小是7。
  49054. * @property {string} [fontFamily] - 字体系列。对应 font-family。
  49055. * @property {number} [lineHeight] - 行高。对应 line-height。
  49056. */
  49057. /**
  49058. * @typedef {Object} KnowledgeGraph.EdgeLabelCfg - node节点配置项。
  49059. * @property {string} [position] - 文本相对于边的位置,目前支持的位置有:'start','middle','end'。默认为'middle'。
  49060. * @property {number} [refX] - 标签在 x 方向的偏移量。
  49061. * @property {number} [refY] -标签在 y 方向的偏移量。
  49062. * @property {boolean} [autoRotate=true] - 标签文字是否跟随边旋转,默认: true。
  49063. * @property { KnowledgeGraph.TextStyle} [style] - 标签的样式属性,默认: {fontSize: 3,fill: '#333'}。
  49064. */
  49065. /**
  49066. * @typedef {Object} KnowledgeGraph.EdgeStyle - 边样式通用配置项。
  49067. * @property {string} [stroke] - 边的颜色。
  49068. * @property {number} [lineWidth] - 边宽度。
  49069. * @property {number} [lineAppendWidth] -边响应鼠标事件时的检测宽度,当 lineWidth 太小而不易选中时,可以通过该参数提升击中范围。
  49070. * @property {boolean|Object} [endArrow=true] - 为 true 时在边的结束端绘制默认箭头,为 false 时不绘制结束端箭头, 默认值{path: 'M 0,0 L 2,1 L 2,-1 Z'}
  49071. * @property {boolean|Object} [startArrow] - 为 true 时在边的开始端绘制默认箭头,为 false 时不绘制结束端箭头。
  49072. * @property {number} [strokeOpacity] - 边透明度。
  49073. * @property {string} [shadowColor] - 阴影颜色。
  49074. * @property {number} [shadowBlur] - 阴影模糊程度。
  49075. * @property {number} [shadowOffsetX] - 阴影 x 方向偏移量。
  49076. * @property {number} [shadowOffsetY] - 阴影 y 方向偏移量。
  49077. * @property {Array.<number>} [lineDash] - 设置线的虚线样式,可以指定一个数组。一组描述交替绘制线段和间距(坐标空间单位)长度的数字。 如果数组元素的数量是奇数, 数组的元素会被复制并重复。例如, [5, 15, 25] 会变成 [5, 15, 25, 5, 15, 25]。
  49078. * @property {string} [cursor] - 鼠标在该边上时的鼠标样式,CSS 的 cursor 选项都支持。
  49079. */
  49080. /**
  49081. * @typedef {Object} KnowledgeGraph.AnimateConfig - 动画配置项。
  49082. * @property {number} [duration= 500] - 一次动画的时长。
  49083. * @property {string} [easing='linearEasing'] - 动画函数。
  49084. * @property {number} [delay=0] - 是否重复执行动画。
  49085. * @property {boolean} [repeat=false] - 边透明度。
  49086. * @property {string} [shadowColor] - 阴影颜色。
  49087. */
  49088. var KnowledgeGraph = /*#__PURE__*/function () {
  49089. function KnowledgeGraph(config) {
  49090. var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'G6';
  49091. KnowledgeGraph_classCallCheck(this, KnowledgeGraph);
  49092. /**
  49093. * @member {string} KnowledgeGraph.prototype.graph
  49094. * @description graph实例。
  49095. */
  49096. this.graph = null;
  49097. this.config = lodash_clonedeep_default()(config);
  49098. this.graphRender = null;
  49099. this.type = type;
  49100. this.createGraphRender(this.type);
  49101. this.config = this.graphRender._getGraphConfig(this.config);
  49102. this.createGraph(this.config);
  49103. this.CLASS_NAME = 'SuperMap.KnowledgeGraph';
  49104. }
  49105. /**
  49106. * @function KnowledgeGraph.dataFromGraphMap
  49107. * @description 将iServer GraphMap数据转换成KnowledgeGraph数据。
  49108. * @param {Object} queryResult - iServer知识图谱服务query数据。
  49109. * @param {Object} graphMap - iServer知识图谱服务GraphMap数据(data.graphMap)。
  49110. * @return {KnowledgeGraph.Data} 返回数据。
  49111. */
  49112. KnowledgeGraph_createClass(KnowledgeGraph, [{
  49113. key: "handleNodeStatus",
  49114. value:
  49115. /**
  49116. * @function KnowledgeGraph.prototype.handleNodeStatus
  49117. * @description 展开、折叠、隐藏节点
  49118. * @param {Object} data - 展开 折叠 隐藏的对象, eg: {expand:['id1'], collapse:['id2'], hidden:['id3']}
  49119. */
  49120. function handleNodeStatus(data) {
  49121. var expand = data.expand,
  49122. collapse = data.collapse,
  49123. hidden = data.hidden;
  49124. // 解析expand参数,里面的节点再执行一次查询显示出来
  49125. this.expandNodes(expand);
  49126. // 解析collapse参数,折叠这个里面的节点
  49127. this.collapseNodes(collapse);
  49128. // 解析hidden,隐藏这个里面额的节点
  49129. this.hideNodes(hidden);
  49130. }
  49131. /**
  49132. * @function KnowledgeGraph.prototype.expandNodes
  49133. * @description 展开节点。
  49134. * @param {Array.<string>} expandData - 元素 ID 数组。
  49135. */
  49136. }, {
  49137. key: "expandNodes",
  49138. value: function expandNodes(expandData) {
  49139. var _this = this;
  49140. if (!expandData) {
  49141. return;
  49142. }
  49143. expandData.forEach(function (item) {
  49144. _this.expandNode(item + '');
  49145. });
  49146. }
  49147. /**
  49148. * @function KnowledgeGraph.prototype.collapseNodes
  49149. * @description 折叠节点。
  49150. * @param {Array.<string>} collapseData - 元素 ID 数组。
  49151. */
  49152. }, {
  49153. key: "collapseNodes",
  49154. value: function collapseNodes(collapseData) {
  49155. var _this2 = this;
  49156. if (!collapseData) {
  49157. return;
  49158. }
  49159. collapseData.forEach(function (item) {
  49160. _this2.collapseNode(item + '');
  49161. });
  49162. }
  49163. /**
  49164. * @function KnowledgeGraph.prototype.hideNodes
  49165. * @description 隐藏节点。
  49166. * @param {Array.<string>} hiddenData - 元素 ID 数组。
  49167. */
  49168. }, {
  49169. key: "hideNodes",
  49170. value: function hideNodes(hiddenData) {
  49171. var _this3 = this;
  49172. if (!hiddenData) {
  49173. return;
  49174. }
  49175. hiddenData.forEach(function (item) {
  49176. _this3.hideItem(item + '');
  49177. });
  49178. }
  49179. /**
  49180. * @function KnowledgeGraph.prototype.createGraphRender
  49181. * @description 创建KnowledgeGraphRender
  49182. * @param {string} type -类型, 默认是G6。
  49183. * @private
  49184. */
  49185. }, {
  49186. key: "createGraphRender",
  49187. value: function createGraphRender(type) {
  49188. if (type === 'G6') {
  49189. this.graphRender = new G6Render();
  49190. }
  49191. }
  49192. /**
  49193. * @function KnowledgeGraph.prototype.createGraph
  49194. * @description 创建KnowledgeGraph的guaph实例。
  49195. * @param {Object} config - graph配置项。
  49196. * @returns {Object} graph实例。
  49197. */
  49198. }, {
  49199. key: "createGraph",
  49200. value: function createGraph(config) {
  49201. var graph = this.initGraph(config);
  49202. this.graph = graph;
  49203. this.autoResize();
  49204. return graph;
  49205. }
  49206. /**
  49207. * @function KnowledgeGraph.prototype.getGraph
  49208. * @description 获取KnowledgeGraph的guaph实例。
  49209. * @returns {Object} graph实例。
  49210. */
  49211. }, {
  49212. key: "getGraph",
  49213. value: function getGraph() {
  49214. return this.graph;
  49215. }
  49216. /**
  49217. * @function KnowledgeGraph.prototype.autoResize
  49218. * @description 浏览器窗口大小发生改变时,重新设置canvas画布的大小,重新渲染。
  49219. */
  49220. }, {
  49221. key: "autoResize",
  49222. value: function autoResize() {
  49223. if (this.config && this.config.autoResize !== false) {
  49224. this.graphRender.autoResize();
  49225. }
  49226. }
  49227. /**
  49228. * @function KnowledgeGraph.prototype.zoom
  49229. * @description 改变视口的缩放比例,在当前画布比例下缩放,是相对比例。
  49230. * @param {number} ratio 缩放比例。
  49231. * @param {Object} [center] 以 center 的 x、y 坐标为中心缩放,如果省略了 center 参数,则以元素当前位置为中心缩放。
  49232. * @param {boolean} [animate] 是否开启动画。
  49233. * @param {KnowledgeGraph.AnimateConfig} [animateCfg] 若带有动画,可配置动画。若未配置,则跟随 graph 的 animateCfg 参数。
  49234. */
  49235. }, {
  49236. key: "zoom",
  49237. value: function zoom(ratio, center, animate, animateCfg) {
  49238. this.graphRender.zoom(ratio, center, animate, animateCfg);
  49239. }
  49240. /**
  49241. * @function KnowledgeGraph.prototype.zoomTo
  49242. * @description 改变视口的缩放比例,在当前画布比例下缩放,是相对比例。
  49243. * @param {number} ratio 缩放比例。
  49244. * @param {Object} [center] 以 center 的 x、y 坐标为中心缩放,如果省略了 center 参数,则以元素当前位置为中心缩放。
  49245. * @param {boolean} [animate] 是否开启动画。
  49246. * @param {KnowledgeGraph.AnimateConfig} [animateCfg] 若带有动画,可配置动画。若未配置,则跟随 graph 的 animateCfg 参数。
  49247. */
  49248. }, {
  49249. key: "zoomTo",
  49250. value: function zoomTo(ratio, center, animate, animateCfg) {
  49251. this.graphRender.zoomTo(ratio, center, animate, animateCfg);
  49252. }
  49253. /**
  49254. * @function KnowledgeGraph.prototype.fitView
  49255. * @description 让画布内容适应视口。
  49256. * @param {Array.<number>|number} [padding] [top, right, bottom, left] 四个方向上的间距值。
  49257. * @param {Object} [rules] fitView 的规则,参数如下:{ onlyOutOfViewPort?: boolean; direction?: 'x' / 'y' / 'both'; ratioRule?: 'max' / 'min}。
  49258. * @param {boolean} [animate] 是否开启动画。
  49259. * @param {KnowledgeGraph.AnimateConfig} [animateCfg] 若带有动画,可配置动画。若未配置,则跟随 graph 的 animateCfg 参数。
  49260. */
  49261. }, {
  49262. key: "fitView",
  49263. value: function fitView(padding, rules, animate, animateCfg) {
  49264. this.graphRender.fitView(padding, rules, animate, animateCfg);
  49265. }
  49266. /**
  49267. * @function KnowledgeGraph.prototype.fitCenter
  49268. * @description 平移图到中心将对齐到画布中心,但不缩放。优先级低于 fitView。
  49269. * @param {boolean} [animate] 是否开启动画。
  49270. * @param {KnowledgeGraph.AnimateConfig} [animateCfg] 若带有动画,可配置动画,参见基础动画教程。若未配置,则跟随 graph 的 animateCfg 参数。
  49271. */
  49272. }, {
  49273. key: "fitCenter",
  49274. value: function fitCenter(animate, animateCfg) {
  49275. this.graphRender.fitCenter(animate, animateCfg);
  49276. }
  49277. /**
  49278. * @function KnowledgeGraph.prototype.getGraphCenterPoint
  49279. * @description 获取图内容的中心绘制坐标。
  49280. * @return {Object} 包含的属性:x 和 y 属性,分别表示渲染坐标下的 x、y 值。
  49281. */
  49282. }, {
  49283. key: "getGraphCenterPoint",
  49284. value: function getGraphCenterPoint() {
  49285. return this.graphRender.getGraphCenterPoint();
  49286. }
  49287. /**
  49288. * @function KnowledgeGraph.prototype.getViewPortCenterPoint
  49289. * @description 获取窗口的中心绘制坐标。
  49290. * @return {Object} 包含的属性:x 和 y 属性,分别表示渲染坐标下的 x、y 值。
  49291. */
  49292. }, {
  49293. key: "getViewPortCenterPoint",
  49294. value: function getViewPortCenterPoint() {
  49295. return this.graphRender.getViewPortCenterPoint();
  49296. }
  49297. /**
  49298. * @function KnowledgeGraph.prototype.getZoom
  49299. * @description 获取当前视口的缩放比例。
  49300. * @return {number} 返回值表示当前视口的缩放比例, 默认值为 1。
  49301. */
  49302. }, {
  49303. key: "getZoom",
  49304. value: function getZoom() {
  49305. return this.graphRender.getZoom();
  49306. }
  49307. /**
  49308. * @function KnowledgeGraph.prototype.getMinZoom
  49309. * @description 获取 graph 当前允许的最小缩放比例。
  49310. * @return {number} 返回值表示当前视口的最小缩放比例。
  49311. */
  49312. }, {
  49313. key: "getMinZoom",
  49314. value: function getMinZoom() {
  49315. return this.graphRender.getMinZoom();
  49316. }
  49317. /**
  49318. * @function KnowledgeGraph.prototype.setMinZoom
  49319. * @description 设置 graph 当前允许的最小缩放比例。
  49320. * @param {number} ratio 缩放比例。
  49321. */
  49322. }, {
  49323. key: "setMinZoom",
  49324. value: function setMinZoom(ratio) {
  49325. this.graphRender.setMinZoom(ratio);
  49326. }
  49327. /**
  49328. * @function KnowledgeGraph.prototype.getMaxZoom
  49329. * @description 获取 graph 当前允许的最大缩放比例。
  49330. * @return {number} 返回值表示当前视口的最大缩放比例。
  49331. */
  49332. }, {
  49333. key: "getMaxZoom",
  49334. value: function getMaxZoom() {
  49335. return this.graphRender.getMaxZoom();
  49336. }
  49337. /**
  49338. * @function KnowledgeGraph.prototype.setMaxZoom
  49339. * @description 设置 graph 当前允许的最大缩放比例。
  49340. * @param {number} ratio 缩放比例。
  49341. */
  49342. }, {
  49343. key: "setMaxZoom",
  49344. value: function setMaxZoom(ratio) {
  49345. this.graphRender.setMaxZoom(ratio);
  49346. }
  49347. /**
  49348. * @function KnowledgeGraph.prototype.getWidth
  49349. * @description获取 graph 当前的宽度。
  49350. * @return {number} graph 当前的宽度。
  49351. */
  49352. }, {
  49353. key: "getWidth",
  49354. value: function getWidth() {
  49355. return this.graphRender.getWidth();
  49356. }
  49357. /**
  49358. * @function KnowledgeGraph.prototype.getHeight
  49359. * @description 获取 graph 当前的高度。
  49360. * @return {number} graph 当前的高度。
  49361. */
  49362. }, {
  49363. key: "getHeight",
  49364. value: function getHeight() {
  49365. return this.graphRender.getHeight();
  49366. }
  49367. /**
  49368. * @function KnowledgeGraph.prototype.initGraph
  49369. * @description 创建KnowledgeGraph实例
  49370. * @param {Object} config - graph配置项。
  49371. * @returns {Object} graph实例。
  49372. */
  49373. }, {
  49374. key: "initGraph",
  49375. value: function initGraph(config) {
  49376. var _this4 = this;
  49377. var graph = this.graphRender.initGraph(config);
  49378. this.graph = graph;
  49379. var cb = function cb() {
  49380. if (_this4.config.zoom !== undefined) {
  49381. _this4.zoom(_this4.config.zoom);
  49382. }
  49383. if (_this4.config.center !== undefined) {
  49384. _this4.graphRender.setCenter({
  49385. x: _this4.config.center[0],
  49386. y: _this4.config.center[1]
  49387. });
  49388. }
  49389. };
  49390. this.graph.on('beforelayout', cb);
  49391. return graph;
  49392. }
  49393. /**
  49394. * @function KnowledgeGraph.prototype.setData
  49395. * @description 设置默认数据
  49396. * @param {KnowledgeGraph.Data} data - graph数据。
  49397. * @param {Object} [graph = this.graph] - graph实例。
  49398. */
  49399. }, {
  49400. key: "setData",
  49401. value: function setData(data) {
  49402. var graph = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.graph;
  49403. data = data || {
  49404. nodes: [],
  49405. edges: []
  49406. };
  49407. if (this.config && this.config.nodeLabelMaxWidth) {
  49408. data.nodes = this.nodeLabelOpenEllipsis(this.config.nodeLabelMaxWidth, data.nodes);
  49409. }
  49410. this.graphRender.setData(data, graph);
  49411. this.render(graph); // 渲染图
  49412. this.data = data;
  49413. }
  49414. /**
  49415. * @function KnowledgeGraph.prototype.render
  49416. * @description 根据提供的数据渲染视图。
  49417. * @param {Object} [graph = this.graph] - graph实例。
  49418. */
  49419. }, {
  49420. key: "render",
  49421. value: function render() {
  49422. var graph = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.graph;
  49423. graph && this.graphRender.render(graph);
  49424. }
  49425. /**
  49426. * @function KnowledgeGraph.prototype.updateGraph
  49427. * @description 更新数据
  49428. * @param {KnowledgeGraph.Data} data - graph数据。
  49429. * @param {Object} [graph = this.graph] - graph实例。
  49430. */
  49431. }, {
  49432. key: "updateGraph",
  49433. value: function updateGraph(data) {
  49434. var graph = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.graph;
  49435. graph && this.graphRender.updateGraph(data, graph);
  49436. }
  49437. /**
  49438. * @function KnowledgeGraph.prototype.refresh
  49439. * @description 改变画布大小。
  49440. */
  49441. }, {
  49442. key: "refresh",
  49443. value: function refresh() {
  49444. return this.graphRender.refresh();
  49445. }
  49446. /**
  49447. * @function KnowledgeGraph.prototype.changeSize
  49448. * @description 改变画布大小。
  49449. * @param {number} width - 宽度。
  49450. * @param {number} height - 高度。
  49451. */
  49452. }, {
  49453. key: "changeSize",
  49454. value: function changeSize(width, height) {
  49455. return this.graphRender.changeSize(width, height);
  49456. }
  49457. /**
  49458. * @function KnowledgeGraph.prototype.resize
  49459. * @description 改变画布大小后,重新渲染。
  49460. * @param {number} width - 宽度。
  49461. * @param {number} height - 高度。
  49462. */
  49463. }, {
  49464. key: "resize",
  49465. value: function resize(width, height) {
  49466. this.graphRender.changeSize(width, height);
  49467. this.graphRender.refresh();
  49468. }
  49469. /**
  49470. * @function KnowledgeGraph.prototype.getContainer
  49471. * @description 获取 Graph 的 DOM 容器。
  49472. * @return {HTMLElement} DOM 容器。
  49473. */
  49474. }, {
  49475. key: "getContainer",
  49476. value: function getContainer() {
  49477. return this.graphRender.getContainer();
  49478. }
  49479. /**
  49480. * @function KnowledgeGraph.prototype.getCanvas
  49481. * @description 获取canvas。
  49482. * @return {HTMLElement} canvas。
  49483. */
  49484. }, {
  49485. key: "getCanvas",
  49486. value: function getCanvas() {
  49487. return this.graphRender.getCanvas();
  49488. }
  49489. /**
  49490. * @function KnowledgeGraph.prototype.getNodes
  49491. * @description 获取图中所有节点的实例。
  49492. * @return {Array} 返回值表示图中所有节点的实例。
  49493. */
  49494. }, {
  49495. key: "getNodes",
  49496. value: function getNodes() {
  49497. return this.graphRender.getNodes();
  49498. }
  49499. /**
  49500. * @function KnowledgeGraph.prototype.getEdges
  49501. * @description 获取图中所有节点的实例。这里返回的是边的实例,而不是边的数据项。
  49502. * @return {Array} 返回值表示图中所有边的实例。
  49503. */
  49504. }, {
  49505. key: "getEdges",
  49506. value: function getEdges() {
  49507. return this.graphRender.getEdges();
  49508. }
  49509. /**
  49510. * @function KnowledgeGraph.prototype.getNeighbors
  49511. * @description 获取邻居节点数组。
  49512. * @param {string | INode} node - 节点 ID 或节点实例。
  49513. * @param {string | undefined} type - ['source'| 'target' | undefined] 邻居类型, 'source' 只获取当前节点的源节点,'target' 只获取当前节点指向的目标节点, 若不指定则返回所有类型的邻居。
  49514. * @return {Array} 返回值符合要求的节点数组。
  49515. */
  49516. }, {
  49517. key: "getNeighbors",
  49518. value: function getNeighbors(node, type) {
  49519. return this.graphRender.getNeighbors(node, type);
  49520. }
  49521. /**
  49522. * @function KnowledgeGraph.prototype.findById
  49523. * @description 根据 ID,查询对应的元素实例。
  49524. * @param {string} id - 元素 ID。
  49525. * @return {Object} 如果有符合规则的元素实例,则返回第一个匹配的元素实例,否则返回 undefined 。
  49526. */
  49527. }, {
  49528. key: "findById",
  49529. value: function findById(id) {
  49530. return this.graphRender.findById(id);
  49531. }
  49532. /**
  49533. * @function KnowledgeGraph.prototype.find
  49534. * @description 获取邻居节点数组。
  49535. * @param {string} type - 元素类型,可选值为 'node'、'edge'
  49536. * @param {Function} fn - 查找的规则。
  49537. * @return {Object} 如果有符合规则的元素实例,则返回第一个匹配的元素实例,否则返回 undefined 。
  49538. */
  49539. }, {
  49540. key: "find",
  49541. value: function find(type, fn) {
  49542. return this.graphRender.find(type, fn);
  49543. }
  49544. /**
  49545. * @function KnowledgeGraph.prototype.findAll
  49546. * @description 获取邻居节点数组。
  49547. * @param {string} type - 元素类型,可选值为 'node'、'edge'。
  49548. * @param {Function} fn - 查找的规则。
  49549. * @return {Object} 如果有符合规则的元素实例,则返回所有元素实例,否则返回 undefined。
  49550. */
  49551. }, {
  49552. key: "findAll",
  49553. value: function findAll(type, fn) {
  49554. return this.graphRender.findAll(type, fn);
  49555. }
  49556. /**
  49557. * @function KnowledgeGraph.prototype.getEdgesByNode
  49558. * @description 获取与当前节点有关联的所有边。
  49559. * @param {Object} node - node实例。
  49560. * @return {Array} edge实例数组。
  49561. */
  49562. }, {
  49563. key: "getEdgesByNode",
  49564. value: function getEdgesByNode(node) {
  49565. return this.graphRender.getEdgesByNode(node);
  49566. }
  49567. /**
  49568. * @function KnowledgeGraph.prototype.getInEdges
  49569. * @description 获取与当前节点关联的所有入边。
  49570. * @param {Object} node - node实例。
  49571. * @return {Array} edge实例数组。
  49572. */
  49573. }, {
  49574. key: "getInEdges",
  49575. value: function getInEdges(node) {
  49576. return this.graphRender.getInEdges(node);
  49577. }
  49578. /**
  49579. * @function KnowledgeGraph.prototype.getOutEdges
  49580. * @description 获取与当前节点关联的所有出边。
  49581. * @param {Object} node - node实例。
  49582. * @return {Array} edge实例数组。
  49583. */
  49584. }, {
  49585. key: "getOutEdges",
  49586. value: function getOutEdges(node) {
  49587. return this.graphRender.getOutEdges(node);
  49588. }
  49589. /**
  49590. * @function KnowledgeGraph.prototype.getSourceByEdge
  49591. * @description 获取当前边的起始节点
  49592. * @param {Object} edge - node实例。
  49593. * @return {Object} 返回值为起始节点的实例。
  49594. */
  49595. }, {
  49596. key: "getSourceByEdge",
  49597. value: function getSourceByEdge(edge) {
  49598. return this.graphRender.getSourceByEdge(edge);
  49599. }
  49600. /**
  49601. * @function KnowledgeGraph.prototype.getTargetByEdge
  49602. * @description 获取当前边的终止节点。
  49603. * @param {Object} edge - node实例。
  49604. * @return {Object} 终止节点的实例。
  49605. */
  49606. }, {
  49607. key: "getTargetByEdge",
  49608. value: function getTargetByEdge(edge) {
  49609. return this.graphRender.getTargetByEdge(edge);
  49610. }
  49611. /**
  49612. * @function KnowledgeGraph.prototype.expandNode
  49613. * @description 展开当前节点。
  49614. * @param {string} id - 元素 ID。
  49615. */
  49616. }, {
  49617. key: "expandNode",
  49618. value: function expandNode(id) {
  49619. var item = this.findById(id);
  49620. item && this.graphRender.expandNode(item);
  49621. }
  49622. /**
  49623. * @function KnowledgeGraph.prototype.collapseNode
  49624. * @description 收起当前节点。
  49625. * @param {string} id - 元素 ID。
  49626. */
  49627. }, {
  49628. key: "collapseNode",
  49629. value: function collapseNode(id) {
  49630. var item = this.findById(id);
  49631. item && this.graphRender.collapseNode(item);
  49632. }
  49633. /**
  49634. * @function KnowledgeGraph.prototype.showItem
  49635. * @description 显示指定的元素。若 item 为节点,则相关边也会随之显示。而show() 则将只显示自身。
  49636. * @param {string|Object} item - 元素 ID 或元素实例。
  49637. * @param {boolean} [stack] - 操作是否入 undo & redo 栈,当实例化 Graph 时设置 enableStack 为 true 时,默认情况下会自动入栈,入栈以后,就支持 undo & redo 操作,如果不需要,则设置该参数为 false 即可。
  49638. */
  49639. }, {
  49640. key: "showItem",
  49641. value: function showItem(item, stack) {
  49642. this.graphRender.showItem(item, stack);
  49643. }
  49644. /**
  49645. * @function KnowledgeGraph.prototype.showItem
  49646. * @description 隐藏指定元素。若 item 为节点,则相关边也会随之隐藏。而 hide() 则将只隐藏自身。
  49647. * @param {string|Object} item - 元素 ID 或元素实例。
  49648. * @param {boolean} [stack] -操作是否入 undo & redo 栈,当实例化 Graph 时设置 enableStack 为 true 时,默认情况下会自动入栈,入栈以后,就支持 undo & redo 操作,如果不需要,则设置该参数为 false 即可。
  49649. */
  49650. }, {
  49651. key: "hideItem",
  49652. value: function hideItem(item, stack) {
  49653. this.graphRender.hideItem(item, stack);
  49654. }
  49655. /**
  49656. * @function KnowledgeGraph.prototype.show
  49657. * @description 显示元素。只显示 item 自身,若需要在显示节点的同时显示相关边,应调用showItem(item)。
  49658. * @param {Object} item - 元素实例。
  49659. */
  49660. }, {
  49661. key: "show",
  49662. value: function show(item) {
  49663. this.graphRender.show(item);
  49664. }
  49665. /**
  49666. * @function KnowledgeGraph.prototype.hide
  49667. * @description 隐藏元素。只隐藏 item 自身,若需要在隐藏节点的同时隐藏相关边,应调用 hideItem(item)。
  49668. * @param {Object} item - 元素实例。
  49669. */
  49670. }, {
  49671. key: "hide",
  49672. value: function hide(item) {
  49673. this.graphRender.hide(item);
  49674. }
  49675. /**
  49676. * @function KnowledgeGraph.prototype.changeVisibility
  49677. * @description 更改元素是否显示。
  49678. * @param {Object} item - 元素实例。
  49679. * @param {boolean} visible - 是否显示元素,true 为显示,false 为隐藏。
  49680. */
  49681. }, {
  49682. key: "changeVisibility",
  49683. value: function changeVisibility(item, visible) {
  49684. this.graphRender.changeVisibility(item, visible);
  49685. }
  49686. /**
  49687. * @function KnowledgeGraph.prototype.isVisible
  49688. * @description 查询元素显示状态。
  49689. * @param {Object} item - 元素实例。
  49690. * @return {boolean} - 返回值为 true,则表示当前元素处于显示状态,否则处于隐藏状态。
  49691. */
  49692. }, {
  49693. key: "isVisible",
  49694. value: function isVisible(item) {
  49695. return this.graphRender.isVisible(item);
  49696. }
  49697. /**
  49698. * @function KnowledgeGraph.prototype.getModel
  49699. * @description 获取元素的数据模型。
  49700. * @param {Object} item - 元素实例。
  49701. * @return {Object} - 返回值为节点的数据模型。
  49702. */
  49703. }, {
  49704. key: "getModel",
  49705. value: function getModel(item) {
  49706. return this.graphRender.getModel(item);
  49707. }
  49708. /**
  49709. * @function KnowledgeGraph.prototype.addItem
  49710. * @description 新增元素(节点和边)。
  49711. * @param {string} type - 元素类型,可选值为 'node'、'edge'。
  49712. * @param {Object} model - 元素的数据模型,具体内容参见元素配置项。
  49713. */
  49714. }, {
  49715. key: "addItem",
  49716. value: function addItem(type, model) {
  49717. return this.graphRender.addItem(type, model);
  49718. }
  49719. /**
  49720. * @function KnowledgeGraph.prototype.removeItem
  49721. * @description 删除元素。
  49722. * @param {string|Object} item - 元素 ID 或元素实例。
  49723. */
  49724. }, {
  49725. key: "removeItem",
  49726. value: function removeItem(item) {
  49727. return this.graphRender.removeItem(item);
  49728. }
  49729. /**
  49730. * @function KnowledgeGraph.prototype.updateItem
  49731. * @description 更新元素,包括更新数据、样式等。
  49732. * @param {string|Object} item - 元素 ID 或元素实例。
  49733. * @param {Object} model - 元素的数据模型,具体内容参见元素配置项。
  49734. */
  49735. }, {
  49736. key: "updateItem",
  49737. value: function updateItem(item, model) {
  49738. return this.graphRender.updateItem(item, model);
  49739. }
  49740. /**
  49741. * @function KnowledgeGraph.prototype.refreshItem
  49742. * @description 刷新指定元素。
  49743. * @param {string|Object} item - 元素 ID 或元素实例。
  49744. */
  49745. }, {
  49746. key: "refreshItem",
  49747. value: function refreshItem(item) {
  49748. return this.graphRender.refreshItem(item);
  49749. }
  49750. /**
  49751. * @function KnowledgeGraph.prototype.refreshPositions
  49752. * @description 当节点位置发生变化时,刷新所有节点位置,并重计算边的位置。
  49753. */
  49754. }, {
  49755. key: "refreshPositions",
  49756. value: function refreshPositions() {
  49757. return this.graphRender.refreshPositions();
  49758. }
  49759. /**
  49760. * @function KnowledgeGraph.prototype.on
  49761. * @description graph监听事件
  49762. * @param {string} eventName - 事件名,可选事件名参见: Node交互事件名、Edge交互事件名、Canvas交互事件名 时机事件
  49763. * 通用事件名: click dbclick mouseenter mousemove mouseout mouseover mouseleave mousedown mouseup contextmenu dragstart drag dragend dragenter dragleave drop keydown keyup wheel touchstart touchmove touchend
  49764. * Node交互事件名: node:通用事件名, 例如 node:click
  49765. * Edge交互事件名: edge:通用事件名, 例如 edge:click
  49766. * Canvas交互事件名: canvas:通用事件名,例如 canvas:click
  49767. * 时机事件:用于监听图的某方法调用前后的时机。
  49768. * beforerender 调用 render 方法之前触发
  49769. * afterrender 调用 render 方法之后触发
  49770. * beforeadditem 调用 addItem 方法之前触发
  49771. * afteradditem 调用 addItem 方法之后触发
  49772. * beforeremoveitem 调用 removeItem 方法之前触发
  49773. * afterremoveitem 调用 removeItem 方法之后触发
  49774. * beforeupdateitem 调用 updateItem 方法之前触发
  49775. * afterupdateitem 调用 updateItem 方法之后触发
  49776. * beforegraphrefresh 调用 refresh 方法之前触发
  49777. * aftergraphrefresh 调用 refresh 方法之后触发
  49778. * beforelayout 布局前触发。调用 graph.render 时会进行布局,因此 render 时会触发。或用户主动调用图的 graph.layout 时触发
  49779. * afterlayout 布局完成后触发。调用 graph.render 时会进行布局,因此 render 时布局完成后会触发。或用户主动调用图的 graph.layout 时布局完成后触发
  49780. * viewportchange 调用 graph.moveTo 或 graph.zoom 均会触发该事件
  49781. * @param {Function} handler - 监听函数。
  49782. */
  49783. }, {
  49784. key: "on",
  49785. value: function on(eventName, handler) {
  49786. this.graphRender.on(eventName, handler);
  49787. }
  49788. /**
  49789. * @function KnowledgeGraph.prototype.off
  49790. * @description graph关闭事件。
  49791. * @param {string} eventName - 事件名,参考on方法的事件名。
  49792. * @param {Function} handler - 监听函数。
  49793. */
  49794. }, {
  49795. key: "off",
  49796. value: function off(eventName, handler) {
  49797. this.graphRender.off(eventName, handler);
  49798. }
  49799. /**
  49800. * @function KnowledgeGraph.prototype.toDataURL
  49801. * @description 转换成图片。
  49802. * @param {string} type - 图片类型 'image/png' / 'image/jpeg' / 'image/webp' / 'image/bmp'。
  49803. * @param {string} [backgroundColor] - 图片的背景色,可选,不传值时将导出透明背景的图片。
  49804. * @return {string} 返回值表示生成的图片的 URL。
  49805. */
  49806. }, {
  49807. key: "toDataURL",
  49808. value: function toDataURL(type, backgroundColor) {
  49809. this.graphRender.toDataURL(type, backgroundColor);
  49810. }
  49811. /**
  49812. * @function KnowledgeGraph.prototype.nodeLabelOpenEllipsis
  49813. * @description 转换label的省略号。
  49814. * @param {Object} nodeLabelMaxWidth - node节点标签是否开启省略号
  49815. * @param {Object} nodes - graph的nodes数据。
  49816. * @return {Array} nodes
  49817. */
  49818. }, {
  49819. key: "nodeLabelOpenEllipsis",
  49820. value: function nodeLabelOpenEllipsis(nodeLabelMaxWidth, nodes) {
  49821. var _this5 = this;
  49822. if (!nodes) {
  49823. return [];
  49824. }
  49825. if (!nodeLabelMaxWidth) {
  49826. return nodes;
  49827. }
  49828. return nodes.map(function (node) {
  49829. var fontSize = node.labelCfg && node.labelCfg.fontSize || _this5.defaultNode && _this5.defaultNode.labelCfg && _this5.defaultNode.labelCfg.fontSize || 14;
  49830. node.label = fittingStr(node.label, nodeLabelMaxWidth, fontSize);
  49831. return node;
  49832. });
  49833. }
  49834. /**
  49835. * @function KnowledgeGraph.prototype.clear
  49836. * @description 清除画布元素。
  49837. * @param {Object} [graph = this.graph] - graph实例。
  49838. */
  49839. }, {
  49840. key: "clear",
  49841. value: function clear() {
  49842. var graph = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.graph;
  49843. graph && graph.clear();
  49844. }
  49845. /**
  49846. * @function KnowledgeGraph.prototype.destroy
  49847. * @description 销毁画布。
  49848. * @param {Object} [graph = this.graph] - graph实例。
  49849. */
  49850. }, {
  49851. key: "destroy",
  49852. value: function destroy() {
  49853. var graph = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.graph;
  49854. graph && graph.destroy();
  49855. }
  49856. }], [{
  49857. key: "dataFromGraphMap",
  49858. value: function dataFromGraphMap(queryResult, graphMap) {
  49859. return transformGraphMap(queryResult, graphMap);
  49860. }
  49861. /**
  49862. * @function KnowledgeGraph.dataFromKnowledgeGraphQuery
  49863. * @description 将iServer KnowledgeGraphService query数据转换成KnowledgeGraph数据。
  49864. * @param {Object} queryResult - iServer知识图谱服务query数据。
  49865. * @return {KnowledgeGraph.Data} 返回数据。
  49866. */
  49867. }, {
  49868. key: "dataFromKnowledgeGraphQuery",
  49869. value: function dataFromKnowledgeGraphQuery(queryResult) {
  49870. return transformGraphMap(queryResult);
  49871. }
  49872. }]);
  49873. return KnowledgeGraph;
  49874. }();
  49875. /**
  49876. * @private
  49877. * @description 大于最大宽度的字符串会返回带有省略号的字符串 xxx...。
  49878. * @param {string} label - 需要处理的字符串。
  49879. * @param {number} maxWidth - 最大宽度。
  49880. * @param {number} fontSize - 字体大小。
  49881. * @returns {string} 处理之后的字符串。
  49882. */
  49883. function fittingStr(label, maxWidth, fontSize) {
  49884. var calcLabelLength = function calcLabelLength(label) {
  49885. var len = 0;
  49886. for (var i = 0; i < label.length; i++) {
  49887. if (label.charCodeAt(i) > 0 && label.charCodeAt(i) < 128) {
  49888. len++;
  49889. } else {
  49890. len += 2;
  49891. }
  49892. }
  49893. return len;
  49894. };
  49895. var fontWidth = fontSize * 1; //字号+边距
  49896. maxWidth = maxWidth * 1.6; // 需要根据自己项目调整
  49897. var width = calcLabelLength(label) * fontWidth;
  49898. var ellipsis = '…';
  49899. if (width > maxWidth) {
  49900. var len = Math.floor((maxWidth - 20) / fontWidth);
  49901. var result = label.substring(0, len);
  49902. if ((label.substring(len).length + ellipsis.length) * fontWidth > maxWidth) {
  49903. return result + '\n' + label.substring(len, len + len - 2) + ellipsis;
  49904. } else if (label.substring(len).length == 0) {
  49905. return result;
  49906. } else {
  49907. return result + '\n' + label.substring(len);
  49908. }
  49909. } else {
  49910. return label;
  49911. }
  49912. }
  49913. ;// CONCATENATED MODULE: ./src/maplibregl/overlay/GraphMap.js
  49914. function GraphMap_typeof(obj) { "@babel/helpers - typeof"; return GraphMap_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, GraphMap_typeof(obj); }
  49915. function GraphMap_regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ GraphMap_regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == GraphMap_typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
  49916. function GraphMap_asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
  49917. function GraphMap_asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { GraphMap_asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { GraphMap_asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
  49918. function GraphMap_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  49919. function GraphMap_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  49920. function GraphMap_createClass(Constructor, protoProps, staticProps) { if (protoProps) GraphMap_defineProperties(Constructor.prototype, protoProps); if (staticProps) GraphMap_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  49921. function GraphMap_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) GraphMap_setPrototypeOf(subClass, superClass); }
  49922. function GraphMap_setPrototypeOf(o, p) { GraphMap_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GraphMap_setPrototypeOf(o, p); }
  49923. function GraphMap_createSuper(Derived) { var hasNativeReflectConstruct = GraphMap_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = GraphMap_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = GraphMap_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return GraphMap_possibleConstructorReturn(this, result); }; }
  49924. function GraphMap_possibleConstructorReturn(self, call) { if (call && (GraphMap_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return GraphMap_assertThisInitialized(self); }
  49925. function GraphMap_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  49926. function GraphMap_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  49927. function GraphMap_getPrototypeOf(o) { GraphMap_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GraphMap_getPrototypeOf(o); }
  49928. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  49929. * This program are made available under the terms of the Apache License, Version 2.0
  49930. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  49931. /**
  49932. * @class GraphMap
  49933. * @classdesc 对接 iServer GraphMap。
  49934. * @category iServer KnowledgeGraph
  49935. * @version 11.1.0
  49936. * @param {string} serverUrl - GraphMap服务地址, 例如:http://{iserver}/services/{knowledgeGraph-provider}/restjsr/graph/graphmaps/{graphmap}。
  49937. * @param {Object} [options] - 参数。
  49938. * @param {KnowledgeGraph.Config} [options.config] - KnowledgeGraph的配置项。
  49939. * @param {string} [options.proxy] - 服务代理地址。
  49940. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  49941. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  49942. * @param {Object} [options.headers] - 请求头。
  49943. * @fires GraphMap#loaded
  49944. * @extends {maplibregl.Evented}
  49945. * @usage
  49946. */
  49947. var GraphMap = /*#__PURE__*/function (_maplibregl$Evented) {
  49948. GraphMap_inherits(GraphMap, _maplibregl$Evented);
  49949. var _super = GraphMap_createSuper(GraphMap);
  49950. function GraphMap(serverUrl, options) {
  49951. var _this;
  49952. GraphMap_classCallCheck(this, GraphMap);
  49953. _this = _super.call(this, serverUrl, options);
  49954. /**
  49955. * @member GraphMap.prototype.graph
  49956. * @description KnowledgeGraph的实例.
  49957. *
  49958. */
  49959. _this.graph = null;
  49960. /**
  49961. * @member GraphMap.prototype.EVENT_TYPES
  49962. * @description 监听一个自定义事件可用如下方式:
  49963. *
  49964. * 支持的事件如下:
  49965. * loaded - 渲染完成时触发。
  49966. */
  49967. _this.EVENT_TYPES = ['loaded'];
  49968. var graphMapName = serverUrl.split('/').pop();
  49969. _this.url = serverUrl.replace("/graphmaps/".concat(graphMapName), '');
  49970. _this.createGraphMap(graphMapName, options);
  49971. return _this;
  49972. }
  49973. /**
  49974. * @private
  49975. * @function GraphMap.prototype.createGraphMap
  49976. * @description 创建图谱。
  49977. * @param {string} graphMapName - 图谱名称
  49978. * @param {Object} options - 配置项
  49979. * @param {string} [options.proxy] - 服务代理地址
  49980. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie
  49981. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求
  49982. * @param {Object} [options.headers] - 请求头
  49983. * @param {KnowledgeGraph.Config} [options.config] - knowledgegrah配置项
  49984. */
  49985. GraphMap_createClass(GraphMap, [{
  49986. key: "createGraphMap",
  49987. value: function () {
  49988. var _createGraphMap = GraphMap_asyncToGenerator( /*#__PURE__*/GraphMap_regeneratorRuntime().mark(function _callee(graphMapName, options) {
  49989. var _this2 = this;
  49990. var res, result;
  49991. return GraphMap_regeneratorRuntime().wrap(function _callee$(_context) {
  49992. while (1) switch (_context.prev = _context.next) {
  49993. case 0:
  49994. this.knowledgeGraphService = this.createKnowledgeGraphService(this.url, options);
  49995. _context.next = 3;
  49996. return this.knowledgeGraphService.getGraphMapData(graphMapName);
  49997. case 3:
  49998. res = _context.sent;
  49999. result = KnowledgeGraph.dataFromGraphMap(res.data, res.graphMap);
  50000. this.graph = new KnowledgeGraph(options && options.config);
  50001. this.graph.on('beforelayout', function () {
  50002. /**
  50003. * @event GraphMap#loaded
  50004. * @description 渲染完成时触发。
  50005. */
  50006. _this2.fire(_this2.EVENT_TYPES[0]);
  50007. });
  50008. this.graph.setData(result);
  50009. this.graph.handleNodeStatus(transformExpandCollapseHiddenData(res.graphMap));
  50010. case 9:
  50011. case "end":
  50012. return _context.stop();
  50013. }
  50014. }, _callee, this);
  50015. }));
  50016. function createGraphMap(_x, _x2) {
  50017. return _createGraphMap.apply(this, arguments);
  50018. }
  50019. return createGraphMap;
  50020. }()
  50021. /**
  50022. * @private
  50023. * @function GraphMap.prototype.createKnowledgeGraphService
  50024. * @description 创建KnowledgeGraphService实例。
  50025. * @param {string} serviceUrl - GraphMap服务地址, 例如:http://{iserver}/services/knowledgeGraph-test/restjsr/graph
  50026. * @param {Object} options - 参数。
  50027. * @param {string} [options.proxy] - 服务代理地址。
  50028. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  50029. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  50030. * @param {Object} [options.headers] - 请求头。
  50031. */
  50032. }, {
  50033. key: "createKnowledgeGraphService",
  50034. value: function createKnowledgeGraphService(serviceUrl, options) {
  50035. return new KnowledgeGraphService(serviceUrl, options);
  50036. }
  50037. }]);
  50038. return GraphMap;
  50039. }((external_maplibregl_default()).Evented);
  50040. ;// CONCATENATED MODULE: external "function(){try{return mapv}catch(e){return {}}}()"
  50041. var external_function_try_return_mapv_catch_e_return_namespaceObject = function(){try{return mapv}catch(e){return {}}}();
  50042. ;// CONCATENATED MODULE: ./src/common/overlay/mapv/MapvRenderer.js
  50043. function MapvRenderer_typeof(obj) { "@babel/helpers - typeof"; return MapvRenderer_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, MapvRenderer_typeof(obj); }
  50044. function MapvRenderer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  50045. 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); } }
  50046. function MapvRenderer_createClass(Constructor, protoProps, staticProps) { if (protoProps) MapvRenderer_defineProperties(Constructor.prototype, protoProps); if (staticProps) MapvRenderer_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  50047. function MapvRenderer_get() { if (typeof Reflect !== "undefined" && Reflect.get) { MapvRenderer_get = Reflect.get.bind(); } else { MapvRenderer_get = function _get(target, property, receiver) { var base = MapvRenderer_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return MapvRenderer_get.apply(this, arguments); }
  50048. function MapvRenderer_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = MapvRenderer_getPrototypeOf(object); if (object === null) break; } return object; }
  50049. function MapvRenderer_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) MapvRenderer_setPrototypeOf(subClass, superClass); }
  50050. function MapvRenderer_setPrototypeOf(o, p) { MapvRenderer_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return MapvRenderer_setPrototypeOf(o, p); }
  50051. function MapvRenderer_createSuper(Derived) { var hasNativeReflectConstruct = MapvRenderer_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = MapvRenderer_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = MapvRenderer_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return MapvRenderer_possibleConstructorReturn(this, result); }; }
  50052. function MapvRenderer_possibleConstructorReturn(self, call) { if (call && (MapvRenderer_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return MapvRenderer_assertThisInitialized(self); }
  50053. function MapvRenderer_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  50054. function MapvRenderer_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  50055. function MapvRenderer_getPrototypeOf(o) { MapvRenderer_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return MapvRenderer_getPrototypeOf(o); }
  50056. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  50057. * This program are made available under the terms of the Apache License, Version 2.0
  50058. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  50059. var BaseLayer = external_function_try_return_mapv_catch_e_return_namespaceObject.baiduMapLayer ? external_function_try_return_mapv_catch_e_return_namespaceObject.baiduMapLayer.__proto__ : Function;
  50060. /**
  50061. * @private
  50062. * @class MapvRenderer
  50063. * @classdesc MapV图层渲染。
  50064. * @param {Object} map - 地图。
  50065. * @param {Object} layer - 图层。
  50066. * @param {Mapv.DataSet} dataSet - 数据集。
  50067. * @param {Object} options - 参数。
  50068. * @param {Object} [functions] - 图层传递给渲染器调用的方法。
  50069. * @param {Object} [mapOptions] - 图层传递给渲染器的地图元素信息。
  50070. * @extends {MapV.BaseLayer}
  50071. *
  50072. */
  50073. var MapvRenderer = /*#__PURE__*/function (_BaseLayer) {
  50074. MapvRenderer_inherits(MapvRenderer, _BaseLayer);
  50075. var _super = MapvRenderer_createSuper(MapvRenderer);
  50076. function MapvRenderer(map, dataSet, options, functions, mapOptions) {
  50077. var _this;
  50078. MapvRenderer_classCallCheck(this, MapvRenderer);
  50079. _this = _super.call(this, map, dataSet, options);
  50080. if (!BaseLayer) {
  50081. return MapvRenderer_possibleConstructorReturn(_this);
  50082. }
  50083. _this.options = options || {};
  50084. _this.transferCoordinate = functions.transferCoordinate;
  50085. _this.getCenterPixel = functions.getCenterPixel;
  50086. _this.getResolution = functions.getResolution;
  50087. _this.validZoom = functions.validZoom;
  50088. var mapElement = mapOptions.mapElement,
  50089. targetElement = mapOptions.targetElement,
  50090. id = mapOptions.id;
  50091. _this.targetElement = targetElement;
  50092. _this.canvas = _this._createCanvas(id, mapElement);
  50093. _this.canvasLayer = {
  50094. canvas: _this.canvas,
  50095. devicePixelRatio: _this.devicePixelRatio
  50096. };
  50097. _this.init(options);
  50098. _this.argCheck(options);
  50099. _this.stopAniamation = false;
  50100. _this.animation = options.animation;
  50101. _this.clickEvent = _this.clickEvent.bind(MapvRenderer_assertThisInitialized(_this));
  50102. _this.mousemoveEvent = _this.mousemoveEvent.bind(MapvRenderer_assertThisInitialized(_this));
  50103. _this._canvasUpdate();
  50104. _this.targetElement.appendChild(_this.canvas);
  50105. _this._expectShow = true;
  50106. _this.isShow = true;
  50107. return _this;
  50108. }
  50109. /**
  50110. * @function MapvRenderer.prototype.clickEvent
  50111. * @description 点击绑定事件。
  50112. * @param {Object} e - 事件。
  50113. */
  50114. MapvRenderer_createClass(MapvRenderer, [{
  50115. key: "clickEvent",
  50116. value: function clickEvent(e) {
  50117. var pixel = e.point;
  50118. MapvRenderer_get(MapvRenderer_getPrototypeOf(MapvRenderer.prototype), "clickEvent", this).call(this, pixel, e);
  50119. }
  50120. /**
  50121. * @function MapvRenderer.prototype.mousemoveEvent
  50122. * @description 鼠标移动事件。
  50123. * @param {Object} e - 事件。
  50124. */
  50125. }, {
  50126. key: "mousemoveEvent",
  50127. value: function mousemoveEvent(e) {
  50128. var pixel = e.point;
  50129. MapvRenderer_get(MapvRenderer_getPrototypeOf(MapvRenderer.prototype), "mousemoveEvent", this).call(this, pixel, e);
  50130. }
  50131. /**
  50132. * @function MapvRenderer.prototype.getContext
  50133. * @description 获取信息。
  50134. */
  50135. }, {
  50136. key: "getContext",
  50137. value: function getContext() {
  50138. return this.canvas.getContext(this.context);
  50139. }
  50140. /**
  50141. * @function MapvRenderer.prototype.addData
  50142. * @description 添加数据。
  50143. * @param {Object} data - 待添加的数据。
  50144. * @param {Object} options - 待添加的数据信息。
  50145. */
  50146. }, {
  50147. key: "addData",
  50148. value: function addData(data, options) {
  50149. var _data = data;
  50150. if (data && data.get) {
  50151. _data = data.get();
  50152. }
  50153. this.dataSet.add(_data);
  50154. this.update({
  50155. options: options
  50156. });
  50157. }
  50158. /**
  50159. * @function MapvRenderer.prototype.update
  50160. * @description 更新图层。
  50161. * @param {Object} opt - 待更新的数据。
  50162. * @param {Object} opt.data - mapv 数据集。
  50163. * @param {Object} opt.options - mapv 绘制参数。
  50164. */
  50165. }, {
  50166. key: "update",
  50167. value: function update(opt) {
  50168. var update = opt || {};
  50169. var _data = update.data;
  50170. if (_data && _data.get) {
  50171. _data = _data.get();
  50172. }
  50173. if (_data != undefined) {
  50174. this.dataSet.set(_data);
  50175. }
  50176. MapvRenderer_get(MapvRenderer_getPrototypeOf(MapvRenderer.prototype), "update", this).call(this, {
  50177. options: update.options
  50178. });
  50179. }
  50180. /**
  50181. * @function MapvRenderer.prototype.getData
  50182. * @description 获取数据。
  50183. */
  50184. }, {
  50185. key: "getData",
  50186. value: function getData() {
  50187. return this.dataSet;
  50188. }
  50189. /**
  50190. * @function MapvRenderer.prototype.removeData
  50191. * @description 删除符合过滤条件的数据。
  50192. * @param {function} [filter] - 过滤条件。条件参数为数据项,返回值为true,表示删除该元素;否则表示不删除。
  50193. */
  50194. }, {
  50195. key: "removeData",
  50196. value: function removeData(_filter) {
  50197. if (!this.dataSet) {
  50198. return;
  50199. }
  50200. var newData = this.dataSet.get({
  50201. filter: function filter(data) {
  50202. return _filter != null && typeof _filter === 'function' ? !_filter(data) : true;
  50203. }
  50204. });
  50205. this.dataSet.set(newData);
  50206. this.update({
  50207. options: null
  50208. });
  50209. }
  50210. /**
  50211. * @function MapVRenderer.prototype.clearData
  50212. * @description 清除数据。
  50213. */
  50214. }, {
  50215. key: "clearData",
  50216. value: function clearData() {
  50217. this.dataSet && this.dataSet.clear();
  50218. this.update({
  50219. options: null
  50220. });
  50221. }
  50222. /**
  50223. * @function MapVRenderer.prototype.updateData
  50224. * @param {Object} dataSet - 数据集。
  50225. * @param {Object} options - 数据项配置。
  50226. * @description 更新数据。
  50227. */
  50228. }, {
  50229. key: "updateData",
  50230. value: function updateData(dataSet, options) {
  50231. if (dataSet && dataSet.get) {
  50232. this.dataSet.set(dataSet.get());
  50233. }
  50234. this.update({
  50235. options: options
  50236. });
  50237. }
  50238. }, {
  50239. key: "_createCanvas",
  50240. value: function _createCanvas(id, mapElement) {
  50241. var _mapElement$style = mapElement.style,
  50242. width = _mapElement$style.width,
  50243. height = _mapElement$style.height;
  50244. var canvas = document.createElement('canvas');
  50245. canvas.style.position = 'absolute';
  50246. canvas.style.top = '0px';
  50247. canvas.style.left = '0px';
  50248. canvas.id = id;
  50249. var global$2 = typeof window === 'undefined' ? {} : window;
  50250. var devicePixelRatio = this.devicePixelRatio = global$2.devicePixelRatio || 1;
  50251. canvas.width = parseInt(width) * devicePixelRatio;
  50252. canvas.height = parseInt(height) * devicePixelRatio;
  50253. if (!this.options.context || this.options.context == '2d') {
  50254. canvas.getContext('2d').scale(devicePixelRatio, devicePixelRatio);
  50255. }
  50256. canvas.style.width = width;
  50257. canvas.style.height = height;
  50258. return canvas;
  50259. }
  50260. }, {
  50261. key: "_canvasUpdate",
  50262. value: function _canvasUpdate(time) {
  50263. if (this.stopAniamation) {
  50264. return;
  50265. }
  50266. var self = this;
  50267. var animationOptions = self.options.animation;
  50268. var context = this.getContext();
  50269. if (self.isEnabledTime()) {
  50270. if (time === undefined) {
  50271. this.clear(context);
  50272. return;
  50273. }
  50274. if (this.context === '2d') {
  50275. context.save();
  50276. context.globalCompositeOperation = 'destination-out';
  50277. context.fillStyle = 'rgba(0, 0, 0, .1)';
  50278. context.fillRect(0, 0, context.canvas.width, context.canvas.height);
  50279. context.restore();
  50280. }
  50281. } else {
  50282. this.clear(context);
  50283. }
  50284. if (this.context === '2d') {
  50285. for (var key in self.options) {
  50286. context[key] = self.options[key];
  50287. }
  50288. } else {
  50289. context.clear(context.COLOR_BUFFER_BIT);
  50290. }
  50291. if (!this.validZoom()) {
  50292. return;
  50293. }
  50294. var dataGetOptions = {
  50295. transferCoordinate: this.transferCoordinate()
  50296. };
  50297. var zoomUnit = this.getResolution();
  50298. if (time !== undefined) {
  50299. dataGetOptions.filter = function (item) {
  50300. var trails = animationOptions.trails || 10;
  50301. return time && item.time > time - trails && item.time < time;
  50302. };
  50303. }
  50304. var data = self.dataSet.get(dataGetOptions);
  50305. this.processData(data);
  50306. // 兼容unit为'm'的情况
  50307. if (self.options.unit === 'm') {
  50308. if (self.options.size) {
  50309. self.options._size = self.options.size / zoomUnit;
  50310. }
  50311. if (self.options.width) {
  50312. self.options._width = self.options.width / zoomUnit;
  50313. }
  50314. if (self.options.height) {
  50315. self.options._height = self.options.height / zoomUnit;
  50316. }
  50317. } else {
  50318. self.options._size = self.options.size;
  50319. self.options._height = self.options.height;
  50320. self.options._width = self.options.width;
  50321. }
  50322. var worldPoint = this.getCenterPixel();
  50323. this.drawContext(context, data, self.options, worldPoint);
  50324. self.options.updateCallback && self.options.updateCallback(time);
  50325. }
  50326. }, {
  50327. key: "init",
  50328. value: function init(options) {
  50329. var self = this;
  50330. self.options = options;
  50331. this.initDataRange(options);
  50332. this.context = self.options.context || '2d';
  50333. if (self.options.zIndex) {
  50334. this.setZIndex(self.options.zIndex);
  50335. }
  50336. this.initAnimator();
  50337. }
  50338. /**
  50339. * @function MapVRenderer.prototype.destroy
  50340. * @description 释放资源。
  50341. */
  50342. }, {
  50343. key: "destroy",
  50344. value: function destroy() {
  50345. this.targetElement.removeChild(this.canvas);
  50346. this.clearData();
  50347. this.animator && this.animator.stop();
  50348. this.animator = null;
  50349. }
  50350. /**
  50351. * @function MapvRenderer.prototype.addAnimatorEvent
  50352. * @description 添加动画事件。
  50353. */
  50354. }, {
  50355. key: "addAnimatorEvent",
  50356. value: function addAnimatorEvent() {}
  50357. }, {
  50358. key: "moveEndEvent",
  50359. value: function moveEndEvent() {
  50360. this.stopAniamation = false;
  50361. this._canvasUpdate();
  50362. }
  50363. /**
  50364. * @function MapvRenderer.prototype.draw
  50365. * @description 渲染绘制。
  50366. */
  50367. }, {
  50368. key: "draw",
  50369. value: function draw() {
  50370. this._canvasUpdate();
  50371. }
  50372. }, {
  50373. key: "visible",
  50374. value: function visible() {
  50375. return this.isShow;
  50376. }
  50377. }, {
  50378. key: "hide",
  50379. value: function hide() {
  50380. this.isShow = false;
  50381. this.canvas.style.display = 'none';
  50382. }
  50383. }, {
  50384. key: "show",
  50385. value: function show() {
  50386. this.isShow = true;
  50387. this.canvas.style.display = 'block';
  50388. }
  50389. }, {
  50390. key: "setZIndex",
  50391. value: function setZIndex(z) {
  50392. this.canvas.style.zIndex = z;
  50393. }
  50394. /**
  50395. * @function MapvRenderer.prototype.clear
  50396. * @param {Object} context - 当前环境。
  50397. * @description 清除环境。
  50398. */
  50399. }, {
  50400. key: "clear",
  50401. value: function clear(context) {
  50402. context && context.clearRect && context.clearRect(0, 0, parseInt(this.map.getCanvas().style.width), parseInt(this.map.getCanvas().style.height));
  50403. }
  50404. }]);
  50405. return MapvRenderer;
  50406. }(BaseLayer);
  50407. ;// CONCATENATED MODULE: ./src/common/util/MapCalculateUtil.js
  50408. /**
  50409. * @function getMeterPerMapUnit
  50410. * @description 单位换算,把米|度|千米|英寸|英尺换成米。
  50411. * @category BaseTypes Util
  50412. * @param {string} mapUnit 地图单位。
  50413. * @returns {number} 返回地图的距离单位。
  50414. * @usage
  50415. * ```
  50416. * // 浏览器
  50417. * <script type="text/javascript" src="{cdn}"></script>
  50418. * <script>
  50419. * const result = {namespace}.getMeterPerMapUnit(mapUnit);
  50420. *
  50421. * </script>
  50422. *
  50423. * // ES6 Import
  50424. * import { getMeterPerMapUnit } from '{npm}';
  50425. *
  50426. * const result = getMeterPerMapUnit(mapUnit);
  50427. * ```
  50428. */
  50429. var getMeterPerMapUnit = function getMeterPerMapUnit(mapUnit) {
  50430. var earchRadiusInMeters = 6378137;
  50431. var meterPerMapUnit;
  50432. if (mapUnit === Unit.METER) {
  50433. meterPerMapUnit = 1;
  50434. } else if (mapUnit === Unit.DEGREE) {
  50435. // 每度表示多少米。
  50436. meterPerMapUnit = Math.PI * 2 * earchRadiusInMeters / 360;
  50437. } else if (mapUnit === Unit.KILOMETER) {
  50438. meterPerMapUnit = 1.0e-3;
  50439. } else if (mapUnit === Unit.INCH) {
  50440. meterPerMapUnit = 1 / 2.5399999918e-2;
  50441. } else if (mapUnit === Unit.FOOT) {
  50442. meterPerMapUnit = 0.3048;
  50443. } else {
  50444. return meterPerMapUnit;
  50445. }
  50446. return meterPerMapUnit;
  50447. };
  50448. /**
  50449. * @function getWrapNum
  50450. * @description 获取该坐标系的经纬度范围的经度或纬度。
  50451. * @category BaseTypes Util
  50452. * @param {number} x 经度或纬度。
  50453. * @param {boolean} includeMax 是否获取经度或纬度的最大值。
  50454. * @param {boolean} includeMin 是否获取经度或纬度的最小值。
  50455. * @param {number} range 坐标系的经纬度范围。
  50456. * @returns {number} 返回经度或纬度的值。
  50457. * @usage
  50458. * ```
  50459. * // 浏览器
  50460. * <script type="text/javascript" src="{cdn}"></script>
  50461. * <script>
  50462. * const result = {namespace}.getWrapNum(x, includeMax, includeMin, range);
  50463. *
  50464. * </script>
  50465. *
  50466. * // ES6 Import
  50467. * import { getWrapNum } from '{npm}';
  50468. *
  50469. * const result = getWrapNum(x, includeMax, includeMin, range);
  50470. * ```
  50471. */
  50472. function getWrapNum(x) {
  50473. var includeMax = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  50474. var includeMin = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  50475. var range = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [-180, 180];
  50476. var max = range[1],
  50477. min = range[0],
  50478. d = max - min;
  50479. if (x === max && includeMax) {
  50480. return x;
  50481. }
  50482. if (x === min && includeMin) {
  50483. return x;
  50484. }
  50485. var tmp = ((x - min) % d + d) % d;
  50486. if (tmp === 0 && includeMax) {
  50487. return max;
  50488. }
  50489. return ((x - min) % d + d) % d + min;
  50490. }
  50491. /**
  50492. * @function conversionDegree
  50493. * @description 转换经纬度。
  50494. * @category BaseTypes Util
  50495. * @param {number} degrees 经度或纬度。
  50496. * @returns {string} 返回度分秒。
  50497. * @usage
  50498. * ```
  50499. * // 浏览器
  50500. * <script type="text/javascript" src="{cdn}"></script>
  50501. * <script>
  50502. * const result = {namespace}.conversionDegree(degrees);
  50503. *
  50504. * </script>
  50505. *
  50506. * // ES6 Import
  50507. * import { conversionDegree } from '{npm}';
  50508. *
  50509. * const result = conversionDegree(degrees);
  50510. * ```
  50511. */
  50512. function conversionDegree(degrees) {
  50513. var degree = parseInt(degrees);
  50514. var fraction = parseInt((degrees - degree) * 60);
  50515. var second = parseInt(((degrees - degree) * 60 - fraction) * 60);
  50516. fraction = parseInt(fraction / 10) === 0 ? "0".concat(fraction) : fraction;
  50517. second = parseInt(second / 10) === 0 ? "0".concat(second) : second;
  50518. return "".concat(degree, "\xB0").concat(fraction, "'").concat(second);
  50519. }
  50520. /**
  50521. * @function scalesToResolutions
  50522. * @description 通过比例尺数组计算分辨率数组,没有传入比例尺数组时通过地图范围与地图最大级别进行计算。
  50523. * @version 11.0.1
  50524. * @param {Array} scales - 比例尺数组。
  50525. * @param {Object} bounds - 地图范围。
  50526. * @param {number} dpi - 屏幕分辨率。
  50527. * @param {string} mapUnit - 地图单位。
  50528. * @param {number} [level=22] - 地图最大级别。
  50529. * @returns {number} 分辨率。
  50530. * @usage
  50531. * ```
  50532. * // 浏览器
  50533. * <script type="text/javascript" src="{cdn}"></script>
  50534. * <script>
  50535. * const result = {namespace}.scalesToResolutions(scales, bounds, dpi, mapUnit);
  50536. *
  50537. * </script>
  50538. *
  50539. * // ES6 Import
  50540. * import { scalesToResolutions } from '{npm}';
  50541. *
  50542. * const result = scalesToResolutions(scales, bounds, dpi, mapUnit);
  50543. * ```
  50544. */
  50545. function scalesToResolutions(scales, bounds, dpi, mapUnit) {
  50546. var level = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 22;
  50547. var resolutions = [];
  50548. if (scales && scales.length > 0) {
  50549. for (var i = 0; i < scales.length; i++) {
  50550. resolutions.push(scaleToResolution(scales[i], dpi, mapUnit));
  50551. }
  50552. } else {
  50553. var maxReolution = Math.abs(bounds.left - bounds.right) / 256;
  50554. for (var _i2 = 0; _i2 < level; _i2++) {
  50555. resolutions.push(maxReolution / Math.pow(2, _i2));
  50556. }
  50557. }
  50558. return resolutions.sort(function (a, b) {
  50559. return b - a;
  50560. });
  50561. }
  50562. /**
  50563. * @function getZoomByResolution
  50564. * @description 通过分辨率获取地图级别。
  50565. * @version 11.0.1
  50566. * @param {number} resolution - 分辨率。
  50567. * @param {Array} resolutions - 分辨率数组。
  50568. * @returns {number} 地图级别。
  50569. * @usage
  50570. * ```
  50571. * // 浏览器
  50572. * <script type="text/javascript" src="{cdn}"></script>
  50573. * <script>
  50574. * const result = {namespace}.getZoomByResolution(resolution, resolutions);
  50575. *
  50576. * </script>
  50577. *
  50578. * // ES6 Import
  50579. * import { getZoomByResolution } from '{npm}';
  50580. *
  50581. * const result = getZoomByResolution(resolution, resolutions);
  50582. * ```
  50583. */
  50584. function getZoomByResolution(resolution, resolutions) {
  50585. var zoom = 0;
  50586. var minDistance;
  50587. for (var i = 0; i < resolutions.length; i++) {
  50588. if (i === 0) {
  50589. minDistance = Math.abs(resolution - resolutions[i]);
  50590. }
  50591. if (minDistance > Math.abs(resolution - resolutions[i])) {
  50592. minDistance = Math.abs(resolution - resolutions[i]);
  50593. zoom = i;
  50594. }
  50595. }
  50596. return zoom;
  50597. }
  50598. /**
  50599. * @function scaleToResolution
  50600. * @description 通过比例尺计算分辨率。
  50601. * @version 11.0.1
  50602. * @param {number} scale - 比例尺。
  50603. * @param {number} dpi - 屏幕分辨率。
  50604. * @param {string} mapUnit - 地图单位。
  50605. * @returns {number} 分辨率。
  50606. * @usage
  50607. * ```
  50608. * // 浏览器
  50609. * <script type="text/javascript" src="{cdn}"></script>
  50610. * <script>
  50611. * const result = {namespace}.scaleToResolution(scale, dpi, mapUnit);
  50612. *
  50613. * </script>
  50614. *
  50615. * // ES6 Import
  50616. * import { scaleToResolution } from '{npm}';
  50617. *
  50618. * const result = scaleToResolution(scale, dpi, mapUnit);
  50619. * ```
  50620. */
  50621. function scaleToResolution(scale, dpi, mapUnit) {
  50622. var inchPerMeter = 1 / 0.0254;
  50623. var meterPerMapUnitValue = getMeterPerMapUnit(mapUnit);
  50624. var resolution = 1 / (scale * dpi * inchPerMeter * meterPerMapUnitValue);
  50625. return resolution;
  50626. }
  50627. /**
  50628. * 范围是否相交
  50629. * @param {Array} extent1 范围1
  50630. * @param {Array} extent2 范围2
  50631. * @return {boolean} 范围是否相交。
  50632. */
  50633. function intersects(extent1, extent2) {
  50634. return extent1[0] <= extent2[2] && extent1[2] >= extent2[0] && extent1[1] <= extent2[3] && extent1[3] >= extent2[1];
  50635. }
  50636. /**
  50637. * 获取两个范围的交集
  50638. * @param {Array} extent1 Extent 1
  50639. * @param {Array} extent2 Extent 2
  50640. * @return {Array} 相交范围数组.
  50641. * @api
  50642. */
  50643. function getIntersection(extent1, extent2) {
  50644. var intersection = [];
  50645. if (intersects(extent1, extent2)) {
  50646. if (extent1[0] > extent2[0]) {
  50647. intersection[0] = extent1[0];
  50648. } else {
  50649. intersection[0] = extent2[0];
  50650. }
  50651. if (extent1[1] > extent2[1]) {
  50652. intersection[1] = extent1[1];
  50653. } else {
  50654. intersection[1] = extent2[1];
  50655. }
  50656. if (extent1[2] < extent2[2]) {
  50657. intersection[2] = extent1[2];
  50658. } else {
  50659. intersection[2] = extent2[2];
  50660. }
  50661. if (extent1[3] < extent2[3]) {
  50662. intersection[3] = extent1[3];
  50663. } else {
  50664. intersection[3] = extent2[3];
  50665. }
  50666. }
  50667. return intersection;
  50668. }
  50669. ;// CONCATENATED MODULE: ./src/maplibregl/overlay/MapvLayer.js
  50670. function MapvLayer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  50671. 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); } }
  50672. function MapvLayer_createClass(Constructor, protoProps, staticProps) { if (protoProps) MapvLayer_defineProperties(Constructor.prototype, protoProps); if (staticProps) MapvLayer_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  50673. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  50674. * This program are made available under the terms of the Apache License, Version 2.0
  50675. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  50676. /**
  50677. * @class MapvLayer
  50678. * @category Visualization MapV
  50679. * @classdesc Mapv 图层类。
  50680. * @version 11.1.0
  50681. * @modulecategory Overlay
  50682. * @param {maplibregl.Map} map - MapLibreGL Map 对象,将在下个版本弃用,请用 map.addLayer() 方法添加图层。
  50683. * @param {Mapv.DataSet} dataSet - MapV 图层数据集。
  50684. * @param {Object} options - Mapv 参数。
  50685. * @param {string} [options.layerID] - 图层 ID。默认使用 CommonUtil.createUniqueID("mapvLayer_") 创建专题图层 ID。
  50686. * @usage
  50687. */
  50688. var MapvLayer = /*#__PURE__*/function () {
  50689. function MapvLayer(dataSet, options) {
  50690. MapvLayer_classCallCheck(this, MapvLayer);
  50691. this.id = options.layerID ? options.layerID : Util_Util.createUniqueID('mapvLayer_');
  50692. delete options['layerID'];
  50693. this.options = options;
  50694. this.dataSet = dataSet;
  50695. this.type = 'custom';
  50696. this.isPitching = false;
  50697. this.pitchStartEvent = this._pitchStart.bind(this);
  50698. this.pitchEndEvent = this._pitchEnd.bind(this);
  50699. this.renderingMode = '3d';
  50700. this.context = this.options.context || '2d';
  50701. this.overlay = true;
  50702. }
  50703. /**
  50704. * @function MapvLayer.prototype.onAdd
  50705. * @description 添加该图层
  50706. */
  50707. MapvLayer_createClass(MapvLayer, [{
  50708. key: "onAdd",
  50709. value: function onAdd(map) {
  50710. this.map = map;
  50711. this.mapContainer = map.getCanvasContainer();
  50712. this.renderer = new MapvRenderer(map, this.dataSet, this.options, {
  50713. transferCoordinate: this._transferCoordinate,
  50714. getCenterPixel: this._getCenterPixel,
  50715. getResolution: this._getResolution,
  50716. validZoom: this._validZoom.bind(this)
  50717. }, {
  50718. id: this.id,
  50719. targetElement: this.mapContainer,
  50720. mapElement: this.map.getCanvas()
  50721. });
  50722. this.mapContainer.style.perspective = this.map.transform.cameraToCenterDistance + 'px';
  50723. this._bindEvent();
  50724. }
  50725. /**
  50726. * @function MapvLayer.prototype.onRemove
  50727. * @description 添加该图层
  50728. */
  50729. }, {
  50730. key: "onRemove",
  50731. value: function onRemove() {
  50732. this.renderer.destroy();
  50733. this._unbindEvent();
  50734. }
  50735. /**
  50736. * @function MapvLayer.prototype.render
  50737. * @description 添加该图层
  50738. */
  50739. }, {
  50740. key: "render",
  50741. value: function render() {
  50742. if (this.map.isZooming() || this.map.isRotating() || this.isPitching) {
  50743. this.renderer.visible() && this.renderer.hide();
  50744. return;
  50745. }
  50746. !this.renderer.visible() && this.renderer.show();
  50747. this.renderer.draw();
  50748. }
  50749. /**
  50750. * @function MapvLayer.prototype.hide
  50751. * @description 隐藏该图层
  50752. */
  50753. }, {
  50754. key: "hide",
  50755. value: function hide() {
  50756. this.renderer && this.renderer.hide();
  50757. return this;
  50758. }
  50759. /**
  50760. * @function MapvLayer.prototype.show
  50761. * @description 显示该图层
  50762. */
  50763. }, {
  50764. key: "show",
  50765. value: function show() {
  50766. this.renderer && this.renderer.show();
  50767. return this;
  50768. }
  50769. }, {
  50770. key: "_validZoom",
  50771. value: function _validZoom() {
  50772. var self = this;
  50773. if (self.options.minZoom && this.map.getZoom() < self.options.minZoom || self.options.maxZoom && this.map.getZoom() > self.options.maxZoom) {
  50774. return false;
  50775. }
  50776. return true;
  50777. }
  50778. }, {
  50779. key: "_transferCoordinate",
  50780. value: function _transferCoordinate() {
  50781. var map = this.map;
  50782. var bounds = map.getBounds(),
  50783. dw = bounds.getEast() - bounds.getWest(),
  50784. dh = bounds.getNorth() - bounds.getSouth();
  50785. var resolutionX = dw / this.map.getCanvas().getBoundingClientRect().width,
  50786. resolutionY = dh / this.map.getCanvas().getBoundingClientRect().height;
  50787. // 一个像素是多少米
  50788. var center = map.getCenter();
  50789. var centerPx = map.project(center);
  50790. var self = this;
  50791. return function (coordinate) {
  50792. if (map.transform.rotationMatrix || self.context === '2d') {
  50793. var worldPoint = map.project(new (external_maplibregl_default()).LngLat(coordinate[0], coordinate[1]));
  50794. return [worldPoint.x, worldPoint.y];
  50795. }
  50796. var pixel = [(coordinate[0] - center.lng) / resolutionX, (center.lat - coordinate[1]) / resolutionY];
  50797. return [pixel[0] + centerPx.x, pixel[1] + centerPx.y];
  50798. };
  50799. }
  50800. }, {
  50801. key: "_getResolution",
  50802. value: function _getResolution() {
  50803. var bounds = this.map.getBounds();
  50804. var dw = bounds.getEast() - bounds.getWest();
  50805. var rect = this.map.getCanvas().getBoundingClientRect();
  50806. var resolutionX = dw / rect.width;
  50807. // 一个像素是多少米
  50808. return getMeterPerMapUnit('DEGREE') * resolutionX;
  50809. }
  50810. }, {
  50811. key: "_getCenterPixel",
  50812. value: function _getCenterPixel() {
  50813. return this.map.project(new (external_maplibregl_default()).LngLat(0, 0));
  50814. }
  50815. /**
  50816. * @function MapvLayer.prototype.getTopLeft
  50817. * @description 获取左上的坐标。
  50818. */
  50819. }, {
  50820. key: "getTopLeft",
  50821. value: function getTopLeft() {
  50822. var map = this.map;
  50823. var topLeft;
  50824. if (map) {
  50825. var bounds = map.getBounds();
  50826. topLeft = bounds.getNorthWest();
  50827. }
  50828. return topLeft;
  50829. }
  50830. /**
  50831. * @function MapvLayer.prototype.addData
  50832. * @description 追加数据。
  50833. * @param {Object} data - 要追加的数据。
  50834. * @param {Object} options - 要追加的值。
  50835. */
  50836. }, {
  50837. key: "addData",
  50838. value: function addData(data, options) {
  50839. this.renderer.addData(data, options);
  50840. }
  50841. /**
  50842. * @function MapvLayer.prototype.update
  50843. * @description 更新图层。
  50844. * @param {Object} opt - 待更新的数据。
  50845. * @param {Object} opt.data - mapv 数据集。
  50846. * @param {Object} opt.options - mapv 绘制参数。
  50847. */
  50848. }, {
  50849. key: "update",
  50850. value: function update(opt) {
  50851. this.renderer.update(opt);
  50852. }
  50853. /**
  50854. * @function MapvLayer.prototype.getData
  50855. * @description 获取数据。
  50856. * @returns {Mapv.DataSet} mapv 数据集。
  50857. */
  50858. }, {
  50859. key: "getData",
  50860. value: function getData() {
  50861. if (this.renderer) {
  50862. this.dataSet = this.renderer.getData();
  50863. }
  50864. return this.dataSet;
  50865. }
  50866. /**
  50867. * @function MapvLayer.prototype.removeData
  50868. * @description 删除符合过滤条件的数据。
  50869. * @param {function} [filter] - 过滤条件。条件参数为数据项,返回值为 true,表示删除该元素;否则表示不删除。
  50870. * @example
  50871. * filter=function(data){
  50872. * if(data.id=="1"){
  50873. * return true
  50874. * }
  50875. * return false;
  50876. * }
  50877. */
  50878. }, {
  50879. key: "removeData",
  50880. value: function removeData(filter) {
  50881. this.renderer && this.renderer.removeData(filter);
  50882. }
  50883. /**
  50884. * @function MapvLayer.prototype.clearData
  50885. * @description 清除数据。
  50886. */
  50887. }, {
  50888. key: "clearData",
  50889. value: function clearData() {
  50890. this.renderer.clearData();
  50891. }
  50892. }, {
  50893. key: "_bindEvent",
  50894. value: function _bindEvent() {
  50895. var map = this.map;
  50896. map.on('pitchstart', this.pitchStartEvent);
  50897. map.on('pitchend', this.pitchEndEvent);
  50898. if (this.options.methods) {
  50899. if (this.options.methods.click) {
  50900. map.on('click', this.renderer.clickEvent);
  50901. }
  50902. if (this.options.methods.mousemove) {
  50903. map.on('mousemove', this.renderer.mousemoveEvent);
  50904. }
  50905. }
  50906. }
  50907. }, {
  50908. key: "_unbindEvent",
  50909. value: function _unbindEvent() {
  50910. var map = this.map;
  50911. map.off('pitchstart', this.pitchStartEvent);
  50912. map.off('pitchend', this.pitchEndEvent);
  50913. if (this.options.methods) {
  50914. if (this.options.methods.click) {
  50915. map.off('click', this.renderer.clickEvent);
  50916. }
  50917. if (this.options.methods.mousemove) {
  50918. map.off('mousemove', this.renderer.mousemoveEvent);
  50919. }
  50920. }
  50921. }
  50922. /**
  50923. * @function MapvLayer.prototype.setVisibility
  50924. * @description 设置图层可见性。
  50925. * @param {boolean} [visibility] - 是否显示图层(当前地图的 resolution 在最大最小 resolution 之间)。
  50926. */
  50927. }, {
  50928. key: "setVisibility",
  50929. value: function setVisibility(visibility) {
  50930. if (visibility !== this.visibility) {
  50931. this.visibility = visibility;
  50932. if (visibility) {
  50933. this.show();
  50934. } else {
  50935. this.hide();
  50936. }
  50937. }
  50938. }
  50939. /**
  50940. * @function MapvLayer.prototype.setZIndex
  50941. * @description 设置 canvas 层级。
  50942. * @param {number} zIndex - canvas 层级。
  50943. */
  50944. }, {
  50945. key: "setZIndex",
  50946. value: function setZIndex(z) {
  50947. this.renderer.setZIndex(z);
  50948. }
  50949. }, {
  50950. key: "_pitchStart",
  50951. value: function _pitchStart() {
  50952. this.isPitching = true;
  50953. }
  50954. }, {
  50955. key: "_pitchEnd",
  50956. value: function _pitchEnd() {
  50957. this.isPitching = false;
  50958. }
  50959. }]);
  50960. return MapvLayer;
  50961. }();
  50962. ;// CONCATENATED MODULE: external "function(){try{return THREE}catch(e){return {}}}()"
  50963. var external_function_try_return_THREE_catch_e_return_namespaceObject = function(){try{return THREE}catch(e){return {}}}();
  50964. ;// CONCATENATED MODULE: ./src/common/overlay/threejs/Transform.js
  50965. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  50966. * This program are made available under the terms of the Apache License, Version 2.0
  50967. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  50968. function wrap(source, min, max) {
  50969. if (source === max || source === min) {
  50970. return source;
  50971. }
  50972. var len = max - min;
  50973. return ((source - min) % len + len) % len + min;
  50974. }
  50975. function rad(angle) {
  50976. return angle * Math.PI / 180;
  50977. }
  50978. var Projection = {
  50979. R: 6378137,
  50980. minZoom: 0,
  50981. maxZoom: 22,
  50982. nativeMaxZoom: 19,
  50983. RAD: Math.PI / 180,
  50984. METERS_PER_DEGREE: 6378137 * Math.PI / 180,
  50985. MAX_LATITUDE: 85.0511287798,
  50986. project: function project(lngLat) {
  50987. var rad = this.RAD,
  50988. metersPerDegree = this.METERS_PER_DEGREE,
  50989. max = this.MAX_LATITUDE;
  50990. var ll = lngLat instanceof Array ? {
  50991. lng: lngLat[0],
  50992. lat: lngLat[1]
  50993. } : {
  50994. lng: lngLat.lng,
  50995. lat: lngLat.lat
  50996. };
  50997. var lng = ll.lng,
  50998. lat = Math.max(Math.min(max, ll.lat), -max);
  50999. var c;
  51000. if (lat === 0) {
  51001. c = 0;
  51002. } else {
  51003. c = Math.log(Math.tan((90 + lat) * rad / 2)) / rad;
  51004. }
  51005. return {
  51006. x: lng * metersPerDegree,
  51007. y: c * metersPerDegree
  51008. };
  51009. },
  51010. unproject: function unproject(point) {
  51011. var x = point.x,
  51012. y = point.y;
  51013. var rad = this.RAD,
  51014. metersPerDegree = this.METERS_PER_DEGREE;
  51015. var c;
  51016. if (y === 0) {
  51017. c = 0;
  51018. } else {
  51019. c = y / metersPerDegree;
  51020. c = (2 * Math.atan(Math.exp(c * rad)) - Math.PI / 2) / rad;
  51021. }
  51022. return {
  51023. lng: wrap(x / metersPerDegree, -180, 180),
  51024. lat: wrap(c, -this.MAX_LATITUDE, this.MAX_LATITUDE)
  51025. };
  51026. },
  51027. locate: function locate(lngLat, dx, dy) {
  51028. if (!lngLat) {
  51029. return null;
  51030. }
  51031. dx = !dx ? 0 : dx;
  51032. dy = !dy ? 0 : dy;
  51033. if (!dx && !dy) {
  51034. return lngLat;
  51035. }
  51036. var lng = lngLat.lng;
  51037. if (dx !== 0) {
  51038. var ndx = Math.abs(dx),
  51039. radLng = rad(lngLat.lng);
  51040. var sLng = 2 * Math.sqrt(Math.pow(Math.sin(ndx / (2 * this.R)), 2) / Math.pow(Math.cos(radLng), 2));
  51041. radLng = radLng + sLng * (ndx > 0 ? 1 : -1);
  51042. lng = wrap(radLng * 180 / Math.PI, -180, 180);
  51043. }
  51044. var lat = lngLat.lat;
  51045. if (dy !== 0) {
  51046. var ndy = Math.abs(dy),
  51047. radLat = rad(lngLat.lat);
  51048. var sLat = Math.sin(ndy / (2 * this.R)) * 2;
  51049. radLat = radLat + sLat * (ndy > 0 ? 1 : -1);
  51050. lat = wrap(radLat * 180 / Math.PI, -90, 90);
  51051. }
  51052. return {
  51053. lng: lng,
  51054. lat: lat
  51055. };
  51056. },
  51057. getResolution: function getResolution(zoom) {
  51058. if (!this.resolutions) {
  51059. var resolutions = [];
  51060. var d = 2 * 6378137 * Math.PI;
  51061. for (var i = 0; i <= this.maxZoom; i++) {
  51062. resolutions[i] = d / (256 * Math.pow(2, i));
  51063. }
  51064. this.resolutions = resolutions;
  51065. }
  51066. var z = zoom | 0,
  51067. length = this.resolutions.length;
  51068. z = z < 0 ? 0 : z > length - 1 ? length - 1 : z;
  51069. var res = this.resolutions[z];
  51070. if ((zoom | 0) !== zoom && z !== length - 1) {
  51071. var next = this.resolutions[z + 1];
  51072. return res + (next - res) * (zoom - z);
  51073. }
  51074. return res;
  51075. }
  51076. };
  51077. var Transform = {
  51078. matrix: [1, -1, 0, 0],
  51079. projection: Projection,
  51080. project: function project(lngLat) {
  51081. return this.projection.project(lngLat);
  51082. },
  51083. unproject: function unproject(point) {
  51084. return this.projection.unproject(point);
  51085. },
  51086. lngLatToPoint: function lngLatToPoint(lngLat, zoom) {
  51087. var pt = this.project(lngLat);
  51088. return this.transform(pt, this.projection.getResolution(zoom));
  51089. },
  51090. locate: function locate(lngLat, dx, dy) {
  51091. return this.projection.locate(lngLat, dx, dy);
  51092. },
  51093. transform: function transform(point, scale) {
  51094. return {
  51095. x: this.matrix[0] * (point.x - this.matrix[2]) / scale,
  51096. y: this.matrix[1] * (point.y - this.matrix[3]) / scale
  51097. };
  51098. }
  51099. };
  51100. ;// CONCATENATED MODULE: ./src/common/overlay/threejs/ThreeLayerRenderer.js
  51101. function ThreeLayerRenderer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  51102. function ThreeLayerRenderer_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  51103. function ThreeLayerRenderer_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThreeLayerRenderer_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThreeLayerRenderer_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  51104. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  51105. * This program are made available under the terms of the Apache License, Version 2.0
  51106. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  51107. /**
  51108. * reference and modification
  51109. * maptalks.three
  51110. * (https://github.com/maptalks/maptalks.three)
  51111. * Apache Licene 2.0
  51112. * thanks maptalks
  51113. */
  51114. var projection = Transform.projection;
  51115. var Color = external_function_try_return_THREE_catch_e_return_namespaceObject.Color,
  51116. Scene = external_function_try_return_THREE_catch_e_return_namespaceObject.Scene,
  51117. WebGLRenderer = external_function_try_return_THREE_catch_e_return_namespaceObject.WebGLRenderer,
  51118. PerspectiveCamera = external_function_try_return_THREE_catch_e_return_namespaceObject.PerspectiveCamera,
  51119. Vector3 = external_function_try_return_THREE_catch_e_return_namespaceObject.Vector3,
  51120. ThreeLayerRenderer_Shape = external_function_try_return_THREE_catch_e_return_namespaceObject.Shape,
  51121. Mesh = external_function_try_return_THREE_catch_e_return_namespaceObject.Mesh,
  51122. ExtrudeGeometry = external_function_try_return_THREE_catch_e_return_namespaceObject.ExtrudeGeometry;
  51123. var RADIAN = Math.PI / 180;
  51124. var ThreeLayerRenderer_frame = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || window.msRequestAnimationFrame;
  51125. var cancel = window.cancelAnimationFrame || window.mozCancelAnimationFrame || window.webkitCancelAnimationFrame || window.msCancelAnimationFrame;
  51126. /**
  51127. * @private
  51128. * @class ThreeLayerRenderer
  51129. * @category Visualization Three
  51130. * @classdesc Three 图层渲染器
  51131. * @param {ThreeLayer} layer - ThreeJs图层。
  51132. * @param {string} [renderer="gl"] - 图层渲染器,仅支持"gl"。'canvas'在v11.1.0后被弃用。
  51133. * @param {Object} options - threejs渲染器初始化参数对象。参数内容详见:
  51134. * [WebGLRenderer]{@link https://threejs.org/docs/index.html#api/renderers/WebGLRenderer}
  51135. *
  51136. */
  51137. var ThreeLayerRenderer = /*#__PURE__*/function () {
  51138. function ThreeLayerRenderer(layer, renderer, options) {
  51139. ThreeLayerRenderer_classCallCheck(this, ThreeLayerRenderer);
  51140. this._layer = layer;
  51141. this.renderer = renderer || "gl";
  51142. this.options = options;
  51143. }
  51144. ThreeLayerRenderer_createClass(ThreeLayerRenderer, [{
  51145. key: "setMap",
  51146. value: function setMap(map) {
  51147. this.map = map;
  51148. }
  51149. //开始渲染
  51150. }, {
  51151. key: "render",
  51152. value: function render() {
  51153. if (!this._layer) {
  51154. return;
  51155. }
  51156. this.prepare();
  51157. /**
  51158. * @event ThreeLayer#initialized
  51159. * @description three 初始化之后后触发。
  51160. */
  51161. this._layer.fire("initialized");
  51162. this._layer && this._layer.draw(this.context, this.scene, this.camera);
  51163. /**
  51164. * @event ThreeLayer#draw
  51165. * @description draw 绘制事件,调用提供给外部绘制的接口后触发。
  51166. */
  51167. this._layer.fire("draw");
  51168. this.renderScene();
  51169. }
  51170. }, {
  51171. key: "update",
  51172. value: function update() {
  51173. this.remove();
  51174. this.render();
  51175. }
  51176. //渲染场景(模型已经添加到图层)
  51177. }, {
  51178. key: "renderScene",
  51179. value: function renderScene() {
  51180. this.locationCamera();
  51181. this.animationFrame = this.renderFrame(function () {
  51182. this.animationFrame = null;
  51183. this.context && this.context.render(this.scene, this.camera);
  51184. }.bind(this));
  51185. }
  51186. }, {
  51187. key: "renderFrame",
  51188. value: function renderFrame(fn) {
  51189. var render = function render() {
  51190. fn && typeof fn === "function" && fn();
  51191. };
  51192. return ThreeLayerRenderer_frame(render);
  51193. }
  51194. }, {
  51195. key: "resize",
  51196. value: function resize() {
  51197. this._resetElementSize(this.container);
  51198. this._resetElementSize(this.canvas);
  51199. var width = this.canvas.width,
  51200. height = this.canvas.height;
  51201. var size = this.getMapSize();
  51202. this.camera.aspect = width / height;
  51203. this.camera.updateProjectionMatrix();
  51204. this.context.setSize(size.width, size.height);
  51205. this.renderScene();
  51206. }
  51207. //创建画布、初始化渲染器、初始化相机等
  51208. }, {
  51209. key: "prepare",
  51210. value: function prepare() {
  51211. if (!this.map) {
  51212. return new Error("map object is necessary");
  51213. }
  51214. if (!this.canvas) {
  51215. this._initContainer();
  51216. this._initThreeRenderer();
  51217. /**
  51218. * @event ThreeLayer#rendererinitialized
  51219. * @description rendererinitialized 事件,初始化 three 渲染器后触发。
  51220. */
  51221. this._layer.fire("rendererinitialized");
  51222. } else {
  51223. this.clear(this.context);
  51224. }
  51225. }
  51226. }, {
  51227. key: "getMapSize",
  51228. value: function getMapSize() {
  51229. var container = this.map.getContainer();
  51230. return {
  51231. width: container.clientWidth,
  51232. height: container.clientHeight
  51233. };
  51234. }
  51235. }, {
  51236. key: "cancelFrame",
  51237. value: function cancelFrame() {
  51238. if (this.animationFrame != null) {
  51239. cancel(this.animationFrame);
  51240. }
  51241. }
  51242. }, {
  51243. key: "remove",
  51244. value: function remove() {
  51245. if (this.animationFrame != null) {
  51246. cancel(this.animationFrame);
  51247. }
  51248. this.container.removeChild(this.canvas);
  51249. this.container.parentNode.removeChild(this.container);
  51250. this.context = null;
  51251. this.canvas = null;
  51252. this.container = null;
  51253. }
  51254. //清理画布内容
  51255. }, {
  51256. key: "clear",
  51257. value: function clear(context) {
  51258. context && context.clear && context.clear();
  51259. context && context.clearRect && context.clearRect(0, 0, context.canvas.width, context.canvas.height);
  51260. }
  51261. //计算缩放比例
  51262. }, {
  51263. key: "getScale",
  51264. value: function getScale(zoom) {
  51265. var map = this.map;
  51266. var z = zoom == null ? map.getZoom() : zoom;
  51267. var max = projection.getResolution(projection.nativeMaxZoom),
  51268. res = projection.getResolution(z);
  51269. return res / max;
  51270. }
  51271. }, {
  51272. key: "getCanvasContainer",
  51273. value: function getCanvasContainer() {
  51274. return this.container;
  51275. }
  51276. }, {
  51277. key: "getCanvas",
  51278. value: function getCanvas() {
  51279. return this.canvas;
  51280. }
  51281. //重新设置相机位置
  51282. }, {
  51283. key: "locationCamera",
  51284. value: function locationCamera() {
  51285. var map = this.map;
  51286. var size = this.getMapSize();
  51287. var scale = map.transform.zoomScale(projection.nativeMaxZoom - map.getZoom() - 1);
  51288. var fovRatio = Math.tan(map.transform.fov / 2 * RADIAN);
  51289. var camera = this.camera;
  51290. //倾斜时,相机位置低于Z轴
  51291. var pitch = map.getPitch() * RADIAN;
  51292. var pZ = -scale * size.height / 2 / fovRatio;
  51293. camera.position.z = pZ * Math.cos(pitch);
  51294. var centerPoint = Transform.lngLatToPoint(map.getCenter(), projection.nativeMaxZoom);
  51295. var distance = Math.sin(pitch) * pZ;
  51296. var bearing = map.getBearing() * RADIAN;
  51297. camera.position.x = centerPoint.x + distance * Math.sin(bearing);
  51298. camera.position.y = centerPoint.y - distance * Math.cos(bearing);
  51299. camera.up.set(Math.sin(bearing), -Math.cos(bearing), 0);
  51300. camera.lookAt(new external_function_try_return_THREE_catch_e_return_namespaceObject.Vector3(centerPoint.x, centerPoint.y, 0));
  51301. camera.updateProjectionMatrix();
  51302. }
  51303. /**
  51304. * @function ThreeLayerRenderer.prototype.toThreeShape
  51305. * @description 创建 threejs shape 对象。
  51306. * @param {Array} coordinates - 坐标点数组。
  51307. * @returns {THREE.Shape} threejs shape 对象。
  51308. */
  51309. }, {
  51310. key: "toThreeShape",
  51311. value: function toThreeShape(coordinates) {
  51312. var _this = this;
  51313. if (!coordinates) {
  51314. return null;
  51315. }
  51316. var center = this.getCoordinatesCenter(coordinates);
  51317. var centerPoint = this.lngLatToPosition(center);
  51318. var outer = coordinates.map(function (coords) {
  51319. return _this.lngLatToPosition({
  51320. lng: coords[0],
  51321. lat: coords[1]
  51322. }).sub(centerPoint);
  51323. });
  51324. return new ThreeLayerRenderer_Shape(outer);
  51325. }
  51326. /**
  51327. * @function ThreeLayerRenderer.prototype.toThreeMesh
  51328. * @description 创建 threejs Mesh 对象。将地理坐标转换成 threejs 3D 模型(适用于挤压模型,如城市建筑)。
  51329. * @param {Array.<Object>} coordinates - 坐标点数组。
  51330. * @param {number} amount - 高度。
  51331. * @param {THREE.Material} material - Threejs 材质对象。
  51332. * @param {boolean} [removeDuplicated] - 是否移除重复的坐标点。
  51333. * @returns {THREE.Mesh} threejs Mesh 对象。
  51334. */
  51335. }, {
  51336. key: "toThreeMesh",
  51337. value: function toThreeMesh(coordinates, amount, material, removeDuplicated) {
  51338. if (!coordinates) {
  51339. return null;
  51340. }
  51341. var coords = coordinates;
  51342. if (removeDuplicated) {
  51343. coords = this.removeDuplicatedCoordinates(coordinates);
  51344. }
  51345. var targetAmount = this.distanceToThreeVector3(amount, amount).x;
  51346. var shape = this.toThreeShape(coords);
  51347. var geometry = new ExtrudeGeometry(shape, {
  51348. 'amount': targetAmount,
  51349. 'bevelEnabled': true
  51350. });
  51351. var mesh = new Mesh(geometry, material);
  51352. var center = this.lngLatToPosition(this.getCoordinatesCenter(coords));
  51353. mesh.position.set(center.x, center.y, -targetAmount);
  51354. return mesh;
  51355. }
  51356. /**
  51357. * @function ThreeLayerRenderer.prototype.addObject
  51358. * @description 设置threejs 3D 对象的坐标(经纬度)。
  51359. * @param {THREE.Object3D} object3D - threejs 3D 对象及子类对象。
  51360. * @param {(Array.<number>|Object)} coordinate - 添加的 three 对象坐标(经纬度)。
  51361. * @returns {ThreeLayer} ThreeLayer的实例对象。
  51362. */
  51363. }, {
  51364. key: "addObject",
  51365. value: function addObject(object3D, coordinate) {
  51366. if (coordinate && object3D) {
  51367. this.setPosition(object3D, coordinate);
  51368. }
  51369. this.scene.add(object3D);
  51370. }
  51371. /**
  51372. * @function ThreeLayerRenderer.prototype.clearMesh
  51373. * @description 清除所有 threejs mesh 对象。
  51374. * @returns {ThreeLayer} ThreeLayer的实例对象。
  51375. */
  51376. }, {
  51377. key: "clearMesh",
  51378. value: function clearMesh() {
  51379. var scene = this.scene;
  51380. if (!scene) {
  51381. return this;
  51382. }
  51383. for (var i = scene.children.length - 1; i >= 0; i--) {
  51384. if (scene.children[i] instanceof external_function_try_return_THREE_catch_e_return_namespaceObject.Mesh) {
  51385. scene.remove(scene.children[i]);
  51386. }
  51387. }
  51388. return this;
  51389. }
  51390. /**
  51391. * @function ThreeLayerRenderer.prototype.clearAll
  51392. * @description 清除所有 threejs 对象。
  51393. * @param {boolean} clearCamera - 是否清除相机。
  51394. * @returns {ThreeLayer} ThreeLayer的实例对象。
  51395. */
  51396. }, {
  51397. key: "clearAll",
  51398. value: function clearAll(clearCamera) {
  51399. var scene = this.scene;
  51400. if (!scene) {
  51401. return this;
  51402. }
  51403. for (var i = scene.children.length - 1; i >= 0; i--) {
  51404. if (!clearCamera && scene.children[i] instanceof external_function_try_return_THREE_catch_e_return_namespaceObject.Camera) {
  51405. continue;
  51406. }
  51407. scene.remove(scene.children[i]);
  51408. }
  51409. return this;
  51410. }
  51411. /**
  51412. * @function ThreeLayerRenderer.prototype.setPosition
  51413. * @description 设置 threejs 3D 对象的坐标(经纬度)。
  51414. * @param {THREE.Object3D} object3D - threejs 3D 对象及子类对象。
  51415. * @param {(Array.<number>|Object)} coordinate - 添加的 three 对象坐标(经纬度)。
  51416. * @returns {ThreeLayer} ThreeLayer的实例对象。
  51417. */
  51418. }, {
  51419. key: "setPosition",
  51420. value: function setPosition(object3D, coordinate) {
  51421. if (!object3D || !coordinate) {
  51422. return this;
  51423. }
  51424. var pos = this.lngLatToPosition(coordinate);
  51425. object3D.position.set(pos.x, pos.y, pos.z);
  51426. return this;
  51427. }
  51428. /**
  51429. * @function ThreeLayerRenderer.prototype.lngLatToPosition
  51430. * @description 经纬度转threejs 3D 矢量对象。
  51431. * @param {(Array.<number>|Object)} lngLat - 经纬度坐标。
  51432. * @returns {THREE.Vector3} threejs 3D 矢量对象。
  51433. */
  51434. }, {
  51435. key: "lngLatToPosition",
  51436. value: function lngLatToPosition(lngLat) {
  51437. var zoom = Transform.projection.nativeMaxZoom;
  51438. var point = Transform.lngLatToPoint(lngLat, zoom);
  51439. return new Vector3(point.x, point.y, -0);
  51440. }
  51441. /**
  51442. * @function ThreeLayerRenderer.prototype.distanceToThreeVector3
  51443. * @description 计算距离指定坐标给定距离的新坐标的 threejs 3D 矢量对象。
  51444. * @param {number} x - x 轴距离,单位米。
  51445. * @param {number} y - y 轴距离,单位米。
  51446. * @param {(Array.<number>|Object)} lngLat - 源坐标。
  51447. * @returns {THREE.Vector3} 目标点的 threejs 3D 矢量对象。
  51448. */
  51449. }, {
  51450. key: "distanceToThreeVector3",
  51451. value: function distanceToThreeVector3(x, y, lngLat) {
  51452. var map = this.map;
  51453. var center = lngLat || map.getCenter(),
  51454. maxZoom = Transform.projection.nativeMaxZoom,
  51455. targetLngLat = Transform.locate(center, x, y);
  51456. var point1 = Transform.lngLatToPoint(center, maxZoom),
  51457. point2 = Transform.lngLatToPoint(targetLngLat, maxZoom);
  51458. var targetX = Math.abs(point2.x - point1.x) * Math.sign(x);
  51459. var targetY = Math.abs(point2.y - point1.y) * Math.sign(y);
  51460. return new Vector3(targetX, targetY, 0);
  51461. }
  51462. /**
  51463. * @function ThreeLayerRenderer.prototype.removeDuplicatedCoordinates
  51464. * @description 移除数组中的重复坐标。
  51465. * @param {(Array.<Array.<number>>)} coordinates - 坐标数组。
  51466. * @returns {(Array.<Array.<number>>)} 新的坐标数组。
  51467. */
  51468. }, {
  51469. key: "removeDuplicatedCoordinates",
  51470. value: function removeDuplicatedCoordinates(coordinates) {
  51471. function equals(point1, point2) {
  51472. return point1[0] === point2[0] && point1[1] === point2[1];
  51473. }
  51474. var coords = [].concat(coordinates);
  51475. var length = coords.length;
  51476. for (var i = length - 1; i >= 1; i--) {
  51477. if (equals(coords[i], coords[i - 1])) {
  51478. coords.splice(i, 1);
  51479. }
  51480. }
  51481. var isClose = equals(coords[0], coords[coords.length - 1]);
  51482. isClose && coords.splice(coords.length - 1, 1);
  51483. return coords;
  51484. }
  51485. /**
  51486. * @function ThreeLayerRenderer.prototype.getCoordinatesCenter
  51487. * @description 获取给定坐标数组的中心坐标。
  51488. * @param {(Array.<Array.<number>>)} coordinates - 坐标数组。
  51489. * @returns {Object} 包含经纬度的坐标对象。
  51490. */
  51491. // 提工具
  51492. }, {
  51493. key: "getCoordinatesCenter",
  51494. value: function getCoordinatesCenter(coordinates) {
  51495. var sumX = 0,
  51496. sumY = 0,
  51497. count = 0;
  51498. var i = 0,
  51499. len = coordinates.length;
  51500. for (; i < len; i++) {
  51501. if (coordinates[i]) {
  51502. sumX += coordinates[i][0];
  51503. sumY += coordinates[i][1];
  51504. count++;
  51505. }
  51506. }
  51507. return {
  51508. lng: sumX / count,
  51509. lat: sumY / count
  51510. };
  51511. }
  51512. }, {
  51513. key: "_initContainer",
  51514. value: function _initContainer() {
  51515. var canvas = this._createCanvas();
  51516. var container = this.container = document.createElement("div");
  51517. container.id = this._layer.id;
  51518. container.className = "threejs-wrapper";
  51519. container.style.position = "absolute";
  51520. container.style.left = "0px";
  51521. container.style.top = "0px";
  51522. container.style.overflow = "hidden";
  51523. this._resetElementSize(container);
  51524. container.appendChild(canvas);
  51525. var targetElement = this.map.getCanvasContainer();
  51526. targetElement.appendChild(container);
  51527. }
  51528. }, {
  51529. key: "_createCanvas",
  51530. value: function _createCanvas() {
  51531. if (this.canvas) {
  51532. return;
  51533. }
  51534. var canvas = this.canvas = document.createElement('canvas');
  51535. canvas.className = "threejs-overlay";
  51536. canvas.style.outline = "none";
  51537. this._resetElementSize(canvas);
  51538. return canvas;
  51539. }
  51540. }, {
  51541. key: "_resetElementSize",
  51542. value: function _resetElementSize(element) {
  51543. if (!element) {
  51544. return;
  51545. }
  51546. var size = this.getMapSize();
  51547. var dpr = window.devicePixelRatio ? window.devicePixelRatio : 1;
  51548. var width = dpr * size.width;
  51549. var height = dpr * size.height;
  51550. element.width = width;
  51551. element.height = height;
  51552. element.style.width = size.width + 'px';
  51553. element.style.height = size.height + 'px';
  51554. }
  51555. }, {
  51556. key: "_initThreeRenderer",
  51557. value: function _initThreeRenderer() {
  51558. var map = this.map;
  51559. var size = this.getMapSize();
  51560. var renderer = this.renderer || 'gl';
  51561. var context;
  51562. if (renderer === 'gl') {
  51563. context = new WebGLRenderer({
  51564. 'canvas': this.canvas,
  51565. 'alpha': true,
  51566. 'antialias': true,
  51567. 'preserveDrawingBuffer': true
  51568. }, this.options);
  51569. context.autoClear = true;
  51570. context.clear();
  51571. }
  51572. context.setClearColor(new Color(1, 1, 1), 0);
  51573. context.canvas = this.canvas;
  51574. this.context = context;
  51575. var fov = map.transform.fov;
  51576. var fovRatio = Math.tan(fov / 2 * RADIAN);
  51577. var maxScale = this.getScale(projection.minZoom) / this.getScale(projection.nativeMaxZoom);
  51578. var far = maxScale * size.height / 2 / fovRatio;
  51579. this.camera = new PerspectiveCamera(fov, size.width / size.height, 1, far);
  51580. this.scene = new Scene();
  51581. this.scene.add(this.camera);
  51582. }
  51583. }]);
  51584. return ThreeLayerRenderer;
  51585. }();
  51586. ;// CONCATENATED MODULE: ./src/maplibregl/overlay/ThreeLayer.js
  51587. function ThreeLayer_typeof(obj) { "@babel/helpers - typeof"; return ThreeLayer_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, ThreeLayer_typeof(obj); }
  51588. function ThreeLayer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  51589. function ThreeLayer_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  51590. function ThreeLayer_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThreeLayer_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThreeLayer_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  51591. function ThreeLayer_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) ThreeLayer_setPrototypeOf(subClass, superClass); }
  51592. function ThreeLayer_setPrototypeOf(o, p) { ThreeLayer_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ThreeLayer_setPrototypeOf(o, p); }
  51593. function ThreeLayer_createSuper(Derived) { var hasNativeReflectConstruct = ThreeLayer_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = ThreeLayer_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = ThreeLayer_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return ThreeLayer_possibleConstructorReturn(this, result); }; }
  51594. function ThreeLayer_possibleConstructorReturn(self, call) { if (call && (ThreeLayer_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return ThreeLayer_assertThisInitialized(self); }
  51595. function ThreeLayer_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  51596. function ThreeLayer_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  51597. function ThreeLayer_getPrototypeOf(o) { ThreeLayer_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ThreeLayer_getPrototypeOf(o); }
  51598. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  51599. * This program are made available under the terms of the Apache License, Version 2.0
  51600. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  51601. /**
  51602. * reference and modification
  51603. * maptalks.three
  51604. * (https://github.com/maptalks/maptalks.three)
  51605. * Apache Licene 2.0
  51606. * thanks maptalks
  51607. */
  51608. /**
  51609. * @class ThreeLayer
  51610. * @category Visualization Three
  51611. * @classdesc Three 图层类。
  51612. * @version 11.1.0
  51613. * @modulecategory Overlay
  51614. * @param {string} id - 图层 ID。
  51615. * @param {string} [renderer="gl"] - 图层渲染器,仅支持"gl"。'canvas'在v11.1.0后被弃用。
  51616. * @param {Object} options - 初始化参数。
  51617. * @param {Object} options.threeOptions - threejs 渲染器初始化参数对象。参数内容详见:
  51618. * {@link THREE.WebGLRenderer}。
  51619. *
  51620. * @extends {maplibregl.Evented}
  51621. * @fires ThreeLayer#render
  51622. * @fires ThreeLayer#renderscene
  51623. * @example
  51624. * var threeLayer = new ThreeLayer('three');
  51625. * //模型绘制
  51626. * threeLayer.on("initialized", draw);
  51627. * threeLayer.addTo(map);
  51628. *
  51629. * function draw() {
  51630. * var scene=threeLayer.getScene();
  51631. * camera=threeLayer.getCamera();
  51632. * var light = new THREE.PointLight(0xffffff);
  51633. * camera.add(light);
  51634. * var material = new THREE.MeshPhongMaterial({color: 0xff0000});
  51635. * //根据坐标点转换成模型
  51636. * var mesh = this.toThreeMesh(feature.geometry.coordinates, 10, material, true);
  51637. * //模型添加到3D场景
  51638. * scene.add(mesh);
  51639. * }
  51640. *
  51641. * 叠加模型可以通过两种方式:</br>
  51642. * 1.调用 threeLayer.toThreeMesh 直接将地理坐标转换成 threejs 3D 模型(适用于挤压模型,如城市建筑),然后添加到 3D 场景
  51643. * 2.使用 ThreeJS 的接口创建好 Mesh,然后调用 threeLayer.setPosition 设置地理位置,然后添加到 3D 场景
  51644. *
  51645. * @usage
  51646. */
  51647. var ThreeLayer = /*#__PURE__*/function (_maplibregl$Evented) {
  51648. ThreeLayer_inherits(ThreeLayer, _maplibregl$Evented);
  51649. var _super = ThreeLayer_createSuper(ThreeLayer);
  51650. //options.threeOptions是初始化threejs renderer的参数对象
  51651. function ThreeLayer(id, renderer, options) {
  51652. var _this;
  51653. ThreeLayer_classCallCheck(this, ThreeLayer);
  51654. _this = _super.call(this);
  51655. _this.id = id;
  51656. _this.options = options;
  51657. _this.type = 'custom';
  51658. _this.renderingMode = '3d';
  51659. _this.overlay = true;
  51660. var threeOptions = options && options.threeOptions;
  51661. _this.renderer = new ThreeLayerRenderer(ThreeLayer_assertThisInitialized(_this), renderer, threeOptions);
  51662. return _this;
  51663. }
  51664. /**
  51665. * @function ThreeLayer.prototype.toThreeShape
  51666. * @description 创建 threejs shape 对象。
  51667. * @param {Array} coordinates - 坐标点数组。
  51668. * @returns {THREE.Shape} threejs shape 对象。
  51669. */
  51670. ThreeLayer_createClass(ThreeLayer, [{
  51671. key: "toThreeShape",
  51672. value: function toThreeShape(coordinates) {
  51673. return this.renderer.toThreeShape(coordinates);
  51674. }
  51675. /**
  51676. * @function ThreeLayer.prototype.toThreeMesh
  51677. * @description 创建 threejs Mesh 对象。将地理坐标转换成 threejs 3D 模型(适用于挤压模型,如城市建筑)。
  51678. * @param {Array.<Object>} coordinates - 坐标点数组。
  51679. * @param {number} amount - 高度。
  51680. * @param {THREE.Material} material - Threejs 材质对象。
  51681. * @param {boolean} [removeDuplicated] - 是否移除重复的坐标点。
  51682. * @returns {THREE.Mesh} threejs Mesh 对象。
  51683. */
  51684. }, {
  51685. key: "toThreeMesh",
  51686. value: function toThreeMesh(coordinates, amount, material, removeDuplicated) {
  51687. return this.renderer.toThreeMesh(coordinates, amount, material, removeDuplicated);
  51688. }
  51689. /**
  51690. * @function ThreeLayer.prototype.addObject
  51691. * @description 设置threejs 3D 对象的坐标(经纬度)。
  51692. * @param {THREE.Object3D} object3D - threejs 3D 对象及子类对象。
  51693. * @param {(Array.<number>|Object)} coordinate - 添加的 three 对象坐标(经纬度)。
  51694. * @returns {ThreeLayer} ThreeLayer的实例对象。
  51695. */
  51696. }, {
  51697. key: "addObject",
  51698. value: function addObject(object3D, coordinate) {
  51699. this.renderer && this.renderer.addObject(object3D, coordinate);
  51700. }
  51701. /**
  51702. * @function ThreeLayer.prototype.getScene
  51703. * @description 获取 threejs 场景对象。
  51704. * @returns {THREE.Scene} threejs 场景对象。
  51705. */
  51706. }, {
  51707. key: "getScene",
  51708. value: function getScene() {
  51709. return this.renderer.scene;
  51710. }
  51711. /**
  51712. * @function ThreeLayer.prototype.getCamera
  51713. * @description 获取 threejs 相机。
  51714. * @returns {THREE.Camera} threejs 相机。
  51715. */
  51716. }, {
  51717. key: "getCamera",
  51718. value: function getCamera() {
  51719. return this.renderer.camera;
  51720. }
  51721. /**
  51722. * @function ThreeLayer.prototype.getThreeRenderer
  51723. * @description 获取 threejs renderer。
  51724. * @returns {THREE.WebGLRenderer} threejs renderer。
  51725. */
  51726. }, {
  51727. key: "getThreeRenderer",
  51728. value: function getThreeRenderer() {
  51729. return this.renderer.context;
  51730. }
  51731. /**
  51732. * @function ThreeLayer.prototype.clearMesh
  51733. * @description 清除所有 threejs mesh 对象。
  51734. * @returns {ThreeLayer} ThreeLayer的实例对象。
  51735. */
  51736. }, {
  51737. key: "clearMesh",
  51738. value: function clearMesh() {
  51739. this.renderer.clearMesh();
  51740. return this;
  51741. }
  51742. /**
  51743. * @function ThreeLayer.prototype.clearAll
  51744. * @description 清除所有 threejs 对象。
  51745. * @param {boolean} clearCamera - 是否清除相机。
  51746. * @returns {ThreeLayer} ThreeLayer的实例对象。
  51747. */
  51748. }, {
  51749. key: "clearAll",
  51750. value: function clearAll(clearCamera) {
  51751. this.renderer.clearAll(clearCamera);
  51752. return this;
  51753. }
  51754. /**
  51755. * @function ThreeLayer.prototype.setPosition
  51756. * @description 设置 threejs 3D 对象的坐标(经纬度)。
  51757. * @param {THREE.Object3D} object3D - threejs 3D 对象及子类对象。
  51758. * @param {(Array.<number>|Object)} coordinate - 添加的 three 对象坐标(经纬度)。
  51759. * @returns {ThreeLayer} ThreeLayer的实例对象。
  51760. */
  51761. }, {
  51762. key: "setPosition",
  51763. value: function setPosition(object3D, coordinate) {
  51764. return this.renderer.setPosition(object3D, coordinate);
  51765. }
  51766. /**
  51767. * @function ThreeLayer.prototype.lngLatToPosition
  51768. * @description 经纬度转threejs 3D 矢量对象。
  51769. * @param {(Array.<number>|Object)} lngLat - 经纬度坐标。
  51770. * @returns {THREE.Vector3} threejs 3D 矢量对象。
  51771. */
  51772. }, {
  51773. key: "lngLatToPosition",
  51774. value: function lngLatToPosition(lngLat) {
  51775. return this.renderer.lngLatToPosition(lngLat);
  51776. }
  51777. /**
  51778. * @function ThreeLayer.prototype.distanceToThreeVector3
  51779. * @description 计算距离指定坐标给定距离的新坐标的 threejs 3D 矢量对象。
  51780. * @param {number} x - x 轴距离,单位米。
  51781. * @param {number} y - y 轴距离,单位米。
  51782. * @param {(Array.<number>|Object)} lngLat - 源坐标。
  51783. * @returns {THREE.Vector3} 目标点的 threejs 3D 矢量对象。
  51784. */
  51785. }, {
  51786. key: "distanceToThreeVector3",
  51787. value: function distanceToThreeVector3(x, y, lngLat) {
  51788. var map = this._map;
  51789. var center = lngLat || map.getCenter();
  51790. return this.renderer.distanceToThreeVector3(x, y, center);
  51791. }
  51792. /**
  51793. * @function ThreeLayer.prototype.removeDuplicatedCoordinates
  51794. * @description 移除数组中的重复坐标。
  51795. * @param {(Array.<Array.<number>>)} coordinates - 坐标数组。
  51796. * @returns {(Array.<Array.<number>>)} 新的坐标数组。
  51797. */
  51798. }, {
  51799. key: "removeDuplicatedCoordinates",
  51800. value: function removeDuplicatedCoordinates(coordinates) {
  51801. return this.renderer.removeDuplicatedCoordinates(coordinates);
  51802. }
  51803. /**
  51804. * @function ThreeLayer.prototype.getCoordinatesCenter
  51805. * @description 获取给定坐标数组的中心坐标。
  51806. * @param {(Array.<Array.<number>>)} coordinates - 坐标数组。
  51807. * @returns {Object} 包含经纬度的坐标对象。
  51808. */
  51809. }, {
  51810. key: "getCoordinatesCenter",
  51811. value: function getCoordinatesCenter(coordinates) {
  51812. return this.renderer.getCoordinatesCenter(coordinates);
  51813. }
  51814. /**
  51815. * @function ThreeLayer.prototype.onAdd
  51816. * @description 添加图层到地图。
  51817. * @param {Object} map - 地图对象。
  51818. */
  51819. }, {
  51820. key: "onAdd",
  51821. value: function onAdd(map) {
  51822. var me = this;
  51823. me._map = map;
  51824. me.renderer.setMap(map);
  51825. me.renderer.render();
  51826. me.on('render', function () {
  51827. this.context && this.context.render(this.scene, this.camera);
  51828. }.bind(me.renderer));
  51829. return this;
  51830. }
  51831. /**
  51832. * @function ThreeLayer.prototype.addTo
  51833. * @deprecated
  51834. * @description 添加图层到地图。
  51835. * @param {Object} map - 地图对象。
  51836. * @returns {ThreeLayer} ThreeLayer的实例对象。
  51837. */
  51838. }, {
  51839. key: "addTo",
  51840. value: function addTo(map) {
  51841. map.addLayer(this);
  51842. return this;
  51843. }
  51844. /**
  51845. * @function ThreeLayer.prototype.render
  51846. */
  51847. }, {
  51848. key: "render",
  51849. value: function render() {
  51850. this._update();
  51851. }
  51852. /**
  51853. * @function ThreeLayer.prototype.getCanvasContainer
  51854. * @description 获取 three 图层容器。
  51855. * @returns {HTMLElement} three 图层的容器。
  51856. */
  51857. }, {
  51858. key: "getCanvasContainer",
  51859. value: function getCanvasContainer() {
  51860. return this.renderer.getCanvasContainer();
  51861. }
  51862. /**
  51863. * @function ThreeLayer.prototype.getCanvas
  51864. * @description 获取 three 图层画布。
  51865. * @returns {HTMLCanvasElement} three 图层画布。
  51866. */
  51867. }, {
  51868. key: "getCanvas",
  51869. value: function getCanvas() {
  51870. return this.renderer.getCanvas();
  51871. }
  51872. /**
  51873. * @function ThreeLayer.prototype.remove
  51874. * @description 移除图层。
  51875. */
  51876. }, {
  51877. key: "remove",
  51878. value: function remove() {
  51879. this.renderer.remove();
  51880. this._map = null;
  51881. }
  51882. /**
  51883. * @function ThreeLayer.prototype.draw
  51884. * @description 提供给外部的 threejs 模型绘制接口。
  51885. * @returns {ThreeLayer} ThreeLayer的实例对象。
  51886. * @example
  51887. * var threeLayer = new ThreeLayer('three');
  51888. * //可以通过重写 draw 实现模型绘制
  51889. * threeLayer.draw = function (gl, scene, camera) {
  51890. * //TODO 绘制操作
  51891. * }
  51892. * threeLayer.addTo(map);
  51893. */
  51894. }, {
  51895. key: "draw",
  51896. value: function draw() {
  51897. return this;
  51898. }
  51899. /**
  51900. * @function ThreeLayer.prototype.renderScene
  51901. * @description 渲染场景。
  51902. * @returns {ThreeLayer} ThreeLayer的实例对象。
  51903. */
  51904. }, {
  51905. key: "renderScene",
  51906. value: function renderScene() {
  51907. this.renderer.renderScene();
  51908. /**
  51909. * @event ThreeLayer#renderscene
  51910. * @description renderScene 事件,场景渲染后触发。
  51911. */
  51912. this.fire("renderscene");
  51913. return this;
  51914. }
  51915. }, {
  51916. key: "_resize",
  51917. value: function _resize() {
  51918. this.renderer.resize();
  51919. }
  51920. }, {
  51921. key: "_update",
  51922. value: function _update() {
  51923. /**
  51924. * @event ThreeLayer#render
  51925. * @description render 事件,地图渲染时(地图状态改变时)触发。
  51926. */
  51927. this.renderScene();
  51928. this.fire('render');
  51929. return this;
  51930. }
  51931. }]);
  51932. return ThreeLayer;
  51933. }((external_maplibregl_default()).Evented);
  51934. ;// CONCATENATED MODULE: ./src/common/overlay/deckgl/DeckglLayerBase.js
  51935. function DeckglLayerBase_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
  51936. function DeckglLayerBase_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? DeckglLayerBase_ownKeys(Object(source), !0).forEach(function (key) { DeckglLayerBase_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : DeckglLayerBase_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
  51937. function DeckglLayerBase_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
  51938. function DeckglLayerBase_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  51939. function DeckglLayerBase_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  51940. function DeckglLayerBase_createClass(Constructor, protoProps, staticProps) { if (protoProps) DeckglLayerBase_defineProperties(Constructor.prototype, protoProps); if (staticProps) DeckglLayerBase_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  51941. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  51942. * This program are made available under the terms of the Apache License, Version 2.0
  51943. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  51944. /**
  51945. * @class DeckglLayerBase
  51946. * @category Visualization DeckGL
  51947. * @classdesc Deckgl 高效率图层,该图图层为综合图层,通过该图层可创建 高效率点图层、路径图层(线图层)、高效率面图层、曲线图层、
  51948. * 正六边形图层(蜂巢图层)、网格图层,只需给定相依配置,因此,在创建图层之前,请仔细阅读参数配置。
  51949. * @param {string} layerTypeID - 高效率图层类型 ID,包括 "scatter-plot" 高效率点图层、"path-layer" 路径图层(线图层)、
  51950. * "polygon-layer" 高效率面图层、"arc-layer" 曲线图层、"hexagon-layer" 正六边形图层(蜂巢图层)、"screen-grid-layer" 网格图层。
  51951. *
  51952. * @param {Object} options - 图层配置项,包括以下参数:
  51953. * @param {Object} [options.layerId] - DeckglLayerBase 图层 Dom 元素 ID。默认使用 CommonUtil.createUniqueID("graphicLayer_" + this.layerTypeID + "_") 创建专题图层 ID。
  51954. * @param {Array.<GeoJSONObject>} options.data - 图层数据,支持 GeoJSON 规范数据类型。
  51955. * @param {Object} options.callback - deckgl 图层回调函数配置项。
  51956. * @param {Object} options.props - deckgl 图层配置项, 在该参数下配置图层配置项:
  51957. * @param {boolean} options.props.coverage - "hexagon-layer" 配置项:六边形半径乘数,介于0 - 1之间。六边形的最终半径通过覆盖半径计算。注意:覆盖范围不会影响分数的分配方式。分配方式的半径仅由半径属性确定;
  51958. * @param {boolean} options.props.hexagonAggregator - "hexagon-layer" 配置项:* @param {boolean}
  51959. * @param {Object} options.props.lightSettings - 光照配置项。
  51960. * @param {Array} options.props.lightSettings.lightsPosition - 光照配置项:指定为`[x,y,z]`的光在平面阵列中的位置`, 在一个平面阵列。长度应该是 `3 x numberOfLights`。
  51961. * @param {Array} options.props.lightSettings.lightsStrength - 光照配置项:平面阵列中指定为“[x,y]`的灯的强度。长度应该是`2 x numberOfLights`。
  51962. * @param {number} [options.props.lightSettings.numberOfLights=1] - 光照配置项:光照值,最大值为 `5`。
  51963. * @param {number} [options.props.lightSettings.coordinateSystem=COORDINATE_SYSTEM.LNGLAT] - 光照配置项:指定灯位置的坐标系。
  51964. * @param {number} [options.props.lightSettings.coordinateOrigin=[0, 0, 0]] - 光照配置项:指定灯位置的坐标原点。
  51965. * @param {number} [options.props.lightSettings.modelMatrix] - 光照配置项:光位置的变换矩阵。
  51966. * @param {number} [options.props.lightSettings.ambientRatio=0.4] - 光照配置项:光照的环境比例。
  51967. * @param {number} [options.props.lightSettings.diffuseRatio=0.6] - 光照配置项:光的漫反射率。
  51968. * @param {number} [options.props.lightSettings.specularRatio=0.8] - 光照配置项:光的镜面反射率。
  51969. * @param {number} [options.props.opacity=1] - 公共配置项:图层不透明度度。
  51970. * @param {boolean} [options.props.pickable=false] - 公共配置项:是否响应鼠标事件(鼠标点击,鼠标滑动)。
  51971. * @param {function} [options.props.autoHighlight=false] - 公共配置项:鼠标滑动高亮要素。
  51972. * @param {function} [options.props.highlightColor=[0, 0, 128, 128]] - 公共配置项:鼠标滑动高亮颜色。
  51973. * @param {function} [options.props.onClick] - 公共配置项:鼠标点击事件。
  51974. * @param {function} [options.props.onHover] - 公共配置项:鼠标滑动事件。
  51975. * @param {number} [options.props.radiusScale=1] - "scatter-plot" 配置项:散点半径比例。
  51976. * @param {boolean} [options.props.outline=false] - "scatter-plot" 配置项:是否边线显示。
  51977. * @param {number} [options.props.strokeWidth=1] - "scatter-plot" 配置项:边线宽度。
  51978. * @param {number} [options.props.radiusMinPixels=0] - "scatter-plot" 配置项:半径最小像素值。
  51979. * @param {number} [options.props.radiusMaxPixels=Number.MAX_SAFE_INTEGER] - "scatter-plot" 配置项:半径最大像素值。
  51980. * @param {boolean} [options.props.fp64=false] - "scatter-plot" 配置项:否应以高精度64位模式呈现图层。
  51981. * @param {number} [options.props.widthScale=1] - "path-layer" 配置项:线宽比例。
  51982. * @param {number} [options.props.widthMinPixels=0] - "path-layer" 配置项:线宽最小像素值。
  51983. * @param {number} [options.props.widthMaxPixels=Number.MAX_SAFE_INTEGER] - "path-layer" 配置项:线宽最大像素值。
  51984. * @param {boolean} [options.props.rounded=false] - "path-layer" 配置项:节点是否绘制为弧形。
  51985. * @param {number} [options.props.miterLimit=4] - "path-layer" 配置项:节点相对于线宽的最大范围,仅在 rounded 为 false 时有效;
  51986. * @param {boolean} [options.props.fp64=false] - "path-layer" 配置项:否应以高精度64位模式呈现图层。
  51987. * @param {boolean} [options.props.dashJustified=false] - "path-layer" 配置项:是否虚线形式显示,仅在 getDashArray() 回调函数被指定时有效。
  51988. * @param {boolean} [options.props.filled=true] - "polygon-layer" 配置项:是否填充面。
  51989. * @param {boolean} [options.props.stroked=true] - "polygon-layer" 配置项:是否绘制边线。
  51990. * @param {boolean} [options.props.extruded=false] - "polygon-layer" 配置项:是否拉伸建筑。
  51991. * @param {boolean} [options.props.wireframe=false] - "polygon-layer" 配置项:当面被拉伸为建筑时,是否描绘建筑物边线。
  51992. * @param {boolean} [options.props.elevationScale=1] - "polygon-layer" 配置项:海拔比例。
  51993. * @param {boolean} [options.props.lineWidthScale=1] - "polygon-layer" 配置项:线宽比例。
  51994. * @param {boolean} [options.props.lineWidthMinPixels=0] - "polygon-layer" 配置项:线宽最小像素值。
  51995. * @param {boolean} [options.props.lineWidthMaxPixels=Number.MAX_SAFE_INTEGER] - "polygon-layer" 配置项:线宽最大像素值。
  51996. * @param {boolean} [options.props.lineJointRounded=false] - "polygon-layer" 配置项:节点是否绘制为弧形。
  51997. * @param {boolean} [options.props.lineMiterLimit=4] - "polygon-layer" 配置项:节点相对于线宽的最大范围,仅在 lineJointRounded 为 false 时有效。
  51998. * @param {boolean} [options.props.lineDashJustified=false] - "polygon-layer" 配置项:是否虚线形式显示,仅在 getLineDashArray() 回调函数被指定时有效。
  51999. * @param {boolean} [options.props.fp64=false] - "polygon-layer" 配置项:否应以高精度64位模式呈现图层。
  52000. * @param {boolean} [options.props.fp64=false] - "arc-layer" 配置项:否应以高精度64位模式呈现图层。
  52001. * @param {boolean} [options.props.strokeWidth=1] - "arc-layer" 配置项:线宽。
  52002. * @param {boolean} [options.props.radius=1000] - "hexagon-layer" 配置项:六边形半径值。
  52003. * @param {boolean} [options.props.extruded=false] - "hexagon-layer" 配置项:是否拉伸要素。
  52004. * @param {boolean} [options.props.upperPercentile=100] - "hexagon-layer" 配置项:筛选箱并通过upperPercentile重新计算颜色。颜色值大于upperPercentile的六边形将被隐藏。
  52005. * @param {boolean} [options.props.elevationScale=1] - "hexagon-layer" 配置项:高程乘数,实际海拔高度由 elevationScale * getElevation(d)计算。 elevationScale是一个方便的属性,可以在不更新数据的情况下缩放所有六边形。
  52006. * @param {boolean} [options.props.colorDomain=false] - "hexagon-layer" 配置项:色阶。
  52007. * @param {boolean} [options.props.colorRange=[[255,255,178,255],[254,217,118,255],[254,178,76,255],[253,141,60,255],[240,59,32,255],[189,0,38,255]]] - "hexagon-layer" 配置项:色带。
  52008. * @usage
  52009. */
  52010. var DeckglLayerBase = /*#__PURE__*/function () {
  52011. function DeckglLayerBase(layerTypeID, options) {
  52012. DeckglLayerBase_classCallCheck(this, DeckglLayerBase);
  52013. /**
  52014. * @member {string} DeckglLayerBase.prototype.id
  52015. * @description 高效率点图层 ID。
  52016. */
  52017. this.layerTypeID = layerTypeID;
  52018. /**
  52019. * @member {Array.<Graphic>} DeckglLayerBase.prototype.graphics
  52020. * @description 点要素对象数组。
  52021. *
  52022. */
  52023. this.data = [].concat(options.data);
  52024. this.props = options.props ? options.props : {};
  52025. this.callback = options.callback ? options.callback : {};
  52026. this.id = options.layerId ? options.layerId : Util_Util.createUniqueID('graphicLayer_' + this.layerTypeID + '_');
  52027. }
  52028. /**
  52029. * @function DeckglLayerBase.prototype.onAdd
  52030. */
  52031. DeckglLayerBase_createClass(DeckglLayerBase, [{
  52032. key: "onAdd",
  52033. value: function onAdd() {}
  52034. /**
  52035. * @function DeckglLayerBase.prototype.render
  52036. */
  52037. }, {
  52038. key: "render",
  52039. value: function render() {}
  52040. /**
  52041. * @function DeckglLayerBase.prototype.setStyle
  52042. * @description 设置图层整体样式。
  52043. * @param {Object} styleOptions - 样式对象。
  52044. * @param {Array.<number>} [styleOptions.color=[0, 0, 0, 255]] - 点颜色。
  52045. * @param {number} [styleOptions.radius=10] - 点半径。
  52046. * @param {number} [styleOptions.opacity=0.8] - 不透明度。
  52047. * @param {Array.<number>} [styleOptions.highlightColor] - 高亮颜色,目前只支持 rgba 数组。
  52048. * @param {number} [styleOptions.radiusScale=1] - 点放大倍数。
  52049. * @param {number} [styleOptions.radiusMinPixels=0] - 半径最小值(像素)。
  52050. * @param {number} [styleOptions.radiusMaxPixels=Number.MAX_SAFE_INTEGER] - 半径最大值(像素)。
  52051. * @param {number} [styleOptions.strokeWidth=12] - 边框大小。
  52052. * @param {boolean} [styleOptions.outline=false] - 是否显示边框。
  52053. */
  52054. }, {
  52055. key: "setStyle",
  52056. value: function setStyle(styleOptions) {
  52057. Util_Util.extend(this.props, styleOptions);
  52058. this._createLayerByLayerTypeID();
  52059. this.update();
  52060. }
  52061. /**
  52062. * @function DeckglLayerBase.prototype.setData
  52063. * @description 设置绘制的点要素数据,会覆盖之前的所有要素。
  52064. * @param {Array.<Object>} data - 点要素对象数组。
  52065. */
  52066. }, {
  52067. key: "setData",
  52068. value: function setData(data) {
  52069. this.data = this.data || [];
  52070. this.data.length = 0;
  52071. var dataTemp = !Util_Util.isArray(data) ? [data] : [].concat(data);
  52072. //this.layer.props.data不能被重新赋值,只能在原数组上进行操作
  52073. if (!this.layer.props.data) {
  52074. this.layer.props.data = [];
  52075. }
  52076. this.layer.props.data.length = 0;
  52077. for (var i = 0; i < dataTemp.length; i++) {
  52078. this.layer.props.data.push(dataTemp[i]);
  52079. }
  52080. this.data = this.layer.props.data;
  52081. this.update();
  52082. }
  52083. /**
  52084. * @function DeckglLayerBase.prototype.addData
  52085. * @description 添加点要素,不会覆盖之前的要素。
  52086. * @param {Array.<Object>} data - 点要素对象数组。
  52087. */
  52088. }, {
  52089. key: "addData",
  52090. value: function addData(data) {
  52091. this.data = this.data || [];
  52092. var dataTemp = !Util_Util.isArray(data) ? [data] : [].concat(data);
  52093. //this.layer.props.data不能被重新赋值,只能在原数组上进行操作
  52094. if (!this.layer.props.data) {
  52095. this.layer.props.data = [];
  52096. }
  52097. for (var i = 0; i < dataTemp.length; i++) {
  52098. this.layer.props.data.push(dataTemp[i]);
  52099. }
  52100. this.update();
  52101. }
  52102. /**
  52103. * @function DeckglLayerBase.prototype.update
  52104. * @description 更新图层。
  52105. */
  52106. }, {
  52107. key: "update",
  52108. value: function update() {
  52109. if (this.layer.lifecycle !== 'Awaiting state') {
  52110. var changeFlags = {
  52111. dataChanged: true,
  52112. propsChanged: true,
  52113. viewportChanged: true,
  52114. updateTriggersChanged: true
  52115. };
  52116. this.layer.setChangeFlags(changeFlags);
  52117. }
  52118. this._draw();
  52119. }
  52120. /**
  52121. * @function DeckglLayerBase.prototype.clear
  52122. * @description 释放图层资源。
  52123. */
  52124. // todo 还有哪些资源应该被释放?
  52125. }, {
  52126. key: "clear",
  52127. value: function clear() {
  52128. this.removeData();
  52129. this.deckGL.finalize();
  52130. }
  52131. /**
  52132. * @function DeckglLayerBase.prototype.removeData
  52133. * @description 移除所有要素。
  52134. */
  52135. }, {
  52136. key: "removeData",
  52137. value: function removeData() {
  52138. this.data.length = 0;
  52139. if (this.layer.props.data) {
  52140. this.layer.props.data.length = 0;
  52141. }
  52142. this.update();
  52143. }
  52144. /**
  52145. * @function DeckglLayerBase.prototype.moveTo
  52146. * @description 将图层移动到某个图层之前。
  52147. * @param {string} layerID - 待插入的图层 ID。
  52148. * @param {boolean} [before=true] - 是否将本图层插入到图层 ID 为 layerID 的图层之前。
  52149. */
  52150. }, {
  52151. key: "moveTo",
  52152. value: function moveTo(layerID, before) {
  52153. var layer = document.getElementById(this.id);
  52154. before = before !== undefined ? before : true;
  52155. if (before) {
  52156. var beforeLayer = document.getElementById(layerID);
  52157. if (layer && beforeLayer) {
  52158. beforeLayer.parentNode.insertBefore(layer, beforeLayer);
  52159. }
  52160. return;
  52161. }
  52162. var nextLayer = document.getElementById(layerID);
  52163. if (layer) {
  52164. if (nextLayer.nextSibling) {
  52165. nextLayer.parentNode.insertBefore(layer, nextLayer.nextSibling);
  52166. return;
  52167. }
  52168. nextLayer.parentNode.appendChild(layer);
  52169. }
  52170. }
  52171. /**
  52172. * @function DeckglLayerBase.prototype.setVisibility
  52173. * @description 设置图层可见性。
  52174. * @param {boolean} [visibility] - 是否显示图层(当前地图的 resolution 在最大最小 resolution 之间)。
  52175. */
  52176. }, {
  52177. key: "setVisibility",
  52178. value: function setVisibility(visibility) {
  52179. if (this.canvas && visibility !== this.visibility) {
  52180. this.visibility = visibility;
  52181. this.canvas.style.display = visibility ? 'block' : 'none';
  52182. }
  52183. }
  52184. }, {
  52185. key: "_draw",
  52186. value: function _draw() {
  52187. var deckOptions = this._getState();
  52188. deckOptions.layers = [this.layer];
  52189. deckOptions.canvas = this.canvas;
  52190. this.deckGL.setProps(deckOptions);
  52191. }
  52192. }, {
  52193. key: "_getState",
  52194. value: function _getState() {
  52195. //获取地图信息构建state
  52196. var width = parseInt(this.canvas.style.width);
  52197. var height = parseInt(this.canvas.style.height);
  52198. var mapInfo = this.getMapInfo();
  52199. var mapViewport = DeckglLayerBase_objectSpread({
  52200. width: width,
  52201. height: height
  52202. }, mapInfo);
  52203. var state = {};
  52204. //克隆 mapViewport
  52205. for (var key in mapViewport) {
  52206. state[key] = mapViewport[key];
  52207. }
  52208. //克隆 props
  52209. for (var _key2 in this.props) {
  52210. state[_key2] = this.props[_key2];
  52211. }
  52212. if (this._isEPSG3857 && this._isEPSG3857()) {
  52213. state.coordinateSystem = this.coordinateSystem;
  52214. state.isGeographicCoordinateSystem = this.isGeographicCoordinateSystem;
  52215. } else {
  52216. state.coordinateSystem = 1;
  52217. state.isGeographicCoordinateSystem = false;
  52218. }
  52219. //更行数据
  52220. state.data = this.data;
  52221. return state;
  52222. }
  52223. /**
  52224. * @function DeckglLayerBase.prototype._createLayerByLayerTypeID
  52225. * @description 判别当前创建图层类型。
  52226. * @private
  52227. */
  52228. }, {
  52229. key: "_createLayerByLayerTypeID",
  52230. value: function _createLayerByLayerTypeID() {
  52231. //统一处理公共属性:
  52232. this.props.data = this.data;
  52233. this.props.isGeographicCoordinateSystem = this.isGeographicCoordinateSystem;
  52234. this.props.coordinateSystem = this.coordinateSystem;
  52235. //添加事件监听
  52236. this.props.pickable = Boolean(this.props.onClick) || Boolean(this.props.onHover);
  52237. //各类型各自从 defaultProps 取出相形的参数:
  52238. if (this.layerTypeID === 'scatter-plot') {
  52239. this.props.id = 'scatter-plot';
  52240. this._createScatterPlotLayer();
  52241. } else if (this.layerTypeID === 'path-layer') {
  52242. this.props.id = 'path-layer';
  52243. this._createPathLayer();
  52244. } else if (this.layerTypeID === 'polygon-layer') {
  52245. this.props.id = 'polygon-layer';
  52246. this._createPolygonLayer();
  52247. } else if (this.layerTypeID === 'arc-layer') {
  52248. this.props.id = 'arc-layer';
  52249. this._createArcLineLayer();
  52250. } else if (this.layerTypeID === 'hexagon-layer') {
  52251. this.props.id = 'hexagon-layer';
  52252. this._createHexagonLayer();
  52253. } else {
  52254. throw new Error(this.layerTypeID + ' does not support');
  52255. }
  52256. }
  52257. /**
  52258. * @description scatter-plot
  52259. * @private
  52260. */
  52261. }, {
  52262. key: "_createScatterPlotLayer",
  52263. value: function _createScatterPlotLayer() {
  52264. //处理回调
  52265. /* this.props.getPosition = this.callback.getPosition ? this.callback.getPosition : function (point) {
  52266. if (!point) {
  52267. return [0, 0, 0];
  52268. }
  52269. return point.geometry.coordinates;
  52270. };*/
  52271. var me = this;
  52272. this.props.getPosition = this.callback.getPosition ? this.callback.getPosition : function (point) {
  52273. if (!point) {
  52274. return [0, 0, 0];
  52275. }
  52276. var lngLat = point.getLngLat();
  52277. return lngLat && [lngLat.lng, lngLat.lat, 0];
  52278. };
  52279. if (this.callback.getColor) {
  52280. this.props.getColor = this.callback.getColor ? this.callback.getColor : function (point) {
  52281. var style = point && point.getStyle();
  52282. return style && style.color || me.props.color;
  52283. };
  52284. }
  52285. if (this.callback.getRadius) {
  52286. this.props.getRadius = this.callback.getRadius ? this.callback.getRadius : function (point) {
  52287. var style = point && point.getStyle();
  52288. return style && style.radius || me.props.radius;
  52289. };
  52290. }
  52291. if (this.props.color || this.props.radius) {
  52292. this.props.updateTriggers = {};
  52293. if (this.props.radius) {
  52294. this.props.updateTriggers.getRadius = [this.props.radius];
  52295. }
  52296. if (this.props.color) {
  52297. this.props.updateTriggers.getColor = [this.props.color];
  52298. }
  52299. }
  52300. this.layer = new window.DeckGL.ScatterplotLayer(this.props);
  52301. }
  52302. /**
  52303. * @description path-layer
  52304. * @private
  52305. */
  52306. }, {
  52307. key: "_createPathLayer",
  52308. value: function _createPathLayer() {
  52309. this.props.getPath = this.callback.getPath ? this.callback.getPath : function (feature) {
  52310. return feature.geometry.coordinates;
  52311. };
  52312. //以下几个函数也可走默认值
  52313. if (this.callback.getColor) {
  52314. this.props.getColor = this.callback.getColor;
  52315. }
  52316. if (this.callback.getWidth) {
  52317. this.props.getWidth = this.callback.getWidth;
  52318. }
  52319. if (this.callback.getDashArray) {
  52320. this.props.getDashArray = this.callback.getDashArray;
  52321. }
  52322. this.layer = new window.DeckGL.PathLayer(this.props);
  52323. }
  52324. /**
  52325. * @description polygon-layer
  52326. * @private
  52327. */
  52328. }, {
  52329. key: "_createPolygonLayer",
  52330. value: function _createPolygonLayer() {
  52331. this.props.getPolygon = this.callback.getPolygon ? this.callback.getPolygon : function (feature) {
  52332. return feature.geometry.coordinates;
  52333. };
  52334. //todo 思考下真的让用户配这么多回调么,或者先判断下数据属性里面有没有配置的属性值?
  52335. if (this.callback.getElevation) {
  52336. this.props.getElevation = this.callback.getElevation;
  52337. }
  52338. if (this.callback.getFillColor) {
  52339. this.props.getFillColor = this.callback.getFillColor;
  52340. }
  52341. if (this.callback.getLineColor) {
  52342. this.props.getLineColor = this.callback.getLineColor;
  52343. }
  52344. if (this.callback.getLineWidth) {
  52345. this.props.getLineWidth = this.callback.getLineWidth;
  52346. }
  52347. this.props.updateTriggers = {};
  52348. this.props.updateTriggers.getColor = this.props.color ? this.props.color : [0, 0, 128, 128];
  52349. this.layer = new window.DeckGL.PolygonLayer(this.props);
  52350. }
  52351. /**
  52352. * @description arc-layer
  52353. * @private
  52354. */
  52355. }, {
  52356. key: "_createArcLineLayer",
  52357. value: function _createArcLineLayer() {
  52358. //todo ArcLineLayer geojson coordinates数组中只能有一个线段
  52359. this.props.getSourcePosition = this.callback.getSourcePosition ? this.callback.getSourcePosition : function (feature) {
  52360. if (!feature) {
  52361. return [0, 0, 0];
  52362. }
  52363. return feature.geometry.coordinates[0];
  52364. };
  52365. this.props.getTargetPosition = this.callback.getTargetPosition ? this.callback.getTargetPosition : function (feature) {
  52366. if (!feature) {
  52367. return [0, 0, 0];
  52368. }
  52369. return feature.geometry.coordinates[1];
  52370. };
  52371. if (this.callback.getStrokeWidth) {
  52372. this.props.getStrokeWidth = this.callback.getStrokeWidth;
  52373. }
  52374. if (this.callback.getSourceColor) {
  52375. this.props.getSourceColor = this.callback.getSourceColor;
  52376. }
  52377. if (this.callback.getTargetColor) {
  52378. this.props.getTargetColor = this.callback.getTargetColor;
  52379. }
  52380. this.layer = new window.DeckGL.ArcLayer(this.props);
  52381. }
  52382. /**
  52383. * @description hexagon-layer
  52384. * @private
  52385. */
  52386. }, {
  52387. key: "_createHexagonLayer",
  52388. value: function _createHexagonLayer() {
  52389. this.props.getPosition = this.callback.getPosition ? this.callback.getPosition : function (feature) {
  52390. if (!feature) {
  52391. return [0, 0, 0];
  52392. }
  52393. return feature.geometry.coordinates;
  52394. };
  52395. if (this.callback.getColorValue) {
  52396. this.props.getColorValue = this.callback.getColorValue;
  52397. }
  52398. if (this.callback.getElevationValue) {
  52399. this.props.getElevationValue = this.callback.getElevationValue;
  52400. }
  52401. this.layer = new window.DeckGL.HexagonLayer(this.props);
  52402. }
  52403. }, {
  52404. key: "_initContainer",
  52405. value: function _initContainer(targetElement, mapElement) {
  52406. var _mapElement$style = mapElement.style,
  52407. width = _mapElement$style.width,
  52408. height = _mapElement$style.height;
  52409. this.canvas = this._createCanvas(width, height);
  52410. targetElement.appendChild(this.canvas);
  52411. }
  52412. }, {
  52413. key: "_createCanvas",
  52414. value: function _createCanvas(width, height) {
  52415. var canvas = document.createElement('canvas');
  52416. canvas.id = this.id;
  52417. canvas.style.position = 'absolute';
  52418. canvas.style.top = 0 + 'px';
  52419. canvas.style.left = 0 + 'px';
  52420. canvas.style.cursor = '';
  52421. canvas.width = parseInt(width);
  52422. canvas.height = parseInt(height);
  52423. canvas.style.width = width;
  52424. canvas.style.height = height;
  52425. return canvas;
  52426. }
  52427. }]);
  52428. return DeckglLayerBase;
  52429. }();
  52430. ;// CONCATENATED MODULE: ./src/maplibregl/overlay/DeckglLayer.js
  52431. function DeckglLayer_typeof(obj) { "@babel/helpers - typeof"; return DeckglLayer_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, DeckglLayer_typeof(obj); }
  52432. function DeckglLayer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  52433. function DeckglLayer_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  52434. function DeckglLayer_createClass(Constructor, protoProps, staticProps) { if (protoProps) DeckglLayer_defineProperties(Constructor.prototype, protoProps); if (staticProps) DeckglLayer_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  52435. function DeckglLayer_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) DeckglLayer_setPrototypeOf(subClass, superClass); }
  52436. function DeckglLayer_setPrototypeOf(o, p) { DeckglLayer_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return DeckglLayer_setPrototypeOf(o, p); }
  52437. function DeckglLayer_createSuper(Derived) { var hasNativeReflectConstruct = DeckglLayer_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = DeckglLayer_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = DeckglLayer_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return DeckglLayer_possibleConstructorReturn(this, result); }; }
  52438. function DeckglLayer_possibleConstructorReturn(self, call) { if (call && (DeckglLayer_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return DeckglLayer_assertThisInitialized(self); }
  52439. function DeckglLayer_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  52440. function DeckglLayer_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  52441. function DeckglLayer_getPrototypeOf(o) { DeckglLayer_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return DeckglLayer_getPrototypeOf(o); }
  52442. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  52443. * This program are made available under the terms of the Apache License, Version 2.0
  52444. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  52445. /**
  52446. * @class DeckglLayer
  52447. * @category Visualization DeckGL
  52448. * @classdesc Deckgl 高效率图层类。该图图层为综合图层,通过该图层可创建 高效率点图层、路径图层(线图层)、高效率面图层、曲线图层、
  52449. * 正六边形图层(蜂巢图层)、网格图层,只需给定相依配置,因此,在创建图层之前,请仔细阅读参数配置。
  52450. * @version 11.1.0
  52451. * @modulecategory Overlay
  52452. * @param {string} layerTypeID - 高效率图层类型 ID,包括 "scatter-plot" 高效率点图层、"path-layer" 路径图层(线图层)、
  52453. * "polygon-layer" 高效率面图层、"arc-layer" 曲线图层、"hexagon-layer" 正六边形图层(蜂巢图层)、"screen-grid-layer" 网格图层。
  52454. *
  52455. * @param {Object} options - 图层配置项,包括以下参数:
  52456. * @param {Object} [options.layerId] - DeckglLayer 图层 Dom 元素 ID。默认使用 CommonUtil.createUniqueID("graphicLayer_" + this.layerTypeID + "_") 创建专题图层 ID。
  52457. * @param {Array.<GeoJSONObject>} options.data - 图层数据,支持 GeoJSON 规范数据类型。
  52458. * @param {Object} options.callback - deckgl 图层回调函数配置项。
  52459. * @param {Object} options.props - deckgl 图层配置项, 在该参数下配置图层配置项:
  52460. * @param {boolean} options.props.coverage - "hexagon-layer" 配置项:六边形半径乘数,介于0 - 1之间。六边形的最终半径通过覆盖半径计算。注意:覆盖范围不会影响分数的分配方式。分配方式的半径仅由半径属性确定;
  52461. * @param {boolean} options.props.hexagonAggregator - "hexagon-layer" 配置项:* @param {boolean}
  52462. * @param {Object} options.props.lightSettings - 光照配置项。
  52463. * @param {Array} options.props.lightSettings.lightsPosition - 光照配置项:指定为`[x,y,z]`的光在平面阵列中的位置`, 在一个平面阵列。长度应该是 `3 x numberOfLights`。
  52464. * @param {Array} options.props.lightSettings.lightsStrength - 光照配置项:平面阵列中指定为“[x,y]`的灯的强度。长度应该是`2 x numberOfLights`。
  52465. * @param {number} [options.props.lightSettings.numberOfLights=1] - 光照配置项:光照值,最大值为 `5`。
  52466. * @param {number} [options.props.lightSettings.coordinateSystem=COORDINATE_SYSTEM.LNGLAT] - 光照配置项:指定灯位置的坐标系。
  52467. * @param {number} [options.props.lightSettings.coordinateOrigin=[0, 0, 0]] - 光照配置项:指定灯位置的坐标原点。
  52468. * @param {number} [options.props.lightSettings.modelMatrix] - 光照配置项:光位置的变换矩阵。
  52469. * @param {number} [options.props.lightSettings.ambientRatio=0.4] - 光照配置项:光照的环境比例。
  52470. * @param {number} [options.props.lightSettings.diffuseRatio=0.6] - 光照配置项:光的漫反射率。
  52471. * @param {number} [options.props.lightSettings.specularRatio=0.8] - 光照配置项:光的镜面反射率。
  52472. * @param {number} [options.props.opacity=1] - 公共配置项:图层不透明度度。
  52473. * @param {boolean} [options.props.pickable=false] - 公共配置项:是否响应鼠标事件(鼠标点击,鼠标滑动)。
  52474. * @param {function} [options.props.autoHighlight=false] - 公共配置项:鼠标滑动高亮要素。
  52475. * @param {function} [options.props.highlightColor=[0, 0, 128, 128]] - 公共配置项:鼠标滑动高亮颜色。
  52476. * @param {function} [options.props.onClick] - 公共配置项:鼠标点击事件。
  52477. * @param {function} [options.props.onHover] - 公共配置项:鼠标滑动事件。
  52478. * @param {number} [options.props.radiusScale=1] - "scatter-plot" 配置项:散点半径比例。
  52479. * @param {boolean} [options.props.outline=false] - "scatter-plot" 配置项:是否边线显示。
  52480. * @param {number} [options.props.strokeWidth=1] - "scatter-plot" 配置项:边线宽度。
  52481. * @param {number} [options.props.radiusMinPixels=0] - "scatter-plot" 配置项:半径最小像素值。
  52482. * @param {number} [options.props.radiusMaxPixels=Number.MAX_SAFE_INTEGER] - "scatter-plot" 配置项:半径最大像素值。
  52483. * @param {boolean} [options.props.fp64=false] - "scatter-plot" 配置项:否应以高精度64位模式呈现图层。
  52484. * @param {number} [options.props.widthScale=1] - "path-layer" 配置项:线宽比例。
  52485. * @param {number} [options.props.widthMinPixels=0] - "path-layer" 配置项:线宽最小像素值。
  52486. * @param {number} [options.props.widthMaxPixels=Number.MAX_SAFE_INTEGER] - "path-layer" 配置项:线宽最大像素值。
  52487. * @param {boolean} [options.props.rounded=false] - "path-layer" 配置项:节点是否绘制为弧形。
  52488. * @param {number} [options.props.miterLimit=4] - "path-layer" 配置项:节点相对于线宽的最大范围,仅在 rounded 为 false 时有效;
  52489. * @param {boolean} [options.props.fp64=false] - "path-layer" 配置项:否应以高精度64位模式呈现图层。
  52490. * @param {boolean} [options.props.dashJustified=false] - "path-layer" 配置项:是否虚线形式显示,仅在 getDashArray() 回调函数被指定时有效。
  52491. * @param {boolean} [options.props.filled=true] - "polygon-layer" 配置项:是否填充面。
  52492. * @param {boolean} [options.props.stroked=true] - "polygon-layer" 配置项:是否绘制边线。
  52493. * @param {boolean} [options.props.extruded=false] - "polygon-layer" 配置项:是否拉伸建筑。
  52494. * @param {boolean} [options.props.wireframe=false] - "polygon-layer" 配置项:当面被拉伸为建筑时,是否描绘建筑物边线。
  52495. * @param {boolean} [options.props.elevationScale=1] - "polygon-layer" 配置项:海拔比例。
  52496. * @param {boolean} [options.props.lineWidthScale=1] - "polygon-layer" 配置项:线宽比例。
  52497. * @param {boolean} [options.props.lineWidthMinPixels=0] - "polygon-layer" 配置项:线宽最小像素值。
  52498. * @param {boolean} [options.props.lineWidthMaxPixels=Number.MAX_SAFE_INTEGER] - "polygon-layer" 配置项:线宽最大像素值。
  52499. * @param {boolean} [options.props.lineJointRounded=false] - "polygon-layer" 配置项:节点是否绘制为弧形。
  52500. * @param {boolean} [options.props.lineMiterLimit=4] - "polygon-layer" 配置项:节点相对于线宽的最大范围,仅在 lineJointRounded 为 false 时有效。
  52501. * @param {boolean} [options.props.lineDashJustified=false] - "polygon-layer" 配置项:是否虚线形式显示,仅在 getLineDashArray() 回调函数被指定时有效。
  52502. * @param {boolean} [options.props.fp64=false] - "polygon-layer" 配置项:否应以高精度64位模式呈现图层。
  52503. * @param {boolean} [options.props.fp64=false] - "arc-layer" 配置项:否应以高精度64位模式呈现图层。
  52504. * @param {boolean} [options.props.strokeWidth=1] - "arc-layer" 配置项:线宽。
  52505. * @param {boolean} [options.props.radius=1000] - "hexagon-layer" 配置项:六边形半径值。
  52506. * @param {boolean} [options.props.extruded=false] - "hexagon-layer" 配置项:是否拉伸要素。
  52507. * @param {boolean} [options.props.upperPercentile=100] - "hexagon-layer" 配置项:筛选箱并通过upperPercentile重新计算颜色。颜色值大于upperPercentile的六边形将被隐藏。
  52508. * @param {boolean} [options.props.elevationScale=1] - "hexagon-layer" 配置项:高程乘数,实际海拔高度由 elevationScale * getElevation(d)计算。 elevationScale是一个方便的属性,可以在不更新数据的情况下缩放所有六边形。
  52509. * @param {boolean} [options.props.colorDomain=false] - "hexagon-layer" 配置项:色阶。
  52510. * @param {boolean} [options.props.colorRange=[[255,255,178,255],[254,217,118,255],[254,178,76,255],[253,141,60,255],[240,59,32,255],[189,0,38,255]]] - "hexagon-layer" 配置项:色带。
  52511. * @extends {DeckglLayerBase}
  52512. * @usage
  52513. */
  52514. var DeckglLayer = /*#__PURE__*/function (_DeckglLayerBase) {
  52515. DeckglLayer_inherits(DeckglLayer, _DeckglLayerBase);
  52516. var _super = DeckglLayer_createSuper(DeckglLayer);
  52517. function DeckglLayer(layerTypeID, options) {
  52518. var _this;
  52519. DeckglLayer_classCallCheck(this, DeckglLayer);
  52520. _this = _super.call(this, layerTypeID, options);
  52521. _this.type = 'custom';
  52522. _this.renderingMode = '3d';
  52523. _this.overlay = true;
  52524. return _this;
  52525. }
  52526. /**
  52527. * @function DeckglLayer.prototype.onAdd
  52528. * @param {maplibregl.Map} map - MapLibreGL Map 对象。
  52529. */
  52530. DeckglLayer_createClass(DeckglLayer, [{
  52531. key: "onAdd",
  52532. value: function onAdd(map) {
  52533. this.map = map;
  52534. if (this.canvas) {
  52535. this.mapContainer = this.map.getCanvasContainer();
  52536. return this;
  52537. }
  52538. if (this._isEPSG3857()) {
  52539. this.coordinateSystem = 3;
  52540. this.isGeographicCoordinateSystem = true;
  52541. } else {
  52542. this.coordinateSystem = 1;
  52543. this.isGeographicCoordinateSystem = false;
  52544. }
  52545. //创建图层容器
  52546. this._initContainer(this.map.getCanvasContainer(), this.map.getCanvas());
  52547. //创建 deckgl 图层
  52548. this._createLayerByLayerTypeID();
  52549. var mapState = this._getState();
  52550. var deckOptions = {};
  52551. for (var key in mapState) {
  52552. deckOptions[key] = mapState[key];
  52553. }
  52554. deckOptions.layers = [this.layer];
  52555. deckOptions.canvas = this.canvas;
  52556. this.deckGL = new window.DeckGL.experimental.DeckGLJS(deckOptions);
  52557. this._draw();
  52558. }
  52559. /**
  52560. * @function DeckglLayer.prototype.onRemove
  52561. */
  52562. }, {
  52563. key: "onRemove",
  52564. value: function onRemove() {
  52565. this.map.getCanvasContainer().removeChild(this.canvas);
  52566. this.clear();
  52567. }
  52568. }, {
  52569. key: "getMapInfo",
  52570. value: function getMapInfo() {
  52571. var center = this.map.getCenter();
  52572. var zoom = this.map.getZoom();
  52573. var maxZoom = this.map.getMaxZoom();
  52574. var pitch = this.map.getPitch();
  52575. var bearing = this.map.getBearing();
  52576. var longitude = center.lng;
  52577. var latitude = center.lat;
  52578. return {
  52579. center: center,
  52580. zoom: zoom,
  52581. maxZoom: maxZoom,
  52582. pitch: pitch,
  52583. bearing: bearing,
  52584. longitude: longitude,
  52585. latitude: latitude
  52586. };
  52587. }
  52588. /**
  52589. * @function DeckglLayer.prototype.render
  52590. */
  52591. }, {
  52592. key: "render",
  52593. value: function render() {
  52594. this._draw();
  52595. }
  52596. }, {
  52597. key: "_isEPSG3857",
  52598. value: function _isEPSG3857() {
  52599. return this.map.getCRS && this.map.getCRS() !== (external_maplibregl_default()).CRS.EPSG3857;
  52600. }
  52601. }]);
  52602. return DeckglLayer;
  52603. }(DeckglLayerBase);
  52604. ;// CONCATENATED MODULE: ./src/common/commontypes/geometry/GeoText.js
  52605. function GeoText_typeof(obj) { "@babel/helpers - typeof"; return GeoText_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, GeoText_typeof(obj); }
  52606. function GeoText_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  52607. function GeoText_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  52608. function GeoText_createClass(Constructor, protoProps, staticProps) { if (protoProps) GeoText_defineProperties(Constructor.prototype, protoProps); if (staticProps) GeoText_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  52609. function GeoText_get() { if (typeof Reflect !== "undefined" && Reflect.get) { GeoText_get = Reflect.get.bind(); } else { GeoText_get = function _get(target, property, receiver) { var base = GeoText_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return GeoText_get.apply(this, arguments); }
  52610. function GeoText_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GeoText_getPrototypeOf(object); if (object === null) break; } return object; }
  52611. function GeoText_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) GeoText_setPrototypeOf(subClass, superClass); }
  52612. function GeoText_setPrototypeOf(o, p) { GeoText_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GeoText_setPrototypeOf(o, p); }
  52613. function GeoText_createSuper(Derived) { var hasNativeReflectConstruct = GeoText_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = GeoText_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = GeoText_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return GeoText_possibleConstructorReturn(this, result); }; }
  52614. function GeoText_possibleConstructorReturn(self, call) { if (call && (GeoText_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return GeoText_assertThisInitialized(self); }
  52615. function GeoText_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  52616. function GeoText_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  52617. function GeoText_getPrototypeOf(o) { GeoText_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GeoText_getPrototypeOf(o); }
  52618. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  52619. * This program are made available under the terms of the Apache License, Version 2.0
  52620. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  52621. /**
  52622. * @class GeometryGeoText
  52623. * @aliasclass Geometry.GeoText
  52624. * @deprecatedclass SuperMap.Geometry.GeoText
  52625. * @classdesc 文本标签类。
  52626. * @category BaseTypes Geometry
  52627. * @extends {Geometry}
  52628. * @param {number} x - x 坐标。
  52629. * @param {number} y - y 坐标。
  52630. * @param {string} text - 标签中的文本内容。
  52631. * @usage
  52632. */
  52633. var GeoText = /*#__PURE__*/function (_Geometry) {
  52634. GeoText_inherits(GeoText, _Geometry);
  52635. var _super = GeoText_createSuper(GeoText);
  52636. function GeoText(x, y, text) {
  52637. var _this;
  52638. GeoText_classCallCheck(this, GeoText);
  52639. _this = _super.call(this, x, y, text);
  52640. /**
  52641. * @member {number} GeometryGeoText.prototype.x
  52642. * @description 横坐标。
  52643. */
  52644. _this.x = parseFloat(x);
  52645. /**
  52646. * @member {number} GeometryGeoText.prototype.y
  52647. * @description 纵坐标。
  52648. */
  52649. _this.y = parseFloat(y);
  52650. /**
  52651. * @member {string} GeometryGeoText.prototype.text
  52652. * @description 标签中的文本内容。
  52653. */
  52654. _this.text = text.toString();
  52655. /**
  52656. * @member {Object} GeometryGeoText.prototype.bsInfo
  52657. * @description 标签范围的基础信息。
  52658. * @property {number} w - bounds 的宽度。
  52659. * @property {number} h - bounds 的高度。
  52660. */
  52661. _this.bsInfo = {
  52662. "h": null,
  52663. "w": null
  52664. };
  52665. _this.element = document.createElement('span');
  52666. _this.CLASS_NAME = "SuperMap.Geometry.GeoText";
  52667. _this.geometryType = "GeoText";
  52668. return _this;
  52669. }
  52670. /**
  52671. * @function GeometryGeoText.prototype.destroy
  52672. * @description 销毁文本标签类。
  52673. */
  52674. GeoText_createClass(GeoText, [{
  52675. key: "destroy",
  52676. value: function destroy() {
  52677. GeoText_get(GeoText_getPrototypeOf(GeoText.prototype), "destroy", this).call(this);
  52678. this.x = null;
  52679. this.y = null;
  52680. this.text = null;
  52681. }
  52682. /**
  52683. * @function GeometryGeoText.prototype.getCentroid
  52684. * @description 获取标签对象的质心。
  52685. * @returns {GeometryPoint} 标签对象的质心。
  52686. */
  52687. }, {
  52688. key: "getCentroid",
  52689. value: function getCentroid() {
  52690. return new Point(this.x, this.y);
  52691. }
  52692. /**
  52693. * @function GeometryGeoText.prototype.clone
  52694. * @description 克隆标签对象。
  52695. * @returns {GeometryGeoText} 克隆后的标签对象。
  52696. */
  52697. }, {
  52698. key: "clone",
  52699. value: function clone(obj) {
  52700. if (obj == null) {
  52701. obj = new GeoText(this.x, this.y, this.text);
  52702. }
  52703. Util_Util.applyDefaults(obj, this);
  52704. return obj;
  52705. }
  52706. /**
  52707. * @function GeometryGeoText.prototype.calculateBounds
  52708. * @description 计算标签对象的范围。
  52709. */
  52710. }, {
  52711. key: "calculateBounds",
  52712. value: function calculateBounds() {
  52713. this.bounds = new Bounds(this.x, this.y, this.x, this.y);
  52714. }
  52715. /**
  52716. * @function GeometryGeoText.prototype.getLabelPxBoundsByLabel
  52717. * @description 根据绘制好的标签获取文字标签的像素范围,参数的单位是像素;此方法相对于 getLabelPxBoundsByText 效率较低,但支持所有格式的文本。
  52718. * @param {Object} locationPixel - 标签的位置点,该对象含有属性 x(横坐标),属性 y(纵坐标)。
  52719. * @param {string} labelWidth - 标签的宽度,如:“90px”。
  52720. * @param {string} labelHeight - 标签的高度。
  52721. * @param {Object} style - 标签的 style。
  52722. * @returns {Bounds} 标签的像素范围。
  52723. */
  52724. }, {
  52725. key: "getLabelPxBoundsByLabel",
  52726. value: function getLabelPxBoundsByLabel(locationPixel, labelWidth, labelHeight, style) {
  52727. var labelPxBounds, left, bottom, top, right;
  52728. var locationPx = Util_Util.cloneObject(locationPixel);
  52729. //计算文本行数
  52730. var theText = style.label || this.text;
  52731. var textRows = theText.split('\n');
  52732. var laberRows = textRows.length;
  52733. //处理文字对齐
  52734. labelWidth = parseFloat(labelWidth);
  52735. labelHeight = parseFloat(labelHeight);
  52736. if (laberRows > 1) {
  52737. labelHeight = parseFloat(labelHeight) * laberRows;
  52738. }
  52739. if (style.labelAlign && style.labelAlign !== "cm") {
  52740. switch (style.labelAlign) {
  52741. case "lt":
  52742. locationPx.x += labelWidth / 2;
  52743. locationPx.y += labelHeight / 2;
  52744. break;
  52745. case "lm":
  52746. locationPx.x += labelWidth / 2;
  52747. break;
  52748. case "lb":
  52749. locationPx.x += labelWidth / 2;
  52750. locationPx.y -= labelHeight / 2;
  52751. break;
  52752. case "ct":
  52753. locationPx.y += labelHeight / 2;
  52754. break;
  52755. case "cb":
  52756. locationPx.y -= labelHeight / 2;
  52757. break;
  52758. case "rt":
  52759. locationPx.x -= labelWidth / 2;
  52760. locationPx.y += labelHeight / 2;
  52761. break;
  52762. case "rm":
  52763. locationPx.x -= labelWidth / 2;
  52764. break;
  52765. case "rb":
  52766. locationPx.x -= labelWidth / 2;
  52767. locationPx.y -= labelHeight / 2;
  52768. break;
  52769. default:
  52770. break;
  52771. }
  52772. }
  52773. this.bsInfo.h = labelHeight;
  52774. this.bsInfo.w = labelWidth;
  52775. //bounds的四边
  52776. left = locationPx.x - parseFloat(labelWidth) / 2;
  52777. bottom = locationPx.y + parseFloat(labelHeight) / 2;
  52778. right = locationPx.x + parseFloat(labelWidth) / 2;
  52779. top = locationPx.y - parseFloat(labelHeight) / 2;
  52780. labelPxBounds = new Bounds(left, bottom, right, top);
  52781. return labelPxBounds;
  52782. }
  52783. /**
  52784. * @function GeometryGeoText.prototype.getLabelPxBoundsByText
  52785. * @description 根据文本内容获取文字标签的像素范围。
  52786. * @param {Object} locationPixel - 标签的位置点,该对象含有属性 x(横坐标),属性 y(纵坐标)。
  52787. * @param {Object} style - 标签的样式。
  52788. * @returns {Bounds} 标签的像素范围。
  52789. */
  52790. }, {
  52791. key: "getLabelPxBoundsByText",
  52792. value: function getLabelPxBoundsByText(locationPixel, style) {
  52793. var labelPxBounds, left, bottom, top, right;
  52794. var labelSize = this.getLabelPxSize(style);
  52795. var locationPx = Util_Util.cloneObject(locationPixel);
  52796. //处理文字对齐
  52797. if (style.labelAlign && style.labelAlign !== "cm") {
  52798. switch (style.labelAlign) {
  52799. case "lt":
  52800. locationPx.x += labelSize.w / 2;
  52801. locationPx.y += labelSize.h / 2;
  52802. break;
  52803. case "lm":
  52804. locationPx.x += labelSize.w / 2;
  52805. break;
  52806. case "lb":
  52807. locationPx.x += labelSize.w / 2;
  52808. locationPx.y -= labelSize.h / 2;
  52809. break;
  52810. case "ct":
  52811. locationPx.y += labelSize.h / 2;
  52812. break;
  52813. case "cb":
  52814. locationPx.y -= labelSize.h / 2;
  52815. break;
  52816. case "rt":
  52817. locationPx.x -= labelSize.w / 2;
  52818. locationPx.y += labelSize.h / 2;
  52819. break;
  52820. case "rm":
  52821. locationPx.x -= labelSize.w / 2;
  52822. break;
  52823. case "rb":
  52824. locationPx.x -= labelSize.w / 2;
  52825. locationPx.y -= labelSize.h / 2;
  52826. break;
  52827. default:
  52828. break;
  52829. }
  52830. }
  52831. this.bsInfo.h = labelSize.h;
  52832. this.bsInfo.w = labelSize.w;
  52833. left = locationPx.x - labelSize.w / 2;
  52834. bottom = locationPx.y + labelSize.h / 2;
  52835. //处理斜体字
  52836. if (style.fontStyle && style.fontStyle === "italic") {
  52837. right = locationPx.x + labelSize.w / 2 + parseInt(parseFloat(style.fontSize) / 2);
  52838. } else {
  52839. right = locationPx.x + labelSize.w / 2;
  52840. }
  52841. top = locationPx.y - labelSize.h / 2;
  52842. labelPxBounds = new Bounds(left, bottom, right, top);
  52843. return labelPxBounds;
  52844. }
  52845. /**
  52846. * @function GeometryGeoText.prototype.getLabelPxSize
  52847. * @description 获取 label 的像素大小。
  52848. * @param {Object} style - 标签样式。
  52849. * @returns {Object} 标签大小对象,属性 w 表示标签的宽度,属性 h 表示标签的高度。
  52850. */
  52851. }, {
  52852. key: "getLabelPxSize",
  52853. value: function getLabelPxSize(style) {
  52854. var text,
  52855. //文本内容
  52856. fontSize,
  52857. //字体大小
  52858. spacing = 1,
  52859. //两个字符间的间距(单位:px)
  52860. lineSpacing = 0.2,
  52861. bgstrokeWidth = parseFloat(style.strokeWidth); //标签背景框边框的宽度
  52862. text = style.label || this.text;
  52863. if (style.fontSize) {
  52864. fontSize = parseFloat(style.fontSize);
  52865. } else {
  52866. fontSize = parseFloat("12px");
  52867. }
  52868. //标签宽高
  52869. var labelW, labelH;
  52870. var textRows = text.split('\n');
  52871. var numRows = textRows.length;
  52872. if (numRows > 1) {
  52873. labelH = fontSize * numRows + numRows + bgstrokeWidth + lineSpacing * fontSize;
  52874. } else {
  52875. labelH = fontSize + bgstrokeWidth + lineSpacing * fontSize + 1;
  52876. }
  52877. //取最大宽度
  52878. labelW = 0;
  52879. if (this.labelWTmp && labelW < this.labelWTmp) {
  52880. labelW = this.labelWTmp;
  52881. }
  52882. for (var i = 0; i < numRows; i++) {
  52883. var textCharC = this.getTextCount(textRows[i]);
  52884. var labelWTmp = this.labelWTmp = Util_Util.getTextBounds(style, textRows[i], this.element).textWidth + textCharC.textC * spacing + bgstrokeWidth;
  52885. if (labelW < labelWTmp) {
  52886. labelW = labelWTmp;
  52887. }
  52888. }
  52889. var labelSize = new Object(); //标签大小
  52890. labelSize.h = labelH;
  52891. labelSize.w = labelW;
  52892. return labelSize;
  52893. }
  52894. /**
  52895. * @function GeometryGeoText.prototype.getTextCount
  52896. * @description 获取 text 中的字符个数。
  52897. * @param {string} text - 字符串。
  52898. * @returns {Object} 字符个数统计结果,属性 cnC 表示中文字符个数,属性 enC 表示英文字符个数,属性 textC 表示字符总个数。
  52899. */
  52900. }, {
  52901. key: "getTextCount",
  52902. value: function getTextCount(text) {
  52903. var textCharCount = {};
  52904. var cnCount = 0;
  52905. var enCount = 0;
  52906. for (var i = 0; i < text.length; i++) {
  52907. if (text.charCodeAt(i) > 255) {
  52908. //遍历判断字符串中每个字符的Unicode码,大于255则为中文
  52909. cnCount++;
  52910. } else {
  52911. enCount++;
  52912. }
  52913. }
  52914. //中午字符个数
  52915. textCharCount.cnC = cnCount;
  52916. //英文字符个数
  52917. textCharCount.enC = enCount;
  52918. //字符总个数
  52919. textCharCount.textC = text.length;
  52920. return textCharCount;
  52921. }
  52922. }]);
  52923. return GeoText;
  52924. }(Geometry_Geometry);
  52925. ;// CONCATENATED MODULE: ./src/common/iServer/ServerFeature.js
  52926. function ServerFeature_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  52927. function ServerFeature_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  52928. function ServerFeature_createClass(Constructor, protoProps, staticProps) { if (protoProps) ServerFeature_defineProperties(Constructor.prototype, protoProps); if (staticProps) ServerFeature_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  52929. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  52930. * This program are made available under the terms of the Apache License, Version 2.0
  52931. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  52932. /**
  52933. * @class ServerFeature
  52934. * @deprecatedclass SuperMap.ServerFeature
  52935. * @category iServer Data Feature
  52936. * @classdesc 服务端矢量要素类。该类描述了服务端返回的矢量要素的相关信息,包括字段和几何信息。
  52937. * @param {ServerGeometry} geometry - 矢量要素的几何信息。
  52938. * @param {Object} options - 参数。
  52939. * @param {Array.<string>} [options.fieldNames] - 矢量要素的属性字段名集合。
  52940. * @param {Array.<string>} [options.fieldValues] - 矢量要素的属性字段值集合。
  52941. * @usage
  52942. */
  52943. var ServerFeature = /*#__PURE__*/function () {
  52944. function ServerFeature(options) {
  52945. ServerFeature_classCallCheck(this, ServerFeature);
  52946. /**
  52947. * @member {Array.<string>} [ServerFeature.prototype.fieldNames]
  52948. * @description 矢量要素的属性字段名集合。
  52949. */
  52950. this.fieldNames = null;
  52951. /**
  52952. * @member {Array.<string>} [ServerFeature.prototype.fieldValues]
  52953. * @description 矢量要素的属性字段值集合。
  52954. */
  52955. this.fieldValues = null;
  52956. /**
  52957. * @member {ServerGeometry} ServerFeature.prototype.geometry
  52958. * @description 矢量要素的几何信息。
  52959. */
  52960. this.geometry = null;
  52961. if (options) {
  52962. Util_Util.extend(this, options);
  52963. }
  52964. this.CLASS_NAME = "SuperMap.ServerFeature";
  52965. }
  52966. /**
  52967. * @function ServerFeature.prototype.destroy
  52968. * @description 释放资源,将引用资源的属性置空。
  52969. */
  52970. ServerFeature_createClass(ServerFeature, [{
  52971. key: "destroy",
  52972. value: function destroy() {
  52973. var me = this;
  52974. me.fieldNames = null;
  52975. me.fieldValues = null;
  52976. if (me.geometry) {
  52977. me.geometry.destroy();
  52978. me.geometry = null;
  52979. }
  52980. }
  52981. /**
  52982. * @function ServerFeature.prototype.toFeature
  52983. * @description 将服务端矢量要素 ServerFeature 转换为客户端矢量要素 Feature。
  52984. * @returns {Vector} 转换后的客户端矢量要素。
  52985. */
  52986. }, {
  52987. key: "toFeature",
  52988. value: function toFeature() {
  52989. var names,
  52990. values,
  52991. geo,
  52992. attr = {},
  52993. me = this,
  52994. feature;
  52995. names = me.fieldNames;
  52996. values = me.fieldValues;
  52997. for (var i in names) {
  52998. attr[names[i]] = values[i];
  52999. }
  53000. if (me.geometry) {
  53001. geo = me.geometry.toGeometry();
  53002. }
  53003. feature = new Vector(geo, attr);
  53004. if (me.geometry && me.geometry.id) {
  53005. feature.fid = me.geometry.id;
  53006. }
  53007. return feature;
  53008. }
  53009. /**
  53010. * @function ServerFeature.prototype.fromJson
  53011. * @description 将 JSON 对象表示服务端矢量要素转换为 ServerFeature。
  53012. * @param {Object} jsonObject - 要转换的 JSON 对象。
  53013. * @returns {ServerFeature} 转化后的 ServerFeature 对象。
  53014. */
  53015. }], [{
  53016. key: "fromJson",
  53017. value: function fromJson(jsonObject) {
  53018. var geo = null;
  53019. if (!jsonObject) {
  53020. return;
  53021. }
  53022. geo = jsonObject.geometry;
  53023. if (geo) {
  53024. geo = ServerGeometry.fromJson(geo);
  53025. }
  53026. return new ServerFeature({
  53027. fieldNames: jsonObject.fieldNames,
  53028. fieldValues: jsonObject.fieldValues,
  53029. geometry: geo
  53030. });
  53031. }
  53032. }]);
  53033. return ServerFeature;
  53034. }();
  53035. ;// CONCATENATED MODULE: ./src/common/overlay/heatmap/HeatMapLayerRenderer.js
  53036. function HeatMapLayerRenderer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  53037. function HeatMapLayerRenderer_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  53038. function HeatMapLayerRenderer_createClass(Constructor, protoProps, staticProps) { if (protoProps) HeatMapLayerRenderer_defineProperties(Constructor.prototype, protoProps); if (staticProps) HeatMapLayerRenderer_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  53039. /**
  53040. * @private
  53041. * @class HeatMapLayerRenderer
  53042. * @classdesc 热力图层渲染器类。
  53043. * @category Visualization HeatMap
  53044. * @param {string} name - 图层名称。
  53045. * @param {Object} options - 构造参数。
  53046. * @param {string} options.featureWeight - 对应 feature 属性中的热点权重字段名称,权重值类型为 float。
  53047. * @param {string} [options.id] - 专题图层ID。默认使用 CommonUtil.createUniqueID("HeatMapLayer_") 创建专题图层 ID。
  53048. * @param {number} [options.radius=50] - 热点渲染的最大半径(热点像素半径),单位为 px,当 useGeoUnit参数 为 true 时,单位使用当前图层地理坐标单位。热点显示的时候以精确点为中心点开始往四周辐射衰减,其衰减半径和权重值成比列。
  53049. * @param {boolean} [options.loadWhileAnimating=true] - 是否实时重绘。(当绘制大数据量要素的情况下会出现卡顿,建议把该参数设为false)。
  53050. * @param {number} [options.opacity=1] - 图层不透明度。
  53051. * @param {Array.<string>} [options.colors=['blue','cyan','lime','yellow','red']] - 颜色线性渐变数组,颜色值必须为canvas所支。
  53052. * @param {boolean} [options.useGeoUnit=false] - 使用地理单位,即默认热点半径默认使用像素单位。当设置为 true 时,热点半径和图层地理坐标保持一致。
  53053. * @usage
  53054. */
  53055. var HeatMapLayerRenderer = /*#__PURE__*/function () {
  53056. function HeatMapLayerRenderer(options) {
  53057. HeatMapLayerRenderer_classCallCheck(this, HeatMapLayerRenderer);
  53058. this.options = options;
  53059. /**
  53060. * @member {Object} HeatMapLayerRenderer.prototype.rootCanvas
  53061. * @description 热点图主绘制面板。
  53062. */
  53063. this.rootCanvas = null;
  53064. /**
  53065. * @member {Array.<FeatureVector>} HeatMapLayerRenderer.prototype.features
  53066. * @description 热点信息数组,记录存储图层上添加的所有热点信息。
  53067. */
  53068. this.features = [];
  53069. /**
  53070. * @member {boolean} [HeatMapLayerRenderer.prototype.visibility=true]
  53071. * @description 图层显示状态属性。
  53072. */
  53073. this.visibility = true;
  53074. /**
  53075. * @member {number} [HeatMapLayerRenderer.prototype.opacity=1]
  53076. * @description 图层不透明度,取值范围[0,1]。
  53077. */
  53078. this.opacity = options.opacity ? options.opacity : 1;
  53079. /**
  53080. * @member {Array.<string>} [HeatMapLayerRenderer.prototype.colors=['blue','cyan','lime','yellow','red']]
  53081. * @description 颜色线性渐变数组。
  53082. */
  53083. this.colors = options.colors ? options.colors : ['blue', 'cyan', 'lime', 'yellow', 'red'];
  53084. /**
  53085. * @member {boolean} [HeatMapLayerRenderer.prototype.useGeoUnit=false]
  53086. * @description 使用地理单位,即默认热点半径默认使用像素单位。当设置为 true 时,热点半径和图层地理坐标保持一致。
  53087. */
  53088. this.useGeoUnit = options.useGeoUnit ? options.useGeoUnit : false;
  53089. /**
  53090. * @member {number} [HeatMapLayerRenderer.prototype.radius=50]
  53091. * @description 热点渲染的最大半径(热点像素半径),
  53092. * 热点显示的时候以精确点为中心点开始往四周辐射衰减,
  53093. * 其衰减半径和权重值成比列。
  53094. */
  53095. this.radius = options.radius ? options.radius : 50;
  53096. /**
  53097. * @member {string} HeatMapLayerRenderer.prototype.featureWeight
  53098. * @description 对应 feature 属性中的热点权重字段名称,权重值类型为 number。
  53099. * @example
  53100. * //feature.attributes中表示权重的字段为 height,则在 HeatMapLayer 的 featureWeight 参数赋值为 "height"。
  53101. * feature1.attributes.height = 7.0;
  53102. * feature2.attributes.height = 6.0;
  53103. * var heatMapLayer = new HeatMapLayer("heatmaplayer",{"featureWeight":"height"});
  53104. * heatMapLayer.addFeatures([feature1,feature2]);
  53105. */
  53106. this.featureWeight = options.featureWeight ? options.featureWeight : null;
  53107. /**
  53108. * @member {number} HeatMapLayerRenderer.prototype.maxWeight
  53109. * @description 设置权重最大值。默认将按照当前屏幕范围内热点所拥有的权重最大值绘制热点图。
  53110. */
  53111. this.maxWeight = null;
  53112. /**
  53113. * @member {number} HeatMapLayerRenderer.prototype.minWeight
  53114. * @description 设置权重最小值。默认将按照当前屏幕范围内热点所拥有的权重最小值绘制热点图。
  53115. */
  53116. this.minWeight = null;
  53117. /**
  53118. * @member {Object} HeatMapLayerRenderer.prototype.canvasContext
  53119. * @description 热点图主绘制对象。
  53120. */
  53121. this.canvasContext = null;
  53122. /**
  53123. * @member {number} HeatMapLayerRenderer.prototype.maxWidth
  53124. * @description 当前绘制面板宽度。默认和当前 map 窗口宽度一致。
  53125. */
  53126. this.maxWidth = null;
  53127. /**
  53128. * @member {number} HeatMapLayerRenderer.prototype.maxHeight
  53129. * @description 当前绘制面板宽度。默认和当前 map 窗口高度一致。
  53130. */
  53131. this.maxHeight = null;
  53132. this.extent = {};
  53133. this.mapElement = options.mapElement;
  53134. this._createCanvasContainer(options.targetElement, options.size);
  53135. }
  53136. /**
  53137. * @function HeatMapLayerRenderer.prototype.addFeatures
  53138. * @description 添加热点信息。
  53139. * @param {GeoJSONObject} features - 待添加的要素数组。
  53140. * @example
  53141. * var geojson = {
  53142. * "type": "FeatureCollection",
  53143. * "features": [
  53144. * {
  53145. * "type": "feature",
  53146. * "geometry": {
  53147. * "type": "Point", //只支持point类型
  53148. * "coordinates": [0, 0]
  53149. * },
  53150. * "properties": {
  53151. * "height": Math.random()*9,
  53152. * "geoRadius": useGeoRadius?radius:null
  53153. * }
  53154. * }
  53155. * ]
  53156. * };
  53157. * var HeatMapLayerRenderer = new HeatMapLayerRenderer("HeatMapLayerRenderer",{"featureWeight":"height"}); pLayer = new HeatMapLayerRenderer("HeatMapLayerRenderer",{"featureWeight":"height"});
  53158. * HeatMapLayerRenderer.addFeatures(geojson);
  53159. * map.addLayer(HeatMapLayerRenderer);
  53160. */
  53161. HeatMapLayerRenderer_createClass(HeatMapLayerRenderer, [{
  53162. key: "addFeatures",
  53163. value: function addFeatures(features) {
  53164. this.features = this.toiClientFeature(features);
  53165. //支持更新features,刷新底图
  53166. this.refresh();
  53167. }
  53168. /**
  53169. * @function HeatMapLayerRenderer.prototype.refresh
  53170. * @description 强制刷新当前热点显示,在图层热点数组发生变化后调用,更新显示。
  53171. */
  53172. }, {
  53173. key: "refresh",
  53174. value: function refresh() {
  53175. if (this.features.length === 0) {
  53176. return;
  53177. }
  53178. this.updateHeatPoints(this.extent);
  53179. }
  53180. /**
  53181. * @function HeatMapLayerRenderer.prototype.setOpacity
  53182. * @description 设置图层的不透明度,取值[0-1]之间。
  53183. * @param {number} [opacity] - 不透明度。
  53184. */
  53185. }, {
  53186. key: "setOpacity",
  53187. value: function setOpacity(opacity) {
  53188. if (opacity !== this.opacity) {
  53189. this.opacity = opacity;
  53190. Util_Util.modifyDOMElement(this.rootCanvas, null, null, null, null, null, null, opacity);
  53191. }
  53192. }
  53193. /**
  53194. * @function HeatMapLayerRenderer.prototype.updateHeatPoints
  53195. * @description 刷新热点图显示。
  53196. * @param {mapboxgl.LngLatBounds} bounds - 当前显示范围。
  53197. */
  53198. }, {
  53199. key: "updateHeatPoints",
  53200. value: function updateHeatPoints(bounds) {
  53201. if (this.features && this.features.length > 0) {
  53202. this.convertFastToPixelPoints(bounds);
  53203. } else {
  53204. this.canvasContext.clearRect(0, 0, this.maxWidth, this.maxWidth);
  53205. }
  53206. }
  53207. /**
  53208. * @function HeatMapLayerRenderer.prototype.convertFastToPixelPoints
  53209. * @description 过滤位于当前显示范围内的热点,并转换其为当前分辨率下的像素坐标。
  53210. * @param {mapboxgl.LngLatBounds} bounds - 当前显示范围。
  53211. * @private
  53212. */
  53213. }, {
  53214. key: "convertFastToPixelPoints",
  53215. value: function convertFastToPixelPoints(bounds) {
  53216. var data = [],
  53217. x,
  53218. y,
  53219. k,
  53220. resolution,
  53221. maxTemp,
  53222. minTemp,
  53223. maxWeightTemp;
  53224. //获取当前像素下的地理范围
  53225. var dw = bounds.getEast() - bounds.getWest();
  53226. var dh = bounds.getNorth() - bounds.getSouth();
  53227. var mapElement = this.mapElement;
  53228. if (dw / mapElement.width > dh / mapElement.height) {
  53229. resolution = dw / mapElement.width;
  53230. } else {
  53231. resolution = dh / mapElement.height;
  53232. }
  53233. //热点半径
  53234. this.useRadius = this.useGeoUnit ? parseInt(this.radius / resolution) : this.radius;
  53235. for (var i = 0; i < this.features.length; i++) {
  53236. var feature = this.features[i];
  53237. var point = feature.geometry;
  53238. //可通过bounds过滤需绘制的features以优化性能,但mapboxgl旋转获取得bounds不适
  53239. var pixelPoint = this.getPixelXY(new LonLat(point.x, point.y));
  53240. if (this.featureWeight) {
  53241. pixelPoint.weight = feature.attributes[this.featureWeight]; //point.value;
  53242. if (!this.maxWeight) {
  53243. //找出最大最小权重值
  53244. maxTemp = maxTemp ? maxTemp : pixelPoint.weight;
  53245. minTemp = minTemp ? minTemp : pixelPoint.weight;
  53246. maxTemp = Math.max(maxTemp, pixelPoint.weight);
  53247. minTemp = Math.min(minTemp, pixelPoint.weight);
  53248. }
  53249. } else {
  53250. pixelPoint.weight = 1;
  53251. }
  53252. x = Math.floor(pixelPoint.x);
  53253. y = Math.floor(pixelPoint.y);
  53254. k = pixelPoint.weight;
  53255. data.push([x, y, k]);
  53256. }
  53257. //无最大权重设置
  53258. if (!this.maxWeight) {
  53259. if (maxTemp && minTemp) {
  53260. maxWeightTemp = (maxTemp + minTemp) / 2;
  53261. } else {
  53262. maxWeightTemp = 1;
  53263. }
  53264. this.draw(data, maxWeightTemp);
  53265. } else {
  53266. this.draw(data, this.maxWeight);
  53267. }
  53268. }
  53269. /**
  53270. * @function HeatMapLayerRenderer.prototype.draw
  53271. * @description 绘制热点图。
  53272. * @param {Array} data - convertToPixelPoints方法计算出的点。
  53273. * @private
  53274. */
  53275. }, {
  53276. key: "draw",
  53277. value: function draw(data, maxWeight) {
  53278. if (this.maxHeight > 0 && this.maxWidth > 0) {
  53279. //清空
  53280. var ctx = this.canvasContext;
  53281. ctx.setTransform(1, 0, 0, 1, 0, 0);
  53282. this.canvasContext.clearRect(0, 0, this.maxWidth, this.maxHeight);
  53283. this.drawCircle(this.useRadius);
  53284. this.createGradient();
  53285. for (var i = 0; i < data.length; i++) {
  53286. var p = data[i];
  53287. this.canvasContext.globalAlpha = Math.max(p[2] / maxWeight, 0.05);
  53288. this.canvasContext.drawImage(this.circle, p[0] - this.useRadius, p[1] - this.useRadius);
  53289. }
  53290. var colored = ctx.getImageData(0, 0, this.maxWidth, this.maxHeight);
  53291. this.colorize(colored.data, this.grad);
  53292. ctx.putImageData(colored, 0, 0);
  53293. } else {
  53294. return false;
  53295. }
  53296. }
  53297. /**
  53298. * @function HeatMapLayerRenderer.prototype.colorize
  53299. * @description 根据渐变色重置热点图rgb值。
  53300. * @param {Array} pixels - 像素 RGBA 值。
  53301. * @param {Array} gradient - 渐变 canvas.getImageData.data。
  53302. * @private
  53303. */
  53304. }, {
  53305. key: "colorize",
  53306. value: function colorize(pixels, gradient) {
  53307. for (var i = 0, j; i < pixels.length; i += 4) {
  53308. j = pixels[i + 3] * 4;
  53309. if (j) {
  53310. pixels[i] = gradient[j];
  53311. pixels[i + 1] = gradient[j + 1];
  53312. pixels[i + 2] = gradient[j + 2];
  53313. }
  53314. }
  53315. }
  53316. /**
  53317. * @function HeatMapLayerRenderer.drawCircle
  53318. * @description 绘制热点半径圆。
  53319. * @param {number} r - 热点半径。
  53320. * @private
  53321. */
  53322. }, {
  53323. key: "drawCircle",
  53324. value: function drawCircle(r) {
  53325. var blur = r / 2;
  53326. var circle = this.circle = document.createElement('canvas'),
  53327. ctx = circle.getContext("2d");
  53328. circle.height = 2 * r;
  53329. circle.width = 2 * r;
  53330. ctx.shadowOffsetX = ctx.shadowOffsetY = 2 * r;
  53331. ctx.shadowBlur = blur;
  53332. ctx.shadowColor = "#000000";
  53333. ctx.beginPath();
  53334. ctx.arc(-r, -r, r / 2, 0, Math.PI * 2, true);
  53335. ctx.closePath();
  53336. ctx.fill();
  53337. }
  53338. /**
  53339. * @function HeatMapLayerRenderer.createGradient
  53340. * @description 根据 options.colors 设置渐变。
  53341. * @private
  53342. */
  53343. }, {
  53344. key: "createGradient",
  53345. value: function createGradient() {
  53346. var colors = this.colors;
  53347. var canvas = document.createElement('canvas'),
  53348. ctx = canvas.getContext("2d"),
  53349. gradient = ctx.createLinearGradient(0, 0, 0, 256);
  53350. canvas.height = 256;
  53351. canvas.width = 1;
  53352. var index = 1;
  53353. for (var i = 0, len = colors.length; i < len; i++) {
  53354. gradient.addColorStop(index / len, colors[i]);
  53355. index++;
  53356. }
  53357. ctx.fillStyle = gradient;
  53358. ctx.fillRect(0, 0, 1, 256);
  53359. this.grad = ctx.getImageData(0, 0, 1, 256).data;
  53360. }
  53361. /**
  53362. * @function HeatMapLayerRenderer.prototype.getPixelXY
  53363. * @description 转换地理坐标为相对于当前窗口左上角的像素坐标。
  53364. * @param {number} x - 热点的像素 x 坐标。
  53365. * @param {number} y - 热点的像素 y 坐标。
  53366. */
  53367. }, {
  53368. key: "getPixelXY",
  53369. value: function getPixelXY(coordinate) {
  53370. var pixelP;
  53371. if (coordinate instanceof Point || coordinate instanceof GeoText) {
  53372. var tempPoint = this.options.convertLatlonToPixel({
  53373. lon: coordinate.x,
  53374. lat: coordinate.y
  53375. });
  53376. pixelP = {
  53377. x: parseInt(tempPoint.x),
  53378. y: parseInt(tempPoint.y)
  53379. };
  53380. }
  53381. if (coordinate instanceof LonLat) {
  53382. var _tempPoint = this.options.convertLatlonToPixel(coordinate);
  53383. pixelP = {
  53384. x: parseInt(_tempPoint.x),
  53385. y: parseInt(_tempPoint.y)
  53386. };
  53387. }
  53388. return pixelP;
  53389. }
  53390. /**
  53391. * @function HeatMapLayerRenderer.prototype._createCanvasContainer
  53392. * @description 创建热力图绘制容器。
  53393. * @private
  53394. */
  53395. }, {
  53396. key: "_createCanvasContainer",
  53397. value: function _createCanvasContainer(targetElement) {
  53398. //热点图要求使用canvas绘制,判断是否支持
  53399. this.rootCanvas = document.createElement("canvas");
  53400. this.rootCanvas.id = this.options.id;
  53401. this.rootCanvas.width = this.maxWidth = parseInt(this.mapElement.style.width);
  53402. this.rootCanvas.height = this.maxHeight = parseInt(this.mapElement.style.height);
  53403. this.canvasContext = this.rootCanvas.getContext('2d');
  53404. var devicePixelRatio = window.devicePixelRatio || 1;
  53405. devicePixelRatio !== 1 && this.canvasContext && this.canvasContext.scale(devicePixelRatio, devicePixelRatio);
  53406. Util_Util.modifyDOMElement(this.rootCanvas, null, {
  53407. x: 0,
  53408. y: 0
  53409. }, {
  53410. w: this.maxWidth,
  53411. h: this.maxHeight
  53412. }, "absolute", null, null, this.opacity);
  53413. targetElement.appendChild(this.rootCanvas);
  53414. }
  53415. /**
  53416. * @function HeatMapLayerRenderer.prototype.toiClientFeature
  53417. * @description 转为 iClient 要素。
  53418. * @param {GeoJSONObject} features - 待添加的要素数组。
  53419. */
  53420. // 提到 common
  53421. }, {
  53422. key: "toiClientFeature",
  53423. value: function toiClientFeature(features) {
  53424. if (!Util_Util.isArray(features)) {
  53425. features = [features];
  53426. }
  53427. var featuresTemp = [];
  53428. for (var i = 0; i < features.length; i++) {
  53429. if (features[i] instanceof Vector) {
  53430. // 若是 FeatureVector 直接返回
  53431. featuresTemp.push(features[i]);
  53432. } else if (["FeatureCollection", "Feature", "Geometry"].indexOf(features[i].type) != -1) {
  53433. //GeoJSON 规范数据类型
  53434. var format = new GeoJSON();
  53435. featuresTemp = featuresTemp.concat(format.read(features[i]));
  53436. } else if (features[i].geometry && features[i].geometry.parts) {
  53437. //iServer服务器返回数据格式
  53438. featuresTemp.push(ServerFeature.fromJson(features[i]).toFeature());
  53439. } else {
  53440. throw new Error("Features[".concat(i, "]'s type does not match, please check."));
  53441. }
  53442. }
  53443. return featuresTemp;
  53444. }
  53445. /**
  53446. * @function HeatMapLayerRenderer.prototype.removeFeatures
  53447. * @description 移除指定的热点信息。
  53448. * @param {Array.<FeatureVector>|FeatureVector} features - 热点信息数组。
  53449. */
  53450. }, {
  53451. key: "removeFeatures",
  53452. value: function removeFeatures(features) {
  53453. if (!features || features.length === 0 || !this.features || this.features.length === 0) {
  53454. return;
  53455. }
  53456. if (features === this.features) {
  53457. return this.removeAllFeatures();
  53458. }
  53459. if (!Util_Util.isArray(features)) {
  53460. features = [features];
  53461. }
  53462. var heatPoint,
  53463. index,
  53464. heatPointsFailedRemoved = [];
  53465. for (var i = 0, len = features.length; i < len; i++) {
  53466. heatPoint = features[i];
  53467. index = Util_Util.indexOf(this.features, heatPoint);
  53468. //找不到视为删除失败
  53469. if (index === -1) {
  53470. heatPointsFailedRemoved.push(heatPoint);
  53471. continue;
  53472. }
  53473. //删除热点
  53474. this.features.splice(index, 1);
  53475. }
  53476. var succeed = heatPointsFailedRemoved.length == 0 ? true : false;
  53477. //派发删除features成功的事件
  53478. /**
  53479. * @event HeatMapLayerRenderer#featuresremoved
  53480. * @description 要素删除之后触发。
  53481. * @property {Array.<FeatureVector>} features - 需要被删除的要素。
  53482. * @property {boolean} succeed - 要素删除成功与否。
  53483. */
  53484. this.refresh();
  53485. return {
  53486. succeed: succeed,
  53487. heatPointsFailedRemoved: heatPointsFailedRemoved
  53488. };
  53489. }
  53490. /**
  53491. * @function HeatMapLayerRenderer.prototype.removeAllFeatures
  53492. * @description 移除全部的热点信息。
  53493. */
  53494. }, {
  53495. key: "removeAllFeatures",
  53496. value: function removeAllFeatures() {
  53497. this.features = [];
  53498. this.refresh();
  53499. }
  53500. /**
  53501. * @function HeatMapLayerRenderer.prototype.removeFromMap
  53502. * @description 删除该图层。
  53503. */
  53504. }, {
  53505. key: "removeFromMap",
  53506. value: function removeFromMap() {
  53507. this.removeAllFeatures();
  53508. this.options.targetElement.removeChild(this.rootCanvas);
  53509. }
  53510. /**
  53511. * @function HeatMapLayerRenderer.prototype.setVisibility
  53512. * @description 设置图层可见性。
  53513. * @param {boolean} [visibility] - 是否显示图层(当前地图的 resolution 在最大最小 resolution 之间)。
  53514. */
  53515. }, {
  53516. key: "setVisibility",
  53517. value: function setVisibility(visibility) {
  53518. if (this.rootCanvas && visibility !== this.visibility) {
  53519. this.visibility = visibility;
  53520. this.rootCanvas.style.display = visibility ? "block" : "none";
  53521. }
  53522. }
  53523. }, {
  53524. key: "setExtent",
  53525. value: function setExtent(extent) {
  53526. this.extent = extent;
  53527. }
  53528. }, {
  53529. key: "_hide",
  53530. value: function _hide() {
  53531. this.rootCanvas.style.display = 'none';
  53532. }
  53533. }, {
  53534. key: "_show",
  53535. value: function _show() {
  53536. this.rootCanvas.style.display = 'block';
  53537. }
  53538. }]);
  53539. return HeatMapLayerRenderer;
  53540. }();
  53541. ;// CONCATENATED MODULE: ./src/maplibregl/overlay/HeatMapLayer.js
  53542. function HeatMapLayer_typeof(obj) { "@babel/helpers - typeof"; return HeatMapLayer_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, HeatMapLayer_typeof(obj); }
  53543. function HeatMapLayer_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
  53544. function HeatMapLayer_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? HeatMapLayer_ownKeys(Object(source), !0).forEach(function (key) { HeatMapLayer_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : HeatMapLayer_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
  53545. function HeatMapLayer_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
  53546. function HeatMapLayer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  53547. function HeatMapLayer_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  53548. function HeatMapLayer_createClass(Constructor, protoProps, staticProps) { if (protoProps) HeatMapLayer_defineProperties(Constructor.prototype, protoProps); if (staticProps) HeatMapLayer_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  53549. function HeatMapLayer_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) HeatMapLayer_setPrototypeOf(subClass, superClass); }
  53550. function HeatMapLayer_setPrototypeOf(o, p) { HeatMapLayer_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return HeatMapLayer_setPrototypeOf(o, p); }
  53551. function HeatMapLayer_createSuper(Derived) { var hasNativeReflectConstruct = HeatMapLayer_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = HeatMapLayer_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = HeatMapLayer_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return HeatMapLayer_possibleConstructorReturn(this, result); }; }
  53552. function HeatMapLayer_possibleConstructorReturn(self, call) { if (call && (HeatMapLayer_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return HeatMapLayer_assertThisInitialized(self); }
  53553. function HeatMapLayer_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  53554. function HeatMapLayer_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  53555. function HeatMapLayer_getPrototypeOf(o) { HeatMapLayer_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return HeatMapLayer_getPrototypeOf(o); }
  53556. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  53557. * This program are made available under the terms of the Apache License, Version 2.0
  53558. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  53559. /**
  53560. * @class HeatMapLayer
  53561. * @classdesc 热力图层类。
  53562. * @category Visualization HeatMap
  53563. * @version 11.1.0
  53564. * @modulecategory Overlay
  53565. * @param {string} name - 图层名称。
  53566. * @param {Object} options - 构造参数。
  53567. * @param {maplibregl.Map} options.map - MapLibreGL Map 对象。
  53568. * @param {string} options.featureWeight - 对应 feature 属性中的热点权重字段名称,权重值类型为 float。
  53569. * @param {string} [options.id] - 专题图层ID。默认使用 CommonUtil.createUniqueID("HeatMapLayer_") 创建专题图层 ID。
  53570. * @param {number} [options.radius=50] - 热点渲染的最大半径(热点像素半径),单位为 px,当 useGeoUnit参数 为 true 时,单位使用当前图层地理坐标单位。热点显示的时候以精确点为中心点开始往四周辐射衰减,其衰减半径和权重值成比列。
  53571. * @param {boolean} [options.loadWhileAnimating=true] - 是否实时重绘。(当绘制大数据量要素的情况下会出现卡顿,建议把该参数设为false)。
  53572. * @param {number} [options.opacity=1] - 图层不透明度。
  53573. * @param {Array.<string>} [options.colors=['blue','cyan','lime','yellow','red']] - 颜色线性渐变数组,颜色值必须为canvas所支。
  53574. * @param {boolean} [options.useGeoUnit=false] - 使用地理单位,即默认热点半径默认使用像素单位。当设置为 true 时,热点半径和图层地理坐标保持一致。
  53575. * @extends {maplibregl.Evented}
  53576. * @fires HeatMapLayer#featuresadded
  53577. * @fires HeatMapLayer#changelayer
  53578. * @fires HeatMapLayer#featuresremoved
  53579. * @usage
  53580. */
  53581. var HeatMapLayer = /*#__PURE__*/function (_maplibregl$Evented) {
  53582. HeatMapLayer_inherits(HeatMapLayer, _maplibregl$Evented);
  53583. var _super = HeatMapLayer_createSuper(HeatMapLayer);
  53584. function HeatMapLayer(name, options) {
  53585. var _this;
  53586. HeatMapLayer_classCallCheck(this, HeatMapLayer);
  53587. _this = _super.call(this);
  53588. var _options = options ? options : {};
  53589. _this.options = _options;
  53590. /**
  53591. * @member {string} HeatMapLayer.prototype.name
  53592. * @description 图层名字。
  53593. */
  53594. _this.name = name;
  53595. /**
  53596. * @member {string} HeatMapLayer.prototype.id
  53597. * @description 热力图图层 ID。
  53598. */
  53599. _this.id = _options.id ? _options.id : Util_Util.createUniqueID("HeatMapLayer_");
  53600. /**
  53601. * @member {boolean} [HeatMapLayer.prototype.loadWhileAnimating=true]
  53602. * @description 是否实时重绘。(当绘制大数据量要素的情况下会出现卡顿,建议把该参数设为false)。
  53603. */
  53604. _this.loadWhileAnimating = _options.loadWhileAnimating === undefined ? true : _options.loadWhileAnimating;
  53605. /**
  53606. * @member {Array.<FeatureVector>} HeatMapLayer.prototype.features
  53607. * @description 热点信息数组,记录存储图层上添加的所有热点信息。
  53608. */
  53609. _this.features = {};
  53610. /**
  53611. * @member HeatMapLayer.prototype.EVENT_TYPES
  53612. * @description 监听一个自定义事件可用如下方式:
  53613. * 热点图自定义事件信息,事件调用时的属性与具体事件类型相对应。
  53614. *
  53615. * 支持的事件如下 (另外包含 <Layer 中定义的其他事件>):
  53616. * featuresadded - 热点添加完成时触发。回调参数为添加的热点信息数组和操作成功与否信息。
  53617. * 参数类型:{features: features, succeed: succeed}
  53618. * featuresremoved - 热点被删除时触发。回调参数为删除的热点信息数组和操作成功与否信息。
  53619. * 参数类型:{features: features, succeed: succeed}
  53620. * featuresdrawcompleted - 热点图渲染完成时触发。
  53621. */
  53622. _this.EVENT_TYPES = ["featuresadded", "featuresremoved", "featuresdrawcompleted"];
  53623. _this.type = 'custom';
  53624. _this.renderingMode = '3d';
  53625. _this.overlay = true;
  53626. return _this;
  53627. }
  53628. /**
  53629. * @function HeatMapLayer.prototype.onAdd
  53630. * @description 添加该图层
  53631. */
  53632. HeatMapLayer_createClass(HeatMapLayer, [{
  53633. key: "onAdd",
  53634. value: function onAdd(map) {
  53635. this.map = map;
  53636. var targetElement = this.map.getCanvasContainer();
  53637. var mapElement = this.map.getCanvas();
  53638. this.renderer = new HeatMapLayerRenderer(HeatMapLayer_objectSpread(HeatMapLayer_objectSpread({
  53639. id: this.id
  53640. }, this.options), {}, {
  53641. convertLatlonToPixel: this._convertLatlonToPixel.bind(this),
  53642. targetElement: targetElement,
  53643. mapElement: mapElement
  53644. }));
  53645. if (this.features.features && this.features.features.length) {
  53646. this.renderer.setExtent(this.map.getBounds());
  53647. this.renderer.addFeatures(this.features);
  53648. }
  53649. }
  53650. /**
  53651. * @function HeatMapLayer.prototype.onRemove
  53652. * @description 移除该图层
  53653. */
  53654. }, {
  53655. key: "onRemove",
  53656. value: function onRemove() {
  53657. this.removeAllFeatures();
  53658. this.renderer.removeFromMap();
  53659. this.features = {};
  53660. this.renderer = null;
  53661. }
  53662. /**
  53663. * @function HeatMapLayer.prototype.render
  53664. * @description 渲染图层
  53665. */
  53666. }, {
  53667. key: "render",
  53668. value: function render() {
  53669. this.refresh();
  53670. }
  53671. /**
  53672. * @function HeatMapLayer.prototype.addFeatures
  53673. * @description 添加热点信息。
  53674. * @param {GeoJSONObject} features - 待添加的要素数组。
  53675. *
  53676. * @example
  53677. * var geojson = {
  53678. * "type": "FeatureCollection",
  53679. * "features": [
  53680. * {
  53681. * "type": "feature",
  53682. * "geometry": {
  53683. * "type": "Point", //只支持point类型
  53684. * "coordinates": [0, 0]
  53685. * },
  53686. * "properties": {
  53687. * "height": Math.random()*9,
  53688. * "geoRadius": useGeoRadius?radius:null
  53689. * }
  53690. * }
  53691. * ]
  53692. * };
  53693. * var heatMapLayer = new HeatMapLayer("heatmaplayer",{"featureWeight":"height"}); pLayer = new HeatMapLayer("heatmaplayer",{"featureWeight":"height"});
  53694. * heatMapLayer.addFeatures(geojson);
  53695. * map.addLayer(heatMapLayer);
  53696. */
  53697. }, {
  53698. key: "addFeatures",
  53699. value: function addFeatures(features) {
  53700. if (this.renderer) {
  53701. this.renderer.addFeatures(features);
  53702. } else {
  53703. this.features = features;
  53704. }
  53705. /**
  53706. * @event HeatMapLayer#featuresadded
  53707. * @description 要素添加完成之后触发。
  53708. * @property {GeoJSONObject} features - 被添加的要素。
  53709. * @property {boolean} succeed - 要素是否成功添加。
  53710. */
  53711. this.fire(this.EVENT_TYPES[0], {
  53712. features: features,
  53713. succeed: true
  53714. });
  53715. }
  53716. /**
  53717. * @function HeatMapLayer.prototype.refresh
  53718. * @description 强制刷新当前热点显示,在图层热点数组发生变化后调用,更新显示。
  53719. */
  53720. }, {
  53721. key: "refresh",
  53722. value: function refresh() {
  53723. if (this.map) {
  53724. this.renderer.setExtent(this.map.getBounds());
  53725. this.renderer.refresh();
  53726. }
  53727. }
  53728. /**
  53729. * @function HeatMapLayer.prototype.setOpacity
  53730. * @description 设置图层的不透明度,取值[0-1]之间。
  53731. * @param {number} [opacity] - 不透明度。
  53732. */
  53733. }, {
  53734. key: "setOpacity",
  53735. value: function setOpacity(opacity) {
  53736. if (opacity !== this.opacity) {
  53737. this.renderer.setOpacity(opacity);
  53738. if (this.map !== null) {
  53739. /**
  53740. * @event HeatMapLayer#changelayer
  53741. * @description 图层属性改变之后触发。
  53742. * @property {Object} layer - 图层。
  53743. * @property {string} property - 被改变的图层属性。
  53744. */
  53745. this.fire('changelayer', {
  53746. layer: this,
  53747. property: "opacity"
  53748. });
  53749. }
  53750. }
  53751. }
  53752. /**
  53753. * @function HeatMapLayer.prototype.updateHeatPoints
  53754. * @description 刷新热点图显示。
  53755. * @param {maplibregl.LngLatBounds} bounds - 当前显示范围。
  53756. */
  53757. }, {
  53758. key: "updateHeatPoints",
  53759. value: function updateHeatPoints(bounds) {
  53760. this.renderer.updateHeatPoints(bounds);
  53761. }
  53762. /**
  53763. * @function HeatMapLayer.prototype.getPixelXY
  53764. * @description 转换地理坐标为相对于当前窗口左上角的像素坐标。
  53765. * @param {number} x - 热点的像素 x 坐标。
  53766. * @param {number} y - 热点的像素 y 坐标。
  53767. */
  53768. }, {
  53769. key: "getPixelXY",
  53770. value: function getPixelXY(coordinate) {
  53771. return this.renderer.getPixelXY(coordinate);
  53772. }
  53773. /**
  53774. * @function HeatMapLayer.prototype.removeFeatures
  53775. * @description 移除指定的热点信息。
  53776. * @param {Array.<FeatureVector>|FeatureVector} features - 热点信息数组。
  53777. */
  53778. }, {
  53779. key: "removeFeatures",
  53780. value: function removeFeatures(features) {
  53781. var removeFeaturesRes = this.renderer.removeFeatures(features);
  53782. if (!removeFeaturesRes) {
  53783. return;
  53784. }
  53785. var heatPointsFailedRemoved = removeFeaturesRes.heatPointsFailedRemoved,
  53786. succeed = removeFeaturesRes.succeed;
  53787. //派发删除features成功的事件
  53788. /**
  53789. * @event HeatMapLayer#featuresremoved
  53790. * @description 要素删除之后触发。
  53791. * @property {Array.<FeatureVector>} features - 需要被删除的要素。
  53792. * @property {boolean} succeed - 要素删除成功与否。
  53793. */
  53794. this.fire(this.EVENT_TYPES[1], {
  53795. features: heatPointsFailedRemoved,
  53796. succeed: succeed
  53797. });
  53798. }
  53799. /**
  53800. * @function HeatMapLayer.prototype.removeAllFeatures
  53801. * @description 移除全部的热点信息。
  53802. */
  53803. }, {
  53804. key: "removeAllFeatures",
  53805. value: function removeAllFeatures() {
  53806. this.renderer.removeAllFeatures();
  53807. }
  53808. /**
  53809. * @function HeatMapLayer.prototype.moveTo
  53810. * @description 将图层移动到某个图层之前。
  53811. * @param {string} layerID - 待插入的图层ID。
  53812. * @param {boolean} [before=true] - 是否将本图层插入到图层 ID 为 layerID 的图层之前(如果为 false 则将本图层插入到图层 ID 为 layerID 的图层之后)。
  53813. */
  53814. }, {
  53815. key: "moveTo",
  53816. value: function moveTo(layerID, before) {
  53817. var layer = document.getElementById(this.renderer.rootCanvas.id);
  53818. before = before !== undefined ? before : true;
  53819. if (before) {
  53820. var beforeLayer = document.getElementById(layerID);
  53821. if (layer && beforeLayer) {
  53822. beforeLayer.parentNode.insertBefore(layer, beforeLayer);
  53823. }
  53824. return;
  53825. }
  53826. var nextLayer = document.getElementById(layerID);
  53827. if (layer) {
  53828. if (nextLayer.nextSibling) {
  53829. nextLayer.parentNode.insertBefore(layer, nextLayer.nextSibling);
  53830. return;
  53831. }
  53832. nextLayer.parentNode.appendChild(layer);
  53833. }
  53834. }
  53835. /**
  53836. * @function HeatMapLayer.prototype.setVisibility
  53837. * @description 设置图层可见性。
  53838. * @param {boolean} [visibility] - 是否显示图层(当前地图的 resolution 在最大最小 resolution 之间)。
  53839. */
  53840. }, {
  53841. key: "setVisibility",
  53842. value: function setVisibility(visibility) {
  53843. this.renderer.setVisibility(visibility);
  53844. }
  53845. }, {
  53846. key: "_convertLatlonToPixel",
  53847. value: function _convertLatlonToPixel(coordinate) {
  53848. return this.map.project(new (external_maplibregl_default()).LngLat(coordinate.lon, coordinate.lat));
  53849. }
  53850. }]);
  53851. return HeatMapLayer;
  53852. }((external_maplibregl_default()).Evented);
  53853. ;// CONCATENATED MODULE: ./src/common/overlay/graphic/GraphicLayerRenderer.js
  53854. function GraphicLayerRenderer_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
  53855. function GraphicLayerRenderer_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? GraphicLayerRenderer_ownKeys(Object(source), !0).forEach(function (key) { GraphicLayerRenderer_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : GraphicLayerRenderer_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
  53856. function GraphicLayerRenderer_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
  53857. function GraphicLayerRenderer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  53858. function GraphicLayerRenderer_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  53859. function GraphicLayerRenderer_createClass(Constructor, protoProps, staticProps) { if (protoProps) GraphicLayerRenderer_defineProperties(Constructor.prototype, protoProps); if (staticProps) GraphicLayerRenderer_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  53860. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  53861. * This program are made available under the terms of the Apache License, Version 2.0
  53862. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  53863. var defaultProps = {
  53864. color: [0, 0, 0, 255],
  53865. opacity: 0.8,
  53866. radius: 10,
  53867. radiusScale: 1,
  53868. radiusMinPixels: 0,
  53869. radiusMaxPixels: Number.MAX_SAFE_INTEGER,
  53870. strokeWidth: 1,
  53871. outline: false
  53872. };
  53873. /**
  53874. * @private
  53875. * @class GraphicLayerRenderer
  53876. * @category Visualization Graphic
  53877. * @classdesc 高效率点图层。
  53878. * @param {string} [id] - 图层id。
  53879. * @param {Object} options - 参数。
  53880. * @param {Array.<Graphic>} options.graphics - 点要素对象数组 。
  53881. * @param {Array.<number>} [options.color=[0, 0, 0, 255]] - 颜色,目前只支持 rgba 数组。
  53882. * @param {number} [options.radius=10] - 半径。
  53883. * @param {number} [options.opacity=0.8] - 不透明度。
  53884. * @param {Array.<number>} [options.highlightColor=[0, 0, 128, 128]] - 高亮颜色,目前只支持 rgba 数组。
  53885. * @param {number} [options.radiusScale=1] - 点放大倍数。
  53886. * @param {number} [options.radiusMinPixels=0] - 半径最小值(像素)。
  53887. * @param {number} [options.radiusMaxPixels=Number.MAX_SAFE_INTEGER] - 半径最大值(像素)。
  53888. * @param {number} [options.strokeWidth=1] - 边框大小。
  53889. * @param {boolean} [options.outline=false] - 是否显示边框。
  53890. * @param {Object} [functions] - 图层传递给渲染器调用的方法。
  53891. * @param {Object} [mapOptions] - 图层传递给渲染器的地图元素信息。
  53892. * @usage
  53893. */
  53894. var GraphicLayerRenderer = /*#__PURE__*/function () {
  53895. function GraphicLayerRenderer(id, options, functions, mapOptions) {
  53896. GraphicLayerRenderer_classCallCheck(this, GraphicLayerRenderer);
  53897. var opt = Util_Util.assign(this, defaultProps, options);
  53898. /**
  53899. * @member {string} GraphicLayerRenderer.prototype.id
  53900. * @description 高效率点图层 ID。
  53901. */
  53902. this.id = id;
  53903. /**
  53904. * @member {Array.<Graphic>} GraphicLayerRenderer.prototype.graphics
  53905. * @description 点要素对象数组。
  53906. */
  53907. this.graphics = [].concat(opt.graphics);
  53908. /**
  53909. * @member {boolean} [GraphicLayerRenderer.prototype.visibility=true]
  53910. * @description 图层显示状态属性。
  53911. */
  53912. this.mapOptions = mapOptions;
  53913. this.functions = functions;
  53914. this.visibility = true;
  53915. this.init();
  53916. }
  53917. GraphicLayerRenderer_createClass(GraphicLayerRenderer, [{
  53918. key: "init",
  53919. value: function init() {
  53920. if (this.canvas) {
  53921. this.mapOptions.targetElement.appendChild(this.canvas);
  53922. }
  53923. this._initContainer();
  53924. var mapState = this.getState();
  53925. var data = mapState.data,
  53926. color = mapState.color,
  53927. radius = mapState.radius,
  53928. opacity = mapState.opacity,
  53929. highlightColor = mapState.highlightColor,
  53930. radiusScale = mapState.radiusScale,
  53931. radiusMinPixels = mapState.radiusMinPixels,
  53932. radiusMaxPixels = mapState.radiusMaxPixels,
  53933. strokeWidth = mapState.strokeWidth,
  53934. outline = mapState.outline;
  53935. var me = this;
  53936. var layerOptions = {
  53937. id: 'scatter-plot',
  53938. data: data,
  53939. pickable: Boolean(this.onClick) || Boolean(this.onHover),
  53940. autoHighlight: true,
  53941. color: color,
  53942. opacity: opacity,
  53943. radius: radius,
  53944. radiusScale: radiusScale,
  53945. highlightColor: highlightColor,
  53946. radiusMinPixels: radiusMinPixels,
  53947. radiusMaxPixels: radiusMaxPixels,
  53948. strokeWidth: strokeWidth,
  53949. outline: outline,
  53950. isGeographicCoordinateSystem: this.isGeographicCoordinateSystem,
  53951. coordinateSystem: this.coordinateSystem,
  53952. getPosition: function getPosition(point) {
  53953. if (!point) {
  53954. return [0, 0, 0];
  53955. }
  53956. var lngLat = point.getLngLat();
  53957. return lngLat && [lngLat.lng, lngLat.lat, 0];
  53958. },
  53959. getColor: function getColor(point) {
  53960. var style = point && point.getStyle();
  53961. var color1 = style && style.color || me.color;
  53962. return color1;
  53963. },
  53964. getRadius: function getRadius(point) {
  53965. var style = point && point.getStyle();
  53966. return style && style.radius || me.radius;
  53967. },
  53968. updateTriggers: {
  53969. getColor: [color],
  53970. getRadius: [radius]
  53971. }
  53972. };
  53973. if (this.onClick) {
  53974. layerOptions.onClick = this.onClick;
  53975. }
  53976. if (this.onHover) {
  53977. layerOptions.onHover = this.onHover;
  53978. }
  53979. this.layer = new window.DeckGL.ScatterplotLayer(layerOptions);
  53980. var deckOptions = {};
  53981. for (var key in mapState) {
  53982. deckOptions[key] = mapState[key];
  53983. }
  53984. var width = parseInt(this.canvas.style.width);
  53985. var height = parseInt(this.canvas.style.height);
  53986. deckOptions.width = width;
  53987. deckOptions.height = height;
  53988. deckOptions.layers = [this.layer];
  53989. deckOptions.canvas = this.canvas;
  53990. this.deckGL = new window.DeckGL.experimental.DeckGLJS(deckOptions);
  53991. this.draw();
  53992. }
  53993. /**
  53994. * @function GraphicLayerRenderer.prototype.setStyle
  53995. * @description 设置图层整体样式。
  53996. * @param {Object} styleOptions - 样式对象。
  53997. * @param {Array.<number>} [styleOptions.color=[0, 0, 0, 255]] - 点颜色。
  53998. * @param {number} [styleOptions.radius=10] - 点半径。
  53999. * @param {number} [styleOptions.opacity=0.8] - 不透明度。
  54000. * @param {Array.<number>} [styleOptions.highlightColor=[0, 0, 128, 128]] - 高亮颜色,目前只支持 rgba 数组。
  54001. * @param {number} [styleOptions.radiusScale=1] - 点放大倍数。
  54002. * @param {number} [styleOptions.radiusMinPixels=0] - 半径最小值(像素)。
  54003. * @param {number} [styleOptions.radiusMaxPixels=Number.MAX_SAFE_INTEGER] - 半径最大值(像素)。
  54004. * @param {number} [styleOptions.strokeWidth=1] - 边框大小。
  54005. * @param {boolean} [styleOptions.outline=false] - 是否显示边框。
  54006. */
  54007. }, {
  54008. key: "setStyle",
  54009. value: function setStyle(styleOptions) {
  54010. var styleOpt = {
  54011. color: this.color,
  54012. radius: this.radius,
  54013. opacity: this.opacity,
  54014. highlightColor: this.highlightColor,
  54015. radiusScale: this.radiusScale,
  54016. radiusMinPixels: this.radiusMinPixels,
  54017. radiusMaxPixels: this.radiusMaxPixels,
  54018. strokeWidth: this.strokeWidth,
  54019. outline: this.outline
  54020. };
  54021. Util_Util.assign(this, styleOpt, styleOptions);
  54022. this.update();
  54023. }
  54024. /**
  54025. * @function GraphicLayerRenderer.prototype.setGraphics
  54026. * @description 设置绘制的点要素数据,会覆盖之前的所有要素。
  54027. * @param {Array.<Graphic>} graphics - 点要素对象数组。
  54028. */
  54029. }, {
  54030. key: "setGraphics",
  54031. value: function setGraphics(graphics) {
  54032. this.graphics = this.graphics || [];
  54033. this.graphics.length = 0;
  54034. var sGraphics = !Util_Util.isArray(graphics) ? [graphics] : [].concat(graphics);
  54035. //this.layer.props.data不能被重新赋值,只能在原数组上进行操作
  54036. if (!this.layer.props.data) {
  54037. this.layer.props.data = [];
  54038. }
  54039. this.layer.props.data.length = 0;
  54040. for (var i = 0; i < sGraphics.length; i++) {
  54041. this.layer.props.data.push(sGraphics[i]);
  54042. }
  54043. this.update();
  54044. }
  54045. /**
  54046. * @function GraphicLayerRenderer.prototype.addGraphics
  54047. * @description 添加点要素,不会覆盖之前的要素。
  54048. * @param {Array.<Graphic>} graphics - 点要素对象数组。
  54049. */
  54050. }, {
  54051. key: "addGraphics",
  54052. value: function addGraphics(graphics) {
  54053. this.graphics = this.graphics || [];
  54054. var sGraphics = !Util_Util.isArray(graphics) ? [graphics] : [].concat(graphics);
  54055. //this.layer.props.data不能被重新赋值,只能在原数组上进行操作
  54056. if (!this.layer.props.data) {
  54057. this.layer.props.data = [];
  54058. }
  54059. for (var i = 0; i < sGraphics.length; i++) {
  54060. this.layer.props.data.push(sGraphics[i]);
  54061. }
  54062. this.update();
  54063. }
  54064. /**
  54065. * @function GraphicLayerRenderer.prototype.getGraphicBy
  54066. * @description 在 Vector 的要素数组 graphics 里面遍历每一个 graphic,当 graphic[property]===value 时,返回此 graphic(并且只返回第一个)。
  54067. * @param {string} property - graphic 的某个属性名称。
  54068. * @param {string} value - property 所对应的值。
  54069. * @returns {Graphic} 一个匹配的 graphic。
  54070. */
  54071. }, {
  54072. key: "getGraphicBy",
  54073. value: function getGraphicBy(property, value) {
  54074. var graphic = null;
  54075. for (var index in this.graphics) {
  54076. if (this.graphics[index][property] === value) {
  54077. graphic = this.graphics[index];
  54078. break;
  54079. }
  54080. }
  54081. return graphic;
  54082. }
  54083. /**
  54084. * @function GraphicLayerRenderer.prototype.getGraphicById
  54085. * @description 通过给定一个 ID,返回对应的矢量要素。
  54086. * @param {string} graphicId - 矢量要素的属性 ID。
  54087. * @returns {Graphic} 一个匹配的 graphic。
  54088. */
  54089. }, {
  54090. key: "getGraphicById",
  54091. value: function getGraphicById(graphicId) {
  54092. return this.getGraphicBy("id", graphicId);
  54093. }
  54094. /**
  54095. * @function GraphicLayerRenderer.prototype.getGraphicsByAttribute
  54096. * @description 通过给定一个属性的 key 值和 value 值,返回所有匹配的要素数组。
  54097. * @param {string} attrName - graphic 的某个属性名称。
  54098. * @param {string} attrValue - property 所对应的值。
  54099. * @returns {Array.<Graphic>} 一个匹配的 graphic 数组。
  54100. */
  54101. }, {
  54102. key: "getGraphicsByAttribute",
  54103. value: function getGraphicsByAttribute(attrName, attrValue) {
  54104. var graphic,
  54105. foundgraphics = [];
  54106. for (var index in this.graphics) {
  54107. graphic = this.graphics[index];
  54108. if (graphic && graphic.attributes) {
  54109. if (graphic.attributes[attrName] === attrValue) {
  54110. foundgraphics.push(graphic);
  54111. }
  54112. }
  54113. }
  54114. return foundgraphics;
  54115. }
  54116. /**
  54117. * @function GraphicLayerRenderer.prototype.removeGraphics
  54118. * @description 删除要素数组,默认将删除所有要素
  54119. * @param {Array.<Graphic>} [graphics=null] - 删除的 graphics 数组
  54120. */
  54121. }, {
  54122. key: "removeGraphics",
  54123. value: function removeGraphics() {
  54124. var graphics = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
  54125. //当 graphics 为 null 、为空数组,或 === this.graphics,则清除所有要素
  54126. if (!graphics || graphics.length === 0 || graphics === this.graphics) {
  54127. this.graphics.length = 0;
  54128. if (this.layer.props.data) {
  54129. this.layer.props.data.length = 0;
  54130. }
  54131. this.update();
  54132. return;
  54133. }
  54134. if (!Util_Util.isArray(graphics)) {
  54135. graphics = [graphics];
  54136. }
  54137. for (var i = graphics.length - 1; i >= 0; i--) {
  54138. var graphic = graphics[i];
  54139. //如果我们传入的grapchic在graphics数组中没有的话,则不进行删除,
  54140. //并将其放入未删除的数组中。
  54141. var findex = Util_Util.indexOf(this.graphics, graphic);
  54142. if (findex === -1) {
  54143. continue;
  54144. }
  54145. this.graphics.splice(findex, 1);
  54146. }
  54147. //删除完成后重新设置 setGraphics,以更新
  54148. this.update();
  54149. }
  54150. /**
  54151. * @function GraphicLayerRenderer.prototype.update
  54152. * @description 更新图层。
  54153. */
  54154. }, {
  54155. key: "update",
  54156. value: function update() {
  54157. if (this.layer.lifecycle !== 'Awaiting state') {
  54158. this.layer.setChangeFlags({
  54159. dataChanged: true,
  54160. propsChanged: true,
  54161. viewportChanged: true,
  54162. updateTriggersChanged: true
  54163. });
  54164. var state = this.getState();
  54165. var width = parseInt(this.canvas.style.width);
  54166. var height = parseInt(this.canvas.style.height);
  54167. state.width = width;
  54168. state.height = height;
  54169. this.layer.setState(state);
  54170. }
  54171. }
  54172. /**
  54173. * @function GraphicLayerRenderer.prototype.clear
  54174. * @description 释放图层资源。
  54175. */
  54176. }, {
  54177. key: "clear",
  54178. value: function clear() {
  54179. this.removeGraphics();
  54180. this.deckGL.finalize();
  54181. }
  54182. /**
  54183. * @function GraphicLayerRenderer.prototype.remove
  54184. * @description 删除该图层。
  54185. */
  54186. }, {
  54187. key: "remove",
  54188. value: function remove() {
  54189. this.mapOptions.targetElement.removeChild(this.canvas);
  54190. }
  54191. /**
  54192. * @function GraphicLayerRenderer.prototype.destroy
  54193. * @deprecated
  54194. * @description 删除该图层,并释放图层资源。
  54195. */
  54196. }, {
  54197. key: "destroy",
  54198. value: function destroy() {
  54199. this.remove();
  54200. this.clear();
  54201. }
  54202. /**
  54203. * @function GraphicLayerRenderer.prototype.moveTo
  54204. * @description 将图层移动到某个图层之前。
  54205. * @param {string} layerID - 待插入的图层 ID。
  54206. * @param {boolean} [before=true] - 是否将本图层插入到图层 ID 为 layerID 的图层之前。
  54207. */
  54208. }, {
  54209. key: "moveTo",
  54210. value: function moveTo(layerID, before) {
  54211. var layer = document.getElementById(this.id);
  54212. before = before !== undefined ? before : true;
  54213. if (before) {
  54214. var beforeLayer = document.getElementById(layerID);
  54215. if (layer && beforeLayer) {
  54216. beforeLayer.parentNode.insertBefore(layer, beforeLayer);
  54217. }
  54218. return;
  54219. }
  54220. var nextLayer = document.getElementById(layerID);
  54221. if (layer) {
  54222. if (nextLayer.nextSibling) {
  54223. nextLayer.parentNode.insertBefore(layer, nextLayer.nextSibling);
  54224. return;
  54225. }
  54226. nextLayer.parentNode.appendChild(layer);
  54227. }
  54228. }
  54229. /**
  54230. * @function GraphicLayerRenderer.prototype.setVisibility
  54231. * @description 设置图层可见性。
  54232. * @param {boolean} [visibility] - 是否显示图层(当前地图的 resolution 在最大最小 resolution 之间)。
  54233. */
  54234. }, {
  54235. key: "setVisibility",
  54236. value: function setVisibility(visibility) {
  54237. if (this.canvas && visibility !== this.visibility) {
  54238. this.visibility = visibility;
  54239. this.canvas.style.display = visibility ? "block" : "none";
  54240. }
  54241. }
  54242. /**
  54243. * @function GraphicLayerRenderer.prototype.draw
  54244. * @description 绘制图层。
  54245. */
  54246. }, {
  54247. key: "draw",
  54248. value: function draw() {
  54249. var mapState = this.getState();
  54250. var deckOptions = {};
  54251. for (var key in mapState) {
  54252. deckOptions[key] = mapState[key];
  54253. }
  54254. var width = parseInt(this.canvas.style.width);
  54255. var height = parseInt(this.canvas.style.height);
  54256. deckOptions.width = width;
  54257. deckOptions.height = height;
  54258. deckOptions.layers = [this.layer];
  54259. deckOptions.canvas = this.canvas;
  54260. this.deckGL.setProps(deckOptions);
  54261. }
  54262. }, {
  54263. key: "_initContainer",
  54264. value: function _initContainer() {
  54265. this.canvas = this._createCanvas(this.mapOptions.mapElement);
  54266. this.mapOptions.targetElement.appendChild(this.canvas);
  54267. }
  54268. }, {
  54269. key: "_createCanvas",
  54270. value: function _createCanvas(mapElement) {
  54271. var canvas = document.createElement('canvas');
  54272. if (this.id) {
  54273. canvas.id = this.id;
  54274. }
  54275. canvas.style.position = 'absolute';
  54276. canvas.style.top = 0 + "px";
  54277. canvas.style.left = 0 + "px";
  54278. canvas.style.cursor = "";
  54279. canvas.width = parseInt(mapElement.style.width);
  54280. canvas.height = parseInt(mapElement.style.height);
  54281. canvas.style.width = mapElement.style.width;
  54282. canvas.style.height = mapElement.style.height;
  54283. return canvas;
  54284. }
  54285. }, {
  54286. key: "getState",
  54287. value: function getState() {
  54288. var mapState = this.functions.getMapState();
  54289. return GraphicLayerRenderer_objectSpread({
  54290. data: this.graphics,
  54291. color: this.color,
  54292. radius: this.radius,
  54293. opacity: this.opacity,
  54294. highlightColor: this.highlightColor,
  54295. radiusScale: this.radiusScale,
  54296. radiusMinPixels: this.radiusMinPixels,
  54297. radiusMaxPixels: this.radiusMaxPixels,
  54298. strokeWidth: this.strokeWidth,
  54299. outline: this.outline
  54300. }, mapState);
  54301. }
  54302. }]);
  54303. return GraphicLayerRenderer;
  54304. }();
  54305. ;// CONCATENATED MODULE: ./src/maplibregl/overlay/GraphicLayer.js
  54306. function GraphicLayer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  54307. function GraphicLayer_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  54308. function GraphicLayer_createClass(Constructor, protoProps, staticProps) { if (protoProps) GraphicLayer_defineProperties(Constructor.prototype, protoProps); if (staticProps) GraphicLayer_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  54309. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  54310. * This program are made available under the terms of the Apache License, Version 2.0
  54311. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  54312. /**
  54313. * @class GraphicLayer
  54314. * @category Visualization Graphic
  54315. * @classdesc 高效率点图层类。
  54316. * @version 11.1.0
  54317. * @modulecategory Overlay
  54318. * @param {string} [id] - 图层id。默认使用 CommonUtil.createUniqueID("graphicLayer_") 创建专题图层 ID。
  54319. * @param {Object} options - 参数。
  54320. * @param {Array.<Graphic>} options.graphics - 点要素对象数组 。
  54321. * @param {Array.<number>} [options.color=[0, 0, 0, 255]] - 颜色,目前只支持 rgba 数组。
  54322. * @param {number} [options.radius=10] - 半径。
  54323. * @param {number} [options.opacity=0.8] - 不透明度。
  54324. * @param {Array.<number>} [options.highlightColor=[0, 0, 128, 128]] - 高亮颜色,目前只支持 rgba 数组。
  54325. * @param {number} [options.radiusScale=1] - 点放大倍数。
  54326. * @param {number} [options.radiusMinPixels=0] - 半径最小值(像素)。
  54327. * @param {number} [options.radiusMaxPixels=Number.MAX_SAFE_INTEGER] - 半径最大值(像素)。
  54328. * @param {number} [options.strokeWidth=1] - 边框大小。
  54329. * @param {boolean} [options.outline=false] - 是否显示边框。
  54330. * @usage
  54331. */
  54332. var GraphicLayer = /*#__PURE__*/function () {
  54333. function GraphicLayer(id, options) {
  54334. GraphicLayer_classCallCheck(this, GraphicLayer);
  54335. this.options = options;
  54336. /**
  54337. * @member {string} GraphicLayer.prototype.id
  54338. * @description 高效率点图层 ID。
  54339. */
  54340. this.id = id || Util_Util.createUniqueID("graphicLayer_");
  54341. this.type = 'custom';
  54342. this.renderingMode = '3d';
  54343. this.overlay = true;
  54344. }
  54345. /**
  54346. * @function GraphicLayer.prototype.addTo
  54347. * @deprecated
  54348. * @description 添加该图层,将在下个版本废弃,请使用 onAdd() 代替。
  54349. * @param {maplibregl.Map} map - MapLibreGL Map 对象。
  54350. * @returns this
  54351. */
  54352. GraphicLayer_createClass(GraphicLayer, [{
  54353. key: "addTo",
  54354. value: function addTo(map) {
  54355. this.onAdd(map);
  54356. return this;
  54357. }
  54358. /**
  54359. * @function GraphicLayer.prototype.onAdd
  54360. * @description 添加该图层。
  54361. * @param {maplibregl.Map} map - MapLibreGL Map 对象。
  54362. */
  54363. }, {
  54364. key: "onAdd",
  54365. value: function onAdd(map) {
  54366. this.map = map;
  54367. this.renderer = new GraphicLayerRenderer(this.id, this.options, {
  54368. getMapState: this.getMapState.bind(this)
  54369. }, {
  54370. targetElement: this.map.getCanvasContainer(),
  54371. mapElement: this.map.getCanvas()
  54372. });
  54373. }
  54374. /**
  54375. * @function GraphicLayer.prototype.onAdd
  54376. * @description 添加该图层。
  54377. */
  54378. }, {
  54379. key: "render",
  54380. value: function render() {
  54381. this.renderer.draw();
  54382. }
  54383. /**
  54384. * @function GraphicLayer.prototype.setStyle
  54385. * @description 设置图层整体样式。
  54386. * @param {Object} styleOptions - 样式对象。
  54387. * @param {Array.<number>} [styleOptions.color=[0, 0, 0, 255]] - 点颜色。
  54388. * @param {number} [styleOptions.radius=10] - 点半径。
  54389. * @param {number} [styleOptions.opacity=0.8] - 不透明度。
  54390. * @param {Array.<number>} [styleOptions.highlightColor=[0, 0, 128, 128]] - 高亮颜色,目前只支持 rgba 数组。
  54391. * @param {number} [styleOptions.radiusScale=1] - 点放大倍数。
  54392. * @param {number} [styleOptions.radiusMinPixels=0] - 半径最小值(像素)。
  54393. * @param {number} [styleOptions.radiusMaxPixels=Number.MAX_SAFE_INTEGER] - 半径最大值(像素)。
  54394. * @param {number} [styleOptions.strokeWidth=1] - 边框大小。
  54395. * @param {boolean} [styleOptions.outline=false] - 是否显示边框。
  54396. */
  54397. }, {
  54398. key: "setStyle",
  54399. value: function setStyle(styleOptions) {
  54400. this.renderer && this.renderer.setStyle(styleOptions);
  54401. }
  54402. /**
  54403. * @function GraphicLayer.prototype.setGraphics
  54404. * @description 设置绘制的点要素数据,会覆盖之前的所有要素。
  54405. * @param {Array.<Graphic>} graphics - 点要素对象数组。
  54406. */
  54407. }, {
  54408. key: "setGraphics",
  54409. value: function setGraphics(graphics) {
  54410. this.renderer && this.renderer.setGraphics(graphics);
  54411. }
  54412. /**
  54413. * @function GraphicLayer.prototype.addGraphics
  54414. * @description 添加点要素,不会覆盖之前的要素。
  54415. * @param {Array.<Graphic>} graphics - 点要素对象数组。
  54416. */
  54417. }, {
  54418. key: "addGraphics",
  54419. value: function addGraphics(graphics) {
  54420. this.renderer && this.renderer.addGraphics(graphics);
  54421. }
  54422. /**
  54423. * @function GraphicLayer.prototype.getGraphicBy
  54424. * @description 在 Vector 的要素数组 graphics 里面遍历每一个 graphic,当 graphic[property]===value 时,返回此 graphic(并且只返回第一个)。
  54425. * @param {string} property - graphic 的某个属性名称。
  54426. * @param {string} value - property 所对应的值。
  54427. * @returns {Graphic} 一个匹配的 graphic。
  54428. */
  54429. }, {
  54430. key: "getGraphicBy",
  54431. value: function getGraphicBy(property, value) {
  54432. return this.renderer && this.renderer.getGraphicBy(property, value);
  54433. }
  54434. /**
  54435. * @function GraphicLayer.prototype.getGraphicById
  54436. * @description 通过给定一个 ID,返回对应的矢量要素。
  54437. * @param {string} graphicId - 矢量要素的属性 ID。
  54438. * @returns {Graphic} 一个匹配的 graphic。
  54439. */
  54440. }, {
  54441. key: "getGraphicById",
  54442. value: function getGraphicById(graphicId) {
  54443. return this.getGraphicBy("id", graphicId);
  54444. }
  54445. /**
  54446. * @function GraphicLayer.prototype.getGraphicsByAttribute
  54447. * @description 通过给定一个属性的 key 值和 value 值,返回所有匹配的要素数组。
  54448. * @param {string} attrName - graphic 的某个属性名称。
  54449. * @param {string} attrValue - property 所对应的值。
  54450. * @returns {Array.<Graphic>} 一个匹配的 graphic 数组。
  54451. */
  54452. }, {
  54453. key: "getGraphicsByAttribute",
  54454. value: function getGraphicsByAttribute(attrName, attrValue) {
  54455. return this.renderer && this.renderer.getGraphicsByAttribute(attrName, attrValue);
  54456. }
  54457. /**
  54458. * @function GraphicLayer.prototype.removeGraphics
  54459. * @description 删除要素数组,默认将删除所有要素
  54460. * @param {Array.<Graphic>} [graphics=null] - 删除的 graphics 数组
  54461. */
  54462. }, {
  54463. key: "removeGraphics",
  54464. value: function removeGraphics() {
  54465. var graphics = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
  54466. this.renderer && this.renderer.removeGraphics(graphics);
  54467. }
  54468. /**
  54469. * @function GraphicLayer.prototype.clear
  54470. * @description 释放图层资源。
  54471. */
  54472. }, {
  54473. key: "clear",
  54474. value: function clear() {
  54475. this.renderer && this.renderer.clear();
  54476. }
  54477. /**
  54478. * @function GraphicLayer.prototype.remove
  54479. * @description 删除该图层。
  54480. */
  54481. }, {
  54482. key: "remove",
  54483. value: function remove() {
  54484. this.renderer && this.renderer.remove();
  54485. }
  54486. /**
  54487. * @function GraphicLayer.prototype.onRemove
  54488. * @deprecated
  54489. * @description 删除该图层,并释放图层资源。
  54490. */
  54491. }, {
  54492. key: "onRemove",
  54493. value: function onRemove() {
  54494. this.remove();
  54495. this.clear();
  54496. }
  54497. /**
  54498. * @function GraphicLayer.prototype.moveTo
  54499. * @description 将图层移动到某个图层之前。
  54500. * @param {string} layerID - 待插入的图层 ID。
  54501. * @param {boolean} [before=true] - 是否将本图层插入到图层 ID 为 layerID 的图层之前。
  54502. */
  54503. }, {
  54504. key: "moveTo",
  54505. value: function moveTo(layerID, before) {
  54506. this.renderer.moveTo(layerID, before);
  54507. }
  54508. /**
  54509. * @function GraphicLayer.prototype.setVisibility
  54510. * @description 设置图层可见性。
  54511. * @param {boolean} [visibility] - 是否显示图层(当前地图的 resolution 在最大最小 resolution 之间)。
  54512. */
  54513. }, {
  54514. key: "setVisibility",
  54515. value: function setVisibility(visibility) {
  54516. this.renderer.setVisibility(visibility);
  54517. }
  54518. /**
  54519. * @function GraphicLayer.prototype.getState
  54520. * @description 获取当前地图及图层状态。
  54521. * @returns {Object} 地图及图层状态,包含地图状态信息和本图层相关状态。
  54522. */
  54523. }, {
  54524. key: "getState",
  54525. value: function getState() {
  54526. return this.renderer.getState();
  54527. }
  54528. /**
  54529. * @function GraphicLayer.prototype.getMapState
  54530. * @description 获取当前地图状态。
  54531. * @returns {Object} 地图状态,包含地图状态信息。
  54532. */
  54533. }, {
  54534. key: "getMapState",
  54535. value: function getMapState() {
  54536. var state = {};
  54537. var center = this.map.getCenter();
  54538. var longitude = center.lng;
  54539. var latitude = center.lat;
  54540. var zoom = this.map.getZoom();
  54541. var maxZoom = this.map.getMaxZoom();
  54542. var pitch = this.map.getPitch();
  54543. var bearing = this.map.getBearing();
  54544. var mapViewport = {
  54545. longitude: longitude,
  54546. latitude: latitude,
  54547. zoom: zoom,
  54548. maxZoom: maxZoom,
  54549. pitch: pitch,
  54550. bearing: bearing
  54551. };
  54552. for (var key in mapViewport) {
  54553. state[key] = mapViewport[key];
  54554. }
  54555. //当使用扩展的maplibregl代码时有效
  54556. if (this.map.getCRS && this.map.getCRS() !== (external_maplibregl_default()).CRS.EPSG3857) {
  54557. state.coordinateSystem = this.coordinateSystem;
  54558. state.isGeographicCoordinateSystem = this.isGeographicCoordinateSystem;
  54559. }
  54560. return state;
  54561. }
  54562. }]);
  54563. return GraphicLayer;
  54564. }();
  54565. ;// CONCATENATED MODULE: ./src/common/overlay/graticule/GraticuleLayerRenderer.js
  54566. function GraticuleLayerRenderer_toConsumableArray(arr) { return GraticuleLayerRenderer_arrayWithoutHoles(arr) || GraticuleLayerRenderer_iterableToArray(arr) || GraticuleLayerRenderer_unsupportedIterableToArray(arr) || GraticuleLayerRenderer_nonIterableSpread(); }
  54567. function GraticuleLayerRenderer_nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
  54568. function GraticuleLayerRenderer_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return GraticuleLayerRenderer_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return GraticuleLayerRenderer_arrayLikeToArray(o, minLen); }
  54569. function GraticuleLayerRenderer_iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
  54570. function GraticuleLayerRenderer_arrayWithoutHoles(arr) { if (Array.isArray(arr)) return GraticuleLayerRenderer_arrayLikeToArray(arr); }
  54571. function GraticuleLayerRenderer_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
  54572. function GraticuleLayerRenderer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  54573. function GraticuleLayerRenderer_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  54574. function GraticuleLayerRenderer_createClass(Constructor, protoProps, staticProps) { if (protoProps) GraticuleLayerRenderer_defineProperties(Constructor.prototype, protoProps); if (staticProps) GraticuleLayerRenderer_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  54575. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  54576. * This program are made available under the terms of the Apache License, Version 2.0
  54577. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  54578. /**
  54579. * reference and modification
  54580. * dereklieu/cool-grid, cloudybay/leaflet.latlng-graticule
  54581. * (https://github.com/dereklieu/cool-grid, https://github.com/cloudybay/leaflet.latlng-graticule)
  54582. * Apache Licene 2.0
  54583. * thanks dereklieu, cloudybay
  54584. */
  54585. /**
  54586. * @private
  54587. * @class GraticuleLayerRenderer
  54588. * @classdesc 经纬网。
  54589. * @version 11.1.1
  54590. * @param {Object} options - 参数。
  54591. * @param {boolean} [options.visible=true] - 是否显示经纬网。
  54592. * @param {boolean} [options.showLabel=true] - 是否显示标签。
  54593. * @param {number} [options.opacity=1] - 画布不透明度。
  54594. * @param {number|function} [options.interval = 10] - 经纬度的间隔(以度为单位),可以是数字,也可以是函数,参数是map。
  54595. * @param {Array.<number>} [options.extent] - 经纬网渲染的边界范围([minx, miny, maxx, maxy]),不传为整个地图范围。
  54596. * @param {number} [options.minZoom] - 最小视图缩放级别(不包括此级别),在该级别之上,该层将可见。
  54597. * @param {number} [options.maxZoom] - 该图层可见的最大视图缩放级别(含)。
  54598. * @param {function} [options.lngLabelFormatter = null] - 经度标签转换函数。
  54599. * @param {function} [options.latLabelFormatter = null] - 纬度标签转换函数。
  54600. * @param {GraticuleLayerRenderer.LabelStyle} [options.lngLabelStyle] - 经度标签样式。
  54601. * @param {GraticuleLayerRenderer.LabelStyle} [options.latLabelStyle] - 纬度标签样式。
  54602. * @param {GraticuleLayerRenderer.StrokeStyle} [options.strokeStyle] - 绘制经纬线的样式。
  54603. * @param {Object} [functions] - 图层传递给渲染器调用的方法。
  54604. * @param {Object} [mapOptions] - 图层传递给渲染器的地图元素信息。
  54605. * @usage
  54606. */
  54607. var defaultTextStyle = {
  54608. textSize: '12px',
  54609. textFont: ['12px Calibri', 'sans-serif'],
  54610. textAnchor: 'bottom',
  54611. textColor: 'rgba(0,0,0,1)',
  54612. textHaloColor: 'rgba(255,255,255,1)',
  54613. textHaloWidth: 1
  54614. };
  54615. var defaultStrokeStyle = {
  54616. lineColor: 'red',
  54617. lineCap: 'round',
  54618. // butt, round, square
  54619. lineJoin: 'round',
  54620. // bevel, round, miter
  54621. lindDasharray: [0.4, 5],
  54622. // 数组|function
  54623. lineDashOffset: 0,
  54624. lineWidth: 1 // 数字|function
  54625. };
  54626. var defaultOptions = {
  54627. showLabel: true,
  54628. opacity: 1,
  54629. visible: true,
  54630. interval: 10,
  54631. // function|number
  54632. extent: null,
  54633. minZoom: 0,
  54634. maxZoom: 50,
  54635. wrapX: true,
  54636. strokeStyle: defaultStrokeStyle,
  54637. lngLabelFormatter: null,
  54638. latLabelFormatter: null,
  54639. lngLabelStyle: defaultTextStyle,
  54640. latLabelStyle: defaultTextStyle
  54641. };
  54642. var GraticuleLayerRenderer = /*#__PURE__*/function () {
  54643. function GraticuleLayerRenderer(map, options, functions, mapOptions) {
  54644. GraticuleLayerRenderer_classCallCheck(this, GraticuleLayerRenderer);
  54645. this.map = map;
  54646. this.id = mapOptions && mapOptions.id;
  54647. this.sourceId = this.id + '_line';
  54648. this.canvasId = this.id;
  54649. this.options = options;
  54650. this.mapElement = mapOptions.mapElement;
  54651. this.targetElement = mapOptions.targetElement;
  54652. this.getMapStateByKey = functions.getMapStateByKey;
  54653. this.getDefaultExtent = functions.getDefaultExtent;
  54654. this.setVisibility = functions.setVisibility;
  54655. this.updateGraticuleLayer = functions.updateGraticuleLayer;
  54656. this.init();
  54657. }
  54658. GraticuleLayerRenderer_createClass(GraticuleLayerRenderer, [{
  54659. key: "init",
  54660. value: function init() {
  54661. this._initialize();
  54662. this._createCanvas();
  54663. this._drawCanvas();
  54664. this.setVisibility();
  54665. this._drawLabel();
  54666. }
  54667. }, {
  54668. key: "onRemove",
  54669. value: function onRemove() {
  54670. this.targetElement.removeChild(this.canvas);
  54671. this.canvas = null;
  54672. }
  54673. /**
  54674. * @function GraticuleLayerRenderer.prototype.setMinZoom
  54675. * @description 设置最小视图缩放级别。
  54676. * @param {number} minZoom - 最小视图缩放级别(不包括此级别),在该级别之上,该层将可见。
  54677. */
  54678. }, {
  54679. key: "setMinZoom",
  54680. value: function setMinZoom(minZoom) {
  54681. this.options.minZoom = minZoom;
  54682. this.setVisibility();
  54683. }
  54684. /**
  54685. * @function GraticuleLayerRenderer.prototype.setMaxZoom
  54686. * @description 该图层可见的最大视图缩放级别。
  54687. * @param {number} maxZoom - 该图层可见的最大视图缩放级别(含)。
  54688. */
  54689. }, {
  54690. key: "setMaxZoom",
  54691. value: function setMaxZoom(maxZoom) {
  54692. this.options.maxZoom = maxZoom;
  54693. this.setVisibility();
  54694. }
  54695. /**
  54696. * @function GraticuleLayerRenderer.prototype.setShowLabel
  54697. * @description 设置显示标签。
  54698. * @param {boolean} showLabel - 是否显示标签。
  54699. */
  54700. }, {
  54701. key: "setShowLabel",
  54702. value: function setShowLabel(showLabel) {
  54703. this.options.showLabel = showLabel;
  54704. this._drawLabel();
  54705. }
  54706. /**
  54707. * @function GraticuleLayerRenderer.prototype.setExtent
  54708. * @description 设置经纬网渲染的边界范围。
  54709. * @param {Array.<number>} extent - 经纬网渲染的边界范围。
  54710. */
  54711. }, {
  54712. key: "setExtent",
  54713. value: function setExtent(extent) {
  54714. this.options.extent = this.getDefaultExtent(extent);
  54715. this.features = this._getGraticuleFeatures();
  54716. this.updateGraticuleLayer();
  54717. this._drawLabel();
  54718. }
  54719. /**
  54720. * @function GraticuleLayerRenderer.prototype.setLngLabelStyle
  54721. * @description 设置经度标签样式。
  54722. * @param {GraticuleLayerRenderer.LabelStyle} labelStyle - 标签样式。
  54723. */
  54724. }, {
  54725. key: "setLngLabelStyle",
  54726. value: function setLngLabelStyle(labelStyle) {
  54727. this.options.lngLabelStyle = labelStyle;
  54728. this._drawLabel();
  54729. }
  54730. /**
  54731. * @function GraticuleLayerRenderer.prototype.setLatLabelStyle
  54732. * @description 设置纬度标签样式。
  54733. * @param {GraticuleLayerRenderer.LabelStyle} labelStyle - 标签样式。
  54734. */
  54735. }, {
  54736. key: "setLatLabelStyle",
  54737. value: function setLatLabelStyle(labelStyle) {
  54738. this.options.latLabelStyle = labelStyle;
  54739. this._drawLabel();
  54740. }
  54741. /**
  54742. * @function GraticuleLayerRenderer.prototype.setIntervals
  54743. * @description 设置经纬度的间隔(以度为单位)。
  54744. * @param {number|function} interval - 经纬度的间隔(以度为单位),可以是数字,也可以是函数,参数是map。
  54745. */
  54746. }, {
  54747. key: "setIntervals",
  54748. value: function setIntervals(interval) {
  54749. this.options.interval = interval;
  54750. this._calcInterval();
  54751. this.features = this._getGraticuleFeatures();
  54752. this.updateGraticuleLayer();
  54753. this._drawLabel();
  54754. }
  54755. }, {
  54756. key: "draw",
  54757. value: function draw() {
  54758. this._reset();
  54759. }
  54760. }, {
  54761. key: "_initialize",
  54762. value: function _initialize() {
  54763. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.options;
  54764. options = options || {};
  54765. options.strokeStyle = Object.assign({}, defaultStrokeStyle, options.strokeStyle || {});
  54766. options.lngLabelStyle = Object.assign({}, defaultTextStyle, options.lngLabelStyle || {});
  54767. options.latLabelStyle = Object.assign({}, defaultTextStyle, options.latLabelStyle || {});
  54768. this.options = Object.assign({}, defaultOptions, options, {
  54769. extent: this.getDefaultExtent(options.extent),
  54770. // 提出去
  54771. wrapX: options.wrapX
  54772. });
  54773. this.oldExtent = this.options.extent;
  54774. this._calcInterval();
  54775. this.isRotate = false;
  54776. this.visible = true;
  54777. this.features = this._getGraticuleFeatures();
  54778. }
  54779. }, {
  54780. key: "_createCanvas",
  54781. value: function _createCanvas() {
  54782. if (this.canvas) {
  54783. return;
  54784. }
  54785. var mapElement = this.mapElement;
  54786. this.canvas = document.createElement('canvas');
  54787. this.canvas.id = this.canvasId;
  54788. this.canvas.style.position = 'absolute';
  54789. this.canvas.style.top = 0 + 'px';
  54790. this.canvas.style.left = 0 + 'px';
  54791. var global$2 = typeof window === 'undefined' ? {} : window;
  54792. var devicePixelRatio = global$2.devicePixelRatio || 1;
  54793. this.canvas.width = parseInt(mapElement.style.width) * devicePixelRatio;
  54794. this.canvas.height = parseInt(mapElement.style.height) * devicePixelRatio;
  54795. this.canvas.style.width = mapElement.style.width;
  54796. this.canvas.style.height = mapElement.style.height;
  54797. this.canvas.globalAlpha = this.options.opacity;
  54798. this.targetElement.appendChild(this.canvas);
  54799. }
  54800. }, {
  54801. key: "_drawCanvas",
  54802. value: function _drawCanvas() {
  54803. if (!this.canvas) {
  54804. this._createCanvas();
  54805. }
  54806. this.setVisibility();
  54807. this._reset();
  54808. }
  54809. }, {
  54810. key: "_resizeCallback",
  54811. value: function _resizeCallback() {
  54812. this.targetElement && this.targetElement.removeChild(this.canvas);
  54813. this.canvas = null;
  54814. this._drawCanvas();
  54815. }
  54816. }, {
  54817. key: "_reset",
  54818. value: function _reset() {
  54819. this._updateRotate();
  54820. this._updateExtent();
  54821. this._calcInterval();
  54822. this._drawLabel();
  54823. }
  54824. }, {
  54825. key: "_updateRotate",
  54826. value: function _updateRotate() {
  54827. var bearing = this.getMapStateByKey('getBearing');
  54828. this.isRotate = bearing > -180 && bearing <= -90 || bearing >= 90 && bearing < 180;
  54829. }
  54830. }, {
  54831. key: "_updateExtent",
  54832. value: function _updateExtent() {
  54833. if (this.options.wrapX && !this.oldExtent) {
  54834. var _this$getMapStateByKe2 = this.getMapStateByKey('getBounds'),
  54835. _ne = _this$getMapStateByKe2._ne,
  54836. _sw = _this$getMapStateByKe2._sw;
  54837. this.options.extent = [_sw.lng, _sw.lat, _ne.lng, _ne.lat];
  54838. }
  54839. }
  54840. }, {
  54841. key: "_calcInterval",
  54842. value: function _calcInterval() {
  54843. var interval = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.options.interval;
  54844. if (typeof interval === 'function') {
  54845. interval = interval(this.map);
  54846. this._currLngInterval = interval;
  54847. this._currLatInterval = interval;
  54848. } else {
  54849. this._currLngInterval = interval;
  54850. this._currLatInterval = interval;
  54851. }
  54852. }
  54853. }, {
  54854. key: "_formatLat",
  54855. value: function _formatLat(lat) {
  54856. if (this.options.latFormatTickLabel) {
  54857. return this.options.latLabelFormatter(lat);
  54858. }
  54859. if (lat < 0) {
  54860. return '' + conversionDegree(lat * -1) + 'S';
  54861. } else if (lat > 0) {
  54862. return '' + conversionDegree(lat) + 'N';
  54863. }
  54864. return '' + conversionDegree(lat);
  54865. }
  54866. }, {
  54867. key: "_formatLng",
  54868. value: function _formatLng(lng) {
  54869. if (this.options.lngLabelFormatter) {
  54870. return this.options.lngLabelFormatter(lng);
  54871. }
  54872. lng = getWrapNum(lng);
  54873. if (lng > 0 && lng <= 180) {
  54874. return '' + conversionDegree(lng) + 'E';
  54875. } else if (lng < 0 && lng >= -180) {
  54876. return '' + conversionDegree(lng * -1) + 'W';
  54877. }
  54878. return '' + conversionDegree(lng);
  54879. }
  54880. }, {
  54881. key: "_parsePxToInt",
  54882. value: function _parsePxToInt(txt) {
  54883. if (txt.length > 2) {
  54884. if (txt.charAt(txt.length - 2) === 'p') {
  54885. txt = txt.substr(0, txt.length - 2);
  54886. }
  54887. }
  54888. try {
  54889. return parseInt(txt, 10);
  54890. } catch (e) {
  54891. console.log(e);
  54892. }
  54893. return 0;
  54894. }
  54895. }, {
  54896. key: "_drawLabel",
  54897. value: function _drawLabel() {
  54898. var _this = this;
  54899. var visible = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.visible;
  54900. var canvas = this.canvas;
  54901. var ctx = canvas.getContext('2d');
  54902. if (!visible || !this.options.showLabel) {
  54903. ctx.clearRect(0, 0, canvas.width, canvas.height);
  54904. return;
  54905. }
  54906. if (this.mapElement) {
  54907. if (!this._currLngInterval || !this._currLatInterval) {
  54908. this._calcInterval();
  54909. }
  54910. ctx.clearRect(0, 0, canvas.width, canvas.height);
  54911. var _this$options2 = this.options,
  54912. lngLabelStyle = _this$options2.lngLabelStyle,
  54913. latLabelStyle = _this$options2.latLabelStyle;
  54914. var _this$_getGridiculePo2 = this._getGridiculePoints(),
  54915. lngPoints = _this$_getGridiculePo2.lngPoints,
  54916. latPonits = _this$_getGridiculePo2.latPonits;
  54917. lngPoints.forEach(function (point) {
  54918. _this._drawLng(ctx, point[0], point[1], point[2], lngLabelStyle);
  54919. });
  54920. latPonits.forEach(function (point) {
  54921. _this._drawLat(ctx, point[0], point[1], point[2], latLabelStyle);
  54922. });
  54923. }
  54924. }
  54925. }, {
  54926. key: "_drawLat",
  54927. value: function _drawLat(ctx, latTick, bb, isIntersect, latLabelStyle) {
  54928. ctx = this._setLabelStyle(ctx, latLabelStyle);
  54929. var ww = this.canvas.width;
  54930. var txtHeight = 12;
  54931. try {
  54932. var fontSize = ctx.font.split(' ')[0];
  54933. txtHeight = this._parsePxToInt(fontSize);
  54934. } catch (e) {
  54935. console.log(e);
  54936. }
  54937. if (!isIntersect) {
  54938. var lngR = latTick;
  54939. latTick = bb;
  54940. bb = this.getMapStateByKey('project', [lngR, latTick]);
  54941. }
  54942. var latstr = this._formatLat(latTick);
  54943. var txtWidth = ctx.measureText(latstr).width;
  54944. ctx.strokeText(latstr, (isIntersect ? ww : bb.x) - txtWidth, (isIntersect ? bb : bb.y) + txtHeight / 2);
  54945. ctx.fillText(latstr, (isIntersect ? ww : bb.x) - txtWidth, (isIntersect ? bb : bb.y) + txtHeight / 2);
  54946. }
  54947. }, {
  54948. key: "_drawLng",
  54949. value: function _drawLng(ctx, lngTick, bb, isIntersect, lngLabelStyle) {
  54950. ctx = this._setLabelStyle(ctx, lngLabelStyle);
  54951. var hh = this.canvas.height;
  54952. if (!isIntersect) {
  54953. var latTick = bb;
  54954. bb = this.getMapStateByKey('project', [lngTick, latTick]);
  54955. }
  54956. var lngstr = this._formatLng(lngTick);
  54957. var txtWidth = ctx.measureText(lngstr).width;
  54958. ctx.strokeText(lngstr, (isIntersect ? bb : bb.x) - txtWidth / 2, isIntersect ? hh : bb.y);
  54959. ctx.fillText(lngstr, (isIntersect ? bb : bb.x) - txtWidth / 2, isIntersect ? hh : bb.y);
  54960. }
  54961. }, {
  54962. key: "_getLatPoints",
  54963. value: function _getLatPoints() {
  54964. var _this2 = this;
  54965. var lngRange = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [-180, 180];
  54966. var firstLng = arguments.length > 1 ? arguments[1] : undefined;
  54967. var lastLng = arguments.length > 2 ? arguments[2] : undefined;
  54968. var features = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : this.features;
  54969. if (!features) {
  54970. return;
  54971. }
  54972. if (this.options.wrapX && lngRange[0] === -180 && lngRange[1] === 180) {
  54973. return [];
  54974. }
  54975. var points = [];
  54976. features.forEach(function (feature) {
  54977. var lat = feature.geometry.coordinates[0][1];
  54978. var isLatFeature = feature.geometry.coordinates[1][1] === lat;
  54979. if (isLatFeature) {
  54980. var lng = typeof lastLng === 'number' ? lastLng : lngRange[1];
  54981. if (_this2.isRotate) {
  54982. lng = typeof firstLng === 'number' ? firstLng : lngRange[0];
  54983. }
  54984. if (_this2.options.wrapX) {
  54985. points = points.concat(_this2._getWrapPoints(lng, lat, [lng, lng]));
  54986. }
  54987. points.push([lng, lat]);
  54988. }
  54989. });
  54990. return points;
  54991. }
  54992. }, {
  54993. key: "_getLngPoints",
  54994. value: function _getLngPoints() {
  54995. var _this3 = this;
  54996. var latRange = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [-90, 90];
  54997. var firstLat = arguments.length > 1 ? arguments[1] : undefined;
  54998. var lastLat = arguments.length > 2 ? arguments[2] : undefined;
  54999. var features = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : this.features;
  55000. if (!features) {
  55001. return;
  55002. }
  55003. var lat = typeof firstLat === 'number' ? firstLat : latRange[0];
  55004. if (this.isRotate) {
  55005. lat = typeof lastLat === 'number' ? lastLat : latRange[1];
  55006. }
  55007. var points = [];
  55008. features.forEach(function (feature) {
  55009. var lng = feature.geometry.coordinates[0][0];
  55010. var isLngFeature = feature.geometry.coordinates[1][0] === lng;
  55011. if (isLngFeature) {
  55012. points.push([lng, lat]);
  55013. if (_this3.options.wrapX) {
  55014. points = points.concat(_this3._getWrapPoints(lng, lat));
  55015. }
  55016. }
  55017. });
  55018. return points;
  55019. }
  55020. }, {
  55021. key: "_getWrapPoints",
  55022. value: function _getWrapPoints(lng, lat) {
  55023. var extent = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.oldExtent;
  55024. var points = [];
  55025. var _this$getMapStateByKe3 = this.getMapStateByKey('getBounds'),
  55026. _ne = _this$getMapStateByKe3._ne,
  55027. _sw = _this$getMapStateByKe3._sw;
  55028. var lastLng = extent.length > 2 ? extent[2] : extent[1];
  55029. while (lng >= _sw.lng) {
  55030. var wrapNum = getWrapNum(lng, lastLng === 180, extent[0] === -180);
  55031. if (!extent || wrapNum >= extent[0] && wrapNum <= lastLng) {
  55032. points.push([lng, lat]);
  55033. }
  55034. lng -= 360;
  55035. }
  55036. while (lng <= _ne.lng) {
  55037. var _wrapNum = getWrapNum(lng, lastLng === 180, extent[0] === -180);
  55038. if (!extent || _wrapNum >= extent[0] && _wrapNum <= lastLng) {
  55039. points.push([lng, lat]);
  55040. }
  55041. lng += 360;
  55042. }
  55043. return points;
  55044. }
  55045. }, {
  55046. key: "_getGridiculePoints",
  55047. value: function _getGridiculePoints() {
  55048. var intersectLatPoints = this._getEdgeLat();
  55049. var intersectLngPoints = this._getEdgeLng();
  55050. var _this$_getRange = this._getRange(),
  55051. latRange = _this$_getRange.latRange,
  55052. lngRange = _this$_getRange.lngRange,
  55053. firstLat = _this$_getRange.firstLat,
  55054. firstLng = _this$_getRange.firstLng,
  55055. lastLat = _this$_getRange.lastLat,
  55056. lastLng = _this$_getRange.lastLng;
  55057. var latPonits = this._getUniquePoint(this._getLatPoints(lngRange, firstLng, lastLng), intersectLatPoints, 1);
  55058. var lngPoints = this._getUniquePoint(this._getLngPoints(latRange, firstLat, lastLat), intersectLngPoints, 0);
  55059. return {
  55060. latPonits: latPonits,
  55061. lngPoints: lngPoints
  55062. };
  55063. }
  55064. }, {
  55065. key: "_getEdgeLat",
  55066. value: function _getEdgeLat() {
  55067. var _currLatInterval = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this._currLatInterval;
  55068. var latPoints = [];
  55069. var latCoordinates = [];
  55070. var firstLat;
  55071. var ww = this.canvas.width;
  55072. var hh = this.canvas.height;
  55073. var _this$_getRange2 = this._getRange(),
  55074. extent = _this$_getRange2.extent;
  55075. var _this$getMapStateByKe4 = this.getMapStateByKey('getBounds'),
  55076. _ne = _this$getMapStateByKe4._ne;
  55077. if (this.options.wrapX && getWrapNum(_ne.lng) > extent[2]) {
  55078. return [];
  55079. }
  55080. var countDecimals = this._countDecimals(_currLatInterval);
  55081. for (var i = 0; i <= hh; i++) {
  55082. var point = this.getMapStateByKey('unproject', [ww, i]);
  55083. var wrapNum = getWrapNum(point.lng);
  55084. var lngEdge = this.options.wrapX ? wrapNum >= extent[0] && wrapNum <= extent[2] : point.lng >= extent[0] && point.lng <= extent[2];
  55085. if (lngEdge && point.lat >= extent[1] && point.lat <= extent[3]) {
  55086. latPoints.push([point.lat, i]);
  55087. latCoordinates.push(point.lat);
  55088. if (firstLat === undefined && point.lat.toFixed(countDecimals) % _currLatInterval === 0) {
  55089. firstLat = Number(point.lat.toFixed(countDecimals));
  55090. }
  55091. }
  55092. }
  55093. var _this$_getIntersectRa = this._getIntersectRange(firstLat, latCoordinates, latPoints, _currLatInterval),
  55094. first = _this$_getIntersectRa.first,
  55095. last = _this$_getIntersectRa.last,
  55096. coordinates = _this$_getIntersectRa.coordinates,
  55097. points = _this$_getIntersectRa.points;
  55098. firstLat = Math.min(Math.max(first, -90), 90);
  55099. var lastLat = Math.max(Math.min(Math.round(last), 90), -90);
  55100. if (firstLat !== -90 || lastLat !== -90) {
  55101. return this._getClosestCoordinate(firstLat, lastLat, coordinates, points, _currLatInterval);
  55102. }
  55103. return [];
  55104. }
  55105. }, {
  55106. key: "_getEdgeLng",
  55107. value: function _getEdgeLng() {
  55108. var _currLngInterval = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this._currLngInterval;
  55109. var lngPoints = [];
  55110. var lngCoordinates = [];
  55111. var firstLng;
  55112. var ww = this.canvas.width;
  55113. var hh = this.canvas.height;
  55114. var extent = this.options.extent;
  55115. var countDecimals = this._countDecimals(_currLngInterval);
  55116. var _this$getMapStateByKe5 = this.getMapStateByKey('getBounds'),
  55117. _sw = _this$getMapStateByKe5._sw;
  55118. if (this.options.wrapX && getWrapNum(_sw.lat) > extent[3]) {
  55119. return [];
  55120. }
  55121. for (var i = 0; i <= ww; i++) {
  55122. var point = this.getMapStateByKey('unproject', [i, hh]);
  55123. var wrapNum = getWrapNum(point.lng);
  55124. var lngEdge = this.options.wrapX ? wrapNum >= extent[0] && wrapNum <= extent[2] : point.lng >= extent[0] && point.lng <= extent[2];
  55125. if (lngEdge && point.lat >= extent[1] && point.lat <= extent[3]) {
  55126. lngPoints.push([point.lng, i]);
  55127. lngCoordinates.push(point.lng);
  55128. if (firstLng === undefined && point.lng.toFixed(countDecimals) % _currLngInterval === 0) {
  55129. firstLng = Number(point.lng.toFixed(countDecimals));
  55130. }
  55131. }
  55132. }
  55133. var _this$_getIntersectRa2 = this._getIntersectRange(firstLng, lngCoordinates, lngPoints, _currLngInterval),
  55134. first = _this$_getIntersectRa2.first,
  55135. lastLng = _this$_getIntersectRa2.last,
  55136. coordinates = _this$_getIntersectRa2.coordinates,
  55137. points = _this$_getIntersectRa2.points;
  55138. firstLng = first;
  55139. return this._getClosestCoordinate(firstLng, lastLng, coordinates, points, _currLngInterval);
  55140. }
  55141. }, {
  55142. key: "_getIntersectRange",
  55143. value: function _getIntersectRange(first, coordinates, points, interval) {
  55144. var last = coordinates[coordinates.length - 1];
  55145. if (first > last) {
  55146. last = first;
  55147. coordinates.reverse();
  55148. points.reverse();
  55149. var countDecimals = this._countDecimals(interval);
  55150. for (var i = 0; i <= coordinates.length; i++) {
  55151. var point = coordinates[i];
  55152. if (point.toFixed(countDecimals) % interval === 0) {
  55153. first = Number(point.toFixed(countDecimals));
  55154. break;
  55155. }
  55156. }
  55157. }
  55158. return {
  55159. first: first,
  55160. last: last,
  55161. coordinates: coordinates,
  55162. points: points
  55163. };
  55164. }
  55165. }, {
  55166. key: "_getClosestCoordinate",
  55167. value: function _getClosestCoordinate(first, last, coordinates, points, interval) {
  55168. var result = [];
  55169. var graticule = first;
  55170. while (graticule <= last) {
  55171. var index = this._getClosestNumberIndex(graticule, coordinates);
  55172. var point = points[index];
  55173. result.push([Math.round(point[0]), point[1], true]);
  55174. graticule += interval;
  55175. coordinates = coordinates.slice(index);
  55176. points = points.slice(index);
  55177. }
  55178. return result;
  55179. }
  55180. }, {
  55181. key: "_getClosestNumberIndex",
  55182. value: function _getClosestNumberIndex(num, arr) {
  55183. var index = 0;
  55184. var diffValue = Number.MAX_VALUE;
  55185. for (var i = 0; i < arr.length; i++) {
  55186. var newDiffValue = Math.abs(arr[i] - num);
  55187. if (newDiffValue <= diffValue) {
  55188. if (newDiffValue === diffValue && arr[i] < arr[index]) {
  55189. continue;
  55190. }
  55191. index = i;
  55192. diffValue = newDiffValue;
  55193. }
  55194. }
  55195. return index;
  55196. }
  55197. }, {
  55198. key: "_getUniquePoint",
  55199. value: function _getUniquePoint(points, intersectPoints) {
  55200. var index = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
  55201. if (this.options.wrapX) {
  55202. return points.concat(intersectPoints);
  55203. }
  55204. if (!intersectPoints || intersectPoints.length === 0) {
  55205. return points;
  55206. }
  55207. var tmp = intersectPoints;
  55208. var width = this.canvas.width;
  55209. var height = this.canvas.height;
  55210. for (var i in points) {
  55211. var edgePoint = this.getMapStateByKey('project', points[i]);
  55212. var intersetIndex = tmp.findIndex(function (item) {
  55213. return item[0] === points[i][index];
  55214. });
  55215. if (intersetIndex <= -1) {
  55216. tmp.push(points[i]);
  55217. } else if (edgePoint && edgePoint.x >= 0 && edgePoint.x <= width && edgePoint.y >= 0 && edgePoint.y <= height) {
  55218. tmp[intersetIndex] = points[i];
  55219. }
  55220. }
  55221. return tmp;
  55222. }
  55223. }, {
  55224. key: "_countDecimals",
  55225. value: function _countDecimals(value) {
  55226. if (Math.floor(value) !== value) {
  55227. return value.toString().split('.')[1].length || 0;
  55228. }
  55229. return 0;
  55230. }
  55231. }, {
  55232. key: "_getGraticuleFeatures",
  55233. value: function _getGraticuleFeatures() {
  55234. var _currLngInterval = this._currLngInterval || 10;
  55235. var _currLatInterval = this._currLatInterval || 10;
  55236. var features = [];
  55237. var _this$_getRange3 = this._getRange(),
  55238. latRange = _this$_getRange3.latRange,
  55239. lngRange = _this$_getRange3.lngRange,
  55240. firstLat = _this$_getRange3.firstLat,
  55241. firstLng = _this$_getRange3.firstLng,
  55242. lastLat = _this$_getRange3.lastLat,
  55243. lastLng = _this$_getRange3.lastLng;
  55244. if (this.options.wrapX && !this.oldExtent) {
  55245. latRange = [-90, 90];
  55246. lngRange = [-180, 180];
  55247. firstLat = firstLng = lastLat = lastLng = null;
  55248. }
  55249. if (typeof firstLng === 'number') {
  55250. features.unshift(this._makeLineFeature(this._makeLineCoords(firstLng, latRange, firstLat, lastLat)));
  55251. }
  55252. if (typeof lastLng === 'number') {
  55253. features.unshift(this._makeLineFeature(this._makeLineCoords(lastLng, latRange, firstLat, lastLat)));
  55254. }
  55255. for (var lng = lngRange[0]; lng <= lngRange[1]; lng += _currLngInterval) {
  55256. features.unshift(this._makeLineFeature(this._makeLineCoords(lng, latRange, firstLat, lastLat)));
  55257. }
  55258. if (typeof firstLat === 'number') {
  55259. features.unshift(this._makeLineFeature(this._makeLineCoords(firstLat, lngRange, firstLng, lastLng, 'lat')));
  55260. }
  55261. if (typeof lastLat === 'number') {
  55262. features.unshift(this._makeLineFeature(this._makeLineCoords(lastLat, lngRange, firstLng, lastLng, 'lat')));
  55263. }
  55264. for (var lat = latRange[0]; lat <= latRange[1]; lat += _currLatInterval) {
  55265. features.unshift(this._makeLineFeature(this._makeLineCoords(lat, lngRange, firstLng, lastLng, 'lat')));
  55266. }
  55267. return features;
  55268. }
  55269. }, {
  55270. key: "_getRange",
  55271. value: function _getRange() {
  55272. var extent = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.options.extent && GraticuleLayerRenderer_toConsumableArray(this.options.extent);
  55273. if (!extent || extent.length === 0) {
  55274. extent = this.getDefaultExtent();
  55275. }
  55276. extent = extent.map(function (item) {
  55277. return Number(item.toFixed(6));
  55278. });
  55279. var realExtent = {};
  55280. if (extent[1] % this._currLatInterval !== 0) {
  55281. realExtent.firstLat = extent[1];
  55282. var intNumber = Math.ceil(extent[1] / this._currLatInterval);
  55283. extent[1] = intNumber * this._currLatInterval;
  55284. }
  55285. if (extent[3] % this._currLatInterval !== 0) {
  55286. realExtent.lastLat = extent[3];
  55287. var _intNumber = Math.floor(extent[3] / this._currLatInterval);
  55288. extent[3] = _intNumber * this._currLatInterval;
  55289. }
  55290. if (extent[0] % this._currLngInterval !== 0) {
  55291. realExtent.firstLng = extent[0];
  55292. var _intNumber2 = Math.ceil(extent[0] / this._currLngInterval);
  55293. extent[0] = _intNumber2 * this._currLngInterval;
  55294. }
  55295. if (extent[2] % this._currLngInterval !== 0) {
  55296. realExtent.lastLng = extent[2];
  55297. var _intNumber3 = Math.floor(extent[2] / this._currLngInterval);
  55298. extent[2] = _intNumber3 * this._currLngInterval;
  55299. }
  55300. var result = Object.assign({
  55301. latRange: [extent[1], extent[3]],
  55302. lngRange: [extent[0], extent[2]],
  55303. extent: extent
  55304. }, realExtent);
  55305. return result;
  55306. }
  55307. }, {
  55308. key: "_makeLineCoords",
  55309. value: function _makeLineCoords(fixedDegree) {
  55310. var range = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [-90, 90];
  55311. var first = arguments.length > 2 ? arguments[2] : undefined;
  55312. var last = arguments.length > 3 ? arguments[3] : undefined;
  55313. var type = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 'lng';
  55314. fixedDegree = type === 'lng' ? this._lngFix(fixedDegree) : fixedDegree;
  55315. first = typeof first === 'number' ? first : range[0];
  55316. last = typeof last === 'number' ? last : range[1];
  55317. var interval = Math.abs(first - last);
  55318. var coords = [];
  55319. for (var changedDegree = first; changedDegree <= last; changedDegree += interval) {
  55320. if (type === 'lng') {
  55321. coords.push([fixedDegree, changedDegree]);
  55322. } else {
  55323. coords.push([changedDegree, fixedDegree]);
  55324. }
  55325. }
  55326. return coords;
  55327. }
  55328. }, {
  55329. key: "_makeLineFeature",
  55330. value: function _makeLineFeature(coordinates) {
  55331. var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'LineString';
  55332. return {
  55333. type: 'Feature',
  55334. geometry: {
  55335. type: type,
  55336. coordinates: coordinates
  55337. }
  55338. };
  55339. }
  55340. }, {
  55341. key: "_lngFix",
  55342. value: function _lngFix(lng) {
  55343. if (lng >= 180) {
  55344. return 180;
  55345. }
  55346. if (lng <= -180) {
  55347. return -180;
  55348. }
  55349. return lng;
  55350. }
  55351. }, {
  55352. key: "_transformStrokeStyle",
  55353. value: function _transformStrokeStyle() {
  55354. var strokeStyle = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.options.strokeStyle;
  55355. if (!strokeStyle || typeof strokeStyle === 'string') {
  55356. return {
  55357. paint: {
  55358. 'line-color': strokeStyle || 'rgba(0,0,0,0.2)'
  55359. }
  55360. };
  55361. }
  55362. var layout = {
  55363. visibility: this.visible ? 'visible' : 'none',
  55364. 'line-join': strokeStyle.lineJoin || 'round',
  55365. 'line-cap': strokeStyle.lineCap || 'round'
  55366. };
  55367. var paint = {
  55368. 'line-color': strokeStyle.lineColor || 'rgba(0,0,0,0.2)',
  55369. 'line-width': strokeStyle.lineWidth || 1,
  55370. 'line-offset': strokeStyle.lineDashOffset || 0,
  55371. 'line-translate-anchor': 'viewport'
  55372. };
  55373. if (strokeStyle.lineWidth) {
  55374. if (typeof strokeStyle.lineWidth === 'function') {
  55375. paint['line-width'] = strokeStyle.lineWidth(this.map);
  55376. } else {
  55377. paint['line-width'] = strokeStyle.lineWidth;
  55378. }
  55379. }
  55380. if (strokeStyle.lindDasharray) {
  55381. if (typeof strokeStyle.lindDasharray === 'function') {
  55382. paint['line-dasharray'] = strokeStyle.lindDasharray(this.map);
  55383. } else {
  55384. paint['line-dasharray'] = strokeStyle.lindDasharray;
  55385. }
  55386. }
  55387. return {
  55388. layout: layout,
  55389. paint: paint
  55390. };
  55391. }
  55392. }, {
  55393. key: "_setLabelStyle",
  55394. value: function _setLabelStyle(ctx, labelStyle) {
  55395. if (labelStyle.textColor) {
  55396. ctx.fillStyle = labelStyle.textColor;
  55397. }
  55398. if (labelStyle.textSize) {
  55399. ctx.font = labelStyle.textSize + ' ' + (labelStyle.textFont || ['Calibri', 'sans-serif']).join(',');
  55400. }
  55401. if (labelStyle.textHaloColor) {
  55402. ctx.strokeStyle = labelStyle.textHaloColor;
  55403. ctx.lineWidth = labelStyle.textHaloWidth || 1;
  55404. }
  55405. if (labelStyle.textAnchor) {
  55406. ctx.textBaseline = this._getTxetBaseline(labelStyle.textAnchor);
  55407. ctx.textAligin = this._getTxetAlign(labelStyle.textAligin);
  55408. }
  55409. return ctx;
  55410. }
  55411. }, {
  55412. key: "_getTxetBaseline",
  55413. value: function _getTxetBaseline(textAnchor) {
  55414. if (!textAnchor) {
  55415. return 'bottom';
  55416. }
  55417. var textStyle = textAnchor.split('-');
  55418. if (textStyle.includes('bottom')) {
  55419. return 'bottom';
  55420. }
  55421. if (textStyle.includes('top')) {
  55422. return 'top';
  55423. }
  55424. if (textStyle.includes('center')) {
  55425. return 'middle';
  55426. }
  55427. }
  55428. }, {
  55429. key: "_getTxetAlign",
  55430. value: function _getTxetAlign(textAnchor) {
  55431. if (!textAnchor) {
  55432. return 'center';
  55433. }
  55434. var textStyle = textAnchor.split('-');
  55435. if (textStyle.includes('left')) {
  55436. return 'left';
  55437. }
  55438. if (textStyle.includes('right')) {
  55439. return 'right';
  55440. }
  55441. if (textStyle.includes('center')) {
  55442. return 'center';
  55443. }
  55444. }
  55445. }]);
  55446. return GraticuleLayerRenderer;
  55447. }();
  55448. ;// CONCATENATED MODULE: ./src/maplibregl/overlay/GraticuleLayer.js
  55449. function GraticuleLayer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  55450. function GraticuleLayer_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  55451. function GraticuleLayer_createClass(Constructor, protoProps, staticProps) { if (protoProps) GraticuleLayer_defineProperties(Constructor.prototype, protoProps); if (staticProps) GraticuleLayer_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  55452. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  55453. * This program are made available under the terms of the Apache License, Version 2.0
  55454. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  55455. /**
  55456. * reference and modification
  55457. * dereklieu/cool-grid, cloudybay/leaflet.latlng-graticule
  55458. * (https://github.com/dereklieu/cool-grid, https://github.com/cloudybay/leaflet.latlng-graticule)
  55459. * Apache Licene 2.0
  55460. * thanks dereklieu, cloudybay
  55461. */
  55462. /**
  55463. * @class GraticuleLayer
  55464. * @category Visualization GraticuleLayer
  55465. * @classdesc 经纬网类。
  55466. * @version 11.1.0
  55467. * @modulecategory Overlay
  55468. * @param {Object} options - 参数。
  55469. * @param {string} [options.layerID] - 图层 ID。默认使用 CommonUtil.createUniqueID("graticuleLayer_") 创建图层 ID。
  55470. * @param {boolean} [options.visible=true] - 是否显示经纬网。
  55471. * @param {boolean} [options.showLabel=true] - 是否显示标签。
  55472. * @param {number} [options.opacity=1] - 画布不透明度。
  55473. * @param {number|function} [options.interval = 10] - 经纬度的间隔(以度为单位),可以是数字,也可以是函数,参数是map。
  55474. * @param {maplibregl.LngLatBounds} [options.extent] - 经纬网渲染的边界范围([minx, miny, maxx, maxy]),不传为整个地图范围。
  55475. * @param {number} [options.minZoom] - 最小视图缩放级别(不包括此级别),在该级别之上,该层将可见。
  55476. * @param {number} [options.maxZoom] - 该图层可见的最大视图缩放级别(含)。
  55477. * @param {function} [options.lngLabelFormatter = null] - 经度标签转换函数。
  55478. * @param {function} [options.latLabelFormatter = null] - 纬度标签转换函数。
  55479. * @param {GraticuleLayer.LabelStyle} [options.lngLabelStyle] - 经度标签样式。
  55480. * @param {GraticuleLayer.LabelStyle} [options.latLabelStyle] - 纬度标签样式。
  55481. * @param {GraticuleLayer.StrokeStyle} [options.strokeStyle] - 绘制经纬线的样式。
  55482. * @usage
  55483. */
  55484. /**
  55485. * @typedef {Object} GraticuleLayer.LabelStyle - 标签样式。
  55486. * @property {Array.<string>} [textFont = ['Calibri','sans-serif']] - 字体样式。
  55487. * @property {string} [textSize = '12px'] - 字体大小。
  55488. * @property {string} [textColor ='rgba(0,0,0,1)'] - 字体颜色。
  55489. * @property {string} [textHaloColor ='rgba(255,255,255,1)'] - 描边颜色。
  55490. * @property {number} [textHaloWidth = 1] - 描边宽度。
  55491. * @property {string} [textAnchor = 'bottom'] - 字体基线: "center", "left", "right", "top", "bottom", "top-left", "top-right", "bottom-left", "bottom-right"。
  55492. */
  55493. /**
  55494. * @typedef {Object} GraticuleLayer.StrokeStyle - 线样式。
  55495. * @property {string} [lineColor = 'red'] - 线颜色。
  55496. * @property {string} [lineCap = 'round'] - 线端点风格:butt, round, square。
  55497. * @property {string} [lineJoin = round] - 线连接样式:bevel, round, miter。
  55498. * @property {Array.<number>} [lindDasharray = [0.5,4]] - 虚线样式。
  55499. * @property {number} [lineWidth = 1] - 线宽。
  55500. */
  55501. var GraticuleLayer_defaultTextStyle = {
  55502. textSize: '12px',
  55503. textFont: ['12px Calibri', 'sans-serif'],
  55504. textAnchor: 'bottom',
  55505. textColor: 'rgba(0,0,0,1)',
  55506. textHaloColor: 'rgba(255,255,255,1)',
  55507. textHaloWidth: 1
  55508. };
  55509. var GraticuleLayer_defaultStrokeStyle = {
  55510. lineColor: 'red',
  55511. lineCap: 'round',
  55512. // butt, round, square
  55513. lineJoin: 'round',
  55514. // bevel, round, miter
  55515. lindDasharray: [0.4, 5],
  55516. // 数组|function
  55517. lineDashOffset: 0,
  55518. lineWidth: 1 // 数字|function
  55519. };
  55520. var GraticuleLayer_defaultOptions = {
  55521. showLabel: true,
  55522. opacity: 1,
  55523. visible: true,
  55524. interval: 10,
  55525. // function|number
  55526. extent: null,
  55527. minZoom: 0,
  55528. maxZoom: 50,
  55529. wrapX: true,
  55530. strokeStyle: GraticuleLayer_defaultStrokeStyle,
  55531. lngLabelFormatter: null,
  55532. latLabelFormatter: null,
  55533. lngLabelStyle: GraticuleLayer_defaultTextStyle,
  55534. latLabelStyle: GraticuleLayer_defaultTextStyle
  55535. };
  55536. var GraticuleLayer = /*#__PURE__*/function () {
  55537. function GraticuleLayer(options) {
  55538. GraticuleLayer_classCallCheck(this, GraticuleLayer);
  55539. this.id = options && options.layerID ? options.layerID : Util_Util.createUniqueID('graticuleLayer_');
  55540. this.sourceId = this.id + '_line';
  55541. options = options || {};
  55542. options.strokeStyle = Object.assign({}, GraticuleLayer_defaultStrokeStyle, options.strokeStyle || {});
  55543. options.lngLabelStyle = Object.assign({}, GraticuleLayer_defaultTextStyle, options.lngLabelStyle || {});
  55544. options.latLabelStyle = Object.assign({}, GraticuleLayer_defaultTextStyle, options.latLabelStyle || {});
  55545. this.options = Object.assign({}, GraticuleLayer_defaultOptions, options);
  55546. this.type = 'custom';
  55547. this.renderingMode = '3d';
  55548. this.overlay = true;
  55549. this.styleDataEevent = this._setLayerTop.bind(this);
  55550. }
  55551. /**
  55552. * @function GraphicLayer.prototype.onAdd
  55553. * @description 添加该图层。
  55554. * @param {maplibregl.Map} map - MapLibreGL Map 对象。
  55555. */
  55556. GraticuleLayer_createClass(GraticuleLayer, [{
  55557. key: "onAdd",
  55558. value: function onAdd(map) {
  55559. this.map = map;
  55560. this.renderer = new GraticuleLayerRenderer(this.map, this.options, {
  55561. getMapStateByKey: this.getMapStateByKey,
  55562. getDefaultExtent: this.getDefaultExtent,
  55563. updateGraticuleLayer: this.updateGraticuleLayer.bind(this),
  55564. setVisibility: this.setVisibility.bind(this)
  55565. }, {
  55566. mapElement: this.map.getCanvas(),
  55567. targetElement: this.map.getCanvasContainer(),
  55568. id: this.id
  55569. });
  55570. this.addGraticuleLayer();
  55571. this.resizeEvent = this.renderer._resizeCallback.bind(this.renderer);
  55572. this.zoomendEvent = this.setVisibility.bind(this);
  55573. this._bindEvent();
  55574. }
  55575. }, {
  55576. key: "render",
  55577. value: function render() {
  55578. this.renderer.draw();
  55579. }
  55580. /**
  55581. * @function GraticuleLayer.prototype.getMapStateByKey
  55582. * @description 根据方法名与参数获取地图状态。
  55583. * @param {string} key - map 方法名。
  55584. * @param {Object} params - 参数。
  55585. */
  55586. }, {
  55587. key: "getMapStateByKey",
  55588. value: function getMapStateByKey(key, params) {
  55589. if (key === 'getBearing') {
  55590. return this.map.getBearing();
  55591. } else if (key === 'getBounds') {
  55592. return this.map.getBounds();
  55593. } else if (key === 'project') {
  55594. return this.map.project(params);
  55595. } else if (key === 'unproject') {
  55596. return this.map.unproject(params);
  55597. }
  55598. }
  55599. /**
  55600. * @function GraticuleLayer.prototype.onRemove
  55601. * @description 移除图层回调。
  55602. */
  55603. }, {
  55604. key: "onRemove",
  55605. value: function onRemove() {
  55606. this.renderer.onRemove();
  55607. this._unbindEvent();
  55608. }
  55609. /**
  55610. * @function GraticuleLayer.prototype.setVisibility
  55611. * @description 设置可见性。
  55612. * @param {boolean} visible - 是否可见。
  55613. */
  55614. }, {
  55615. key: "setVisibility",
  55616. value: function setVisibility(visible) {
  55617. var zoom = this.map && this.map.getZoom();
  55618. this.options.visible = typeof visible === 'boolean' ? visible : this.options.visible;
  55619. this.visible = typeof visible === 'boolean' ? visible : this.options.visible && zoom >= this.options.minZoom && zoom <= this.options.maxZoom;
  55620. if (this.renderer) {
  55621. this.renderer.visible = this.visible;
  55622. }
  55623. if (this.map.getLayer(this.sourceId)) {
  55624. this.map.setLayoutProperty(this.sourceId, 'visibility', this.visible ? 'visible' : 'none');
  55625. }
  55626. this.renderer && this.renderer._drawLabel();
  55627. }
  55628. /**
  55629. * @function GraticuleLayer.prototype.setMinZoom
  55630. * @description 设置最小视图缩放级别。
  55631. * @param {number} minZoom - 最小视图缩放级别(不包括此级别),在该级别之上,该层将可见。
  55632. */
  55633. }, {
  55634. key: "setMinZoom",
  55635. value: function setMinZoom(minZoom) {
  55636. this.options.minZoom = minZoom;
  55637. this.setVisibility();
  55638. }
  55639. /**
  55640. * @function GraticuleLayer.prototype.setMaxZoom
  55641. * @description 该图层可见的最大视图缩放级别。
  55642. * @param {number} maxZoom - 该图层可见的最大视图缩放级别(含)。
  55643. */
  55644. }, {
  55645. key: "setMaxZoom",
  55646. value: function setMaxZoom(maxZoom) {
  55647. this.options.maxZoom = maxZoom;
  55648. this.setVisibility();
  55649. }
  55650. /**
  55651. * @function GraticuleLayer.prototype.setShowLabel
  55652. * @description 设置显示标签。
  55653. * @param {boolean} showLabel - 是否显示标签。
  55654. */
  55655. }, {
  55656. key: "setShowLabel",
  55657. value: function setShowLabel(showLabel) {
  55658. this.options.showLabel = showLabel;
  55659. this.renderer._drawLabel();
  55660. }
  55661. /**
  55662. * @function GraticuleLayer.prototype.setExtent
  55663. * @description 设置经纬网渲染的边界范围。
  55664. * @param {maplibregl.LngLatBounds} extent - 经纬网渲染的边界范围。
  55665. */
  55666. }, {
  55667. key: "setExtent",
  55668. value: function setExtent(extent) {
  55669. this.options.extent = this.getDefaultExtent(extent, this.map);
  55670. // this.features = this._getGraticuleFeatures();
  55671. this.updateGraticuleLayer();
  55672. this.renderer._drawLabel();
  55673. }
  55674. /**
  55675. * @function GraticuleLayer.prototype.setStrokeStyle
  55676. * @description 设置经纬线样式。
  55677. * @param {GraticuleLayer.StrokeStyle} strokeStyle - 经纬线样式。
  55678. */
  55679. }, {
  55680. key: "setStrokeStyle",
  55681. value: function setStrokeStyle(strokeStyle) {
  55682. if (!this.map || !this.map.getLayer(this.sourceId)) {
  55683. return;
  55684. }
  55685. this.options.strokeStyle = strokeStyle;
  55686. var _this$renderer$_trans = this.renderer._transformStrokeStyle(strokeStyle),
  55687. layout = _this$renderer$_trans.layout,
  55688. paint = _this$renderer$_trans.paint;
  55689. for (var key in layout) {
  55690. this.map.setLayoutProperty(this.sourceId, key, layout[key]);
  55691. }
  55692. for (var _key2 in paint) {
  55693. this.map.setPaintProperty(this.sourceId, _key2, paint[_key2]);
  55694. }
  55695. }
  55696. /**
  55697. * @function GraticuleLayer.prototype.setLngLabelStyle
  55698. * @description 设置经度标签样式。
  55699. * @param {GraticuleLayer.LabelStyle} labelStyle - 标签样式。
  55700. */
  55701. }, {
  55702. key: "setLngLabelStyle",
  55703. value: function setLngLabelStyle(labelStyle) {
  55704. this.options.lngLabelStyle = labelStyle;
  55705. this.renderer._drawLabel();
  55706. }
  55707. /**
  55708. * @function GraticuleLayer.prototype.setLatLabelStyle
  55709. * @description 设置纬度标签样式。
  55710. * @param {GraticuleLayer.LabelStyle} labelStyle - 标签样式。
  55711. */
  55712. }, {
  55713. key: "setLatLabelStyle",
  55714. value: function setLatLabelStyle(labelStyle) {
  55715. this.options.latLabelStyle = labelStyle;
  55716. this.renderer._drawLabel();
  55717. }
  55718. /**
  55719. * @function GraticuleLayer.prototype.setIntervals
  55720. * @description 设置经纬度的间隔(以度为单位)。
  55721. * @param {number|function} interval - 经纬度的间隔(以度为单位),可以是数字,也可以是函数,参数是map。
  55722. */
  55723. }, {
  55724. key: "setIntervals",
  55725. value: function setIntervals(interval) {
  55726. if (this.renderer) {
  55727. this.renderer.setIntervals(interval);
  55728. }
  55729. }
  55730. }, {
  55731. key: "getDefaultExtent",
  55732. value: function getDefaultExtent(extent) {
  55733. var map = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.map;
  55734. var crs = map.getCRS && map.getCRS() || {};
  55735. var crsExtent = crs.extent;
  55736. if (!crsExtent) {
  55737. crsExtent = [-180, -85.05119, 180, 85.05119];
  55738. }
  55739. if (!extent || extent.length === 0) {
  55740. return crsExtent;
  55741. }
  55742. var _maplibregl$LngLatBou = external_maplibregl_default().LngLatBounds.convert(extent),
  55743. _sw = _maplibregl$LngLatBou._sw,
  55744. _ne = _maplibregl$LngLatBou._ne;
  55745. extent = [_sw.lng, _sw.lat, _ne.lng, _ne.lat];
  55746. extent = [Math.max(crsExtent[0], extent[0]), Math.max(crsExtent[1], extent[1]), Math.min(crsExtent[2], extent[2]), Math.min(crsExtent[3], extent[3])];
  55747. return extent;
  55748. }
  55749. }, {
  55750. key: "addGraticuleLayer",
  55751. value: function addGraticuleLayer() {
  55752. if (!this.map.getSource(this.sourceId)) {
  55753. var source = {
  55754. type: 'geojson',
  55755. data: {
  55756. type: 'FeatureCollection',
  55757. features: this.renderer.features
  55758. }
  55759. };
  55760. this.map.addSource(this.sourceId, source);
  55761. }
  55762. if (!this.map.getLayer(this.sourceId)) {
  55763. var layer = Object.assign({
  55764. id: this.sourceId,
  55765. type: 'line',
  55766. source: this.sourceId
  55767. }, this.renderer._transformStrokeStyle());
  55768. this.map.addLayer(layer);
  55769. }
  55770. }
  55771. }, {
  55772. key: "updateGraticuleLayer",
  55773. value: function updateGraticuleLayer() {
  55774. var features = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.features;
  55775. if (this.map.getSource(this.sourceId)) {
  55776. var geoJSONData = {
  55777. type: 'FeatureCollection',
  55778. features: features
  55779. };
  55780. this.map.getSource(this.sourceId).setData(geoJSONData);
  55781. }
  55782. this.addGraticuleLayer();
  55783. }
  55784. }, {
  55785. key: "_bindEvent",
  55786. value: function _bindEvent() {
  55787. this.map.on('styledata', this.styleDataEevent);
  55788. this.map.on('resize', this.resizeEvent);
  55789. this.map.on('zoomend', this.zoomendEvent);
  55790. }
  55791. }, {
  55792. key: "_unbindEvent",
  55793. value: function _unbindEvent() {
  55794. this.map.off('styledata', this.styleDataEevent);
  55795. this.map.off('resize', this.resizeEvent);
  55796. this.map.off('zoomend', this.zoomendEvent);
  55797. }
  55798. }, {
  55799. key: "_setLayerTop",
  55800. value: function _setLayerTop() {
  55801. var _this = this;
  55802. var map = this.map;
  55803. if (!map) {
  55804. return;
  55805. }
  55806. var layersOnMap = map.getStyle && map.getStyle().layers;
  55807. if (layersOnMap && layersOnMap.length && layersOnMap.findIndex(function (item) {
  55808. return item.id === _this.sourceId;
  55809. }) !== layersOnMap.length - 1) {
  55810. if (map.getLayer(this.sourceId)) {
  55811. map.removeLayer(this.sourceId);
  55812. this.addGraticuleLayer();
  55813. }
  55814. }
  55815. }
  55816. }, {
  55817. key: "_getLatPoints",
  55818. value: function _getLatPoints(lngRange, firstLng, lastLng, features) {
  55819. return this.renderer._getLatPoints(lngRange, firstLng, lastLng, features);
  55820. }
  55821. }]);
  55822. return GraticuleLayer;
  55823. }();
  55824. ;// CONCATENATED MODULE: ./node_modules/flatgeobuf/lib/mjs/flat-geobuf/geometry-type.js
  55825. var geometry_type_GeometryType;
  55826. (function (GeometryType) {
  55827. GeometryType[GeometryType["Unknown"] = 0] = "Unknown";
  55828. GeometryType[GeometryType["Point"] = 1] = "Point";
  55829. GeometryType[GeometryType["LineString"] = 2] = "LineString";
  55830. GeometryType[GeometryType["Polygon"] = 3] = "Polygon";
  55831. GeometryType[GeometryType["MultiPoint"] = 4] = "MultiPoint";
  55832. GeometryType[GeometryType["MultiLineString"] = 5] = "MultiLineString";
  55833. GeometryType[GeometryType["MultiPolygon"] = 6] = "MultiPolygon";
  55834. GeometryType[GeometryType["GeometryCollection"] = 7] = "GeometryCollection";
  55835. GeometryType[GeometryType["CircularString"] = 8] = "CircularString";
  55836. GeometryType[GeometryType["CompoundCurve"] = 9] = "CompoundCurve";
  55837. GeometryType[GeometryType["CurvePolygon"] = 10] = "CurvePolygon";
  55838. GeometryType[GeometryType["MultiCurve"] = 11] = "MultiCurve";
  55839. GeometryType[GeometryType["MultiSurface"] = 12] = "MultiSurface";
  55840. GeometryType[GeometryType["Curve"] = 13] = "Curve";
  55841. GeometryType[GeometryType["Surface"] = 14] = "Surface";
  55842. GeometryType[GeometryType["PolyhedralSurface"] = 15] = "PolyhedralSurface";
  55843. GeometryType[GeometryType["TIN"] = 16] = "TIN";
  55844. GeometryType[GeometryType["Triangle"] = 17] = "Triangle";
  55845. })(geometry_type_GeometryType || (geometry_type_GeometryType = {}));
  55846. // EXTERNAL MODULE: ./node_modules/flatbuffers/js/flatbuffers.js
  55847. var js_flatbuffers = __webpack_require__(1095);
  55848. ;// CONCATENATED MODULE: ./node_modules/flatgeobuf/lib/mjs/flat-geobuf/geometry.js
  55849. function geometry_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  55850. function geometry_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  55851. function geometry_createClass(Constructor, protoProps, staticProps) { if (protoProps) geometry_defineProperties(Constructor.prototype, protoProps); if (staticProps) geometry_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  55852. var geometry_Geometry = /*#__PURE__*/function () {
  55853. function Geometry() {
  55854. geometry_classCallCheck(this, Geometry);
  55855. this.bb = null;
  55856. this.bb_pos = 0;
  55857. }
  55858. geometry_createClass(Geometry, [{
  55859. key: "__init",
  55860. value: function __init(i, bb) {
  55861. this.bb_pos = i;
  55862. this.bb = bb;
  55863. return this;
  55864. }
  55865. }, {
  55866. key: "ends",
  55867. value: function ends(index) {
  55868. var offset = this.bb.__offset(this.bb_pos, 4);
  55869. return offset ? this.bb.readUint32(this.bb.__vector(this.bb_pos + offset) + index * 4) : 0;
  55870. }
  55871. }, {
  55872. key: "endsLength",
  55873. value: function endsLength() {
  55874. var offset = this.bb.__offset(this.bb_pos, 4);
  55875. return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
  55876. }
  55877. }, {
  55878. key: "endsArray",
  55879. value: function endsArray() {
  55880. var offset = this.bb.__offset(this.bb_pos, 4);
  55881. return offset ? new Uint32Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null;
  55882. }
  55883. }, {
  55884. key: "xy",
  55885. value: function xy(index) {
  55886. var offset = this.bb.__offset(this.bb_pos, 6);
  55887. return offset ? this.bb.readFloat64(this.bb.__vector(this.bb_pos + offset) + index * 8) : 0;
  55888. }
  55889. }, {
  55890. key: "xyLength",
  55891. value: function xyLength() {
  55892. var offset = this.bb.__offset(this.bb_pos, 6);
  55893. return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
  55894. }
  55895. }, {
  55896. key: "xyArray",
  55897. value: function xyArray() {
  55898. var offset = this.bb.__offset(this.bb_pos, 6);
  55899. return offset ? new Float64Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null;
  55900. }
  55901. }, {
  55902. key: "z",
  55903. value: function z(index) {
  55904. var offset = this.bb.__offset(this.bb_pos, 8);
  55905. return offset ? this.bb.readFloat64(this.bb.__vector(this.bb_pos + offset) + index * 8) : 0;
  55906. }
  55907. }, {
  55908. key: "zLength",
  55909. value: function zLength() {
  55910. var offset = this.bb.__offset(this.bb_pos, 8);
  55911. return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
  55912. }
  55913. }, {
  55914. key: "zArray",
  55915. value: function zArray() {
  55916. var offset = this.bb.__offset(this.bb_pos, 8);
  55917. return offset ? new Float64Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null;
  55918. }
  55919. }, {
  55920. key: "m",
  55921. value: function m(index) {
  55922. var offset = this.bb.__offset(this.bb_pos, 10);
  55923. return offset ? this.bb.readFloat64(this.bb.__vector(this.bb_pos + offset) + index * 8) : 0;
  55924. }
  55925. }, {
  55926. key: "mLength",
  55927. value: function mLength() {
  55928. var offset = this.bb.__offset(this.bb_pos, 10);
  55929. return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
  55930. }
  55931. }, {
  55932. key: "mArray",
  55933. value: function mArray() {
  55934. var offset = this.bb.__offset(this.bb_pos, 10);
  55935. return offset ? new Float64Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null;
  55936. }
  55937. }, {
  55938. key: "t",
  55939. value: function t(index) {
  55940. var offset = this.bb.__offset(this.bb_pos, 12);
  55941. return offset ? this.bb.readFloat64(this.bb.__vector(this.bb_pos + offset) + index * 8) : 0;
  55942. }
  55943. }, {
  55944. key: "tLength",
  55945. value: function tLength() {
  55946. var offset = this.bb.__offset(this.bb_pos, 12);
  55947. return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
  55948. }
  55949. }, {
  55950. key: "tArray",
  55951. value: function tArray() {
  55952. var offset = this.bb.__offset(this.bb_pos, 12);
  55953. return offset ? new Float64Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null;
  55954. }
  55955. }, {
  55956. key: "tm",
  55957. value: function tm(index) {
  55958. var offset = this.bb.__offset(this.bb_pos, 14);
  55959. return offset ? this.bb.readUint64(this.bb.__vector(this.bb_pos + offset) + index * 8) : BigInt(0);
  55960. }
  55961. }, {
  55962. key: "tmLength",
  55963. value: function tmLength() {
  55964. var offset = this.bb.__offset(this.bb_pos, 14);
  55965. return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
  55966. }
  55967. }, {
  55968. key: "type",
  55969. value: function type() {
  55970. var offset = this.bb.__offset(this.bb_pos, 16);
  55971. return offset ? this.bb.readUint8(this.bb_pos + offset) : geometry_type_GeometryType.Unknown;
  55972. }
  55973. }, {
  55974. key: "parts",
  55975. value: function parts(index, obj) {
  55976. var offset = this.bb.__offset(this.bb_pos, 18);
  55977. return offset ? (obj || new Geometry()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + offset) + index * 4), this.bb) : null;
  55978. }
  55979. }, {
  55980. key: "partsLength",
  55981. value: function partsLength() {
  55982. var offset = this.bb.__offset(this.bb_pos, 18);
  55983. return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
  55984. }
  55985. }], [{
  55986. key: "getRootAsGeometry",
  55987. value: function getRootAsGeometry(bb, obj) {
  55988. return (obj || new Geometry()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
  55989. }
  55990. }, {
  55991. key: "getSizePrefixedRootAsGeometry",
  55992. value: function getSizePrefixedRootAsGeometry(bb, obj) {
  55993. bb.setPosition(bb.position() + js_flatbuffers/* SIZE_PREFIX_LENGTH */.XU);
  55994. return (obj || new Geometry()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
  55995. }
  55996. }, {
  55997. key: "startGeometry",
  55998. value: function startGeometry(builder) {
  55999. builder.startObject(8);
  56000. }
  56001. }, {
  56002. key: "addEnds",
  56003. value: function addEnds(builder, endsOffset) {
  56004. builder.addFieldOffset(0, endsOffset, 0);
  56005. }
  56006. }, {
  56007. key: "createEndsVector",
  56008. value: function createEndsVector(builder, data) {
  56009. builder.startVector(4, data.length, 4);
  56010. for (var i = data.length - 1; i >= 0; i--) {
  56011. builder.addInt32(data[i]);
  56012. }
  56013. return builder.endVector();
  56014. }
  56015. }, {
  56016. key: "startEndsVector",
  56017. value: function startEndsVector(builder, numElems) {
  56018. builder.startVector(4, numElems, 4);
  56019. }
  56020. }, {
  56021. key: "addXy",
  56022. value: function addXy(builder, xyOffset) {
  56023. builder.addFieldOffset(1, xyOffset, 0);
  56024. }
  56025. }, {
  56026. key: "createXyVector",
  56027. value: function createXyVector(builder, data) {
  56028. builder.startVector(8, data.length, 8);
  56029. for (var i = data.length - 1; i >= 0; i--) {
  56030. builder.addFloat64(data[i]);
  56031. }
  56032. return builder.endVector();
  56033. }
  56034. }, {
  56035. key: "startXyVector",
  56036. value: function startXyVector(builder, numElems) {
  56037. builder.startVector(8, numElems, 8);
  56038. }
  56039. }, {
  56040. key: "addZ",
  56041. value: function addZ(builder, zOffset) {
  56042. builder.addFieldOffset(2, zOffset, 0);
  56043. }
  56044. }, {
  56045. key: "createZVector",
  56046. value: function createZVector(builder, data) {
  56047. builder.startVector(8, data.length, 8);
  56048. for (var i = data.length - 1; i >= 0; i--) {
  56049. builder.addFloat64(data[i]);
  56050. }
  56051. return builder.endVector();
  56052. }
  56053. }, {
  56054. key: "startZVector",
  56055. value: function startZVector(builder, numElems) {
  56056. builder.startVector(8, numElems, 8);
  56057. }
  56058. }, {
  56059. key: "addM",
  56060. value: function addM(builder, mOffset) {
  56061. builder.addFieldOffset(3, mOffset, 0);
  56062. }
  56063. }, {
  56064. key: "createMVector",
  56065. value: function createMVector(builder, data) {
  56066. builder.startVector(8, data.length, 8);
  56067. for (var i = data.length - 1; i >= 0; i--) {
  56068. builder.addFloat64(data[i]);
  56069. }
  56070. return builder.endVector();
  56071. }
  56072. }, {
  56073. key: "startMVector",
  56074. value: function startMVector(builder, numElems) {
  56075. builder.startVector(8, numElems, 8);
  56076. }
  56077. }, {
  56078. key: "addT",
  56079. value: function addT(builder, tOffset) {
  56080. builder.addFieldOffset(4, tOffset, 0);
  56081. }
  56082. }, {
  56083. key: "createTVector",
  56084. value: function createTVector(builder, data) {
  56085. builder.startVector(8, data.length, 8);
  56086. for (var i = data.length - 1; i >= 0; i--) {
  56087. builder.addFloat64(data[i]);
  56088. }
  56089. return builder.endVector();
  56090. }
  56091. }, {
  56092. key: "startTVector",
  56093. value: function startTVector(builder, numElems) {
  56094. builder.startVector(8, numElems, 8);
  56095. }
  56096. }, {
  56097. key: "addTm",
  56098. value: function addTm(builder, tmOffset) {
  56099. builder.addFieldOffset(5, tmOffset, 0);
  56100. }
  56101. }, {
  56102. key: "createTmVector",
  56103. value: function createTmVector(builder, data) {
  56104. builder.startVector(8, data.length, 8);
  56105. for (var i = data.length - 1; i >= 0; i--) {
  56106. builder.addInt64(data[i]);
  56107. }
  56108. return builder.endVector();
  56109. }
  56110. }, {
  56111. key: "startTmVector",
  56112. value: function startTmVector(builder, numElems) {
  56113. builder.startVector(8, numElems, 8);
  56114. }
  56115. }, {
  56116. key: "addType",
  56117. value: function addType(builder, type) {
  56118. builder.addFieldInt8(6, type, geometry_type_GeometryType.Unknown);
  56119. }
  56120. }, {
  56121. key: "addParts",
  56122. value: function addParts(builder, partsOffset) {
  56123. builder.addFieldOffset(7, partsOffset, 0);
  56124. }
  56125. }, {
  56126. key: "createPartsVector",
  56127. value: function createPartsVector(builder, data) {
  56128. builder.startVector(4, data.length, 4);
  56129. for (var i = data.length - 1; i >= 0; i--) {
  56130. builder.addOffset(data[i]);
  56131. }
  56132. return builder.endVector();
  56133. }
  56134. }, {
  56135. key: "startPartsVector",
  56136. value: function startPartsVector(builder, numElems) {
  56137. builder.startVector(4, numElems, 4);
  56138. }
  56139. }, {
  56140. key: "endGeometry",
  56141. value: function endGeometry(builder) {
  56142. var offset = builder.endObject();
  56143. return offset;
  56144. }
  56145. }, {
  56146. key: "createGeometry",
  56147. value: function createGeometry(builder, endsOffset, xyOffset, zOffset, mOffset, tOffset, tmOffset, type, partsOffset) {
  56148. Geometry.startGeometry(builder);
  56149. Geometry.addEnds(builder, endsOffset);
  56150. Geometry.addXy(builder, xyOffset);
  56151. Geometry.addZ(builder, zOffset);
  56152. Geometry.addM(builder, mOffset);
  56153. Geometry.addT(builder, tOffset);
  56154. Geometry.addTm(builder, tmOffset);
  56155. Geometry.addType(builder, type);
  56156. Geometry.addParts(builder, partsOffset);
  56157. return Geometry.endGeometry(builder);
  56158. }
  56159. }]);
  56160. return Geometry;
  56161. }();
  56162. ;// CONCATENATED MODULE: ./node_modules/flatgeobuf/lib/mjs/generic/geometry.js
  56163. function geometry_toConsumableArray(arr) { return geometry_arrayWithoutHoles(arr) || geometry_iterableToArray(arr) || geometry_unsupportedIterableToArray(arr) || geometry_nonIterableSpread(); }
  56164. function geometry_nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
  56165. function geometry_iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
  56166. function geometry_arrayWithoutHoles(arr) { if (Array.isArray(arr)) return geometry_arrayLikeToArray(arr); }
  56167. function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = geometry_unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
  56168. function geometry_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return geometry_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return geometry_arrayLikeToArray(o, minLen); }
  56169. function geometry_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
  56170. function geometry_buildGeometry(builder, parsedGeometry) {
  56171. var xy = parsedGeometry.xy,
  56172. z = parsedGeometry.z,
  56173. ends = parsedGeometry.ends,
  56174. parts = parsedGeometry.parts,
  56175. type = parsedGeometry.type;
  56176. if (parts) {
  56177. var partOffsets = parts.map(function (part) {
  56178. return geometry_buildGeometry(builder, part);
  56179. });
  56180. var partsOffset = Geometry.createPartsVector(builder, partOffsets);
  56181. Geometry.startGeometry(builder);
  56182. Geometry.addParts(builder, partsOffset);
  56183. Geometry.addType(builder, type);
  56184. return Geometry.endGeometry(builder);
  56185. }
  56186. var xyOffset = Geometry.createXyVector(builder, xy);
  56187. var zOffset;
  56188. if (z) zOffset = Geometry.createZVector(builder, z);
  56189. var endsOffset;
  56190. if (ends) endsOffset = Geometry.createEndsVector(builder, ends);
  56191. Geometry.startGeometry(builder);
  56192. if (endsOffset) Geometry.addEnds(builder, endsOffset);
  56193. Geometry.addXy(builder, xyOffset);
  56194. if (zOffset) Geometry.addZ(builder, zOffset);
  56195. Geometry.addType(builder, type);
  56196. return Geometry.endGeometry(builder);
  56197. }
  56198. function geometry_flat(a, xy, z) {
  56199. if (a.length === 0) return;
  56200. if (Array.isArray(a[0])) {
  56201. var _iterator = _createForOfIteratorHelper(a),
  56202. _step;
  56203. try {
  56204. for (_iterator.s(); !(_step = _iterator.n()).done;) {
  56205. var sa = _step.value;
  56206. geometry_flat(sa, xy, z);
  56207. }
  56208. } catch (err) {
  56209. _iterator.e(err);
  56210. } finally {
  56211. _iterator.f();
  56212. }
  56213. } else {
  56214. if (a.length === 2) xy.push.apply(xy, geometry_toConsumableArray(a));else {
  56215. xy.push(a[0], a[1]);
  56216. z.push(a[2]);
  56217. }
  56218. }
  56219. }
  56220. function geometry_parseGeometry(geometry, headerGeomType) {
  56221. var xy;
  56222. var ends;
  56223. var parts;
  56224. var type = headerGeomType;
  56225. if (type === GeometryType.Unknown) {
  56226. type = geometry_toGeometryType(geometry.getType());
  56227. }
  56228. if (type === GeometryType.MultiLineString) {
  56229. if (geometry.getFlatCoordinates) xy = geometry.getFlatCoordinates();
  56230. var mlsEnds = geometry.getEnds();
  56231. if (mlsEnds.length > 1) ends = mlsEnds.map(function (e) {
  56232. return e >> 1;
  56233. });
  56234. } else if (type === GeometryType.Polygon) {
  56235. if (geometry.getFlatCoordinates) xy = geometry.getFlatCoordinates();
  56236. var pEnds = geometry.getEnds();
  56237. if (pEnds.length > 1) ends = pEnds.map(function (e) {
  56238. return e >> 1;
  56239. });
  56240. } else if (type === GeometryType.MultiPolygon) {
  56241. var mp = geometry;
  56242. parts = mp.getPolygons().map(function (p) {
  56243. return geometry_parseGeometry(p, GeometryType.Polygon);
  56244. });
  56245. } else {
  56246. if (geometry.getFlatCoordinates) xy = geometry.getFlatCoordinates();
  56247. }
  56248. return {
  56249. xy: xy,
  56250. ends: ends,
  56251. type: type,
  56252. parts: parts
  56253. };
  56254. }
  56255. function pairFlatCoordinates(xy, z) {
  56256. var newArray = [];
  56257. for (var i = 0; i < xy.length; i += 2) {
  56258. var a = [xy[i], xy[i + 1]];
  56259. if (z) a.push(z[i >> 1]);
  56260. newArray.push(a);
  56261. }
  56262. return newArray;
  56263. }
  56264. function geometry_toGeometryType(name) {
  56265. if (!name) return GeometryType.Unknown;
  56266. var type = GeometryType[name];
  56267. return type;
  56268. }
  56269. ;// CONCATENATED MODULE: ./node_modules/flatgeobuf/lib/mjs/geojson/geometry.js
  56270. function geojson_geometry_parseGeometry(geometry) {
  56271. var cs = geometry.coordinates;
  56272. var xy = [];
  56273. var z = [];
  56274. var ends;
  56275. var parts;
  56276. var type = toGeometryType(geometry.type);
  56277. var end = 0;
  56278. switch (geometry.type) {
  56279. case 'Point':
  56280. flat(cs, xy, z);
  56281. break;
  56282. case 'MultiPoint':
  56283. case 'LineString':
  56284. flat(cs, xy, z);
  56285. break;
  56286. case 'MultiLineString':
  56287. case 'Polygon':
  56288. {
  56289. var css = cs;
  56290. flat(css, xy, z);
  56291. if (css.length > 1) ends = css.map(function (c) {
  56292. return end += c.length;
  56293. });
  56294. break;
  56295. }
  56296. case 'MultiPolygon':
  56297. {
  56298. var csss = cs;
  56299. var geometries = csss.map(function (coordinates) {
  56300. return {
  56301. type: 'Polygon',
  56302. coordinates: coordinates
  56303. };
  56304. });
  56305. parts = geometries.map(geojson_geometry_parseGeometry);
  56306. break;
  56307. }
  56308. }
  56309. return {
  56310. xy: xy,
  56311. z: z.length > 0 ? z : undefined,
  56312. ends: ends,
  56313. type: type,
  56314. parts: parts
  56315. };
  56316. }
  56317. function geometry_parseGC(geometry) {
  56318. var type = toGeometryType(geometry.type);
  56319. var parts = [];
  56320. for (var i = 0; i < geometry.geometries.length; i++) {
  56321. var g = geometry.geometries[i];
  56322. if (g.type === 'GeometryCollection') parts.push(geometry_parseGC(g));else parts.push(geojson_geometry_parseGeometry(g));
  56323. }
  56324. return {
  56325. type: type,
  56326. parts: parts
  56327. };
  56328. }
  56329. function extractParts(xy, z, ends) {
  56330. if (!ends || ends.length === 0) return [pairFlatCoordinates(xy, z)];
  56331. var s = 0;
  56332. var xySlices = Array.from(ends).map(function (e) {
  56333. return xy.slice(s, s = e << 1);
  56334. });
  56335. var zSlices;
  56336. if (z) {
  56337. s = 0;
  56338. zSlices = Array.from(ends).map(function (e) {
  56339. return z.slice(s, s = e);
  56340. });
  56341. }
  56342. return xySlices.map(function (xy, i) {
  56343. return pairFlatCoordinates(xy, zSlices ? zSlices[i] : undefined);
  56344. });
  56345. }
  56346. function toGeoJsonCoordinates(geometry, type) {
  56347. var xy = geometry.xyArray();
  56348. var z = geometry.zArray();
  56349. switch (type) {
  56350. case geometry_type_GeometryType.Point:
  56351. {
  56352. var a = Array.from(xy);
  56353. if (z) a.push(z[0]);
  56354. return a;
  56355. }
  56356. case geometry_type_GeometryType.MultiPoint:
  56357. case geometry_type_GeometryType.LineString:
  56358. return pairFlatCoordinates(xy, z);
  56359. case geometry_type_GeometryType.MultiLineString:
  56360. return extractParts(xy, z, geometry.endsArray());
  56361. case geometry_type_GeometryType.Polygon:
  56362. return extractParts(xy, z, geometry.endsArray());
  56363. }
  56364. }
  56365. function fromGeometry(geometry, headerType) {
  56366. var type = headerType;
  56367. if (type === geometry_type_GeometryType.Unknown) {
  56368. type = geometry.type();
  56369. }
  56370. if (type === geometry_type_GeometryType.GeometryCollection) {
  56371. var geometries = [];
  56372. for (var i = 0; i < geometry.partsLength(); i++) {
  56373. var part = geometry.parts(i);
  56374. var partType = part.type();
  56375. geometries.push(fromGeometry(part, partType));
  56376. }
  56377. return {
  56378. type: geometry_type_GeometryType[type],
  56379. geometries: geometries
  56380. };
  56381. } else if (type === geometry_type_GeometryType.MultiPolygon) {
  56382. var _geometries = [];
  56383. for (var _i2 = 0; _i2 < geometry.partsLength(); _i2++) _geometries.push(fromGeometry(geometry.parts(_i2), geometry_type_GeometryType.Polygon));
  56384. return {
  56385. type: geometry_type_GeometryType[type],
  56386. coordinates: _geometries.map(function (g) {
  56387. return g.coordinates;
  56388. })
  56389. };
  56390. }
  56391. var coordinates = toGeoJsonCoordinates(geometry, type);
  56392. return {
  56393. type: geometry_type_GeometryType[type],
  56394. coordinates: coordinates
  56395. };
  56396. }
  56397. ;// CONCATENATED MODULE: ./node_modules/flatgeobuf/lib/mjs/flat-geobuf/column-type.js
  56398. var column_type_ColumnType;
  56399. (function (ColumnType) {
  56400. ColumnType[ColumnType["Byte"] = 0] = "Byte";
  56401. ColumnType[ColumnType["UByte"] = 1] = "UByte";
  56402. ColumnType[ColumnType["Bool"] = 2] = "Bool";
  56403. ColumnType[ColumnType["Short"] = 3] = "Short";
  56404. ColumnType[ColumnType["UShort"] = 4] = "UShort";
  56405. ColumnType[ColumnType["Int"] = 5] = "Int";
  56406. ColumnType[ColumnType["UInt"] = 6] = "UInt";
  56407. ColumnType[ColumnType["Long"] = 7] = "Long";
  56408. ColumnType[ColumnType["ULong"] = 8] = "ULong";
  56409. ColumnType[ColumnType["Float"] = 9] = "Float";
  56410. ColumnType[ColumnType["Double"] = 10] = "Double";
  56411. ColumnType[ColumnType["String"] = 11] = "String";
  56412. ColumnType[ColumnType["Json"] = 12] = "Json";
  56413. ColumnType[ColumnType["DateTime"] = 13] = "DateTime";
  56414. ColumnType[ColumnType["Binary"] = 14] = "Binary";
  56415. })(column_type_ColumnType || (column_type_ColumnType = {}));
  56416. ;// CONCATENATED MODULE: ./node_modules/flatgeobuf/lib/mjs/flat-geobuf/column.js
  56417. function column_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  56418. function column_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  56419. function column_createClass(Constructor, protoProps, staticProps) { if (protoProps) column_defineProperties(Constructor.prototype, protoProps); if (staticProps) column_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  56420. var column_Column = /*#__PURE__*/function () {
  56421. function Column() {
  56422. column_classCallCheck(this, Column);
  56423. this.bb = null;
  56424. this.bb_pos = 0;
  56425. }
  56426. column_createClass(Column, [{
  56427. key: "__init",
  56428. value: function __init(i, bb) {
  56429. this.bb_pos = i;
  56430. this.bb = bb;
  56431. return this;
  56432. }
  56433. }, {
  56434. key: "name",
  56435. value: function name(optionalEncoding) {
  56436. var offset = this.bb.__offset(this.bb_pos, 4);
  56437. return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
  56438. }
  56439. }, {
  56440. key: "type",
  56441. value: function type() {
  56442. var offset = this.bb.__offset(this.bb_pos, 6);
  56443. return offset ? this.bb.readUint8(this.bb_pos + offset) : column_type_ColumnType.Byte;
  56444. }
  56445. }, {
  56446. key: "title",
  56447. value: function title(optionalEncoding) {
  56448. var offset = this.bb.__offset(this.bb_pos, 8);
  56449. return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
  56450. }
  56451. }, {
  56452. key: "description",
  56453. value: function description(optionalEncoding) {
  56454. var offset = this.bb.__offset(this.bb_pos, 10);
  56455. return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
  56456. }
  56457. }, {
  56458. key: "width",
  56459. value: function width() {
  56460. var offset = this.bb.__offset(this.bb_pos, 12);
  56461. return offset ? this.bb.readInt32(this.bb_pos + offset) : -1;
  56462. }
  56463. }, {
  56464. key: "precision",
  56465. value: function precision() {
  56466. var offset = this.bb.__offset(this.bb_pos, 14);
  56467. return offset ? this.bb.readInt32(this.bb_pos + offset) : -1;
  56468. }
  56469. }, {
  56470. key: "scale",
  56471. value: function scale() {
  56472. var offset = this.bb.__offset(this.bb_pos, 16);
  56473. return offset ? this.bb.readInt32(this.bb_pos + offset) : -1;
  56474. }
  56475. }, {
  56476. key: "nullable",
  56477. value: function nullable() {
  56478. var offset = this.bb.__offset(this.bb_pos, 18);
  56479. return offset ? !!this.bb.readInt8(this.bb_pos + offset) : true;
  56480. }
  56481. }, {
  56482. key: "unique",
  56483. value: function unique() {
  56484. var offset = this.bb.__offset(this.bb_pos, 20);
  56485. return offset ? !!this.bb.readInt8(this.bb_pos + offset) : false;
  56486. }
  56487. }, {
  56488. key: "primaryKey",
  56489. value: function primaryKey() {
  56490. var offset = this.bb.__offset(this.bb_pos, 22);
  56491. return offset ? !!this.bb.readInt8(this.bb_pos + offset) : false;
  56492. }
  56493. }, {
  56494. key: "metadata",
  56495. value: function metadata(optionalEncoding) {
  56496. var offset = this.bb.__offset(this.bb_pos, 24);
  56497. return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
  56498. }
  56499. }], [{
  56500. key: "getRootAsColumn",
  56501. value: function getRootAsColumn(bb, obj) {
  56502. return (obj || new Column()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
  56503. }
  56504. }, {
  56505. key: "getSizePrefixedRootAsColumn",
  56506. value: function getSizePrefixedRootAsColumn(bb, obj) {
  56507. bb.setPosition(bb.position() + js_flatbuffers/* SIZE_PREFIX_LENGTH */.XU);
  56508. return (obj || new Column()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
  56509. }
  56510. }, {
  56511. key: "startColumn",
  56512. value: function startColumn(builder) {
  56513. builder.startObject(11);
  56514. }
  56515. }, {
  56516. key: "addName",
  56517. value: function addName(builder, nameOffset) {
  56518. builder.addFieldOffset(0, nameOffset, 0);
  56519. }
  56520. }, {
  56521. key: "addType",
  56522. value: function addType(builder, type) {
  56523. builder.addFieldInt8(1, type, column_type_ColumnType.Byte);
  56524. }
  56525. }, {
  56526. key: "addTitle",
  56527. value: function addTitle(builder, titleOffset) {
  56528. builder.addFieldOffset(2, titleOffset, 0);
  56529. }
  56530. }, {
  56531. key: "addDescription",
  56532. value: function addDescription(builder, descriptionOffset) {
  56533. builder.addFieldOffset(3, descriptionOffset, 0);
  56534. }
  56535. }, {
  56536. key: "addWidth",
  56537. value: function addWidth(builder, width) {
  56538. builder.addFieldInt32(4, width, -1);
  56539. }
  56540. }, {
  56541. key: "addPrecision",
  56542. value: function addPrecision(builder, precision) {
  56543. builder.addFieldInt32(5, precision, -1);
  56544. }
  56545. }, {
  56546. key: "addScale",
  56547. value: function addScale(builder, scale) {
  56548. builder.addFieldInt32(6, scale, -1);
  56549. }
  56550. }, {
  56551. key: "addNullable",
  56552. value: function addNullable(builder, nullable) {
  56553. builder.addFieldInt8(7, +nullable, +true);
  56554. }
  56555. }, {
  56556. key: "addUnique",
  56557. value: function addUnique(builder, unique) {
  56558. builder.addFieldInt8(8, +unique, +false);
  56559. }
  56560. }, {
  56561. key: "addPrimaryKey",
  56562. value: function addPrimaryKey(builder, primaryKey) {
  56563. builder.addFieldInt8(9, +primaryKey, +false);
  56564. }
  56565. }, {
  56566. key: "addMetadata",
  56567. value: function addMetadata(builder, metadataOffset) {
  56568. builder.addFieldOffset(10, metadataOffset, 0);
  56569. }
  56570. }, {
  56571. key: "endColumn",
  56572. value: function endColumn(builder) {
  56573. var offset = builder.endObject();
  56574. builder.requiredField(offset, 4);
  56575. return offset;
  56576. }
  56577. }, {
  56578. key: "createColumn",
  56579. value: function createColumn(builder, nameOffset, type, titleOffset, descriptionOffset, width, precision, scale, nullable, unique, primaryKey, metadataOffset) {
  56580. Column.startColumn(builder);
  56581. Column.addName(builder, nameOffset);
  56582. Column.addType(builder, type);
  56583. Column.addTitle(builder, titleOffset);
  56584. Column.addDescription(builder, descriptionOffset);
  56585. Column.addWidth(builder, width);
  56586. Column.addPrecision(builder, precision);
  56587. Column.addScale(builder, scale);
  56588. Column.addNullable(builder, nullable);
  56589. Column.addUnique(builder, unique);
  56590. Column.addPrimaryKey(builder, primaryKey);
  56591. Column.addMetadata(builder, metadataOffset);
  56592. return Column.endColumn(builder);
  56593. }
  56594. }]);
  56595. return Column;
  56596. }();
  56597. ;// CONCATENATED MODULE: ./node_modules/flatgeobuf/lib/mjs/flat-geobuf/feature.js
  56598. function feature_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  56599. function feature_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  56600. function feature_createClass(Constructor, protoProps, staticProps) { if (protoProps) feature_defineProperties(Constructor.prototype, protoProps); if (staticProps) feature_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  56601. var feature_Feature = /*#__PURE__*/function () {
  56602. function Feature() {
  56603. feature_classCallCheck(this, Feature);
  56604. this.bb = null;
  56605. this.bb_pos = 0;
  56606. }
  56607. feature_createClass(Feature, [{
  56608. key: "__init",
  56609. value: function __init(i, bb) {
  56610. this.bb_pos = i;
  56611. this.bb = bb;
  56612. return this;
  56613. }
  56614. }, {
  56615. key: "geometry",
  56616. value: function geometry(obj) {
  56617. var offset = this.bb.__offset(this.bb_pos, 4);
  56618. return offset ? (obj || new geometry_Geometry()).__init(this.bb.__indirect(this.bb_pos + offset), this.bb) : null;
  56619. }
  56620. }, {
  56621. key: "properties",
  56622. value: function properties(index) {
  56623. var offset = this.bb.__offset(this.bb_pos, 6);
  56624. return offset ? this.bb.readUint8(this.bb.__vector(this.bb_pos + offset) + index) : 0;
  56625. }
  56626. }, {
  56627. key: "propertiesLength",
  56628. value: function propertiesLength() {
  56629. var offset = this.bb.__offset(this.bb_pos, 6);
  56630. return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
  56631. }
  56632. }, {
  56633. key: "propertiesArray",
  56634. value: function propertiesArray() {
  56635. var offset = this.bb.__offset(this.bb_pos, 6);
  56636. return offset ? new Uint8Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null;
  56637. }
  56638. }, {
  56639. key: "columns",
  56640. value: function columns(index, obj) {
  56641. var offset = this.bb.__offset(this.bb_pos, 8);
  56642. return offset ? (obj || new column_Column()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + offset) + index * 4), this.bb) : null;
  56643. }
  56644. }, {
  56645. key: "columnsLength",
  56646. value: function columnsLength() {
  56647. var offset = this.bb.__offset(this.bb_pos, 8);
  56648. return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
  56649. }
  56650. }], [{
  56651. key: "getRootAsFeature",
  56652. value: function getRootAsFeature(bb, obj) {
  56653. return (obj || new Feature()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
  56654. }
  56655. }, {
  56656. key: "getSizePrefixedRootAsFeature",
  56657. value: function getSizePrefixedRootAsFeature(bb, obj) {
  56658. bb.setPosition(bb.position() + js_flatbuffers/* SIZE_PREFIX_LENGTH */.XU);
  56659. return (obj || new Feature()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
  56660. }
  56661. }, {
  56662. key: "startFeature",
  56663. value: function startFeature(builder) {
  56664. builder.startObject(3);
  56665. }
  56666. }, {
  56667. key: "addGeometry",
  56668. value: function addGeometry(builder, geometryOffset) {
  56669. builder.addFieldOffset(0, geometryOffset, 0);
  56670. }
  56671. }, {
  56672. key: "addProperties",
  56673. value: function addProperties(builder, propertiesOffset) {
  56674. builder.addFieldOffset(1, propertiesOffset, 0);
  56675. }
  56676. }, {
  56677. key: "createPropertiesVector",
  56678. value: function createPropertiesVector(builder, data) {
  56679. builder.startVector(1, data.length, 1);
  56680. for (var i = data.length - 1; i >= 0; i--) {
  56681. builder.addInt8(data[i]);
  56682. }
  56683. return builder.endVector();
  56684. }
  56685. }, {
  56686. key: "startPropertiesVector",
  56687. value: function startPropertiesVector(builder, numElems) {
  56688. builder.startVector(1, numElems, 1);
  56689. }
  56690. }, {
  56691. key: "addColumns",
  56692. value: function addColumns(builder, columnsOffset) {
  56693. builder.addFieldOffset(2, columnsOffset, 0);
  56694. }
  56695. }, {
  56696. key: "createColumnsVector",
  56697. value: function createColumnsVector(builder, data) {
  56698. builder.startVector(4, data.length, 4);
  56699. for (var i = data.length - 1; i >= 0; i--) {
  56700. builder.addOffset(data[i]);
  56701. }
  56702. return builder.endVector();
  56703. }
  56704. }, {
  56705. key: "startColumnsVector",
  56706. value: function startColumnsVector(builder, numElems) {
  56707. builder.startVector(4, numElems, 4);
  56708. }
  56709. }, {
  56710. key: "endFeature",
  56711. value: function endFeature(builder) {
  56712. var offset = builder.endObject();
  56713. return offset;
  56714. }
  56715. }, {
  56716. key: "finishFeatureBuffer",
  56717. value: function finishFeatureBuffer(builder, offset) {
  56718. builder.finish(offset);
  56719. }
  56720. }, {
  56721. key: "finishSizePrefixedFeatureBuffer",
  56722. value: function finishSizePrefixedFeatureBuffer(builder, offset) {
  56723. builder.finish(offset, undefined, true);
  56724. }
  56725. }, {
  56726. key: "createFeature",
  56727. value: function createFeature(builder, geometryOffset, propertiesOffset, columnsOffset) {
  56728. Feature.startFeature(builder);
  56729. Feature.addGeometry(builder, geometryOffset);
  56730. Feature.addProperties(builder, propertiesOffset);
  56731. Feature.addColumns(builder, columnsOffset);
  56732. return Feature.endFeature(builder);
  56733. }
  56734. }]);
  56735. return Feature;
  56736. }();
  56737. ;// CONCATENATED MODULE: ./node_modules/flatgeobuf/lib/mjs/generic/feature.js
  56738. var textEncoder = new TextEncoder();
  56739. var textDecoder = new TextDecoder();
  56740. function fromFeature(feature, header, createGeometry, createFeature) {
  56741. var columns = header.columns;
  56742. var geometry = feature.geometry();
  56743. var simpleGeometry = createGeometry(geometry, header.geometryType);
  56744. var properties = parseProperties(feature, columns);
  56745. return createFeature(simpleGeometry, properties);
  56746. }
  56747. function feature_buildFeature(geometry, properties, header) {
  56748. var columns = header.columns;
  56749. var builder = new flatbuffers.Builder();
  56750. var offset = 0;
  56751. var capacity = 1024;
  56752. var bytes = new Uint8Array(capacity);
  56753. var view = new DataView(bytes.buffer);
  56754. var prep = function prep(size) {
  56755. if (offset + size < capacity) return;
  56756. capacity = Math.max(capacity + size, capacity * 2);
  56757. var newBytes = new Uint8Array(capacity);
  56758. newBytes.set(bytes);
  56759. bytes = newBytes;
  56760. view = new DataView(bytes.buffer);
  56761. };
  56762. if (columns) {
  56763. for (var i = 0; i < columns.length; i++) {
  56764. var column = columns[i];
  56765. var value = properties[column.name];
  56766. if (value === null) continue;
  56767. prep(2);
  56768. view.setUint16(offset, i, true);
  56769. offset += 2;
  56770. switch (column.type) {
  56771. case ColumnType.Bool:
  56772. prep(1);
  56773. view.setUint8(offset, value);
  56774. offset += 1;
  56775. break;
  56776. case ColumnType.Short:
  56777. prep(2);
  56778. view.setInt16(offset, value, true);
  56779. offset += 2;
  56780. break;
  56781. case ColumnType.UShort:
  56782. prep(2);
  56783. view.setUint16(offset, value, true);
  56784. offset += 2;
  56785. break;
  56786. case ColumnType.Int:
  56787. prep(4);
  56788. view.setInt32(offset, value, true);
  56789. offset += 4;
  56790. break;
  56791. case ColumnType.UInt:
  56792. prep(4);
  56793. view.setUint32(offset, value, true);
  56794. offset += 4;
  56795. break;
  56796. case ColumnType.Long:
  56797. prep(8);
  56798. view.setBigInt64(offset, BigInt(value), true);
  56799. offset += 8;
  56800. break;
  56801. case ColumnType.Float:
  56802. prep(4);
  56803. view.setFloat32(offset, value, true);
  56804. offset += 4;
  56805. break;
  56806. case ColumnType.Double:
  56807. prep(8);
  56808. view.setFloat64(offset, value, true);
  56809. offset += 8;
  56810. break;
  56811. case ColumnType.DateTime:
  56812. case ColumnType.String:
  56813. {
  56814. var str = textEncoder.encode(value);
  56815. prep(4);
  56816. view.setUint32(offset, str.length, true);
  56817. offset += 4;
  56818. prep(str.length);
  56819. bytes.set(str, offset);
  56820. offset += str.length;
  56821. break;
  56822. }
  56823. case ColumnType.Json:
  56824. {
  56825. var _str = textEncoder.encode(JSON.stringify(value));
  56826. prep(4);
  56827. view.setUint32(offset, _str.length, true);
  56828. offset += 4;
  56829. prep(_str.length);
  56830. bytes.set(_str, offset);
  56831. offset += _str.length;
  56832. break;
  56833. }
  56834. default:
  56835. throw new Error('Unknown type ' + column.type);
  56836. }
  56837. }
  56838. }
  56839. var propertiesOffset = null;
  56840. if (offset > 0) propertiesOffset = Feature.createPropertiesVector(builder, bytes.slice(0, offset));
  56841. var geometryOffset = buildGeometry(builder, geometry);
  56842. Feature.startFeature(builder);
  56843. Feature.addGeometry(builder, geometryOffset);
  56844. if (propertiesOffset) Feature.addProperties(builder, propertiesOffset);
  56845. var featureOffset = Feature.endFeature(builder);
  56846. builder.finishSizePrefixed(featureOffset);
  56847. return builder.asUint8Array();
  56848. }
  56849. function parseProperties(feature, columns) {
  56850. var properties = {};
  56851. if (!columns || columns.length === 0) return properties;
  56852. var array = feature.propertiesArray();
  56853. if (!array) return properties;
  56854. var view = new DataView(array.buffer, array.byteOffset);
  56855. var length = feature.propertiesLength();
  56856. var offset = 0;
  56857. while (offset < length) {
  56858. var i = view.getUint16(offset, true);
  56859. offset += 2;
  56860. var column = columns[i];
  56861. var name = column.name;
  56862. switch (column.type) {
  56863. case column_type_ColumnType.Bool:
  56864. {
  56865. properties[name] = !!view.getUint8(offset);
  56866. offset += 1;
  56867. break;
  56868. }
  56869. case column_type_ColumnType.Byte:
  56870. {
  56871. properties[name] = view.getInt8(offset);
  56872. offset += 1;
  56873. break;
  56874. }
  56875. case column_type_ColumnType.UByte:
  56876. {
  56877. properties[name] = view.getUint8(offset);
  56878. offset += 1;
  56879. break;
  56880. }
  56881. case column_type_ColumnType.Short:
  56882. {
  56883. properties[name] = view.getInt16(offset, true);
  56884. offset += 2;
  56885. break;
  56886. }
  56887. case column_type_ColumnType.UShort:
  56888. {
  56889. properties[name] = view.getUint16(offset, true);
  56890. offset += 2;
  56891. break;
  56892. }
  56893. case column_type_ColumnType.Int:
  56894. {
  56895. properties[name] = view.getInt32(offset, true);
  56896. offset += 4;
  56897. break;
  56898. }
  56899. case column_type_ColumnType.UInt:
  56900. {
  56901. properties[name] = view.getUint32(offset, true);
  56902. offset += 4;
  56903. break;
  56904. }
  56905. case column_type_ColumnType.Long:
  56906. {
  56907. properties[name] = Number(view.getBigInt64(offset, true));
  56908. offset += 8;
  56909. break;
  56910. }
  56911. case column_type_ColumnType.ULong:
  56912. {
  56913. properties[name] = Number(view.getBigUint64(offset, true));
  56914. offset += 8;
  56915. break;
  56916. }
  56917. case column_type_ColumnType.Float:
  56918. {
  56919. properties[name] = view.getFloat32(offset, true);
  56920. offset += 4;
  56921. break;
  56922. }
  56923. case column_type_ColumnType.Double:
  56924. {
  56925. properties[name] = view.getFloat64(offset, true);
  56926. offset += 8;
  56927. break;
  56928. }
  56929. case column_type_ColumnType.DateTime:
  56930. case column_type_ColumnType.String:
  56931. {
  56932. var _length = view.getUint32(offset, true);
  56933. offset += 4;
  56934. properties[name] = textDecoder.decode(array.subarray(offset, offset + _length));
  56935. offset += _length;
  56936. break;
  56937. }
  56938. case column_type_ColumnType.Json:
  56939. {
  56940. var _length2 = view.getUint32(offset, true);
  56941. offset += 4;
  56942. var str = textDecoder.decode(array.subarray(offset, offset + _length2));
  56943. properties[name] = JSON.parse(str);
  56944. offset += _length2;
  56945. break;
  56946. }
  56947. default:
  56948. throw new Error('Unknown type ' + column.type);
  56949. }
  56950. }
  56951. return properties;
  56952. }
  56953. ;// CONCATENATED MODULE: ./node_modules/flatgeobuf/lib/mjs/geojson/feature.js
  56954. function feature_fromFeature(feature, header) {
  56955. var columns = header.columns;
  56956. var geometry = fromGeometry(feature.geometry(), header.geometryType);
  56957. var geoJsonfeature = {
  56958. type: 'Feature',
  56959. geometry: geometry,
  56960. properties: parseProperties(feature, columns)
  56961. };
  56962. return geoJsonfeature;
  56963. }
  56964. // EXTERNAL MODULE: ./node_modules/slice-source/dist/slice-source.js
  56965. var slice_source = __webpack_require__(3425);
  56966. ;// CONCATENATED MODULE: ./node_modules/flatgeobuf/lib/mjs/flat-geobuf/crs.js
  56967. function crs_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  56968. function crs_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  56969. function crs_createClass(Constructor, protoProps, staticProps) { if (protoProps) crs_defineProperties(Constructor.prototype, protoProps); if (staticProps) crs_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  56970. var Crs = /*#__PURE__*/function () {
  56971. function Crs() {
  56972. crs_classCallCheck(this, Crs);
  56973. this.bb = null;
  56974. this.bb_pos = 0;
  56975. }
  56976. crs_createClass(Crs, [{
  56977. key: "__init",
  56978. value: function __init(i, bb) {
  56979. this.bb_pos = i;
  56980. this.bb = bb;
  56981. return this;
  56982. }
  56983. }, {
  56984. key: "org",
  56985. value: function org(optionalEncoding) {
  56986. var offset = this.bb.__offset(this.bb_pos, 4);
  56987. return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
  56988. }
  56989. }, {
  56990. key: "code",
  56991. value: function code() {
  56992. var offset = this.bb.__offset(this.bb_pos, 6);
  56993. return offset ? this.bb.readInt32(this.bb_pos + offset) : 0;
  56994. }
  56995. }, {
  56996. key: "name",
  56997. value: function name(optionalEncoding) {
  56998. var offset = this.bb.__offset(this.bb_pos, 8);
  56999. return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
  57000. }
  57001. }, {
  57002. key: "description",
  57003. value: function description(optionalEncoding) {
  57004. var offset = this.bb.__offset(this.bb_pos, 10);
  57005. return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
  57006. }
  57007. }, {
  57008. key: "wkt",
  57009. value: function wkt(optionalEncoding) {
  57010. var offset = this.bb.__offset(this.bb_pos, 12);
  57011. return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
  57012. }
  57013. }, {
  57014. key: "codeString",
  57015. value: function codeString(optionalEncoding) {
  57016. var offset = this.bb.__offset(this.bb_pos, 14);
  57017. return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
  57018. }
  57019. }], [{
  57020. key: "getRootAsCrs",
  57021. value: function getRootAsCrs(bb, obj) {
  57022. return (obj || new Crs()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
  57023. }
  57024. }, {
  57025. key: "getSizePrefixedRootAsCrs",
  57026. value: function getSizePrefixedRootAsCrs(bb, obj) {
  57027. bb.setPosition(bb.position() + js_flatbuffers/* SIZE_PREFIX_LENGTH */.XU);
  57028. return (obj || new Crs()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
  57029. }
  57030. }, {
  57031. key: "startCrs",
  57032. value: function startCrs(builder) {
  57033. builder.startObject(6);
  57034. }
  57035. }, {
  57036. key: "addOrg",
  57037. value: function addOrg(builder, orgOffset) {
  57038. builder.addFieldOffset(0, orgOffset, 0);
  57039. }
  57040. }, {
  57041. key: "addCode",
  57042. value: function addCode(builder, code) {
  57043. builder.addFieldInt32(1, code, 0);
  57044. }
  57045. }, {
  57046. key: "addName",
  57047. value: function addName(builder, nameOffset) {
  57048. builder.addFieldOffset(2, nameOffset, 0);
  57049. }
  57050. }, {
  57051. key: "addDescription",
  57052. value: function addDescription(builder, descriptionOffset) {
  57053. builder.addFieldOffset(3, descriptionOffset, 0);
  57054. }
  57055. }, {
  57056. key: "addWkt",
  57057. value: function addWkt(builder, wktOffset) {
  57058. builder.addFieldOffset(4, wktOffset, 0);
  57059. }
  57060. }, {
  57061. key: "addCodeString",
  57062. value: function addCodeString(builder, codeStringOffset) {
  57063. builder.addFieldOffset(5, codeStringOffset, 0);
  57064. }
  57065. }, {
  57066. key: "endCrs",
  57067. value: function endCrs(builder) {
  57068. var offset = builder.endObject();
  57069. return offset;
  57070. }
  57071. }, {
  57072. key: "createCrs",
  57073. value: function createCrs(builder, orgOffset, code, nameOffset, descriptionOffset, wktOffset, codeStringOffset) {
  57074. Crs.startCrs(builder);
  57075. Crs.addOrg(builder, orgOffset);
  57076. Crs.addCode(builder, code);
  57077. Crs.addName(builder, nameOffset);
  57078. Crs.addDescription(builder, descriptionOffset);
  57079. Crs.addWkt(builder, wktOffset);
  57080. Crs.addCodeString(builder, codeStringOffset);
  57081. return Crs.endCrs(builder);
  57082. }
  57083. }]);
  57084. return Crs;
  57085. }();
  57086. ;// CONCATENATED MODULE: ./node_modules/flatgeobuf/lib/mjs/flat-geobuf/header.js
  57087. function header_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  57088. function header_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  57089. function header_createClass(Constructor, protoProps, staticProps) { if (protoProps) header_defineProperties(Constructor.prototype, protoProps); if (staticProps) header_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  57090. var header_Header = /*#__PURE__*/function () {
  57091. function Header() {
  57092. header_classCallCheck(this, Header);
  57093. this.bb = null;
  57094. this.bb_pos = 0;
  57095. }
  57096. header_createClass(Header, [{
  57097. key: "__init",
  57098. value: function __init(i, bb) {
  57099. this.bb_pos = i;
  57100. this.bb = bb;
  57101. return this;
  57102. }
  57103. }, {
  57104. key: "name",
  57105. value: function name(optionalEncoding) {
  57106. var offset = this.bb.__offset(this.bb_pos, 4);
  57107. return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
  57108. }
  57109. }, {
  57110. key: "envelope",
  57111. value: function envelope(index) {
  57112. var offset = this.bb.__offset(this.bb_pos, 6);
  57113. return offset ? this.bb.readFloat64(this.bb.__vector(this.bb_pos + offset) + index * 8) : 0;
  57114. }
  57115. }, {
  57116. key: "envelopeLength",
  57117. value: function envelopeLength() {
  57118. var offset = this.bb.__offset(this.bb_pos, 6);
  57119. return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
  57120. }
  57121. }, {
  57122. key: "envelopeArray",
  57123. value: function envelopeArray() {
  57124. var offset = this.bb.__offset(this.bb_pos, 6);
  57125. return offset ? new Float64Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null;
  57126. }
  57127. }, {
  57128. key: "geometryType",
  57129. value: function geometryType() {
  57130. var offset = this.bb.__offset(this.bb_pos, 8);
  57131. return offset ? this.bb.readUint8(this.bb_pos + offset) : geometry_type_GeometryType.Unknown;
  57132. }
  57133. }, {
  57134. key: "hasZ",
  57135. value: function hasZ() {
  57136. var offset = this.bb.__offset(this.bb_pos, 10);
  57137. return offset ? !!this.bb.readInt8(this.bb_pos + offset) : false;
  57138. }
  57139. }, {
  57140. key: "hasM",
  57141. value: function hasM() {
  57142. var offset = this.bb.__offset(this.bb_pos, 12);
  57143. return offset ? !!this.bb.readInt8(this.bb_pos + offset) : false;
  57144. }
  57145. }, {
  57146. key: "hasT",
  57147. value: function hasT() {
  57148. var offset = this.bb.__offset(this.bb_pos, 14);
  57149. return offset ? !!this.bb.readInt8(this.bb_pos + offset) : false;
  57150. }
  57151. }, {
  57152. key: "hasTm",
  57153. value: function hasTm() {
  57154. var offset = this.bb.__offset(this.bb_pos, 16);
  57155. return offset ? !!this.bb.readInt8(this.bb_pos + offset) : false;
  57156. }
  57157. }, {
  57158. key: "columns",
  57159. value: function columns(index, obj) {
  57160. var offset = this.bb.__offset(this.bb_pos, 18);
  57161. return offset ? (obj || new column_Column()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + offset) + index * 4), this.bb) : null;
  57162. }
  57163. }, {
  57164. key: "columnsLength",
  57165. value: function columnsLength() {
  57166. var offset = this.bb.__offset(this.bb_pos, 18);
  57167. return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
  57168. }
  57169. }, {
  57170. key: "featuresCount",
  57171. value: function featuresCount() {
  57172. var offset = this.bb.__offset(this.bb_pos, 20);
  57173. return offset ? this.bb.readUint64(this.bb_pos + offset) : BigInt('0');
  57174. }
  57175. }, {
  57176. key: "indexNodeSize",
  57177. value: function indexNodeSize() {
  57178. var offset = this.bb.__offset(this.bb_pos, 22);
  57179. return offset ? this.bb.readUint16(this.bb_pos + offset) : 16;
  57180. }
  57181. }, {
  57182. key: "crs",
  57183. value: function crs(obj) {
  57184. var offset = this.bb.__offset(this.bb_pos, 24);
  57185. return offset ? (obj || new Crs()).__init(this.bb.__indirect(this.bb_pos + offset), this.bb) : null;
  57186. }
  57187. }, {
  57188. key: "title",
  57189. value: function title(optionalEncoding) {
  57190. var offset = this.bb.__offset(this.bb_pos, 26);
  57191. return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
  57192. }
  57193. }, {
  57194. key: "description",
  57195. value: function description(optionalEncoding) {
  57196. var offset = this.bb.__offset(this.bb_pos, 28);
  57197. return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
  57198. }
  57199. }, {
  57200. key: "metadata",
  57201. value: function metadata(optionalEncoding) {
  57202. var offset = this.bb.__offset(this.bb_pos, 30);
  57203. return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
  57204. }
  57205. }], [{
  57206. key: "getRootAsHeader",
  57207. value: function getRootAsHeader(bb, obj) {
  57208. return (obj || new Header()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
  57209. }
  57210. }, {
  57211. key: "getSizePrefixedRootAsHeader",
  57212. value: function getSizePrefixedRootAsHeader(bb, obj) {
  57213. bb.setPosition(bb.position() + js_flatbuffers/* SIZE_PREFIX_LENGTH */.XU);
  57214. return (obj || new Header()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
  57215. }
  57216. }, {
  57217. key: "startHeader",
  57218. value: function startHeader(builder) {
  57219. builder.startObject(14);
  57220. }
  57221. }, {
  57222. key: "addName",
  57223. value: function addName(builder, nameOffset) {
  57224. builder.addFieldOffset(0, nameOffset, 0);
  57225. }
  57226. }, {
  57227. key: "addEnvelope",
  57228. value: function addEnvelope(builder, envelopeOffset) {
  57229. builder.addFieldOffset(1, envelopeOffset, 0);
  57230. }
  57231. }, {
  57232. key: "createEnvelopeVector",
  57233. value: function createEnvelopeVector(builder, data) {
  57234. builder.startVector(8, data.length, 8);
  57235. for (var i = data.length - 1; i >= 0; i--) {
  57236. builder.addFloat64(data[i]);
  57237. }
  57238. return builder.endVector();
  57239. }
  57240. }, {
  57241. key: "startEnvelopeVector",
  57242. value: function startEnvelopeVector(builder, numElems) {
  57243. builder.startVector(8, numElems, 8);
  57244. }
  57245. }, {
  57246. key: "addGeometryType",
  57247. value: function addGeometryType(builder, geometryType) {
  57248. builder.addFieldInt8(2, geometryType, geometry_type_GeometryType.Unknown);
  57249. }
  57250. }, {
  57251. key: "addHasZ",
  57252. value: function addHasZ(builder, hasZ) {
  57253. builder.addFieldInt8(3, +hasZ, +false);
  57254. }
  57255. }, {
  57256. key: "addHasM",
  57257. value: function addHasM(builder, hasM) {
  57258. builder.addFieldInt8(4, +hasM, +false);
  57259. }
  57260. }, {
  57261. key: "addHasT",
  57262. value: function addHasT(builder, hasT) {
  57263. builder.addFieldInt8(5, +hasT, +false);
  57264. }
  57265. }, {
  57266. key: "addHasTm",
  57267. value: function addHasTm(builder, hasTm) {
  57268. builder.addFieldInt8(6, +hasTm, +false);
  57269. }
  57270. }, {
  57271. key: "addColumns",
  57272. value: function addColumns(builder, columnsOffset) {
  57273. builder.addFieldOffset(7, columnsOffset, 0);
  57274. }
  57275. }, {
  57276. key: "createColumnsVector",
  57277. value: function createColumnsVector(builder, data) {
  57278. builder.startVector(4, data.length, 4);
  57279. for (var i = data.length - 1; i >= 0; i--) {
  57280. builder.addOffset(data[i]);
  57281. }
  57282. return builder.endVector();
  57283. }
  57284. }, {
  57285. key: "startColumnsVector",
  57286. value: function startColumnsVector(builder, numElems) {
  57287. builder.startVector(4, numElems, 4);
  57288. }
  57289. }, {
  57290. key: "addFeaturesCount",
  57291. value: function addFeaturesCount(builder, featuresCount) {
  57292. builder.addFieldInt64(8, featuresCount, BigInt('0'));
  57293. }
  57294. }, {
  57295. key: "addIndexNodeSize",
  57296. value: function addIndexNodeSize(builder, indexNodeSize) {
  57297. builder.addFieldInt16(9, indexNodeSize, 16);
  57298. }
  57299. }, {
  57300. key: "addCrs",
  57301. value: function addCrs(builder, crsOffset) {
  57302. builder.addFieldOffset(10, crsOffset, 0);
  57303. }
  57304. }, {
  57305. key: "addTitle",
  57306. value: function addTitle(builder, titleOffset) {
  57307. builder.addFieldOffset(11, titleOffset, 0);
  57308. }
  57309. }, {
  57310. key: "addDescription",
  57311. value: function addDescription(builder, descriptionOffset) {
  57312. builder.addFieldOffset(12, descriptionOffset, 0);
  57313. }
  57314. }, {
  57315. key: "addMetadata",
  57316. value: function addMetadata(builder, metadataOffset) {
  57317. builder.addFieldOffset(13, metadataOffset, 0);
  57318. }
  57319. }, {
  57320. key: "endHeader",
  57321. value: function endHeader(builder) {
  57322. var offset = builder.endObject();
  57323. return offset;
  57324. }
  57325. }, {
  57326. key: "finishHeaderBuffer",
  57327. value: function finishHeaderBuffer(builder, offset) {
  57328. builder.finish(offset);
  57329. }
  57330. }, {
  57331. key: "finishSizePrefixedHeaderBuffer",
  57332. value: function finishSizePrefixedHeaderBuffer(builder, offset) {
  57333. builder.finish(offset, undefined, true);
  57334. }
  57335. }]);
  57336. return Header;
  57337. }();
  57338. ;// CONCATENATED MODULE: ./node_modules/flatgeobuf/lib/mjs/header-meta.js
  57339. function fromByteBuffer(bb) {
  57340. var header = header_Header.getRootAsHeader(bb);
  57341. var featuresCount = header.featuresCount();
  57342. var indexNodeSize = header.indexNodeSize();
  57343. var columns = [];
  57344. for (var j = 0; j < header.columnsLength(); j++) {
  57345. var column = header.columns(j);
  57346. if (!column) throw new Error('Column unexpectedly missing');
  57347. if (!column.name()) throw new Error('Column name unexpectedly missing');
  57348. columns.push({
  57349. name: column.name(),
  57350. type: column.type(),
  57351. title: column.title(),
  57352. description: column.description(),
  57353. width: column.width(),
  57354. precision: column.precision(),
  57355. scale: column.scale(),
  57356. nullable: column.nullable(),
  57357. unique: column.unique(),
  57358. primary_key: column.primaryKey()
  57359. });
  57360. }
  57361. var crs = header.crs();
  57362. var crsMeta = crs ? {
  57363. org: crs.org(),
  57364. code: crs.code(),
  57365. name: crs.name(),
  57366. description: crs.description(),
  57367. wkt: crs.wkt(),
  57368. code_string: crs.codeString()
  57369. } : null;
  57370. var headerMeta = {
  57371. geometryType: header.geometryType(),
  57372. columns: columns,
  57373. envelope: null,
  57374. featuresCount: Number(featuresCount),
  57375. indexNodeSize: indexNodeSize,
  57376. crs: crsMeta,
  57377. title: header.title(),
  57378. description: header.description(),
  57379. metadata: header.metadata()
  57380. };
  57381. return headerMeta;
  57382. }
  57383. // EXTERNAL MODULE: ./node_modules/@repeaterjs/repeater/cjs/repeater.js
  57384. var repeater = __webpack_require__(1351);
  57385. ;// CONCATENATED MODULE: ./node_modules/flatgeobuf/lib/mjs/config.js
  57386. function config_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  57387. function config_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  57388. function config_createClass(Constructor, protoProps, staticProps) { if (protoProps) config_defineProperties(Constructor.prototype, protoProps); if (staticProps) config_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  57389. var Config = /*#__PURE__*/function () {
  57390. function Config() {
  57391. config_classCallCheck(this, Config);
  57392. this._extraRequestThreshold = 256 * 1024;
  57393. }
  57394. config_createClass(Config, [{
  57395. key: "extraRequestThreshold",
  57396. value: function extraRequestThreshold() {
  57397. return this._extraRequestThreshold;
  57398. }
  57399. }, {
  57400. key: "setExtraRequestThreshold",
  57401. value: function setExtraRequestThreshold(bytes) {
  57402. if (bytes < 0) {
  57403. throw new Error('extraRequestThreshold cannot be negative');
  57404. }
  57405. this._extraRequestThreshold = bytes;
  57406. }
  57407. }]);
  57408. return Config;
  57409. }();
  57410. Config.global = new Config();
  57411. ;// CONCATENATED MODULE: ./node_modules/flatgeobuf/lib/mjs/logger.js
  57412. function logger_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  57413. function logger_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  57414. function logger_createClass(Constructor, protoProps, staticProps) { if (protoProps) logger_defineProperties(Constructor.prototype, protoProps); if (staticProps) logger_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  57415. var LogLevel;
  57416. (function (LogLevel) {
  57417. LogLevel[LogLevel["Debug"] = 0] = "Debug";
  57418. LogLevel[LogLevel["Info"] = 1] = "Info";
  57419. LogLevel[LogLevel["Warn"] = 2] = "Warn";
  57420. LogLevel[LogLevel["Error"] = 3] = "Error";
  57421. })(LogLevel || (LogLevel = {}));
  57422. var Logger = /*#__PURE__*/function () {
  57423. function Logger() {
  57424. logger_classCallCheck(this, Logger);
  57425. }
  57426. logger_createClass(Logger, null, [{
  57427. key: "debug",
  57428. value: function debug() {
  57429. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  57430. args[_key] = arguments[_key];
  57431. }
  57432. this.log.apply(this, [LogLevel.Debug].concat(args));
  57433. }
  57434. }, {
  57435. key: "info",
  57436. value: function info() {
  57437. for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
  57438. args[_key2] = arguments[_key2];
  57439. }
  57440. this.log.apply(this, [LogLevel.Info].concat(args));
  57441. }
  57442. }, {
  57443. key: "warn",
  57444. value: function warn() {
  57445. for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
  57446. args[_key3] = arguments[_key3];
  57447. }
  57448. this.log.apply(this, [LogLevel.Warn].concat(args));
  57449. }
  57450. }, {
  57451. key: "error",
  57452. value: function error() {
  57453. for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
  57454. args[_key4] = arguments[_key4];
  57455. }
  57456. this.log.apply(this, [LogLevel.Error].concat(args));
  57457. }
  57458. }, {
  57459. key: "log",
  57460. value: function log(level) {
  57461. if (this.logLevel > level) {
  57462. return;
  57463. }
  57464. for (var _len5 = arguments.length, args = new Array(_len5 > 1 ? _len5 - 1 : 0), _key5 = 1; _key5 < _len5; _key5++) {
  57465. args[_key5 - 1] = arguments[_key5];
  57466. }
  57467. switch (level) {
  57468. case LogLevel.Debug:
  57469. {
  57470. var _console;
  57471. (_console = console).debug.apply(_console, args);
  57472. break;
  57473. }
  57474. case LogLevel.Info:
  57475. {
  57476. var _console2;
  57477. (_console2 = console).info.apply(_console2, args);
  57478. break;
  57479. }
  57480. case LogLevel.Warn:
  57481. {
  57482. var _console3;
  57483. (_console3 = console).warn.apply(_console3, args);
  57484. break;
  57485. }
  57486. case LogLevel.Error:
  57487. {
  57488. var _console4;
  57489. (_console4 = console).error.apply(_console4, args);
  57490. break;
  57491. }
  57492. }
  57493. }
  57494. }]);
  57495. return Logger;
  57496. }();
  57497. Logger.logLevel = LogLevel.Info;
  57498. ;// CONCATENATED MODULE: ./node_modules/flatgeobuf/lib/mjs/packedrtree.js
  57499. function packedrtree_typeof(obj) { "@babel/helpers - typeof"; return packedrtree_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, packedrtree_typeof(obj); }
  57500. function packedrtree_regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ packedrtree_regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == packedrtree_typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
  57501. function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || packedrtree_unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
  57502. function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
  57503. function packedrtree_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return packedrtree_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return packedrtree_arrayLikeToArray(o, minLen); }
  57504. function packedrtree_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
  57505. function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
  57506. function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
  57507. function packedrtree_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  57508. function packedrtree_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  57509. function packedrtree_createClass(Constructor, protoProps, staticProps) { if (protoProps) packedrtree_defineProperties(Constructor.prototype, protoProps); if (staticProps) packedrtree_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  57510. function _awaitAsyncGenerator(value) { return new _OverloadYield(value, 0); }
  57511. function _wrapAsyncGenerator(fn) { return function () { return new _AsyncGenerator(fn.apply(this, arguments)); }; }
  57512. function _AsyncGenerator(gen) { var front, back; function resume(key, arg) { try { var result = gen[key](arg), value = result.value, overloaded = value instanceof _OverloadYield; Promise.resolve(overloaded ? value.v : value).then(function (arg) { if (overloaded) { var nextKey = "return" === key ? "return" : "next"; if (!value.k || arg.done) return resume(nextKey, arg); arg = gen[nextKey](arg).value; } settle(result.done ? "return" : "normal", arg); }, function (err) { resume("throw", err); }); } catch (err) { settle("throw", err); } } function settle(type, value) { switch (type) { case "return": front.resolve({ value: value, done: !0 }); break; case "throw": front.reject(value); break; default: front.resolve({ value: value, done: !1 }); } (front = front.next) ? resume(front.key, front.arg) : back = null; } this._invoke = function (key, arg) { return new Promise(function (resolve, reject) { var request = { key: key, arg: arg, resolve: resolve, reject: reject, next: null }; back ? back = back.next = request : (front = back = request, resume(key, arg)); }); }, "function" != typeof gen["return"] && (this["return"] = void 0); }
  57513. _AsyncGenerator.prototype["function" == typeof Symbol && Symbol.asyncIterator || "@@asyncIterator"] = function () { return this; }, _AsyncGenerator.prototype.next = function (arg) { return this._invoke("next", arg); }, _AsyncGenerator.prototype["throw"] = function (arg) { return this._invoke("throw", arg); }, _AsyncGenerator.prototype["return"] = function (arg) { return this._invoke("return", arg); };
  57514. function _OverloadYield(value, kind) { this.v = value, this.k = kind; }
  57515. var NODE_ITEM_LEN = 8 * 4 + 8;
  57516. var DEFAULT_NODE_SIZE = 16;
  57517. function calcTreeSize(numItems, nodeSize) {
  57518. nodeSize = Math.min(Math.max(+nodeSize, 2), 65535);
  57519. var n = numItems;
  57520. var numNodes = n;
  57521. do {
  57522. n = Math.ceil(n / nodeSize);
  57523. numNodes += n;
  57524. } while (n !== 1);
  57525. return numNodes * NODE_ITEM_LEN;
  57526. }
  57527. function generateLevelBounds(numItems, nodeSize) {
  57528. if (nodeSize < 2) throw new Error('Node size must be at least 2');
  57529. if (numItems === 0) throw new Error('Number of items must be greater than 0');
  57530. var n = numItems;
  57531. var numNodes = n;
  57532. var levelNumNodes = [n];
  57533. do {
  57534. n = Math.ceil(n / nodeSize);
  57535. numNodes += n;
  57536. levelNumNodes.push(n);
  57537. } while (n !== 1);
  57538. var levelOffsets = [];
  57539. n = numNodes;
  57540. for (var _i = 0, _levelNumNodes = levelNumNodes; _i < _levelNumNodes.length; _i++) {
  57541. var size = _levelNumNodes[_i];
  57542. levelOffsets.push(n - size);
  57543. n -= size;
  57544. }
  57545. levelOffsets.reverse();
  57546. levelNumNodes.reverse();
  57547. var levelBounds = [];
  57548. for (var i = 0; i < levelNumNodes.length; i++) levelBounds.push([levelOffsets[i], levelOffsets[i] + levelNumNodes[i]]);
  57549. levelBounds.reverse();
  57550. return levelBounds;
  57551. }
  57552. function streamSearch(_x, _x2, _x3, _x4) {
  57553. return _streamSearch.apply(this, arguments);
  57554. }
  57555. function _streamSearch() {
  57556. _streamSearch = _wrapAsyncGenerator( /*#__PURE__*/packedrtree_regeneratorRuntime().mark(function _callee(numItems, nodeSize, rect, readNode) {
  57557. var NodeRange, minX, minY, maxX, maxY, levelBounds, leafNodesOffset, rootNodeRange, queue, _loop;
  57558. return packedrtree_regeneratorRuntime().wrap(function _callee$(_context3) {
  57559. while (1) switch (_context3.prev = _context3.next) {
  57560. case 0:
  57561. NodeRange = /*#__PURE__*/function () {
  57562. function NodeRange(nodes, level) {
  57563. packedrtree_classCallCheck(this, NodeRange);
  57564. this._level = level;
  57565. this.nodes = nodes;
  57566. }
  57567. packedrtree_createClass(NodeRange, [{
  57568. key: "level",
  57569. value: function level() {
  57570. return this._level;
  57571. }
  57572. }, {
  57573. key: "startNode",
  57574. value: function startNode() {
  57575. return this.nodes[0];
  57576. }
  57577. }, {
  57578. key: "endNode",
  57579. value: function endNode() {
  57580. return this.nodes[1];
  57581. }
  57582. }, {
  57583. key: "extendEndNodeToNewOffset",
  57584. value: function extendEndNodeToNewOffset(newOffset) {
  57585. console.assert(newOffset > this.nodes[1]);
  57586. this.nodes[1] = newOffset;
  57587. }
  57588. }, {
  57589. key: "toString",
  57590. value: function toString() {
  57591. return "[NodeRange level: ".concat(this._level, ", nodes: ").concat(this.nodes[0], "-").concat(this.nodes[1], "]");
  57592. }
  57593. }]);
  57594. return NodeRange;
  57595. }();
  57596. minX = rect.minX, minY = rect.minY, maxX = rect.maxX, maxY = rect.maxY;
  57597. Logger.info("tree items: ".concat(numItems, ", nodeSize: ").concat(nodeSize));
  57598. levelBounds = generateLevelBounds(numItems, nodeSize);
  57599. leafNodesOffset = levelBounds[0][0];
  57600. rootNodeRange = function () {
  57601. var range = [0, 1];
  57602. var level = levelBounds.length - 1;
  57603. return new NodeRange(range, level);
  57604. }();
  57605. queue = [rootNodeRange];
  57606. Logger.debug("starting stream search with queue: ".concat(queue, ", numItems: ").concat(numItems, ", nodeSize: ").concat(nodeSize, ", levelBounds: ").concat(levelBounds));
  57607. _loop = /*#__PURE__*/packedrtree_regeneratorRuntime().mark(function _loop() {
  57608. var nodeRange, nodeIndex, isLeafNode, _levelBounds$nodeRang, levelBound, end, length, buffer, float64Array, uint32Array, _loop2, _ret, pos;
  57609. return packedrtree_regeneratorRuntime().wrap(function _loop$(_context2) {
  57610. while (1) switch (_context2.prev = _context2.next) {
  57611. case 0:
  57612. nodeRange = queue.shift();
  57613. Logger.debug("popped node: ".concat(nodeRange, ", queueLength: ").concat(queue.length));
  57614. nodeIndex = nodeRange.startNode();
  57615. isLeafNode = nodeIndex >= leafNodesOffset;
  57616. _levelBounds$nodeRang = _slicedToArray(levelBounds[nodeRange.level()], 2), levelBound = _levelBounds$nodeRang[1];
  57617. end = Math.min(nodeRange.endNode() + nodeSize, levelBound);
  57618. length = end - nodeIndex;
  57619. _context2.next = 9;
  57620. return _awaitAsyncGenerator(readNode(nodeIndex * NODE_ITEM_LEN, length * NODE_ITEM_LEN));
  57621. case 9:
  57622. buffer = _context2.sent;
  57623. float64Array = new Float64Array(buffer);
  57624. uint32Array = new Uint32Array(buffer);
  57625. _loop2 = /*#__PURE__*/packedrtree_regeneratorRuntime().mark(function _loop2(pos) {
  57626. var nodePos, low32Offset, high32Offset, offset, featureLength, extraRequestThresholdNodes, nearestNodeRange, newNodeRange;
  57627. return packedrtree_regeneratorRuntime().wrap(function _loop2$(_context) {
  57628. while (1) switch (_context.prev = _context.next) {
  57629. case 0:
  57630. nodePos = (pos - nodeIndex) * 5;
  57631. if (!(maxX < float64Array[nodePos + 0])) {
  57632. _context.next = 3;
  57633. break;
  57634. }
  57635. return _context.abrupt("return", 0);
  57636. case 3:
  57637. if (!(maxY < float64Array[nodePos + 1])) {
  57638. _context.next = 5;
  57639. break;
  57640. }
  57641. return _context.abrupt("return", 0);
  57642. case 5:
  57643. if (!(minX > float64Array[nodePos + 2])) {
  57644. _context.next = 7;
  57645. break;
  57646. }
  57647. return _context.abrupt("return", 0);
  57648. case 7:
  57649. if (!(minY > float64Array[nodePos + 3])) {
  57650. _context.next = 9;
  57651. break;
  57652. }
  57653. return _context.abrupt("return", 0);
  57654. case 9:
  57655. low32Offset = uint32Array[(nodePos << 1) + 8];
  57656. high32Offset = uint32Array[(nodePos << 1) + 9];
  57657. offset = readUint52(high32Offset, low32Offset);
  57658. if (!isLeafNode) {
  57659. _context.next = 17;
  57660. break;
  57661. }
  57662. featureLength = function () {
  57663. if (pos < numItems - 1) {
  57664. var nextPos = (pos - nodeIndex + 1) * 5;
  57665. var _low32Offset = uint32Array[(nextPos << 1) + 8];
  57666. var _high32Offset = uint32Array[(nextPos << 1) + 9];
  57667. var nextOffset = readUint52(_high32Offset, _low32Offset);
  57668. return nextOffset - offset;
  57669. } else {
  57670. return null;
  57671. }
  57672. }();
  57673. _context.next = 16;
  57674. return [offset, pos - leafNodesOffset, featureLength];
  57675. case 16:
  57676. return _context.abrupt("return", 0);
  57677. case 17:
  57678. extraRequestThresholdNodes = Config.global.extraRequestThreshold() / NODE_ITEM_LEN;
  57679. nearestNodeRange = queue[queue.length - 1];
  57680. if (!(nearestNodeRange !== undefined && nearestNodeRange.level() == nodeRange.level() - 1 && offset < nearestNodeRange.endNode() + extraRequestThresholdNodes)) {
  57681. _context.next = 23;
  57682. break;
  57683. }
  57684. Logger.debug("Merging \"nodeRange\" request into existing range: ".concat(nearestNodeRange, ", newOffset: ").concat(nearestNodeRange.endNode(), " -> ").concat(offset));
  57685. nearestNodeRange.extendEndNodeToNewOffset(offset);
  57686. return _context.abrupt("return", 0);
  57687. case 23:
  57688. newNodeRange = function () {
  57689. var level = nodeRange.level() - 1;
  57690. var range = [offset, offset + 1];
  57691. return new NodeRange(range, level);
  57692. }();
  57693. if (nearestNodeRange !== undefined && nearestNodeRange.level() == newNodeRange.level()) {
  57694. Logger.info("Same level, but too far away. Pushing new request at offset: ".concat(offset, " rather than merging with distant ").concat(nearestNodeRange));
  57695. } else {
  57696. Logger.info("Pushing new level for ".concat(newNodeRange, " onto queue with nearestNodeRange: ").concat(nearestNodeRange, " since there's not already a range for this level."));
  57697. }
  57698. queue.push(newNodeRange);
  57699. case 26:
  57700. case "end":
  57701. return _context.stop();
  57702. }
  57703. }, _loop2);
  57704. });
  57705. pos = nodeIndex;
  57706. case 14:
  57707. if (!(pos < end)) {
  57708. _context2.next = 22;
  57709. break;
  57710. }
  57711. return _context2.delegateYield(_loop2(pos), "t0", 16);
  57712. case 16:
  57713. _ret = _context2.t0;
  57714. if (!(_ret === 0)) {
  57715. _context2.next = 19;
  57716. break;
  57717. }
  57718. return _context2.abrupt("continue", 19);
  57719. case 19:
  57720. pos++;
  57721. _context2.next = 14;
  57722. break;
  57723. case 22:
  57724. case "end":
  57725. return _context2.stop();
  57726. }
  57727. }, _loop);
  57728. });
  57729. case 9:
  57730. if (!(queue.length != 0)) {
  57731. _context3.next = 13;
  57732. break;
  57733. }
  57734. return _context3.delegateYield(_loop(), "t0", 11);
  57735. case 11:
  57736. _context3.next = 9;
  57737. break;
  57738. case 13:
  57739. case "end":
  57740. return _context3.stop();
  57741. }
  57742. }, _callee);
  57743. }));
  57744. return _streamSearch.apply(this, arguments);
  57745. }
  57746. function readUint52(high32Bits, low32Bits) {
  57747. if ((high32Bits & 0xfff00000) != 0) {
  57748. throw Error('integer is too large to be safely represented');
  57749. }
  57750. var result = low32Bits + high32Bits * Math.pow(2, 32);
  57751. return result;
  57752. }
  57753. ;// CONCATENATED MODULE: ./node_modules/flatgeobuf/lib/mjs/constants.js
  57754. var constants_magicbytes = new Uint8Array([0x66, 0x67, 0x62, 0x03, 0x66, 0x67, 0x62, 0x00]);
  57755. var SIZE_PREFIX_LEN = 4;
  57756. ;// CONCATENATED MODULE: ./node_modules/flatgeobuf/lib/mjs/http-reader.js
  57757. function http_reader_typeof(obj) { "@babel/helpers - typeof"; return http_reader_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, http_reader_typeof(obj); }
  57758. function http_reader_createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = http_reader_unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
  57759. function http_reader_slicedToArray(arr, i) { return http_reader_arrayWithHoles(arr) || http_reader_iterableToArrayLimit(arr, i) || http_reader_unsupportedIterableToArray(arr, i) || http_reader_nonIterableRest(); }
  57760. function http_reader_nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
  57761. function http_reader_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return http_reader_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return http_reader_arrayLikeToArray(o, minLen); }
  57762. function http_reader_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
  57763. function http_reader_iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
  57764. function http_reader_arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
  57765. function http_reader_regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ http_reader_regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == http_reader_typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
  57766. function http_reader_asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
  57767. function http_reader_asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { http_reader_asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { http_reader_asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
  57768. function http_reader_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  57769. function http_reader_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  57770. function http_reader_createClass(Constructor, protoProps, staticProps) { if (protoProps) http_reader_defineProperties(Constructor.prototype, protoProps); if (staticProps) http_reader_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  57771. function http_reader_wrapAsyncGenerator(fn) { return function () { return new http_reader_AsyncGenerator(fn.apply(this, arguments)); }; }
  57772. function http_reader_AsyncGenerator(gen) { var front, back; function resume(key, arg) { try { var result = gen[key](arg), value = result.value, overloaded = value instanceof http_reader_OverloadYield; Promise.resolve(overloaded ? value.v : value).then(function (arg) { if (overloaded) { var nextKey = "return" === key ? "return" : "next"; if (!value.k || arg.done) return resume(nextKey, arg); arg = gen[nextKey](arg).value; } settle(result.done ? "return" : "normal", arg); }, function (err) { resume("throw", err); }); } catch (err) { settle("throw", err); } } function settle(type, value) { switch (type) { case "return": front.resolve({ value: value, done: !0 }); break; case "throw": front.reject(value); break; default: front.resolve({ value: value, done: !1 }); } (front = front.next) ? resume(front.key, front.arg) : back = null; } this._invoke = function (key, arg) { return new Promise(function (resolve, reject) { var request = { key: key, arg: arg, resolve: resolve, reject: reject, next: null }; back ? back = back.next = request : (front = back = request, resume(key, arg)); }); }, "function" != typeof gen["return"] && (this["return"] = void 0); }
  57773. http_reader_AsyncGenerator.prototype["function" == typeof Symbol && Symbol.asyncIterator || "@@asyncIterator"] = function () { return this; }, http_reader_AsyncGenerator.prototype.next = function (arg) { return this._invoke("next", arg); }, http_reader_AsyncGenerator.prototype["throw"] = function (arg) { return this._invoke("throw", arg); }, http_reader_AsyncGenerator.prototype["return"] = function (arg) { return this._invoke("return", arg); };
  57774. function http_reader_awaitAsyncGenerator(value) { return new http_reader_OverloadYield(value, 0); }
  57775. function _asyncGeneratorDelegate(inner) { var iter = {}, waiting = !1; function pump(key, value) { return waiting = !0, value = new Promise(function (resolve) { resolve(inner[key](value)); }), { done: !1, value: new http_reader_OverloadYield(value, 1) }; } return iter["undefined" != typeof Symbol && Symbol.iterator || "@@iterator"] = function () { return this; }, iter.next = function (value) { return waiting ? (waiting = !1, value) : pump("next", value); }, "function" == typeof inner["throw"] && (iter["throw"] = function (value) { if (waiting) throw waiting = !1, value; return pump("throw", value); }), "function" == typeof inner["return"] && (iter["return"] = function (value) { return waiting ? (waiting = !1, value) : pump("return", value); }), iter; }
  57776. function http_reader_OverloadYield(value, kind) { this.v = value, this.k = kind; }
  57777. function _asyncIterator(iterable) { var method, async, sync, retry = 2; for ("undefined" != typeof Symbol && (async = Symbol.asyncIterator, sync = Symbol.iterator); retry--;) { if (async && null != (method = iterable[async])) return method.call(iterable); if (sync && null != (method = iterable[sync])) return new AsyncFromSyncIterator(method.call(iterable)); async = "@@asyncIterator", sync = "@@iterator"; } throw new TypeError("Object is not async iterable"); }
  57778. function AsyncFromSyncIterator(s) { function AsyncFromSyncIteratorContinuation(r) { if (Object(r) !== r) return Promise.reject(new TypeError(r + " is not an object.")); var done = r.done; return Promise.resolve(r.value).then(function (value) { return { value: value, done: done }; }); } return AsyncFromSyncIterator = function AsyncFromSyncIterator(s) { this.s = s, this.n = s.next; }, AsyncFromSyncIterator.prototype = { s: null, n: null, next: function next() { return AsyncFromSyncIteratorContinuation(this.n.apply(this.s, arguments)); }, "return": function _return(value) { var ret = this.s["return"]; return void 0 === ret ? Promise.resolve({ value: value, done: !0 }) : AsyncFromSyncIteratorContinuation(ret.apply(this.s, arguments)); }, "throw": function _throw(value) { var thr = this.s["return"]; return void 0 === thr ? Promise.reject(value) : AsyncFromSyncIteratorContinuation(thr.apply(this.s, arguments)); } }, new AsyncFromSyncIterator(s); }
  57779. var HttpReader = /*#__PURE__*/function () {
  57780. function HttpReader(headerClient, header, headerLength, indexLength) {
  57781. http_reader_classCallCheck(this, HttpReader);
  57782. this.headerClient = headerClient;
  57783. this.header = header;
  57784. this.headerLength = headerLength;
  57785. this.indexLength = indexLength;
  57786. }
  57787. http_reader_createClass(HttpReader, [{
  57788. key: "selectBbox",
  57789. value: function selectBbox(rect) {
  57790. var _this = this;
  57791. return http_reader_wrapAsyncGenerator( /*#__PURE__*/http_reader_regeneratorRuntime().mark(function _callee2() {
  57792. var lengthBeforeTree, bufferedClient, readNode, batches, currentBatch, _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _iterator, _step, searchResult, _searchResult2, featureOffset, _searchResult4, featureLength, guessLength, prevFeature, gap, promises;
  57793. return http_reader_regeneratorRuntime().wrap(function _callee2$(_context2) {
  57794. while (1) switch (_context2.prev = _context2.next) {
  57795. case 0:
  57796. lengthBeforeTree = _this.lengthBeforeTree();
  57797. bufferedClient = _this.headerClient;
  57798. readNode = /*#__PURE__*/function () {
  57799. var _ref = http_reader_asyncToGenerator( /*#__PURE__*/http_reader_regeneratorRuntime().mark(function _callee(offsetIntoTree, size) {
  57800. var minReqLength;
  57801. return http_reader_regeneratorRuntime().wrap(function _callee$(_context) {
  57802. while (1) switch (_context.prev = _context.next) {
  57803. case 0:
  57804. minReqLength = 0;
  57805. return _context.abrupt("return", bufferedClient.getRange(lengthBeforeTree + offsetIntoTree, size, minReqLength, 'index'));
  57806. case 2:
  57807. case "end":
  57808. return _context.stop();
  57809. }
  57810. }, _callee);
  57811. }));
  57812. return function readNode(_x, _x2) {
  57813. return _ref.apply(this, arguments);
  57814. };
  57815. }();
  57816. batches = [];
  57817. currentBatch = [];
  57818. _iteratorAbruptCompletion = false;
  57819. _didIteratorError = false;
  57820. _context2.prev = 7;
  57821. _iterator = _asyncIterator(streamSearch(_this.header.featuresCount, _this.header.indexNodeSize, rect, readNode));
  57822. case 9:
  57823. _context2.next = 11;
  57824. return http_reader_awaitAsyncGenerator(_iterator.next());
  57825. case 11:
  57826. if (!(_iteratorAbruptCompletion = !(_step = _context2.sent).done)) {
  57827. _context2.next = 26;
  57828. break;
  57829. }
  57830. searchResult = _step.value;
  57831. _searchResult2 = http_reader_slicedToArray(searchResult, 2), featureOffset = _searchResult2[0];
  57832. _searchResult4 = http_reader_slicedToArray(searchResult, 3), featureLength = _searchResult4[2];
  57833. if (!featureLength) {
  57834. Logger.info('final feature');
  57835. guessLength = Config.global.extraRequestThreshold();
  57836. featureLength = guessLength;
  57837. }
  57838. if (!(currentBatch.length == 0)) {
  57839. _context2.next = 19;
  57840. break;
  57841. }
  57842. currentBatch.push([featureOffset, featureLength]);
  57843. return _context2.abrupt("continue", 23);
  57844. case 19:
  57845. prevFeature = currentBatch[currentBatch.length - 1];
  57846. gap = featureOffset - (prevFeature[0] + prevFeature[1]);
  57847. if (gap > Config.global.extraRequestThreshold()) {
  57848. Logger.info("Pushing new feature batch, since gap ".concat(gap, " was too large"));
  57849. batches.push(currentBatch);
  57850. currentBatch = [];
  57851. }
  57852. currentBatch.push([featureOffset, featureLength]);
  57853. case 23:
  57854. _iteratorAbruptCompletion = false;
  57855. _context2.next = 9;
  57856. break;
  57857. case 26:
  57858. _context2.next = 32;
  57859. break;
  57860. case 28:
  57861. _context2.prev = 28;
  57862. _context2.t0 = _context2["catch"](7);
  57863. _didIteratorError = true;
  57864. _iteratorError = _context2.t0;
  57865. case 32:
  57866. _context2.prev = 32;
  57867. _context2.prev = 33;
  57868. if (!(_iteratorAbruptCompletion && _iterator["return"] != null)) {
  57869. _context2.next = 37;
  57870. break;
  57871. }
  57872. _context2.next = 37;
  57873. return http_reader_awaitAsyncGenerator(_iterator["return"]());
  57874. case 37:
  57875. _context2.prev = 37;
  57876. if (!_didIteratorError) {
  57877. _context2.next = 40;
  57878. break;
  57879. }
  57880. throw _iteratorError;
  57881. case 40:
  57882. return _context2.finish(37);
  57883. case 41:
  57884. return _context2.finish(32);
  57885. case 42:
  57886. _this.headerClient.logUsage('header+index');
  57887. if (currentBatch.length > 0) {
  57888. batches.push(currentBatch);
  57889. }
  57890. promises = batches.flatMap(function (batch) {
  57891. return _this.readFeatureBatch(batch);
  57892. });
  57893. return _context2.delegateYield(_asyncGeneratorDelegate(_asyncIterator(repeater/* Repeater */.ZN.merge(promises)), http_reader_awaitAsyncGenerator), "t1", 46);
  57894. case 46:
  57895. case "end":
  57896. return _context2.stop();
  57897. }
  57898. }, _callee2, null, [[7, 28, 32, 42], [33,, 37, 41]]);
  57899. }))();
  57900. }
  57901. }, {
  57902. key: "lengthBeforeTree",
  57903. value: function lengthBeforeTree() {
  57904. return constants_magicbytes.length + SIZE_PREFIX_LEN + this.headerLength;
  57905. }
  57906. }, {
  57907. key: "lengthBeforeFeatures",
  57908. value: function lengthBeforeFeatures() {
  57909. return this.lengthBeforeTree() + this.indexLength;
  57910. }
  57911. }, {
  57912. key: "buildFeatureClient",
  57913. value: function buildFeatureClient() {
  57914. return new BufferedHttpRangeClient(this.headerClient.httpClient);
  57915. }
  57916. }, {
  57917. key: "readFeatureBatch",
  57918. value: function readFeatureBatch(batch) {
  57919. var _this2 = this;
  57920. return http_reader_wrapAsyncGenerator( /*#__PURE__*/http_reader_regeneratorRuntime().mark(function _callee3() {
  57921. var _batch$, firstFeatureOffset, _batch, lastFeatureOffset, lastFeatureLength, batchStart, batchEnd, batchSize, featureClient, _iterator2, _step2, _step2$value2, featureOffset;
  57922. return http_reader_regeneratorRuntime().wrap(function _callee3$(_context3) {
  57923. while (1) switch (_context3.prev = _context3.next) {
  57924. case 0:
  57925. _batch$ = http_reader_slicedToArray(batch[0], 1), firstFeatureOffset = _batch$[0];
  57926. _batch = http_reader_slicedToArray(batch[batch.length - 1], 2), lastFeatureOffset = _batch[0], lastFeatureLength = _batch[1];
  57927. batchStart = firstFeatureOffset;
  57928. batchEnd = lastFeatureOffset + lastFeatureLength;
  57929. batchSize = batchEnd - batchStart;
  57930. featureClient = _this2.buildFeatureClient();
  57931. _iterator2 = http_reader_createForOfIteratorHelper(batch);
  57932. _context3.prev = 7;
  57933. _iterator2.s();
  57934. case 9:
  57935. if ((_step2 = _iterator2.n()).done) {
  57936. _context3.next = 17;
  57937. break;
  57938. }
  57939. _step2$value2 = http_reader_slicedToArray(_step2.value, 1), featureOffset = _step2$value2[0];
  57940. _context3.next = 13;
  57941. return http_reader_awaitAsyncGenerator(_this2.readFeature(featureClient, featureOffset, batchSize));
  57942. case 13:
  57943. _context3.next = 15;
  57944. return _context3.sent;
  57945. case 15:
  57946. _context3.next = 9;
  57947. break;
  57948. case 17:
  57949. _context3.next = 22;
  57950. break;
  57951. case 19:
  57952. _context3.prev = 19;
  57953. _context3.t0 = _context3["catch"](7);
  57954. _iterator2.e(_context3.t0);
  57955. case 22:
  57956. _context3.prev = 22;
  57957. _iterator2.f();
  57958. return _context3.finish(22);
  57959. case 25:
  57960. featureClient.logUsage('feature');
  57961. case 26:
  57962. case "end":
  57963. return _context3.stop();
  57964. }
  57965. }, _callee3, null, [[7, 19, 22, 25]]);
  57966. }))();
  57967. }
  57968. }, {
  57969. key: "readFeature",
  57970. value: function () {
  57971. var _readFeature = http_reader_asyncToGenerator( /*#__PURE__*/http_reader_regeneratorRuntime().mark(function _callee4(featureClient, featureOffset, minFeatureReqLength) {
  57972. var offset, featureLength, _bytes, byteBuffer, bytes, bytesAligned, bb;
  57973. return http_reader_regeneratorRuntime().wrap(function _callee4$(_context4) {
  57974. while (1) switch (_context4.prev = _context4.next) {
  57975. case 0:
  57976. offset = featureOffset + this.lengthBeforeFeatures();
  57977. _context4.next = 3;
  57978. return featureClient.getRange(offset, 4, minFeatureReqLength, 'feature length');
  57979. case 3:
  57980. _bytes = _context4.sent;
  57981. featureLength = new DataView(_bytes).getUint32(0, true);
  57982. _context4.next = 7;
  57983. return featureClient.getRange(offset + 4, featureLength, minFeatureReqLength, 'feature data');
  57984. case 7:
  57985. byteBuffer = _context4.sent;
  57986. bytes = new Uint8Array(byteBuffer);
  57987. bytesAligned = new Uint8Array(featureLength + SIZE_PREFIX_LEN);
  57988. bytesAligned.set(bytes, SIZE_PREFIX_LEN);
  57989. bb = new js_flatbuffers/* ByteBuffer */.cZ(bytesAligned);
  57990. bb.setPosition(SIZE_PREFIX_LEN);
  57991. return _context4.abrupt("return", feature_Feature.getRootAsFeature(bb));
  57992. case 14:
  57993. case "end":
  57994. return _context4.stop();
  57995. }
  57996. }, _callee4, this);
  57997. }));
  57998. function readFeature(_x3, _x4, _x5) {
  57999. return _readFeature.apply(this, arguments);
  58000. }
  58001. return readFeature;
  58002. }()
  58003. }], [{
  58004. key: "open",
  58005. value: function () {
  58006. var _open = http_reader_asyncToGenerator( /*#__PURE__*/http_reader_regeneratorRuntime().mark(function _callee5(url) {
  58007. var assumedHeaderLength, headerClient, assumedIndexLength, minReqLength, _bytes2, headerLength, _bytes3, HEADER_MAX_BUFFER_SIZE, bytes, bb, header, indexLength;
  58008. return http_reader_regeneratorRuntime().wrap(function _callee5$(_context5) {
  58009. while (1) switch (_context5.prev = _context5.next) {
  58010. case 0:
  58011. assumedHeaderLength = 2024;
  58012. headerClient = new BufferedHttpRangeClient(url);
  58013. assumedIndexLength = function () {
  58014. var assumedBranchingFactor = DEFAULT_NODE_SIZE;
  58015. var prefetchedLayers = 3;
  58016. var result = 0;
  58017. var i;
  58018. for (i = 0; i < prefetchedLayers; i++) {
  58019. var layer_width = Math.pow(assumedBranchingFactor, i) * NODE_ITEM_LEN;
  58020. result += layer_width;
  58021. }
  58022. return result;
  58023. }();
  58024. minReqLength = assumedHeaderLength + assumedIndexLength;
  58025. Logger.debug("fetching header. minReqLength: ".concat(minReqLength, " (assumedHeaderLength: ").concat(assumedHeaderLength, ", assumedIndexLength: ").concat(assumedIndexLength, ")"));
  58026. _context5.t0 = Uint8Array;
  58027. _context5.next = 8;
  58028. return headerClient.getRange(0, 8, minReqLength, 'header');
  58029. case 8:
  58030. _context5.t1 = _context5.sent;
  58031. _bytes2 = new _context5.t0(_context5.t1);
  58032. if (_bytes2.subarray(0, 3).every(function (v, i) {
  58033. return constants_magicbytes[i] === v;
  58034. })) {
  58035. _context5.next = 13;
  58036. break;
  58037. }
  58038. Logger.error("bytes: ".concat(_bytes2, " != ").concat(constants_magicbytes));
  58039. throw new Error('Not a FlatGeobuf file');
  58040. case 13:
  58041. Logger.debug('magic bytes look good');
  58042. _context5.next = 16;
  58043. return headerClient.getRange(8, 4, minReqLength, 'header');
  58044. case 16:
  58045. _bytes3 = _context5.sent;
  58046. headerLength = new DataView(_bytes3).getUint32(0, true);
  58047. HEADER_MAX_BUFFER_SIZE = 1048576 * 10;
  58048. if (!(headerLength > HEADER_MAX_BUFFER_SIZE || headerLength < 8)) {
  58049. _context5.next = 21;
  58050. break;
  58051. }
  58052. throw new Error('Invalid header size');
  58053. case 21:
  58054. Logger.debug("headerLength: ".concat(headerLength));
  58055. _context5.next = 24;
  58056. return headerClient.getRange(12, headerLength, minReqLength, 'header');
  58057. case 24:
  58058. bytes = _context5.sent;
  58059. bb = new js_flatbuffers/* ByteBuffer */.cZ(new Uint8Array(bytes));
  58060. header = fromByteBuffer(bb);
  58061. indexLength = calcTreeSize(header.featuresCount, header.indexNodeSize);
  58062. Logger.debug('completed: opening http reader');
  58063. return _context5.abrupt("return", new HttpReader(headerClient, header, headerLength, indexLength));
  58064. case 30:
  58065. case "end":
  58066. return _context5.stop();
  58067. }
  58068. }, _callee5);
  58069. }));
  58070. function open(_x6) {
  58071. return _open.apply(this, arguments);
  58072. }
  58073. return open;
  58074. }()
  58075. }]);
  58076. return HttpReader;
  58077. }();
  58078. var BufferedHttpRangeClient = /*#__PURE__*/function () {
  58079. function BufferedHttpRangeClient(source) {
  58080. http_reader_classCallCheck(this, BufferedHttpRangeClient);
  58081. this.bytesEverUsed = 0;
  58082. this.bytesEverFetched = 0;
  58083. this.buffer = new ArrayBuffer(0);
  58084. this.head = 0;
  58085. if (typeof source === 'string') {
  58086. this.httpClient = new HttpRangeClient(source);
  58087. } else {
  58088. this.httpClient = source;
  58089. }
  58090. }
  58091. http_reader_createClass(BufferedHttpRangeClient, [{
  58092. key: "getRange",
  58093. value: function () {
  58094. var _getRange = http_reader_asyncToGenerator( /*#__PURE__*/http_reader_regeneratorRuntime().mark(function _callee6(start, length, minReqLength, purpose) {
  58095. var start_i, end_i, lengthToFetch;
  58096. return http_reader_regeneratorRuntime().wrap(function _callee6$(_context6) {
  58097. while (1) switch (_context6.prev = _context6.next) {
  58098. case 0:
  58099. this.bytesEverUsed += length;
  58100. start_i = start - this.head;
  58101. end_i = start_i + length;
  58102. if (!(start_i >= 0 && end_i <= this.buffer.byteLength)) {
  58103. _context6.next = 5;
  58104. break;
  58105. }
  58106. return _context6.abrupt("return", this.buffer.slice(start_i, end_i));
  58107. case 5:
  58108. lengthToFetch = Math.max(length, minReqLength);
  58109. this.bytesEverFetched += lengthToFetch;
  58110. Logger.debug("requesting for new Range: ".concat(start, "-").concat(start + length - 1));
  58111. _context6.next = 10;
  58112. return this.httpClient.getRange(start, lengthToFetch, purpose);
  58113. case 10:
  58114. this.buffer = _context6.sent;
  58115. this.head = start;
  58116. return _context6.abrupt("return", this.buffer.slice(0, length));
  58117. case 13:
  58118. case "end":
  58119. return _context6.stop();
  58120. }
  58121. }, _callee6, this);
  58122. }));
  58123. function getRange(_x7, _x8, _x9, _x10) {
  58124. return _getRange.apply(this, arguments);
  58125. }
  58126. return getRange;
  58127. }()
  58128. }, {
  58129. key: "logUsage",
  58130. value: function logUsage(purpose) {
  58131. var category = purpose.split(' ')[0];
  58132. var used = this.bytesEverUsed;
  58133. var requested = this.bytesEverFetched;
  58134. var efficiency = (100.0 * used / requested).toFixed(2);
  58135. Logger.info("".concat(category, " bytes used/requested: ").concat(used, " / ").concat(requested, " = ").concat(efficiency, "%"));
  58136. }
  58137. }]);
  58138. return BufferedHttpRangeClient;
  58139. }();
  58140. var HttpRangeClient = /*#__PURE__*/function () {
  58141. function HttpRangeClient(url) {
  58142. http_reader_classCallCheck(this, HttpRangeClient);
  58143. this.requestsEverMade = 0;
  58144. this.bytesEverRequested = 0;
  58145. this.url = url;
  58146. }
  58147. http_reader_createClass(HttpRangeClient, [{
  58148. key: "getRange",
  58149. value: function () {
  58150. var _getRange2 = http_reader_asyncToGenerator( /*#__PURE__*/http_reader_regeneratorRuntime().mark(function _callee7(begin, length, purpose) {
  58151. var range, response;
  58152. return http_reader_regeneratorRuntime().wrap(function _callee7$(_context7) {
  58153. while (1) switch (_context7.prev = _context7.next) {
  58154. case 0:
  58155. this.requestsEverMade += 1;
  58156. this.bytesEverRequested += length;
  58157. range = "bytes=".concat(begin, "-").concat(begin + length - 1);
  58158. Logger.info("request: #".concat(this.requestsEverMade, ", purpose: ").concat(purpose, "), bytes: (this_request: ").concat(length, ", ever: ").concat(this.bytesEverRequested, "), Range: ").concat(range));
  58159. _context7.next = 6;
  58160. return fetch(this.url, {
  58161. headers: {
  58162. Range: range
  58163. }
  58164. });
  58165. case 6:
  58166. response = _context7.sent;
  58167. return _context7.abrupt("return", response.arrayBuffer());
  58168. case 8:
  58169. case "end":
  58170. return _context7.stop();
  58171. }
  58172. }, _callee7, this);
  58173. }));
  58174. function getRange(_x11, _x12, _x13) {
  58175. return _getRange2.apply(this, arguments);
  58176. }
  58177. return getRange;
  58178. }()
  58179. }]);
  58180. return HttpRangeClient;
  58181. }();
  58182. ;// CONCATENATED MODULE: ./node_modules/flatgeobuf/lib/mjs/generic/header.js
  58183. function header_createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = header_unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
  58184. function header_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return header_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return header_arrayLikeToArray(o, minLen); }
  58185. function header_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
  58186. function featureGeomType(feature) {
  58187. if (feature.getGeometry) {
  58188. return toGeometryType(feature.getGeometry().getType());
  58189. } else {
  58190. return toGeometryType(feature.geometry.type);
  58191. }
  58192. }
  58193. function header_inferGeometryType(features) {
  58194. var geometryType = undefined;
  58195. var _iterator = header_createForOfIteratorHelper(features),
  58196. _step;
  58197. try {
  58198. for (_iterator.s(); !(_step = _iterator.n()).done;) {
  58199. var f = _step.value;
  58200. if (geometryType === GeometryType.Unknown) {
  58201. break;
  58202. }
  58203. var gtype = featureGeomType(f);
  58204. if (geometryType === undefined) {
  58205. geometryType = gtype;
  58206. } else if (geometryType !== gtype) {
  58207. geometryType = GeometryType.Unknown;
  58208. }
  58209. }
  58210. } catch (err) {
  58211. _iterator.e(err);
  58212. } finally {
  58213. _iterator.f();
  58214. }
  58215. if (geometryType === undefined) {
  58216. throw new Error('Could not infer geometry type for collection of features.');
  58217. }
  58218. return geometryType;
  58219. }
  58220. ;// CONCATENATED MODULE: ./node_modules/flatgeobuf/lib/mjs/generic/featurecollection.js
  58221. function featurecollection_typeof(obj) { "@babel/helpers - typeof"; return featurecollection_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, featurecollection_typeof(obj); }
  58222. function featurecollection_regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ featurecollection_regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == featurecollection_typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
  58223. function featurecollection_asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
  58224. function featurecollection_asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { featurecollection_asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { featurecollection_asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
  58225. function featurecollection_createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = featurecollection_unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
  58226. function featurecollection_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return featurecollection_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return featurecollection_arrayLikeToArray(o, minLen); }
  58227. function featurecollection_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
  58228. function featurecollection_asyncIterator(iterable) { var method, async, sync, retry = 2; for ("undefined" != typeof Symbol && (async = Symbol.asyncIterator, sync = Symbol.iterator); retry--;) { if (async && null != (method = iterable[async])) return method.call(iterable); if (sync && null != (method = iterable[sync])) return new featurecollection_AsyncFromSyncIterator(method.call(iterable)); async = "@@asyncIterator", sync = "@@iterator"; } throw new TypeError("Object is not async iterable"); }
  58229. function featurecollection_AsyncFromSyncIterator(s) { function AsyncFromSyncIteratorContinuation(r) { if (Object(r) !== r) return Promise.reject(new TypeError(r + " is not an object.")); var done = r.done; return Promise.resolve(r.value).then(function (value) { return { value: value, done: done }; }); } return featurecollection_AsyncFromSyncIterator = function AsyncFromSyncIterator(s) { this.s = s, this.n = s.next; }, featurecollection_AsyncFromSyncIterator.prototype = { s: null, n: null, next: function next() { return AsyncFromSyncIteratorContinuation(this.n.apply(this.s, arguments)); }, "return": function _return(value) { var ret = this.s["return"]; return void 0 === ret ? Promise.resolve({ value: value, done: !0 }) : AsyncFromSyncIteratorContinuation(ret.apply(this.s, arguments)); }, "throw": function _throw(value) { var thr = this.s["return"]; return void 0 === thr ? Promise.reject(value) : AsyncFromSyncIteratorContinuation(thr.apply(this.s, arguments)); } }, new featurecollection_AsyncFromSyncIterator(s); }
  58230. function featurecollection_awaitAsyncGenerator(value) { return new featurecollection_OverloadYield(value, 0); }
  58231. function featurecollection_wrapAsyncGenerator(fn) { return function () { return new featurecollection_AsyncGenerator(fn.apply(this, arguments)); }; }
  58232. function featurecollection_AsyncGenerator(gen) { var front, back; function resume(key, arg) { try { var result = gen[key](arg), value = result.value, overloaded = value instanceof featurecollection_OverloadYield; Promise.resolve(overloaded ? value.v : value).then(function (arg) { if (overloaded) { var nextKey = "return" === key ? "return" : "next"; if (!value.k || arg.done) return resume(nextKey, arg); arg = gen[nextKey](arg).value; } settle(result.done ? "return" : "normal", arg); }, function (err) { resume("throw", err); }); } catch (err) { settle("throw", err); } } function settle(type, value) { switch (type) { case "return": front.resolve({ value: value, done: !0 }); break; case "throw": front.reject(value); break; default: front.resolve({ value: value, done: !1 }); } (front = front.next) ? resume(front.key, front.arg) : back = null; } this._invoke = function (key, arg) { return new Promise(function (resolve, reject) { var request = { key: key, arg: arg, resolve: resolve, reject: reject, next: null }; back ? back = back.next = request : (front = back = request, resume(key, arg)); }); }, "function" != typeof gen["return"] && (this["return"] = void 0); }
  58233. featurecollection_AsyncGenerator.prototype["function" == typeof Symbol && Symbol.asyncIterator || "@@asyncIterator"] = function () { return this; }, featurecollection_AsyncGenerator.prototype.next = function (arg) { return this._invoke("next", arg); }, featurecollection_AsyncGenerator.prototype["throw"] = function (arg) { return this._invoke("throw", arg); }, featurecollection_AsyncGenerator.prototype["return"] = function (arg) { return this._invoke("return", arg); };
  58234. function featurecollection_OverloadYield(value, kind) { this.v = value, this.k = kind; }
  58235. function serialize(features) {
  58236. var headerMeta = introspectHeaderMeta(features);
  58237. var header = featurecollection_buildHeader(headerMeta);
  58238. var featureBuffers = features.map(function (f) {
  58239. if (!f.getGeometry) throw new Error('Missing getGeometry implementation');
  58240. if (!f.getProperties) throw new Error('Missing getProperties implementation');
  58241. return buildFeature(parseGeometry(f.getGeometry(), headerMeta.geometryType), f.getProperties(), headerMeta);
  58242. });
  58243. var featuresLength = featureBuffers.map(function (f) {
  58244. return f.length;
  58245. }).reduce(function (a, b) {
  58246. return a + b;
  58247. });
  58248. var uint8 = new Uint8Array(magicbytes.length + header.length + featuresLength);
  58249. uint8.set(header, magicbytes.length);
  58250. var offset = magicbytes.length + header.length;
  58251. var _iterator2 = featurecollection_createForOfIteratorHelper(featureBuffers),
  58252. _step2;
  58253. try {
  58254. for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
  58255. var feature = _step2.value;
  58256. uint8.set(feature, offset);
  58257. offset += feature.length;
  58258. }
  58259. } catch (err) {
  58260. _iterator2.e(err);
  58261. } finally {
  58262. _iterator2.f();
  58263. }
  58264. uint8.set(magicbytes);
  58265. return uint8;
  58266. }
  58267. function deserialize(bytes, fromFeature, headerMetaFn) {
  58268. if (!bytes.subarray(0, 3).every(function (v, i) {
  58269. return constants_magicbytes[i] === v;
  58270. })) throw new Error('Not a FlatGeobuf file');
  58271. var bb = new js_flatbuffers/* ByteBuffer */.cZ(bytes);
  58272. var headerLength = bb.readUint32(constants_magicbytes.length);
  58273. bb.setPosition(constants_magicbytes.length + SIZE_PREFIX_LEN);
  58274. var headerMeta = fromByteBuffer(bb);
  58275. if (headerMetaFn) headerMetaFn(headerMeta);
  58276. var offset = constants_magicbytes.length + SIZE_PREFIX_LEN + headerLength;
  58277. var indexNodeSize = headerMeta.indexNodeSize,
  58278. featuresCount = headerMeta.featuresCount;
  58279. if (indexNodeSize > 0) offset += calcTreeSize(featuresCount, indexNodeSize);
  58280. var features = [];
  58281. while (offset < bb.capacity()) {
  58282. var featureLength = bb.readUint32(offset);
  58283. bb.setPosition(offset + SIZE_PREFIX_LEN);
  58284. var feature = feature_Feature.getRootAsFeature(bb);
  58285. features.push(fromFeature(feature, headerMeta));
  58286. offset += SIZE_PREFIX_LEN + featureLength;
  58287. }
  58288. return features;
  58289. }
  58290. function deserializeStream(_x, _x2, _x3) {
  58291. return _deserializeStream.apply(this, arguments);
  58292. }
  58293. function _deserializeStream() {
  58294. _deserializeStream = featurecollection_wrapAsyncGenerator( /*#__PURE__*/featurecollection_regeneratorRuntime().mark(function _callee2(stream, fromFeature, headerMetaFn) {
  58295. var reader, read, bytes, bb, headerLength, headerMeta, indexNodeSize, featuresCount, treeSize, feature;
  58296. return featurecollection_regeneratorRuntime().wrap(function _callee2$(_context2) {
  58297. while (1) switch (_context2.prev = _context2.next) {
  58298. case 0:
  58299. reader = slice_source(stream);
  58300. read = /*#__PURE__*/function () {
  58301. var _ref = featurecollection_asyncToGenerator( /*#__PURE__*/featurecollection_regeneratorRuntime().mark(function _callee(size) {
  58302. return featurecollection_regeneratorRuntime().wrap(function _callee$(_context) {
  58303. while (1) switch (_context.prev = _context.next) {
  58304. case 0:
  58305. _context.next = 2;
  58306. return reader.slice(size);
  58307. case 2:
  58308. return _context.abrupt("return", _context.sent);
  58309. case 3:
  58310. case "end":
  58311. return _context.stop();
  58312. }
  58313. }, _callee);
  58314. }));
  58315. return function read(_x8) {
  58316. return _ref.apply(this, arguments);
  58317. };
  58318. }();
  58319. _context2.t0 = Uint8Array;
  58320. _context2.next = 5;
  58321. return featurecollection_awaitAsyncGenerator(read(8, 'magic bytes'));
  58322. case 5:
  58323. _context2.t1 = _context2.sent;
  58324. bytes = new _context2.t0(_context2.t1);
  58325. if (bytes.subarray(0, 3).every(function (v, i) {
  58326. return constants_magicbytes[i] === v;
  58327. })) {
  58328. _context2.next = 9;
  58329. break;
  58330. }
  58331. throw new Error('Not a FlatGeobuf file');
  58332. case 9:
  58333. _context2.t2 = Uint8Array;
  58334. _context2.next = 12;
  58335. return featurecollection_awaitAsyncGenerator(read(4, 'header length'));
  58336. case 12:
  58337. _context2.t3 = _context2.sent;
  58338. bytes = new _context2.t2(_context2.t3);
  58339. bb = new js_flatbuffers/* ByteBuffer */.cZ(bytes);
  58340. headerLength = bb.readUint32(0);
  58341. _context2.t4 = Uint8Array;
  58342. _context2.next = 19;
  58343. return featurecollection_awaitAsyncGenerator(read(headerLength, 'header data'));
  58344. case 19:
  58345. _context2.t5 = _context2.sent;
  58346. bytes = new _context2.t4(_context2.t5);
  58347. bb = new js_flatbuffers/* ByteBuffer */.cZ(bytes);
  58348. headerMeta = fromByteBuffer(bb);
  58349. if (headerMetaFn) headerMetaFn(headerMeta);
  58350. indexNodeSize = headerMeta.indexNodeSize, featuresCount = headerMeta.featuresCount;
  58351. if (!(indexNodeSize > 0)) {
  58352. _context2.next = 29;
  58353. break;
  58354. }
  58355. treeSize = calcTreeSize(featuresCount, indexNodeSize);
  58356. _context2.next = 29;
  58357. return featurecollection_awaitAsyncGenerator(read(treeSize, 'entire index, w/o rect'));
  58358. case 29:
  58359. _context2.next = 31;
  58360. return featurecollection_awaitAsyncGenerator(readFeature(read, headerMeta, fromFeature));
  58361. case 31:
  58362. if (!(feature = _context2.sent)) {
  58363. _context2.next = 36;
  58364. break;
  58365. }
  58366. _context2.next = 34;
  58367. return feature;
  58368. case 34:
  58369. _context2.next = 29;
  58370. break;
  58371. case 36:
  58372. case "end":
  58373. return _context2.stop();
  58374. }
  58375. }, _callee2);
  58376. }));
  58377. return _deserializeStream.apply(this, arguments);
  58378. }
  58379. function deserializeFiltered(_x4, _x5, _x6, _x7) {
  58380. return _deserializeFiltered.apply(this, arguments);
  58381. }
  58382. function _deserializeFiltered() {
  58383. _deserializeFiltered = featurecollection_wrapAsyncGenerator( /*#__PURE__*/featurecollection_regeneratorRuntime().mark(function _callee3(url, rect, fromFeature, headerMetaFn) {
  58384. var reader, _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _iterator, _step, feature;
  58385. return featurecollection_regeneratorRuntime().wrap(function _callee3$(_context3) {
  58386. while (1) switch (_context3.prev = _context3.next) {
  58387. case 0:
  58388. _context3.next = 2;
  58389. return featurecollection_awaitAsyncGenerator(HttpReader.open(url));
  58390. case 2:
  58391. reader = _context3.sent;
  58392. Logger.debug('opened reader');
  58393. if (headerMetaFn) headerMetaFn(reader.header);
  58394. _iteratorAbruptCompletion = false;
  58395. _didIteratorError = false;
  58396. _context3.prev = 7;
  58397. _iterator = featurecollection_asyncIterator(reader.selectBbox(rect));
  58398. case 9:
  58399. _context3.next = 11;
  58400. return featurecollection_awaitAsyncGenerator(_iterator.next());
  58401. case 11:
  58402. if (!(_iteratorAbruptCompletion = !(_step = _context3.sent).done)) {
  58403. _context3.next = 18;
  58404. break;
  58405. }
  58406. feature = _step.value;
  58407. _context3.next = 15;
  58408. return fromFeature(feature, reader.header);
  58409. case 15:
  58410. _iteratorAbruptCompletion = false;
  58411. _context3.next = 9;
  58412. break;
  58413. case 18:
  58414. _context3.next = 24;
  58415. break;
  58416. case 20:
  58417. _context3.prev = 20;
  58418. _context3.t0 = _context3["catch"](7);
  58419. _didIteratorError = true;
  58420. _iteratorError = _context3.t0;
  58421. case 24:
  58422. _context3.prev = 24;
  58423. _context3.prev = 25;
  58424. if (!(_iteratorAbruptCompletion && _iterator["return"] != null)) {
  58425. _context3.next = 29;
  58426. break;
  58427. }
  58428. _context3.next = 29;
  58429. return featurecollection_awaitAsyncGenerator(_iterator["return"]());
  58430. case 29:
  58431. _context3.prev = 29;
  58432. if (!_didIteratorError) {
  58433. _context3.next = 32;
  58434. break;
  58435. }
  58436. throw _iteratorError;
  58437. case 32:
  58438. return _context3.finish(29);
  58439. case 33:
  58440. return _context3.finish(24);
  58441. case 34:
  58442. case "end":
  58443. return _context3.stop();
  58444. }
  58445. }, _callee3, null, [[7, 20, 24, 34], [25,, 29, 33]]);
  58446. }));
  58447. return _deserializeFiltered.apply(this, arguments);
  58448. }
  58449. function readFeature(_x9, _x10, _x11) {
  58450. return _readFeature.apply(this, arguments);
  58451. }
  58452. function _readFeature() {
  58453. _readFeature = featurecollection_asyncToGenerator( /*#__PURE__*/featurecollection_regeneratorRuntime().mark(function _callee4(read, headerMeta, fromFeature) {
  58454. var bytes, bb, featureLength, bytesAligned, feature;
  58455. return featurecollection_regeneratorRuntime().wrap(function _callee4$(_context4) {
  58456. while (1) switch (_context4.prev = _context4.next) {
  58457. case 0:
  58458. _context4.t0 = Uint8Array;
  58459. _context4.next = 3;
  58460. return read(4, 'feature length');
  58461. case 3:
  58462. _context4.t1 = _context4.sent;
  58463. bytes = new _context4.t0(_context4.t1);
  58464. if (!(bytes.byteLength === 0)) {
  58465. _context4.next = 7;
  58466. break;
  58467. }
  58468. return _context4.abrupt("return");
  58469. case 7:
  58470. bb = new js_flatbuffers/* ByteBuffer */.cZ(bytes);
  58471. featureLength = bb.readUint32(0);
  58472. _context4.t2 = Uint8Array;
  58473. _context4.next = 12;
  58474. return read(featureLength, 'feature data');
  58475. case 12:
  58476. _context4.t3 = _context4.sent;
  58477. bytes = new _context4.t2(_context4.t3);
  58478. bytesAligned = new Uint8Array(featureLength + 4);
  58479. bytesAligned.set(bytes, 4);
  58480. bb = new js_flatbuffers/* ByteBuffer */.cZ(bytesAligned);
  58481. bb.setPosition(SIZE_PREFIX_LEN);
  58482. feature = feature_Feature.getRootAsFeature(bb);
  58483. return _context4.abrupt("return", fromFeature(feature, headerMeta));
  58484. case 20:
  58485. case "end":
  58486. return _context4.stop();
  58487. }
  58488. }, _callee4);
  58489. }));
  58490. return _readFeature.apply(this, arguments);
  58491. }
  58492. function buildColumn(builder, column) {
  58493. var nameOffset = builder.createString(column.name);
  58494. Column.startColumn(builder);
  58495. Column.addName(builder, nameOffset);
  58496. Column.addType(builder, column.type);
  58497. return Column.endColumn(builder);
  58498. }
  58499. function featurecollection_buildHeader(header) {
  58500. var builder = new flatbuffers.Builder();
  58501. var columnOffsets = null;
  58502. if (header.columns) columnOffsets = Header.createColumnsVector(builder, header.columns.map(function (c) {
  58503. return buildColumn(builder, c);
  58504. }));
  58505. var nameOffset = builder.createString('L1');
  58506. Header.startHeader(builder);
  58507. Header.addFeaturesCount(builder, BigInt(header.featuresCount));
  58508. Header.addGeometryType(builder, header.geometryType);
  58509. Header.addIndexNodeSize(builder, 0);
  58510. if (columnOffsets) Header.addColumns(builder, columnOffsets);
  58511. Header.addName(builder, nameOffset);
  58512. var offset = Header.endHeader(builder);
  58513. builder.finishSizePrefixed(offset);
  58514. return builder.asUint8Array();
  58515. }
  58516. function valueToType(value) {
  58517. if (typeof value === 'boolean') return ColumnType.Bool;else if (typeof value === 'number') {
  58518. if (value % 1 === 0) return ColumnType.Int;else return ColumnType.Double;
  58519. } else if (typeof value === 'string') return ColumnType.String;else if (value === null) return ColumnType.String;else if (featurecollection_typeof(value) === 'object') return ColumnType.Json;else throw new Error("Unknown type (value '".concat(value, "')"));
  58520. }
  58521. function featurecollection_mapColumn(properties, k) {
  58522. return {
  58523. name: k,
  58524. type: valueToType(properties[k]),
  58525. title: null,
  58526. description: null,
  58527. width: -1,
  58528. precision: -1,
  58529. scale: -1,
  58530. nullable: true,
  58531. unique: false,
  58532. primary_key: false
  58533. };
  58534. }
  58535. function introspectHeaderMeta(features) {
  58536. var sampleFeature = features[0];
  58537. var properties = sampleFeature.getProperties ? sampleFeature.getProperties() : {};
  58538. var columns = null;
  58539. if (properties) columns = Object.keys(properties).filter(function (key) {
  58540. return key !== 'geometry';
  58541. }).map(function (k) {
  58542. return featurecollection_mapColumn(properties, k);
  58543. });
  58544. var geometryType = inferGeometryType(features);
  58545. var headerMeta = {
  58546. geometryType: geometryType,
  58547. columns: columns,
  58548. envelope: null,
  58549. featuresCount: features.length,
  58550. indexNodeSize: 0,
  58551. crs: null,
  58552. title: null,
  58553. description: null,
  58554. metadata: null
  58555. };
  58556. return headerMeta;
  58557. }
  58558. ;// CONCATENATED MODULE: ./node_modules/flatgeobuf/lib/mjs/geojson/featurecollection.js
  58559. function geojson_featurecollection_createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = geojson_featurecollection_unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
  58560. function geojson_featurecollection_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return geojson_featurecollection_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return geojson_featurecollection_arrayLikeToArray(o, minLen); }
  58561. function geojson_featurecollection_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
  58562. function featurecollection_serialize(featurecollection) {
  58563. var headerMeta = featurecollection_introspectHeaderMeta(featurecollection);
  58564. var header = buildHeader(headerMeta);
  58565. var features = featurecollection.features.map(function (f) {
  58566. return buildFeature(f.geometry.type === 'GeometryCollection' ? parseGC(f.geometry) : parseGeometry(f.geometry), f.properties, headerMeta);
  58567. });
  58568. var featuresLength = features.map(function (f) {
  58569. return f.length;
  58570. }).reduce(function (a, b) {
  58571. return a + b;
  58572. });
  58573. var uint8 = new Uint8Array(magicbytes.length + header.length + featuresLength);
  58574. uint8.set(header, magicbytes.length);
  58575. var offset = magicbytes.length + header.length;
  58576. var _iterator = geojson_featurecollection_createForOfIteratorHelper(features),
  58577. _step;
  58578. try {
  58579. for (_iterator.s(); !(_step = _iterator.n()).done;) {
  58580. var feature = _step.value;
  58581. uint8.set(feature, offset);
  58582. offset += feature.length;
  58583. }
  58584. } catch (err) {
  58585. _iterator.e(err);
  58586. } finally {
  58587. _iterator.f();
  58588. }
  58589. uint8.set(magicbytes);
  58590. return uint8;
  58591. }
  58592. function featurecollection_deserialize(bytes, headerMetaFn) {
  58593. var features = deserialize(bytes, feature_fromFeature, headerMetaFn);
  58594. return {
  58595. type: 'FeatureCollection',
  58596. features: features
  58597. };
  58598. }
  58599. function featurecollection_deserializeStream(stream, headerMetaFn) {
  58600. return deserializeStream(stream, feature_fromFeature, headerMetaFn);
  58601. }
  58602. function featurecollection_deserializeFiltered(url, rect, headerMetaFn) {
  58603. return deserializeFiltered(url, rect, feature_fromFeature, headerMetaFn);
  58604. }
  58605. function featurecollection_introspectHeaderMeta(featurecollection) {
  58606. var feature = featurecollection.features[0];
  58607. var properties = feature.properties;
  58608. var columns = null;
  58609. if (properties) columns = Object.keys(properties).map(function (k) {
  58610. return mapColumn(properties, k);
  58611. });
  58612. var geometryType = inferGeometryType(featurecollection.features);
  58613. var headerMeta = {
  58614. geometryType: geometryType,
  58615. columns: columns,
  58616. envelope: null,
  58617. featuresCount: featurecollection.features.length,
  58618. indexNodeSize: 0,
  58619. crs: null,
  58620. title: null,
  58621. description: null,
  58622. metadata: null
  58623. };
  58624. return headerMeta;
  58625. }
  58626. ;// CONCATENATED MODULE: ./node_modules/flatgeobuf/lib/mjs/geojson.js
  58627. function geojson_serialize(geojson) {
  58628. var bytes = fcSerialize(geojson);
  58629. return bytes;
  58630. }
  58631. function geojson_deserialize(input, rect, headerMetaFn) {
  58632. if (input instanceof Uint8Array) return featurecollection_deserialize(input, headerMetaFn);else if (input instanceof ReadableStream) return featurecollection_deserializeStream(input, headerMetaFn);else return featurecollection_deserializeFiltered(input, rect, headerMetaFn);
  58633. }
  58634. // EXTERNAL MODULE: ./node_modules/rbush/index.js
  58635. var rbush = __webpack_require__(3861);
  58636. var rbush_default = /*#__PURE__*/__webpack_require__.n(rbush);
  58637. ;// CONCATENATED MODULE: ./src/common/overlay/fgb/FGBLayerRenderer.js
  58638. function FGBLayerRenderer_typeof(obj) { "@babel/helpers - typeof"; return FGBLayerRenderer_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, FGBLayerRenderer_typeof(obj); }
  58639. function FGBLayerRenderer_regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ FGBLayerRenderer_regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == FGBLayerRenderer_typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
  58640. function FGBLayerRenderer_asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
  58641. function FGBLayerRenderer_asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { FGBLayerRenderer_asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { FGBLayerRenderer_asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
  58642. function FGBLayerRenderer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  58643. function FGBLayerRenderer_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  58644. function FGBLayerRenderer_createClass(Constructor, protoProps, staticProps) { if (protoProps) FGBLayerRenderer_defineProperties(Constructor.prototype, protoProps); if (staticProps) FGBLayerRenderer_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  58645. function FGBLayerRenderer_asyncIterator(iterable) { var method, async, sync, retry = 2; for ("undefined" != typeof Symbol && (async = Symbol.asyncIterator, sync = Symbol.iterator); retry--;) { if (async && null != (method = iterable[async])) return method.call(iterable); if (sync && null != (method = iterable[sync])) return new FGBLayerRenderer_AsyncFromSyncIterator(method.call(iterable)); async = "@@asyncIterator", sync = "@@iterator"; } throw new TypeError("Object is not async iterable"); }
  58646. function FGBLayerRenderer_AsyncFromSyncIterator(s) { function AsyncFromSyncIteratorContinuation(r) { if (Object(r) !== r) return Promise.reject(new TypeError(r + " is not an object.")); var done = r.done; return Promise.resolve(r.value).then(function (value) { return { value: value, done: done }; }); } return FGBLayerRenderer_AsyncFromSyncIterator = function AsyncFromSyncIterator(s) { this.s = s, this.n = s.next; }, FGBLayerRenderer_AsyncFromSyncIterator.prototype = { s: null, n: null, next: function next() { return AsyncFromSyncIteratorContinuation(this.n.apply(this.s, arguments)); }, "return": function _return(value) { var ret = this.s["return"]; return void 0 === ret ? Promise.resolve({ value: value, done: !0 }) : AsyncFromSyncIteratorContinuation(ret.apply(this.s, arguments)); }, "throw": function _throw(value) { var thr = this.s["return"]; return void 0 === thr ? Promise.reject(value) : AsyncFromSyncIteratorContinuation(thr.apply(this.s, arguments)); } }, new FGBLayerRenderer_AsyncFromSyncIterator(s); }
  58647. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  58648. * This program are made available under the terms of the Apache License, Version 2.0
  58649. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  58650. /**
  58651. * @private
  58652. * @class FGBLayerRenderer
  58653. * @classdesc FGB。
  58654. * @version 11.1.0
  58655. * @param {Object} options - 参数。
  58656. * @param {string} [options.layerID] - 图层 ID。默认使用 CommonUtil.createUniqueID("FGBlayer_") 创建图层 ID。
  58657. * @param {boolean} [options.strategy='bbox'] - 指定加载策略,可选值为 all,bbox。 all为全量加载, bbox为当前可见范围加载。
  58658. * @param {Array} [options.extent] - 加载范围, 参数规范为: [minX, minY, maxX, maxY], 传递此参数后, 图层将使用局部加载。
  58659. * @param {function} [options.featureLoader] - 要素自定义方法,接收要素作为参数,需返回要素。
  58660. * @usage
  58661. */
  58662. var GEOMETRY_TYPE_MAP = {
  58663. 1: 'circle',
  58664. 2: 'line',
  58665. 3: 'fill',
  58666. 5: 'line',
  58667. 4: 'circle',
  58668. 6: 'fill',
  58669. 'MultiPolygon': 'fill',
  58670. 'Point': 'circle',
  58671. 'MultiLineString': 'line',
  58672. 'MultiPoint': 'circle',
  58673. 'LineString': 'line',
  58674. 'Polygon': 'fill'
  58675. };
  58676. var FGBLayerRenderer = /*#__PURE__*/function () {
  58677. function FGBLayerRenderer() {
  58678. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  58679. FGBLayerRenderer_classCallCheck(this, FGBLayerRenderer);
  58680. this.id = options.layerID ? options.layerID : Util_Util.createUniqueID('FGBLayer_');
  58681. this.layerId = this.id + 'outer';
  58682. this.sourceId = this.layerId;
  58683. this.options = options;
  58684. this.strategy = options.strategy || 'bbox';
  58685. this.url = options.url;
  58686. this.layerType = '';
  58687. this.extent = options.extent;
  58688. this.init();
  58689. }
  58690. FGBLayerRenderer_createClass(FGBLayerRenderer, [{
  58691. key: "init",
  58692. value: function init() {
  58693. if (this.strategy === 'bbox') {
  58694. this.loadedExtentsRtree_ = new (rbush_default())();
  58695. }
  58696. }
  58697. }, {
  58698. key: "iterateFeatures",
  58699. value: function () {
  58700. var _iterateFeatures = FGBLayerRenderer_asyncToGenerator( /*#__PURE__*/FGBLayerRenderer_regeneratorRuntime().mark(function _callee(iterator) {
  58701. var features, _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _iterator, _step, feature;
  58702. return FGBLayerRenderer_regeneratorRuntime().wrap(function _callee$(_context) {
  58703. while (1) switch (_context.prev = _context.next) {
  58704. case 0:
  58705. features = {
  58706. type: 'FeatureCollection',
  58707. features: []
  58708. };
  58709. _iteratorAbruptCompletion = false;
  58710. _didIteratorError = false;
  58711. _context.prev = 3;
  58712. _iterator = FGBLayerRenderer_asyncIterator(iterator);
  58713. case 5:
  58714. _context.next = 7;
  58715. return _iterator.next();
  58716. case 7:
  58717. if (!(_iteratorAbruptCompletion = !(_step = _context.sent).done)) {
  58718. _context.next = 15;
  58719. break;
  58720. }
  58721. feature = _step.value;
  58722. if (this.options.featureLoader && typeof this.options.featureLoader === 'function') {
  58723. feature = this.options.featureLoader(feature);
  58724. }
  58725. if (!this.layerType) {
  58726. this.layerType = GEOMETRY_TYPE_MAP[feature.geometry.type];
  58727. }
  58728. features.features.push(feature);
  58729. case 12:
  58730. _iteratorAbruptCompletion = false;
  58731. _context.next = 5;
  58732. break;
  58733. case 15:
  58734. _context.next = 21;
  58735. break;
  58736. case 17:
  58737. _context.prev = 17;
  58738. _context.t0 = _context["catch"](3);
  58739. _didIteratorError = true;
  58740. _iteratorError = _context.t0;
  58741. case 21:
  58742. _context.prev = 21;
  58743. _context.prev = 22;
  58744. if (!(_iteratorAbruptCompletion && _iterator["return"] != null)) {
  58745. _context.next = 26;
  58746. break;
  58747. }
  58748. _context.next = 26;
  58749. return _iterator["return"]();
  58750. case 26:
  58751. _context.prev = 26;
  58752. if (!_didIteratorError) {
  58753. _context.next = 29;
  58754. break;
  58755. }
  58756. throw _iteratorError;
  58757. case 29:
  58758. return _context.finish(26);
  58759. case 30:
  58760. return _context.finish(21);
  58761. case 31:
  58762. return _context.abrupt("return", features);
  58763. case 32:
  58764. case "end":
  58765. return _context.stop();
  58766. }
  58767. }, _callee, this, [[3, 17, 21, 31], [22,, 26, 30]]);
  58768. }));
  58769. function iterateFeatures(_x) {
  58770. return _iterateFeatures.apply(this, arguments);
  58771. }
  58772. return iterateFeatures;
  58773. }()
  58774. }, {
  58775. key: "_loadData",
  58776. value: function () {
  58777. var _loadData2 = FGBLayerRenderer_asyncToGenerator( /*#__PURE__*/FGBLayerRenderer_regeneratorRuntime().mark(function _callee2(bounds) {
  58778. var _this = this;
  58779. var fgbStream, rect;
  58780. return FGBLayerRenderer_regeneratorRuntime().wrap(function _callee2$(_context2) {
  58781. while (1) switch (_context2.prev = _context2.next) {
  58782. case 0:
  58783. rect = {
  58784. minX: bounds[0],
  58785. minY: bounds[1],
  58786. maxX: bounds[2],
  58787. maxY: bounds[3]
  58788. };
  58789. if (bounds.length) {
  58790. _context2.next = 7;
  58791. break;
  58792. }
  58793. _context2.next = 4;
  58794. return this._getStream(this.url);
  58795. case 4:
  58796. fgbStream = _context2.sent;
  58797. _context2.next = 9;
  58798. break;
  58799. case 7:
  58800. rect.value = {
  58801. extent: bounds.slice()
  58802. };
  58803. this.loadedExtentsRtree_.insert(rect);
  58804. case 9:
  58805. _context2.next = 11;
  58806. return geojson_deserialize(fgbStream && fgbStream.body || this.url, rect, function (headerMeta) {
  58807. _this.layerType = GEOMETRY_TYPE_MAP[headerMeta.geometryType];
  58808. });
  58809. case 11:
  58810. return _context2.abrupt("return", _context2.sent);
  58811. case 12:
  58812. case "end":
  58813. return _context2.stop();
  58814. }
  58815. }, _callee2, this);
  58816. }));
  58817. function _loadData(_x2) {
  58818. return _loadData2.apply(this, arguments);
  58819. }
  58820. return _loadData;
  58821. }()
  58822. }, {
  58823. key: "_getStream",
  58824. value: function () {
  58825. var _getStream2 = FGBLayerRenderer_asyncToGenerator( /*#__PURE__*/FGBLayerRenderer_regeneratorRuntime().mark(function _callee3(url) {
  58826. return FGBLayerRenderer_regeneratorRuntime().wrap(function _callee3$(_context3) {
  58827. while (1) switch (_context3.prev = _context3.next) {
  58828. case 0:
  58829. _context3.next = 2;
  58830. return FetchRequest.get(url, {}, {
  58831. withoutFormatSuffix: true
  58832. }).then(function (response) {
  58833. return response;
  58834. });
  58835. case 2:
  58836. return _context3.abrupt("return", _context3.sent);
  58837. case 3:
  58838. case "end":
  58839. return _context3.stop();
  58840. }
  58841. }, _callee3);
  58842. }));
  58843. function _getStream(_x3) {
  58844. return _getStream2.apply(this, arguments);
  58845. }
  58846. return _getStream;
  58847. }()
  58848. }, {
  58849. key: "_containsExtent",
  58850. value: function _containsExtent(extent1, extent2) {
  58851. return extent1[0] <= extent2[0] && extent2[2] <= extent1[2] && extent1[1] <= extent2[1] && extent2[3] <= extent1[3];
  58852. }
  58853. }, {
  58854. key: "_getInExtent",
  58855. value: function _getInExtent(extent) {
  58856. var bbox = {
  58857. minX: extent[0],
  58858. minY: extent[1],
  58859. maxX: extent[2],
  58860. maxY: extent[3]
  58861. };
  58862. var items = this.loadedExtentsRtree_.search(bbox);
  58863. return items.map(function (item) {
  58864. return item.value;
  58865. });
  58866. }
  58867. }, {
  58868. key: "_forEachInExtent",
  58869. value: function _forEachInExtent(extent, callback) {
  58870. return this._forEach(this._getInExtent(extent), callback);
  58871. }
  58872. }, {
  58873. key: "_forEach",
  58874. value: function _forEach(values, callback) {
  58875. var result;
  58876. for (var i = 0, l = values.length; i < l; i++) {
  58877. result = callback(values[i]);
  58878. if (result) {
  58879. return result;
  58880. }
  58881. }
  58882. return result;
  58883. }
  58884. }]);
  58885. return FGBLayerRenderer;
  58886. }();
  58887. ;// CONCATENATED MODULE: ./src/maplibregl/overlay/FGBLayer.js
  58888. function FGBLayer_typeof(obj) { "@babel/helpers - typeof"; return FGBLayer_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, FGBLayer_typeof(obj); }
  58889. function FGBLayer_regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ FGBLayer_regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == FGBLayer_typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
  58890. function FGBLayer_asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
  58891. function FGBLayer_asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { FGBLayer_asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { FGBLayer_asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
  58892. function FGBLayer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  58893. function FGBLayer_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  58894. function FGBLayer_createClass(Constructor, protoProps, staticProps) { if (protoProps) FGBLayer_defineProperties(Constructor.prototype, protoProps); if (staticProps) FGBLayer_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  58895. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  58896. * This program are made available under the terms of the Apache License, Version 2.0
  58897. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  58898. /**
  58899. * reference and modification
  58900. * dereklieu/cool-grid, cloudybay/leaflet.latlng-graticule
  58901. * (https://github.com/dereklieu/cool-grid, https://github.com/cloudybay/leaflet.latlng-graticule)
  58902. * Apache Licene 2.0
  58903. * thanks dereklieu, cloudybay
  58904. */
  58905. /**
  58906. * @class FGBLayer
  58907. * @category Visualization FGB
  58908. * @classdesc FGB 图层类。
  58909. * @version 11.1.0
  58910. * @modulecategory Overlay
  58911. * @param {Object} options - 参数。
  58912. * @param {string} [options.layerID] - 图层 ID。默认使用 CommonUtil.createUniqueID("FGBlayer_") 创建图层 ID。
  58913. * @param {boolean} [options.strategy='bbox'] - 指定加载策略,可选值为 all,bbox。 all为全量加载, bbox为当前可见范围加载。
  58914. * @param {Array} [options.extent] - 加载范围, 参数规范为: [minX, minY, maxX, maxY], 传递此参数后, 图层将使用局部加载。
  58915. * @param {function} [options.featureLoader] - 要素自定义方法,接收要素作为参数,需返回要素。
  58916. * @param {Object} [options.paint] - 参数内容详见: {@link https://docs.mapbox.com/mapbox-gl-js/style-spec/layers/#paint-property}
  58917. * @param {Object} [options.layout] - 参数内容详见: {@link https://docs.mapbox.com/mapbox-gl-js/style-spec/layers/#layout-property}
  58918. * @param {Object} [options.sourceOptions] - 参数内容详见: {@link mapboxgl.source}
  58919. * @usage
  58920. */
  58921. var PAINT_MAP = {
  58922. circle: {
  58923. 'circle-radius': 6,
  58924. 'circle-color': '#3fb1e3',
  58925. 'circle-opacity': 1,
  58926. 'circle-blur': 0,
  58927. 'circle-translate': [0, 0],
  58928. 'circle-stroke-width': 0,
  58929. 'circle-stroke-color': '#000',
  58930. 'circle-stroke-opacity': 1
  58931. },
  58932. line: {
  58933. 'line-opacity': 1,
  58934. 'line-color': '#3fb1e3',
  58935. 'line-width': 3,
  58936. 'line-blur': 1
  58937. },
  58938. fill: {
  58939. 'fill-opacity': 0.8,
  58940. 'fill-color': '#3fb1e3',
  58941. 'fill-translate': [0, 0],
  58942. 'fill-antialias': true,
  58943. 'fill-outline-color': '#3fb1e3'
  58944. }
  58945. };
  58946. var FGBLayer = /*#__PURE__*/function () {
  58947. function FGBLayer() {
  58948. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  58949. FGBLayer_classCallCheck(this, FGBLayer);
  58950. this.id = options.layerID ? options.layerID : Util_Util.createUniqueID('FGBLayer_');
  58951. this.layerId = this.id + 'outer';
  58952. this.sourceId = this.layerId;
  58953. this.options = options;
  58954. this.strategy = options.strategy || 'bbox';
  58955. this.url = options.url;
  58956. this.layerType = '';
  58957. this.type = 'custom';
  58958. this.renderingMode = '3d';
  58959. this.overlay = true;
  58960. this.extent = options.extent;
  58961. this._updateFeaturesFn = this._updateFeatures.bind(this);
  58962. }
  58963. /**
  58964. * @function FGBLayer.prototype.onAdd
  58965. * @param {maplibregl.Map} map - MapLibreGL Map 对象。
  58966. */
  58967. FGBLayer_createClass(FGBLayer, [{
  58968. key: "onAdd",
  58969. value: function onAdd(map) {
  58970. this.map = map;
  58971. var extent = [];
  58972. if (this.strategy === 'bbox') {
  58973. var bounds = this.map.getBounds().toArray();
  58974. extent = [bounds[0][0], bounds[0][1], bounds[1][0], bounds[1][1]];
  58975. this.map.on('moveend', this._updateFeaturesFn);
  58976. }
  58977. if (this.extent) {
  58978. var intersectExtent = getIntersection(this.extent, extent);
  58979. if (intersectExtent && intersectExtent.length) {
  58980. extent = intersectExtent;
  58981. } else {
  58982. extent = this.extent;
  58983. }
  58984. }
  58985. this.renderer = new FGBLayerRenderer(this.options);
  58986. this._handleFeatures(extent);
  58987. }
  58988. /**
  58989. * @function FGBLayer.prototype.render
  58990. */
  58991. }, {
  58992. key: "render",
  58993. value: function render() {}
  58994. /**
  58995. * @function FGBLayer.prototype.onRemove
  58996. */
  58997. }, {
  58998. key: "onRemove",
  58999. value: function onRemove() {
  59000. this.map.off('moveend', this._updateFeaturesFn);
  59001. }
  59002. /**
  59003. * @function FGBLayer.prototype.moveLayer
  59004. * @description 设置图层可见性。
  59005. * @param {string} layerID - 待插入的图层 ID。
  59006. * @param {boolean} [beforeId=true] - 将本图层插入到图层 ID 为layerID 的图层之前。
  59007. */
  59008. }, {
  59009. key: "moveLayer",
  59010. value: function moveLayer(id, beforeId) {
  59011. this.map.moveLayer(id, beforeId);
  59012. }
  59013. /**
  59014. * @function FGBLayer.prototype.setVisibility
  59015. * @description 设置图层可见性。
  59016. * @param {boolean} [visibility] - 是否显示图层(当前地图的 resolution 在最大最小 resolution 之间)。
  59017. */
  59018. }, {
  59019. key: "setVisibility",
  59020. value: function setVisibility(visibility) {
  59021. var visible = visibility ? 'visible' : 'none';
  59022. this.map.setLayoutProperty(this.layerId, 'visibility', visible);
  59023. }
  59024. }, {
  59025. key: "_handleFeatures",
  59026. value: function () {
  59027. var _handleFeatures2 = FGBLayer_asyncToGenerator( /*#__PURE__*/FGBLayer_regeneratorRuntime().mark(function _callee(bounds) {
  59028. var iter, features, layer;
  59029. return FGBLayer_regeneratorRuntime().wrap(function _callee$(_context) {
  59030. while (1) switch (_context.prev = _context.next) {
  59031. case 0:
  59032. _context.next = 2;
  59033. return this.renderer._loadData(bounds);
  59034. case 2:
  59035. iter = _context.sent;
  59036. _context.next = 5;
  59037. return this.renderer.iterateFeatures(iter);
  59038. case 5:
  59039. features = _context.sent;
  59040. if (!this.map.getSource(this.sourceId)) {
  59041. this.map.addSource(this.sourceId, {
  59042. type: 'geojson',
  59043. data: features
  59044. });
  59045. } else {
  59046. this.map.getSource(this.sourceId).setData(features);
  59047. }
  59048. if (!this.map.getLayer(this.layerId)) {
  59049. this.layerType = this.renderer.layerType;
  59050. layer = Object.assign({
  59051. id: this.layerId,
  59052. type: this.layerType,
  59053. source: this.sourceId,
  59054. paint: Object.assign(PAINT_MAP[this.layerType], this.options.paint) || {},
  59055. layout: this.options.layout || {}
  59056. });
  59057. this.map.addLayer(layer);
  59058. }
  59059. case 8:
  59060. case "end":
  59061. return _context.stop();
  59062. }
  59063. }, _callee, this);
  59064. }));
  59065. function _handleFeatures(_x) {
  59066. return _handleFeatures2.apply(this, arguments);
  59067. }
  59068. return _handleFeatures;
  59069. }()
  59070. }, {
  59071. key: "_updateFeatures",
  59072. value: function () {
  59073. var _updateFeatures2 = FGBLayer_asyncToGenerator( /*#__PURE__*/FGBLayer_regeneratorRuntime().mark(function _callee2() {
  59074. var _this = this;
  59075. var bounds, extentToLoad, alreadyLoaded, iter, features;
  59076. return FGBLayer_regeneratorRuntime().wrap(function _callee2$(_context2) {
  59077. while (1) switch (_context2.prev = _context2.next) {
  59078. case 0:
  59079. bounds = this.map.getBounds().toArray();
  59080. extentToLoad = [bounds[0][0], bounds[0][1], bounds[1][0], bounds[1][1]];
  59081. alreadyLoaded = this.renderer._forEachInExtent(extentToLoad, function (object) {
  59082. return _this.renderer._containsExtent(object.extent, extentToLoad);
  59083. });
  59084. if (alreadyLoaded) {
  59085. _context2.next = 11;
  59086. break;
  59087. }
  59088. _context2.next = 6;
  59089. return this.renderer._loadData(extentToLoad);
  59090. case 6:
  59091. iter = _context2.sent;
  59092. _context2.next = 9;
  59093. return this.renderer.iterateFeatures(iter);
  59094. case 9:
  59095. features = _context2.sent;
  59096. this.map.getSource(this.sourceId).setData(features);
  59097. case 11:
  59098. case "end":
  59099. return _context2.stop();
  59100. }
  59101. }, _callee2, this);
  59102. }));
  59103. function _updateFeatures() {
  59104. return _updateFeatures2.apply(this, arguments);
  59105. }
  59106. return _updateFeatures;
  59107. }()
  59108. }]);
  59109. return FGBLayer;
  59110. }();
  59111. ;// CONCATENATED MODULE: ./src/maplibregl/overlay/graphic/Graphic.js
  59112. function Graphic_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  59113. function Graphic_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  59114. function Graphic_createClass(Constructor, protoProps, staticProps) { if (protoProps) Graphic_defineProperties(Constructor.prototype, protoProps); if (staticProps) Graphic_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  59115. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  59116. * This program are made available under the terms of the Apache License, Version 2.0
  59117. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  59118. /**
  59119. * @class Graphic
  59120. * @classdesc 高效率点图层点要素类。
  59121. * @category Visualization Graphic
  59122. * @param {(Object|Array.<number>)} lngLat - 坐标。格式:经纬度数组或包含{lng,lat}格式对象。
  59123. * @param {Object} style - 图形参数。
  59124. * @param {Array.<number>} [style.color] - 点颜色。目前只支持 rgba 数组。
  59125. * @param {Object} [style.radius] - 点半径。
  59126. * @param {Object} [attributes] - 属性信息。
  59127. * @example
  59128. * var graphic = new Graphic(
  59129. * {
  59130. * lng:116,
  59131. * lat:39
  59132. * },{
  59133. * color:[255,0,0],
  59134. * radius:30
  59135. * }
  59136. * });
  59137. * @usage
  59138. */
  59139. var Graphic = /*#__PURE__*/function () {
  59140. function Graphic(lngLat, style, attributes) {
  59141. Graphic_classCallCheck(this, Graphic);
  59142. this.lngLat = core_Util_Util.isArray(lngLat) ? {
  59143. lng: lngLat[0],
  59144. lat: lngLat[1]
  59145. } : lngLat;
  59146. this.style = core_Util_Util.extend({}, style);
  59147. this.attributes = attributes;
  59148. }
  59149. /**
  59150. * @function Graphic.prototype.getId
  59151. * @description 获取当前 ID。
  59152. * @returns {string} ID。
  59153. */
  59154. Graphic_createClass(Graphic, [{
  59155. key: "getId",
  59156. value: function getId() {
  59157. return this.id;
  59158. }
  59159. /**
  59160. * @function Graphic.prototype.setId
  59161. * @description 设置当前要素 ID。
  59162. * @param {string} id - 要素 ID。
  59163. */
  59164. }, {
  59165. key: "setId",
  59166. value: function setId(id) {
  59167. this.id = id;
  59168. }
  59169. /**
  59170. * @function Graphic.prototype.getLngLat
  59171. * @description 获取经纬度坐标。
  59172. * @returns {Object} 经纬度坐标,数据格式{lng,lat}。
  59173. */
  59174. }, {
  59175. key: "getLngLat",
  59176. value: function getLngLat() {
  59177. return this.lngLat;
  59178. }
  59179. /**
  59180. * @function Graphic.prototype.setLngLat
  59181. * @description 设置经纬度坐标。
  59182. * @param {Object} lngLat - 经纬度坐标,数据格式{lng,lat}。
  59183. */
  59184. }, {
  59185. key: "setLngLat",
  59186. value: function setLngLat(lngLat) {
  59187. this.lngLat = core_Util_Util.isArray(lngLat) ? {
  59188. lng: lngLat[0],
  59189. lat: lngLat[1]
  59190. } : lngLat;
  59191. }
  59192. /**
  59193. * @function Graphic.prototype.setStyle
  59194. * @description 设置点样式。
  59195. * @param {Object} style -样式选项。
  59196. * @param {Array} [style.color] - 颜色。
  59197. * @param {number} [style.radius] - 半径。
  59198. */
  59199. }, {
  59200. key: "setStyle",
  59201. value: function setStyle(style) {
  59202. this.style = core_Util_Util.extend(this.style, style);
  59203. }
  59204. /**
  59205. * @function Graphic.prototype.getStyle
  59206. * @description 获取样式。
  59207. * @returns {Object} 点样式。
  59208. */
  59209. }, {
  59210. key: "getStyle",
  59211. value: function getStyle() {
  59212. return this.style;
  59213. }
  59214. /**
  59215. * @function Graphic.prototype.setAttributes
  59216. * @description 设置属性信息。
  59217. * @param {Object} [attributes] - 属性信息。
  59218. */
  59219. }, {
  59220. key: "setAttributes",
  59221. value: function setAttributes(attributes) {
  59222. this.attributes = core_Util_Util.extend({}, this.attributes, attributes);
  59223. }
  59224. /**
  59225. * @function Graphic.prototype.getAttributes
  59226. * @description 获取属性信息。
  59227. * @returns {Object} 属性信息。
  59228. */
  59229. }, {
  59230. key: "getAttributes",
  59231. value: function getAttributes() {
  59232. return this.attributes;
  59233. }
  59234. }]);
  59235. return Graphic;
  59236. }();
  59237. ;// CONCATENATED MODULE: ./src/maplibregl/overlay/graphic/index.js
  59238. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  59239. * This program are made available under the terms of the Apache License, Version 2.0
  59240. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  59241. ;// CONCATENATED MODULE: ./src/maplibregl/overlay/index.js
  59242. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  59243. * This program are made available under the terms of the Apache License, Version 2.0
  59244. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  59245. ;// CONCATENATED MODULE: ./src/common/SuperMap.js
  59246. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  59247. * This program are made available under the terms of the Apache License, Version 2.0
  59248. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  59249. var SuperMap = window.SuperMap = window.SuperMap || {};
  59250. SuperMap.Components = window.SuperMap.Components || {};
  59251. ;// CONCATENATED MODULE: ./src/common/commontypes/geometry/Rectangle.js
  59252. function Rectangle_typeof(obj) { "@babel/helpers - typeof"; return Rectangle_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, Rectangle_typeof(obj); }
  59253. function Rectangle_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  59254. function Rectangle_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  59255. function Rectangle_createClass(Constructor, protoProps, staticProps) { if (protoProps) Rectangle_defineProperties(Constructor.prototype, protoProps); if (staticProps) Rectangle_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  59256. function Rectangle_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) Rectangle_setPrototypeOf(subClass, superClass); }
  59257. function Rectangle_setPrototypeOf(o, p) { Rectangle_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Rectangle_setPrototypeOf(o, p); }
  59258. function Rectangle_createSuper(Derived) { var hasNativeReflectConstruct = Rectangle_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Rectangle_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Rectangle_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Rectangle_possibleConstructorReturn(this, result); }; }
  59259. function Rectangle_possibleConstructorReturn(self, call) { if (call && (Rectangle_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return Rectangle_assertThisInitialized(self); }
  59260. function Rectangle_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  59261. function Rectangle_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  59262. function Rectangle_getPrototypeOf(o) { Rectangle_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Rectangle_getPrototypeOf(o); }
  59263. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  59264. * This program are made available under the terms of the Apache License, Version 2.0
  59265. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  59266. /**
  59267. * @class GeometryRectangle
  59268. * @aliasclass Geometry.Rectangle
  59269. * @deprecatedclass SuperMap.Geometry.Rectangle
  59270. * @classdesc 矩形几何对象类。
  59271. * @category BaseTypes Geometry
  59272. * @param {number} x - 矩形左下角点的横坐标。
  59273. * @param {number} y - 矩形左下角点的纵坐标。
  59274. * @param {number} width - 矩形的宽度。
  59275. * @param {number} height - 矩形的高度。
  59276. * @extends {Geometry}
  59277. * @example
  59278. * //x 为矩形左下角点的横坐标;y 为矩形左下角点的纵坐标;w 为矩形的宽度;h 为矩形的高度
  59279. * var x = 1;
  59280. * var y = 2;
  59281. * var w = 10;
  59282. * var h = 20;
  59283. * var recttangle = new GeometryRectangle(x, y, w, h);
  59284. * @usage
  59285. */
  59286. var Rectangle = /*#__PURE__*/function (_Geometry) {
  59287. Rectangle_inherits(Rectangle, _Geometry);
  59288. var _super = Rectangle_createSuper(Rectangle);
  59289. function Rectangle(x, y, width, height) {
  59290. var _this;
  59291. Rectangle_classCallCheck(this, Rectangle);
  59292. _this = _super.call(this, x, y, width, height);
  59293. /**
  59294. * @member {number} GeometryRectangle.prototype.x
  59295. * @description 矩形左下角点的横坐标。
  59296. */
  59297. _this.x = x;
  59298. /**
  59299. * @member {number} GeometryRectangle.prototype.y
  59300. * @description 矩形左下角点的纵坐标。
  59301. */
  59302. _this.y = y;
  59303. /**
  59304. * @member {number} GeometryRectangle.prototype.width
  59305. * @description 矩形的宽度。
  59306. */
  59307. _this.width = width;
  59308. /**
  59309. * @member {number} GeometryRectangle.prototype.height
  59310. * @description 矩形的高度。
  59311. */
  59312. _this.height = height;
  59313. _this.CLASS_NAME = "SuperMap.Geometry.Rectangle";
  59314. _this.geometryType = "Rectangle";
  59315. return _this;
  59316. }
  59317. /**
  59318. * @function GeometryRectangle.prototype.calculateBounds
  59319. * @description 计算出此矩形对象的 bounds。
  59320. */
  59321. Rectangle_createClass(Rectangle, [{
  59322. key: "calculateBounds",
  59323. value: function calculateBounds() {
  59324. this.bounds = new Bounds(this.x, this.y, this.x + this.width, this.y + this.height);
  59325. }
  59326. /**
  59327. * @function GeometryRectangle.prototype.getArea
  59328. * @description 获取矩形对象的面积。
  59329. * @returns {number} 矩形对象面积。
  59330. */
  59331. }, {
  59332. key: "getArea",
  59333. value: function getArea() {
  59334. var area = this.width * this.height;
  59335. return area;
  59336. }
  59337. }]);
  59338. return Rectangle;
  59339. }(Geometry_Geometry);
  59340. ;// CONCATENATED MODULE: ./src/common/commontypes/geometry/index.js
  59341. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  59342. * This program are made available under the terms of the Apache License, Version 2.0
  59343. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  59344. ;// CONCATENATED MODULE: ./src/common/commontypes/Date.js
  59345. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  59346. * This program are made available under the terms of the Apache License, Version 2.0
  59347. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  59348. /**
  59349. * @name Date
  59350. * @namespace
  59351. * @category BaseTypes Util
  59352. * @description 包含 parse、toISOString 方法的实现,两个方法用来解析 RFC 3339 日期,遵循 ECMAScript 5 规范。
  59353. * @private
  59354. */
  59355. var DateExt = {
  59356. /**
  59357. * @description 生成代表一个具体的日期字符串,该日期遵循 ISO 8601 标准(详情查看{@link http://tools.ietf.org/html/rfc3339})。
  59358. * @example
  59359. * var dateString = DateExt.toISOString(new Date());
  59360. * @param {Date} date - 日期对象。
  59361. * @returns {string} 一个代表日期的字符串。(例如 "2010-08-07T16:58:23.123Z")。
  59362. */
  59363. toISOString: function () {
  59364. //标准的Date会存在toISOString方法,可以直接调用
  59365. if ("toISOString" in Date.prototype) {
  59366. return function (date) {
  59367. return date.toISOString();
  59368. };
  59369. } else {
  59370. // 部分浏览器没有,就得自己组合,组合后的字符串规则不变
  59371. var pad = function pad(num, len) {
  59372. var str = num + "";
  59373. while (str.length < len) {
  59374. str = "0" + str;
  59375. }
  59376. return str;
  59377. };
  59378. return function (date) {
  59379. var str;
  59380. if (isNaN(date.getTime())) {
  59381. // ECMA-262 says throw RangeError, Firefox returns
  59382. // "Invalid Date"
  59383. str = "Invalid Date";
  59384. } else {
  59385. str = date.getUTCFullYear() + "-" + pad(date.getUTCMonth() + 1, 2) + "-" + pad(date.getUTCDate(), 2) + "T" + pad(date.getUTCHours(), 2) + ":" + pad(date.getUTCMinutes(), 2) + ":" + pad(date.getUTCSeconds(), 2) + "." + pad(date.getUTCMilliseconds(), 3) + "Z";
  59386. }
  59387. return str;
  59388. };
  59389. }
  59390. }(),
  59391. /**
  59392. * @description 从一个字符串生成一个日期对象。
  59393. * @example
  59394. * var date = DateExt.parse("2010-08-07");
  59395. * @param {string} str - 日期的字符串。(例如: "2010", "2010-08", "2010-08-07", "2010-08-07T16:58:23.123Z","2010-08-07T11:58:23.123-06")。
  59396. * @returns {Date} 日期对象,如果字符串无法被解析,则返回一个无效的日期。(例如 isNaN(date.getTime()))。
  59397. */
  59398. parse: function parse(str) {
  59399. var date;
  59400. var match = str.match(/^(?:(\d{4})(?:-(\d{2})(?:-(\d{2}))?)?)?(?:(?:T(\d{1,2}):(\d{2}):(\d{2}(?:\.\d+)?)(Z|(?:[+-]\d{1,2}(?::(\d{2}))?)))|Z)?$/);
  59401. if (match && (match[1] || match[7])) {
  59402. // must have at least year or time
  59403. var year = parseInt(match[1], 10) || 0;
  59404. var month = parseInt(match[2], 10) - 1 || 0;
  59405. var day = parseInt(match[3], 10) || 1;
  59406. date = new Date(Date.UTC(year, month, day));
  59407. // optional time
  59408. var type = match[7];
  59409. if (type) {
  59410. var hours = parseInt(match[4], 10);
  59411. var minutes = parseInt(match[5], 10);
  59412. var secFrac = parseFloat(match[6]);
  59413. var seconds = secFrac | 0;
  59414. var milliseconds = Math.round(1000 * (secFrac - seconds));
  59415. date.setUTCHours(hours, minutes, seconds, milliseconds);
  59416. // check offset
  59417. if (type !== "Z") {
  59418. var hoursOffset = parseInt(type, 10);
  59419. var minutesOffset = parseInt(match[8], 10) || 0;
  59420. var offset = -1000 * (60 * (hoursOffset * 60) + minutesOffset * 60);
  59421. date = new Date(date.getTime() + offset);
  59422. }
  59423. }
  59424. } else {
  59425. date = new Date("invalid");
  59426. }
  59427. return date;
  59428. }
  59429. };
  59430. ;// CONCATENATED MODULE: ./src/common/commontypes/index.js
  59431. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  59432. * This program are made available under the terms of the Apache License, Version 2.0
  59433. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  59434. ;// CONCATENATED MODULE: ./src/common/format/WKT.js
  59435. function WKT_typeof(obj) { "@babel/helpers - typeof"; return WKT_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, WKT_typeof(obj); }
  59436. function WKT_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  59437. function WKT_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  59438. function WKT_createClass(Constructor, protoProps, staticProps) { if (protoProps) WKT_defineProperties(Constructor.prototype, protoProps); if (staticProps) WKT_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  59439. function WKT_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) WKT_setPrototypeOf(subClass, superClass); }
  59440. function WKT_setPrototypeOf(o, p) { WKT_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return WKT_setPrototypeOf(o, p); }
  59441. function WKT_createSuper(Derived) { var hasNativeReflectConstruct = WKT_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = WKT_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = WKT_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return WKT_possibleConstructorReturn(this, result); }; }
  59442. function WKT_possibleConstructorReturn(self, call) { if (call && (WKT_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return WKT_assertThisInitialized(self); }
  59443. function WKT_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  59444. function WKT_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  59445. function WKT_getPrototypeOf(o) { WKT_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return WKT_getPrototypeOf(o); }
  59446. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  59447. * This program are made available under the terms of the Apache License, Version 2.0
  59448. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  59449. /**
  59450. * @class WKTFormat
  59451. * @aliasclass Format.WKT
  59452. * @deprecatedclass SuperMap.Format.WKT
  59453. * @classdesc 用于读写常见文本的类。通过 {@link WKTFormat} 构造器来创建一个新的实例。
  59454. * @category BaseTypes Format
  59455. * @extends {Format}
  59456. * @param {Object} options - 可选的选项对象,其属性将被设置到实例。option 具体配置项继承自 {@link Format}。
  59457. * @usage
  59458. */
  59459. var WKT = /*#__PURE__*/function (_Format) {
  59460. WKT_inherits(WKT, _Format);
  59461. var _super = WKT_createSuper(WKT);
  59462. function WKT(options) {
  59463. var _this;
  59464. WKT_classCallCheck(this, WKT);
  59465. _this = _super.call(this, options);
  59466. _this.regExes = {
  59467. 'typeStr': /^\s*(\w+)\s*\(\s*(.*)\s*\)\s*$/,
  59468. 'spaces': /\s+/,
  59469. 'parenComma': /\)\s*,\s*\(/,
  59470. 'doubleParenComma': /\)\s*\)\s*,\s*\(\s*\(/,
  59471. // can't use {2} here
  59472. 'trimParens': /^\s*\(?(.*?)\)?\s*$/
  59473. };
  59474. _this.CLASS_NAME = "SuperMap.Format.WKT"; /**
  59475. * @private
  59476. * @description Object with properties corresponding to the geometry types.
  59477. * Property values are functions that do the actual data extraction.
  59478. */
  59479. _this.extract = {
  59480. /**
  59481. * @description Return a space delimited string of point coordinates.
  59482. * @param {GeometryPoint} point
  59483. * @returns {string} A string of coordinates representing the point
  59484. */
  59485. 'point': function point(_point) {
  59486. return _point.x + ' ' + _point.y;
  59487. },
  59488. /**
  59489. * @description Return a comma delimited string of point coordinates from a multipoint.
  59490. * @param {GeometryMultiPoint} multipoint
  59491. * @returns {string} A string of point coordinate strings representing
  59492. * the multipoint
  59493. */
  59494. 'multipoint': function multipoint(_multipoint) {
  59495. var array = [];
  59496. for (var i = 0, len = _multipoint.components.length; i < len; ++i) {
  59497. array.push('(' + this.extract.point.apply(this, [_multipoint.components[i]]) + ')');
  59498. }
  59499. return array.join(',');
  59500. },
  59501. /**
  59502. * @description Return a comma delimited string of point coordinates from a line.
  59503. * @param {GeometryLineString} linestring
  59504. * @returns {string} A string of point coordinate strings representing
  59505. * the linestring
  59506. */
  59507. 'linestring': function linestring(_linestring) {
  59508. var array = [];
  59509. for (var i = 0, len = _linestring.components.length; i < len; ++i) {
  59510. array.push(this.extract.point.apply(this, [_linestring.components[i]]));
  59511. }
  59512. return array.join(',');
  59513. },
  59514. /**
  59515. * @description Return a comma delimited string of linestring strings from a multilinestring.
  59516. * @param {GeometryMultiLineString} multilinestring
  59517. * @returns {string} A string of of linestring strings representing
  59518. * the multilinestring
  59519. */
  59520. 'multilinestring': function multilinestring(_multilinestring) {
  59521. var array = [];
  59522. for (var i = 0, len = _multilinestring.components.length; i < len; ++i) {
  59523. array.push('(' + this.extract.linestring.apply(this, [_multilinestring.components[i]]) + ')');
  59524. }
  59525. return array.join(',');
  59526. },
  59527. /**
  59528. * @description Return a comma delimited string of linear ring arrays from a polygon.
  59529. * @param {GeometryPolygon} polygon
  59530. * @returns {string} An array of linear ring arrays representing the polygon
  59531. */
  59532. 'polygon': function polygon(_polygon) {
  59533. var array = [];
  59534. for (var i = 0, len = _polygon.components.length; i < len; ++i) {
  59535. array.push('(' + this.extract.linestring.apply(this, [_polygon.components[i]]) + ')');
  59536. }
  59537. return array.join(',');
  59538. },
  59539. /**
  59540. * @description Return an array of polygon arrays from a multipolygon.
  59541. * @param {GeometryMultiPolygon} multipolygon
  59542. * @returns {string} An array of polygon arrays representing
  59543. * the multipolygon
  59544. */
  59545. 'multipolygon': function multipolygon(_multipolygon) {
  59546. var array = [];
  59547. for (var i = 0, len = _multipolygon.components.length; i < len; ++i) {
  59548. array.push('(' + this.extract.polygon.apply(this, [_multipolygon.components[i]]) + ')');
  59549. }
  59550. return array.join(',');
  59551. },
  59552. /**
  59553. * @description Return the WKT portion between 'GEOMETRYCOLLECTION(' and ')' for an <GeometryCollection>
  59554. * @param {GeometryCollection} collection
  59555. * @returns {string} internal WKT representation of the collection
  59556. */
  59557. 'collection': function collection(_collection) {
  59558. var array = [];
  59559. for (var i = 0, len = _collection.components.length; i < len; ++i) {
  59560. array.push(this.extractGeometry.apply(this, [_collection.components[i]]));
  59561. }
  59562. return array.join(',');
  59563. }
  59564. };
  59565. /**
  59566. * @private
  59567. * @description Object with properties corresponding to the geometry types.
  59568. * Property values are functions that do the actual parsing.
  59569. */
  59570. _this.parse = {
  59571. /**
  59572. * @private
  59573. * @description Return point feature given a point WKT fragment.
  59574. * @param {string} str A WKT fragment representing the point
  59575. * @returns {FeatureVector} A point feature
  59576. *
  59577. */
  59578. 'point': function point(str) {
  59579. var coords = StringExt.trim(str).split(this.regExes.spaces);
  59580. return new Vector(new Point(coords[0], coords[1]));
  59581. },
  59582. /**
  59583. * @description Return a multipoint feature given a multipoint WKT fragment.
  59584. * @param {string} A WKT fragment representing the multipoint
  59585. * @returns {FeatureVector} A multipoint feature
  59586. * @private
  59587. */
  59588. 'multipoint': function multipoint(str) {
  59589. var point;
  59590. var points = StringExt.trim(str).split(',');
  59591. var components = [];
  59592. for (var i = 0, len = points.length; i < len; ++i) {
  59593. point = points[i].replace(this.regExes.trimParens, '$1');
  59594. components.push(this.parse.point.apply(this, [point]).geometry);
  59595. }
  59596. return new Vector(new MultiPoint(components));
  59597. },
  59598. /**
  59599. * @description Return a linestring feature given a linestring WKT fragment.
  59600. * @param {string} A WKT fragment representing the linestring
  59601. * @returns {FeatureVector} A linestring feature
  59602. * @private
  59603. */
  59604. 'linestring': function linestring(str) {
  59605. var points = StringExt.trim(str).split(',');
  59606. var components = [];
  59607. for (var i = 0, len = points.length; i < len; ++i) {
  59608. components.push(this.parse.point.apply(this, [points[i]]).geometry);
  59609. }
  59610. return new Vector(new LineString(components));
  59611. },
  59612. /**
  59613. * @description Return a multilinestring feature given a multilinestring WKT fragment.
  59614. * @param {string} A WKT fragment representing the multilinestring
  59615. * @returns {FeatureVector} A multilinestring feature
  59616. * @private
  59617. */
  59618. 'multilinestring': function multilinestring(str) {
  59619. var line;
  59620. var lines = StringExt.trim(str).split(this.regExes.parenComma);
  59621. var components = [];
  59622. for (var i = 0, len = lines.length; i < len; ++i) {
  59623. line = lines[i].replace(this.regExes.trimParens, '$1');
  59624. components.push(this.parse.linestring.apply(this, [line]).geometry);
  59625. }
  59626. return new Vector(new MultiLineString(components));
  59627. },
  59628. /**
  59629. * @description Return a polygon feature given a polygon WKT fragment.
  59630. * @param {string} A WKT fragment representing the polygon
  59631. * @returns {FeatureVector} A polygon feature
  59632. * @private
  59633. */
  59634. 'polygon': function polygon(str) {
  59635. var ring, linestring, linearring;
  59636. var rings = StringExt.trim(str).split(this.regExes.parenComma);
  59637. var components = [];
  59638. for (var i = 0, len = rings.length; i < len; ++i) {
  59639. ring = rings[i].replace(this.regExes.trimParens, '$1');
  59640. linestring = this.parse.linestring.apply(this, [ring]).geometry;
  59641. linearring = new LinearRing_LinearRing(linestring.components);
  59642. components.push(linearring);
  59643. }
  59644. return new Vector(new Polygon_Polygon(components));
  59645. },
  59646. /**
  59647. * @private
  59648. * @description Return a multipolygon feature given a multipolygon WKT fragment.
  59649. * @param {string} A WKT fragment representing the multipolygon
  59650. * @returns {FeatureVector} A multipolygon feature
  59651. *
  59652. */
  59653. 'multipolygon': function multipolygon(str) {
  59654. var polygon;
  59655. var polygons = StringExt.trim(str).split(this.regExes.doubleParenComma);
  59656. var components = [];
  59657. for (var i = 0, len = polygons.length; i < len; ++i) {
  59658. polygon = polygons[i].replace(this.regExes.trimParens, '$1');
  59659. components.push(this.parse.polygon.apply(this, [polygon]).geometry);
  59660. }
  59661. return new Vector(new MultiPolygon(components));
  59662. },
  59663. /**
  59664. * @description Return an array of features given a geometrycollection WKT fragment.
  59665. * @param {string} A WKT fragment representing the geometrycollection
  59666. * @returns {Array} An array of FeatureVector
  59667. * @private
  59668. */
  59669. 'geometrycollection': function geometrycollection(str) {
  59670. // separate components of the collection with |
  59671. str = str.replace(/,\s*([A-Za-z])/g, '|$1');
  59672. var wktArray = StringExt.trim(str).split('|');
  59673. var components = [];
  59674. for (var i = 0, len = wktArray.length; i < len; ++i) {
  59675. components.push(this.read(wktArray[i]));
  59676. }
  59677. return components;
  59678. }
  59679. };
  59680. return _this;
  59681. }
  59682. /**
  59683. * @function WKTFormat.prototype.read
  59684. * @description 反序列化 WKT 字符串并返回向量特征或向量特征数组。支持 POINT、MULTIPOINT、LINESTRING、MULTILINESTRING、POLYGON、MULTIPOLYGON 和 GEOMETRYCOLLECTION 的 WKT。
  59685. * @param {string} wkt - WKT 字符串。
  59686. * @returns {FeatureVector|Array} GEOMETRYCOLLECTION WKT 的矢量要素或者矢量要素数组。
  59687. */
  59688. WKT_createClass(WKT, [{
  59689. key: "read",
  59690. value: function read(wkt) {
  59691. var features, type, str;
  59692. wkt = wkt.replace(/[\n\r]/g, " ");
  59693. var matches = this.regExes.typeStr.exec(wkt);
  59694. if (matches) {
  59695. type = matches[1].toLowerCase();
  59696. str = matches[2];
  59697. if (this.parse[type]) {
  59698. features = this.parse[type].apply(this, [str]);
  59699. }
  59700. }
  59701. return features;
  59702. }
  59703. /**
  59704. * @function WKTFormat.prototype.write
  59705. * @description 将矢量要素或矢量要素数组序列化为 WKT 字符串。
  59706. * @param {(FeatureVector|Array)} features - 矢量要素或矢量要素数组。
  59707. * @returns {string} 表示几何的 WKT 字符串。
  59708. */
  59709. }, {
  59710. key: "write",
  59711. value: function write(features) {
  59712. var collection, geometry, isCollection;
  59713. if (features.constructor === Array) {
  59714. collection = features;
  59715. isCollection = true;
  59716. } else {
  59717. collection = [features];
  59718. isCollection = false;
  59719. }
  59720. var pieces = [];
  59721. if (isCollection) {
  59722. pieces.push('GEOMETRYCOLLECTION(');
  59723. }
  59724. for (var i = 0, len = collection.length; i < len; ++i) {
  59725. if (isCollection && i > 0) {
  59726. pieces.push(',');
  59727. }
  59728. geometry = collection[i].geometry;
  59729. pieces.push(this.extractGeometry(geometry));
  59730. }
  59731. if (isCollection) {
  59732. pieces.push(')');
  59733. }
  59734. return pieces.join('');
  59735. }
  59736. /**
  59737. * @function WKTFormat.prototype.extractGeometry
  59738. * @description 为单个 Geometry 对象构造 WKT 的入口点。
  59739. * @param {Geometry} geometry - Geometry 对象。
  59740. * @returns {string} 表示几何的 WKT 字符串。
  59741. */
  59742. }, {
  59743. key: "extractGeometry",
  59744. value: function extractGeometry(geometry) {
  59745. var type = geometry.CLASS_NAME.split('.')[2].toLowerCase();
  59746. if (!this.extract[type]) {
  59747. return null;
  59748. }
  59749. var wktType = type === 'collection' ? 'GEOMETRYCOLLECTION' : type.toUpperCase();
  59750. var data = wktType + '(' + this.extract[type].apply(this, [geometry]) + ')';
  59751. return data;
  59752. }
  59753. }]);
  59754. return WKT;
  59755. }(Format);
  59756. ;// CONCATENATED MODULE: ./src/common/format/index.js
  59757. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  59758. * This program are made available under the terms of the Apache License, Version 2.0
  59759. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  59760. ;// CONCATENATED MODULE: ./src/common/control/TimeControlBase.js
  59761. function TimeControlBase_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  59762. function TimeControlBase_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  59763. function TimeControlBase_createClass(Constructor, protoProps, staticProps) { if (protoProps) TimeControlBase_defineProperties(Constructor.prototype, protoProps); if (staticProps) TimeControlBase_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  59764. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  59765. * This program are made available under the terms of the Apache License, Version 2.0
  59766. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  59767. /**
  59768. * @class TimeControlBase
  59769. * @deprecatedclass SuperMap.TimeControlBase
  59770. * @classdesc 时间控制基类。
  59771. * @modulecategory Control
  59772. * @category Control
  59773. * @param {Object} options - 可选参数。
  59774. * @param {number} [options.speed=1] - 速度。不能小于 0,(每帧渲染的数据之间的间隔为1),设置越大速度越快。
  59775. * @param {number} [options.frequency=1000] - 刷新频率(单位 ms),服务器刷新的时间间隔。
  59776. * @param {number} [options.startTime=0] - 起始时间,必须为数字,且小于等于 endTime。如果不设置,初始化时为 0,建议设置。
  59777. * @param {number} [options.endTime] - 结束时间,必须为数字,且大于等于 startTime。如果不设置,初始化时以当前时间进行设置,建议设置。
  59778. * @param {boolean} [options.repeat=true] - 是否重复循环。
  59779. * @param {boolean} [options.reverse=false] - 是否反向。
  59780. * @usage
  59781. */
  59782. var TimeControlBase = /*#__PURE__*/function () {
  59783. function TimeControlBase(options) {
  59784. TimeControlBase_classCallCheck(this, TimeControlBase);
  59785. //设置步长,刷新频率、开始结束时间、是否循环、是否反向
  59786. var me = this;
  59787. options = options || {};
  59788. /**
  59789. * @member {number} [TimeControlBase.prototype.speed=1]
  59790. * @description 步长,必须为非负数,默认为1(表示前后两次渲染的数据之间的间隔为1)。
  59791. */
  59792. this.speed = options.speed && options.speed >= 0 ? options.speed : 1;
  59793. /**
  59794. * @member {number} [TimeControlBase.prototype.frequency=1000]
  59795. * @description 刷新频率(单位ms),服务器刷新的时间间隔。
  59796. */
  59797. this.frequency = options.speed && options.frequency >= 0 ? options.frequency : 1000;
  59798. /**
  59799. * @member {number} [TimeControlBase.prototype.startTime=0]
  59800. * @description 记录的起始时间,必须为数字,
  59801. * 如果不设置,初始化时为0,建议设置。
  59802. */
  59803. this.startTime = options.startTime && options.startTime != null ? options.startTime : 0;
  59804. /**
  59805. * @member {number} TimeControlBase.prototype.endTime
  59806. * @description 记录的结束时间,必须为数字,
  59807. * 如果不设置,初始化时以当前时间进行设置,建议设置。
  59808. */
  59809. this.endTime = options.endTime && options.endTime != null && options.endTime >= me.startTime ? options.endTime : +new Date();
  59810. /**
  59811. * @member {boolean} [TimeControlBase.prototype.repeat=true]
  59812. * @description 是否重复循环。
  59813. */
  59814. this.repeat = options.repeat !== undefined ? options.repeat : true;
  59815. /**
  59816. * @member {boolean} [TimeControlBase.prototype.reverse=false]
  59817. * @description 是否反向。
  59818. */
  59819. this.reverse = options.reverse !== undefined ? options.reverse : false;
  59820. /**
  59821. * @member {number} TimeControlBase.prototype.currentTime
  59822. * @description 记录近期的时间,也就是当前帧运行到的时间。
  59823. */
  59824. this.currentTime = null;
  59825. /**
  59826. * @member {number} TimeControlBase.prototype.oldTime
  59827. * @description 记录上一帧的时间,也就是之前运行到的时间。
  59828. */
  59829. this.oldTime = null;
  59830. /**
  59831. * @member {boolean} [TimeControlBase.prototype.running=false]
  59832. * @description 记录当前是否处于运行中。
  59833. */
  59834. this.running = false;
  59835. /**
  59836. * @private
  59837. * @member {Array.<string>} TimeControlBase.prototype.EVENT_TYPES
  59838. * @description 此类支持的事件类型。
  59839. *
  59840. */
  59841. this.EVENT_TYPES = ["start", "pause", "stop"];
  59842. /**
  59843. * @private
  59844. * @member {Events} TimeControlBase.prototype.events
  59845. * @description 事件
  59846. */
  59847. me.events = new Events(this, null, this.EVENT_TYPES);
  59848. me.speed = Number(me.speed);
  59849. me.frequency = Number(me.frequency);
  59850. me.startTime = Number(me.startTime);
  59851. me.endTime = Number(me.endTime);
  59852. me.startTime = Date.parse(new Date(me.startTime));
  59853. me.endTime = Date.parse(new Date(me.endTime));
  59854. //初始化当前时间
  59855. me.currentTime = me.startTime;
  59856. this.CLASS_NAME = "SuperMap.TimeControlBase";
  59857. }
  59858. /**
  59859. * @function TimeControlBase.prototype.updateOptions
  59860. * @description 更新参数。
  59861. * @param {Object} options - 设置参数的可选参数。设置步长,刷新频率、开始结束时间、是否循环、是否反向。
  59862. */
  59863. TimeControlBase_createClass(TimeControlBase, [{
  59864. key: "updateOptions",
  59865. value: function updateOptions(options) {
  59866. //设置步长,刷新频率、开始结束时间、是否循环、是否反向
  59867. var me = this;
  59868. options = options || {};
  59869. if (options.speed && options.speed >= 0) {
  59870. me.speed = options.speed;
  59871. me.speed = Number(me.speed);
  59872. }
  59873. if (options.speed && options.frequency >= 0) {
  59874. me.frequency = options.frequency;
  59875. me.frequency = Number(me.frequency);
  59876. }
  59877. if (options.startTime && options.startTime != null) {
  59878. me.startTime = options.startTime;
  59879. me.startTime = Date.parse(new Date(me.startTime));
  59880. }
  59881. if (options.endTime && options.endTime != null && options.endTime >= me.startTime) {
  59882. me.endTime = options.endTime;
  59883. me.endTime = Date.parse(new Date(me.endTime));
  59884. }
  59885. if (options.repeat != null) {
  59886. me.repeat = options.repeat;
  59887. }
  59888. if (options.reverse != null) {
  59889. me.reverse = options.reverse;
  59890. }
  59891. }
  59892. /**
  59893. * @function TimeControlBase.prototype.start
  59894. * @description 开始。
  59895. */
  59896. }, {
  59897. key: "start",
  59898. value: function start() {
  59899. var me = this;
  59900. if (!me.running) {
  59901. me.running = true;
  59902. me.tick();
  59903. me.events.triggerEvent('start', me.currentTime);
  59904. }
  59905. }
  59906. /**
  59907. * @function TimeControlBase.prototype.pause
  59908. * @description 暂停。
  59909. */
  59910. }, {
  59911. key: "pause",
  59912. value: function pause() {
  59913. var me = this;
  59914. me.running = false;
  59915. me.events.triggerEvent('pause', me.currentTime);
  59916. }
  59917. /**
  59918. * @function TimeControlBase.prototype.stop
  59919. * @description 停止,停止后返回起始状态。
  59920. */
  59921. }, {
  59922. key: "stop",
  59923. value: function stop() {
  59924. var me = this;
  59925. //停止时 时间设置为开始时间
  59926. me.currentTime = me.startTime;
  59927. //如果正在运行,修改为初始时间即可绘制一帧
  59928. if (me.running) {
  59929. me.running = false;
  59930. }
  59931. me.events.triggerEvent('stop', me.currentTime);
  59932. }
  59933. /**
  59934. * @function TimeControlBase.prototype.toggle
  59935. * @description 开关切换,切换的是开始和暂停。
  59936. */
  59937. }, {
  59938. key: "toggle",
  59939. value: function toggle() {
  59940. var me = this;
  59941. if (me.running) {
  59942. me.pause();
  59943. } else {
  59944. me.start();
  59945. }
  59946. }
  59947. /**
  59948. * @function TimeControlBase.prototype.setSpeed
  59949. * @description 设置步长。
  59950. * @param {number} [speed=1] - 步长,必须为非负数。
  59951. * @returns {boolean} true 代表设置成功,false 设置失败(speed 小于 0 时失败)。
  59952. */
  59953. }, {
  59954. key: "setSpeed",
  59955. value: function setSpeed(speed) {
  59956. var me = this;
  59957. if (speed >= 0) {
  59958. me.speed = speed;
  59959. return true;
  59960. }
  59961. return false;
  59962. }
  59963. /**
  59964. * @function TimeControlBase.prototype.getSpeed
  59965. * @description 获取步长。
  59966. * @returns {number} 返回当前的步长。
  59967. */
  59968. }, {
  59969. key: "getSpeed",
  59970. value: function getSpeed() {
  59971. return this.speed;
  59972. }
  59973. /**
  59974. * @function TimeControlBase.prototype.setFrequency
  59975. * @description 设置刷新频率。
  59976. * @param {number} [frequency=1000] - 刷新频率,单位为 ms。
  59977. * @returns {boolean} true 代表设置成功,false 设置失败(frequency 小于 0 时失败)。
  59978. */
  59979. }, {
  59980. key: "setFrequency",
  59981. value: function setFrequency(frequency) {
  59982. var me = this;
  59983. if (frequency >= 0) {
  59984. me.frequency = frequency;
  59985. return true;
  59986. }
  59987. return false;
  59988. }
  59989. /**
  59990. * @function TimeControlBase.prototype.getFrequency
  59991. * @description 获取刷新频率。
  59992. * @returns {number} 返回当前的刷新频率。
  59993. */
  59994. }, {
  59995. key: "getFrequency",
  59996. value: function getFrequency() {
  59997. return this.frequency;
  59998. }
  59999. /**
  60000. * @function TimeControlBase.prototype.setStartTime
  60001. * @description 设置起始时间,设置完成后如果当前时间小于起始时间,则从起始时间开始。
  60002. * @param {number} startTime - 需要设置的起始时间。
  60003. * @returns {boolean} true 代表设置成功,false 设置失败(startTime 大于结束时间时失败)。
  60004. */
  60005. }, {
  60006. key: "setStartTime",
  60007. value: function setStartTime(startTime) {
  60008. var me = this;
  60009. startTime = Date.parse(new Date(startTime));
  60010. //起始时间不得大于结束时间
  60011. if (startTime > me.endTime) {
  60012. return false;
  60013. }
  60014. me.startTime = startTime;
  60015. //如果当前时间小于了起始时间,则从当前起始时间开始
  60016. if (me.currentTime < me.startTime) {
  60017. me.currentTime = me.startTime;
  60018. me.tick();
  60019. }
  60020. return true;
  60021. }
  60022. /**
  60023. * @function TimeControlBase.prototype.getStartTime
  60024. * @description 获取起始时间。
  60025. * @returns {number} 返回当前的起始时间。
  60026. */
  60027. }, {
  60028. key: "getStartTime",
  60029. value: function getStartTime() {
  60030. return this.startTime;
  60031. }
  60032. /**
  60033. * @function TimeControlBase.prototype.setEndTime
  60034. * @description 设置结束时间,设置完成后如果当前时间大于结束,则从起始时间开始。
  60035. * @param {number} endTime - 需要设置的结束时间。
  60036. * @returns {boolean} true 代表设置成功,false 设置失败(endTime 小于开始时间时失败)。
  60037. */
  60038. }, {
  60039. key: "setEndTime",
  60040. value: function setEndTime(endTime) {
  60041. var me = this;
  60042. me.endTime = Date.parse(new Date(me.endTime));
  60043. //结束时间不得小于开始时间
  60044. if (endTime < me.startTime) {
  60045. return false;
  60046. }
  60047. me.endTime = endTime;
  60048. //如果当前时间大于了结束时间,则从起始时间开始
  60049. if (me.currentTime >= me.endTime) {
  60050. me.currentTime = me.startTime;
  60051. me.tick();
  60052. }
  60053. return true;
  60054. }
  60055. /**
  60056. * @function TimeControlBase.prototype.getEndTime
  60057. * @description 获取结束时间。
  60058. * @returns {number} 返回当前的结束时间。
  60059. */
  60060. }, {
  60061. key: "getEndTime",
  60062. value: function getEndTime() {
  60063. return this.endTime;
  60064. }
  60065. /**
  60066. * @function TimeControlBase.prototype.setCurrentTime
  60067. * @description 设置当前时间。
  60068. * @param {number} currentTime - 需要设置的当前时间。
  60069. * @returns {boolean} true 代表设置成功,false 设置失败。
  60070. */
  60071. }, {
  60072. key: "setCurrentTime",
  60073. value: function setCurrentTime(currentTime) {
  60074. var me = this;
  60075. me.currentTime = Date.parse(new Date(me.currentTime));
  60076. //结束时间不得小于开始时间
  60077. if (currentTime >= me.startTime && currentTime <= me.endTime) {
  60078. me.currentTime = currentTime;
  60079. me.startTime = me.currentTime;
  60080. me.tick();
  60081. return true;
  60082. }
  60083. return false;
  60084. }
  60085. /**
  60086. * @function TimeControlBase.prototype.getCurrentTime
  60087. * @description 获取当前时间。
  60088. * @returns {number} 返回当前时间。
  60089. */
  60090. }, {
  60091. key: "getCurrentTime",
  60092. value: function getCurrentTime() {
  60093. return this.currentTime;
  60094. }
  60095. /**
  60096. * @function TimeControlBase.prototype.setRepeat
  60097. * @description 设置是否重复循环。
  60098. * @param {boolean} [repeat=true] - 是否重复循环。
  60099. */
  60100. }, {
  60101. key: "setRepeat",
  60102. value: function setRepeat(repeat) {
  60103. this.repeat = repeat;
  60104. }
  60105. /**
  60106. * @function TimeControlBase.prototype.getRepeat
  60107. * @description 获取是否重复循环,默认是 true。
  60108. * @returns {boolean} 返回是否重复循环。
  60109. */
  60110. }, {
  60111. key: "getRepeat",
  60112. value: function getRepeat() {
  60113. return this.repeat;
  60114. }
  60115. /**
  60116. * @function TimeControlBase.prototype.setReverse
  60117. * @description 设置是否反向。
  60118. * @param {boolean} [reverse=false] - 是否反向。
  60119. */
  60120. }, {
  60121. key: "setReverse",
  60122. value: function setReverse(reverse) {
  60123. this.reverse = reverse;
  60124. }
  60125. /**
  60126. * @function TimeControlBase.prototype.getReverse
  60127. * @description 获取是否反向,默认是false。
  60128. * @returns {boolean} 返回是否反向。
  60129. */
  60130. }, {
  60131. key: "getReverse",
  60132. value: function getReverse() {
  60133. return this.reverse;
  60134. }
  60135. /**
  60136. * @function TimeControlBase.prototype.getRunning
  60137. * @description 获取运行状态。
  60138. * @returns {boolean} true 代表正在运行,false 发表没有运行。
  60139. */
  60140. }, {
  60141. key: "getRunning",
  60142. value: function getRunning() {
  60143. return this.running;
  60144. }
  60145. /**
  60146. * @function TimeControlBase.prototype.destroy
  60147. * @description 销毁 Animator 对象,释放资源。
  60148. */
  60149. }, {
  60150. key: "destroy",
  60151. value: function destroy() {
  60152. var me = this;
  60153. me.speed = null;
  60154. me.frequency = null;
  60155. me.startTime = null;
  60156. me.endTime = null;
  60157. me.currentTime = null;
  60158. me.repeat = null;
  60159. me.running = false;
  60160. me.reverse = null;
  60161. }
  60162. }, {
  60163. key: "tick",
  60164. value: function tick() {
  60165. //TODO 每次刷新执行的操作。子类实现
  60166. }
  60167. }]);
  60168. return TimeControlBase;
  60169. }();
  60170. ;// CONCATENATED MODULE: ./src/common/control/TimeFlowControl.js
  60171. function TimeFlowControl_typeof(obj) { "@babel/helpers - typeof"; return TimeFlowControl_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, TimeFlowControl_typeof(obj); }
  60172. function TimeFlowControl_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  60173. function TimeFlowControl_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  60174. function TimeFlowControl_createClass(Constructor, protoProps, staticProps) { if (protoProps) TimeFlowControl_defineProperties(Constructor.prototype, protoProps); if (staticProps) TimeFlowControl_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  60175. function TimeFlowControl_get() { if (typeof Reflect !== "undefined" && Reflect.get) { TimeFlowControl_get = Reflect.get.bind(); } else { TimeFlowControl_get = function _get(target, property, receiver) { var base = TimeFlowControl_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return TimeFlowControl_get.apply(this, arguments); }
  60176. function TimeFlowControl_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = TimeFlowControl_getPrototypeOf(object); if (object === null) break; } return object; }
  60177. function TimeFlowControl_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) TimeFlowControl_setPrototypeOf(subClass, superClass); }
  60178. function TimeFlowControl_setPrototypeOf(o, p) { TimeFlowControl_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return TimeFlowControl_setPrototypeOf(o, p); }
  60179. function TimeFlowControl_createSuper(Derived) { var hasNativeReflectConstruct = TimeFlowControl_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = TimeFlowControl_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = TimeFlowControl_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return TimeFlowControl_possibleConstructorReturn(this, result); }; }
  60180. function TimeFlowControl_possibleConstructorReturn(self, call) { if (call && (TimeFlowControl_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return TimeFlowControl_assertThisInitialized(self); }
  60181. function TimeFlowControl_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  60182. function TimeFlowControl_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  60183. function TimeFlowControl_getPrototypeOf(o) { TimeFlowControl_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return TimeFlowControl_getPrototypeOf(o); }
  60184. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  60185. * This program are made available under the terms of the Apache License, Version 2.0
  60186. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  60187. /**
  60188. * @class TimeFlowControl
  60189. * @deprecatedclass SuperMap.TimeFlowControl
  60190. * @category Control
  60191. * @classdesc 时间管理类。此类只负责时间上的控制,具体执行的操作需要用户在初始化时的回调函数内部进行实现。
  60192. * 如设置起始时间为 1000,结束时间是 2000,步长设置为 1,
  60193. * 那么表示按照每次1年(可以通过 setSpeed 进行修改)的变化从公元 1000 年开始到公元 2000 年为止,默认每 1 秒会变化 1 次(通过 setFrequency 修改)
  60194. * @modulecategory Control
  60195. * @extends {TimeControlBase}
  60196. * @param {function} callback - 每次刷新回调函数。具体的效果需要用户在此回调函数里面实现。
  60197. * @param {Object} options - 可选参数。
  60198. * @param {number} [options.speed=1] - 步长(单位 ms)。不能小于 0,(每次刷新的数据之间的间隔为 1ms)。
  60199. * @param {number} [options.frequency=1000] - 刷新频率(单位 ms)。
  60200. * @param {number} [options.startTime=0] - 起始时间,必须为数字,且小于等于 endTime。如果不设置,初始化时为 0,建议设置。
  60201. * @param {number} [options.endTime] - 结束时间,必须为数字,且大于等于 startTime。如果不设置,初始化时使用 new Date() 以当前时间进行设置,建议设置。
  60202. * @param {boolean} [options.repeat=true] - 是否重复循环。
  60203. * @param {boolean} [options.reverse=false] - 是否反向。
  60204. * @usage
  60205. */
  60206. var TimeFlowControl = /*#__PURE__*/function (_TimeControlBase) {
  60207. TimeFlowControl_inherits(TimeFlowControl, _TimeControlBase);
  60208. var _super = TimeFlowControl_createSuper(TimeFlowControl);
  60209. function TimeFlowControl(callback, options) {
  60210. var _this;
  60211. TimeFlowControl_classCallCheck(this, TimeFlowControl);
  60212. _this = _super.call(this, options);
  60213. var me = TimeFlowControl_assertThisInitialized(_this);
  60214. /**
  60215. * @member TimeFlowControl.prototype.callback -{function}
  60216. * @description 每次刷新执行的回调函数。
  60217. */
  60218. me.callback = callback;
  60219. //先让IE下支持bind方法
  60220. if (!Function.prototype.bind) {
  60221. Function.prototype.bind = function (oThis) {
  60222. if (typeof this !== "function") {
  60223. throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");
  60224. }
  60225. var aArgs = Array.prototype.slice.call(arguments, 1),
  60226. fToBind = this,
  60227. fNOP = function fNOP() {
  60228. //empty Function
  60229. },
  60230. fBound = function fBound() {
  60231. return fToBind.apply(this instanceof fNOP && oThis ? this : oThis, aArgs.concat(Array.prototype.slice.call(arguments)));
  60232. };
  60233. fNOP.prototype = this.prototype;
  60234. fBound.prototype = new fNOP();
  60235. return fBound;
  60236. };
  60237. }
  60238. //保证 this.tick 的上下文还是 TimeControl 这个对象
  60239. me.update = me.update.bind(me);
  60240. me.oldTime = me.currentTime;
  60241. me.CLASS_NAME = "SuperMap.TimeFlowControl";
  60242. return _this;
  60243. }
  60244. /**
  60245. * @function TimeFlowControl.prototype.updateOptions
  60246. * @override
  60247. */
  60248. TimeFlowControl_createClass(TimeFlowControl, [{
  60249. key: "updateOptions",
  60250. value: function updateOptions(options) {
  60251. options = options || {};
  60252. TimeFlowControl_get(TimeFlowControl_getPrototypeOf(TimeFlowControl.prototype), "updateOptions", this).call(this, options);
  60253. }
  60254. /**
  60255. * @function TimeFlowControl.prototype.start
  60256. * @override
  60257. */
  60258. }, {
  60259. key: "start",
  60260. value: function start() {
  60261. var me = this;
  60262. if (me.running) {
  60263. return;
  60264. }
  60265. me.running = true;
  60266. if (me.reverse) {
  60267. if (me.currentTime === me.startTime) {
  60268. me.oldTime = me.endTime;
  60269. me.currentTime = me.oldTime;
  60270. }
  60271. } else {
  60272. if (me.oldTime === me.endTime) {
  60273. me.currentTime = me.startTime;
  60274. me.oldTime = me.currentTime;
  60275. }
  60276. }
  60277. me.tick();
  60278. }
  60279. /**
  60280. * @function TimeFlowControl.prototype.stop
  60281. * @override
  60282. */
  60283. }, {
  60284. key: "stop",
  60285. value: function stop() {
  60286. TimeFlowControl_get(TimeFlowControl_getPrototypeOf(TimeFlowControl.prototype), "stop", this).call(this);
  60287. var me = this;
  60288. me.oldTime = me.currentTime;
  60289. if (me.running) {
  60290. me.running = false;
  60291. }
  60292. //清除定时tick
  60293. me.intervalId && window.clearTimeout(me.intervalId);
  60294. }
  60295. /**
  60296. * @function TimeFlowControl.prototype.destroy
  60297. * @override
  60298. */
  60299. }, {
  60300. key: "destroy",
  60301. value: function destroy() {
  60302. TimeFlowControl_get(TimeFlowControl_getPrototypeOf(TimeFlowControl.prototype), "destroy", this).call(this);
  60303. var me = this;
  60304. me.oldTime = null;
  60305. me.callback = null;
  60306. }
  60307. /**
  60308. * @function TimeFlowControl.prototype.tick
  60309. * @description 定时刷新。
  60310. */
  60311. }, {
  60312. key: "tick",
  60313. value: function tick() {
  60314. var me = this;
  60315. me.intervalId && window.clearInterval(me.intervalId);
  60316. me.intervalId = null;
  60317. me.update();
  60318. me.intervalId = window.setInterval(me.update, me.frequency);
  60319. }
  60320. /**
  60321. * @function TimeFlowControl.prototype.update
  60322. * @description 更新控件。
  60323. */
  60324. }, {
  60325. key: "update",
  60326. value: function update() {
  60327. var me = this;
  60328. //判定是否还需要继续
  60329. if (!me.running) {
  60330. return;
  60331. }
  60332. //调用回调函数
  60333. me.callback && me.callback(me.currentTime); //destroy之后callback就为空,所以需要判定一下
  60334. if (!me.reverse) {
  60335. //如果相等,则代表上一帧已经运行到了最后,下一帧运行初始化的状态
  60336. if (me.currentTime === me.endTime) {
  60337. //不循环时
  60338. if (!me.repeat) {
  60339. me.running = false;
  60340. me.stop();
  60341. return null;
  60342. }
  60343. me.stop();
  60344. me.currentTime = me.startTime;
  60345. me.oldTime = me.currentTime;
  60346. me.start();
  60347. } else {
  60348. //否则时间递增
  60349. me.oldTime = me.currentTime;
  60350. me.currentTime += me.speed;
  60351. }
  60352. if (me.currentTime >= me.endTime) {
  60353. me.currentTime = me.endTime;
  60354. }
  60355. } else {
  60356. //如果相等,则代表上一帧已经运行到了最前,下一帧运行结束的状态
  60357. if (me.currentTime === me.startTime) {
  60358. //不循环时
  60359. if (!me.repeat) {
  60360. me.running = false;
  60361. return null;
  60362. }
  60363. me.oldTime = me.endTime;
  60364. me.currentTime = me.oldTime;
  60365. } else {
  60366. //否则时间递减
  60367. me.currentTime = me.oldTime;
  60368. me.oldTime -= me.speed;
  60369. }
  60370. if (me.oldTime <= me.startTime) {
  60371. me.oldTime = me.startTime;
  60372. }
  60373. }
  60374. }
  60375. }]);
  60376. return TimeFlowControl;
  60377. }(TimeControlBase);
  60378. ;// CONCATENATED MODULE: ./src/common/control/index.js
  60379. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  60380. * This program are made available under the terms of the Apache License, Version 2.0
  60381. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  60382. ;// CONCATENATED MODULE: ./src/common/iManager/iManagerServiceBase.js
  60383. function iManagerServiceBase_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  60384. function iManagerServiceBase_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  60385. function iManagerServiceBase_createClass(Constructor, protoProps, staticProps) { if (protoProps) iManagerServiceBase_defineProperties(Constructor.prototype, protoProps); if (staticProps) iManagerServiceBase_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  60386. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  60387. * This program are made available under the terms of the Apache License, Version 2.0
  60388. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  60389. /**
  60390. * @class IManagerServiceBase
  60391. * @aliasclass iManagerServiceBase
  60392. * @deprecatedclass SuperMap.iManagerServiceBase
  60393. * @classdesc iManager 服务基类(有权限限制的类需要实现此类)。
  60394. * @category iManager
  60395. * @param {string} url - iManager 首页地址,如:http://localhost:8390/imanager。
  60396. * @param {Object} options - 可选参数。
  60397. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  60398. * @param {Object} [options.headers] - 请求头。
  60399. * @usage
  60400. */
  60401. var IManagerServiceBase = /*#__PURE__*/function () {
  60402. function IManagerServiceBase(url, options) {
  60403. iManagerServiceBase_classCallCheck(this, IManagerServiceBase);
  60404. if (url) {
  60405. var end = url.substr(url.length - 1, 1);
  60406. this.serviceUrl = end === "/" ? url.substr(0, url.length - 2) : url;
  60407. }
  60408. this.options = options || {};
  60409. this.CLASS_NAME = "SuperMap.iManagerServiceBase";
  60410. }
  60411. /**
  60412. * @function IManagerServiceBase.prototype.request
  60413. * @description 子类统一通过该方法发送请求。
  60414. * @param {string} url - 请求 URL。
  60415. * @param {string} [method='GET'] - 请求类型。
  60416. * @param {Object} [requestOptions] - 请求选项。
  60417. * @param {Object} param - 请求参数。
  60418. * @description 发送请求。
  60419. * @returns {Promise} Promise 对象。
  60420. */
  60421. iManagerServiceBase_createClass(IManagerServiceBase, [{
  60422. key: "request",
  60423. value: function request(method, url, param, requestOptions) {
  60424. requestOptions = requestOptions || {
  60425. headers: {
  60426. 'Accept': '*/*',
  60427. 'Content-Type': 'application/json'
  60428. }
  60429. };
  60430. if (!requestOptions.hasOwnProperty("withCredentials")) {
  60431. requestOptions['withCredentials'] = true;
  60432. }
  60433. requestOptions['crossOrigin'] = this.options.crossOrigin;
  60434. requestOptions['headers'] = this.options.headers;
  60435. var token = SecurityManager.imanagerToken;
  60436. if (token) {
  60437. if (!requestOptions.headers) {
  60438. requestOptions.headers = [];
  60439. }
  60440. requestOptions.headers['X-Auth-Token'] = token;
  60441. }
  60442. if (param) {
  60443. param = JSON.stringify(param);
  60444. }
  60445. return FetchRequest.commit(method, url, param, requestOptions).then(function (response) {
  60446. return response.json();
  60447. });
  60448. }
  60449. }]);
  60450. return IManagerServiceBase;
  60451. }();
  60452. ;// CONCATENATED MODULE: ./src/common/iManager/iManagerCreateNodeParam.js
  60453. function iManagerCreateNodeParam_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  60454. function iManagerCreateNodeParam_createClass(Constructor, protoProps, staticProps) { if (protoProps) iManagerCreateNodeParam_defineProperties(Constructor.prototype, protoProps); if (staticProps) iManagerCreateNodeParam_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  60455. function iManagerCreateNodeParam_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  60456. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  60457. * This program are made available under the terms of the Apache License, Version 2.0
  60458. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  60459. /**
  60460. * @class IManagerCreateNodeParam
  60461. * @aliasclass iManagerCreateNodeParam
  60462. * @deprecatedclass SuperMap.iManagerCreateNodeParam
  60463. * @classdesc iManager 创建节点参数。
  60464. * @category iManager
  60465. * @param {Object} [params] - 节点参数。
  60466. * @usage
  60467. */
  60468. var IManagerCreateNodeParam = /*#__PURE__*/iManagerCreateNodeParam_createClass(function IManagerCreateNodeParam(params) {
  60469. iManagerCreateNodeParam_classCallCheck(this, IManagerCreateNodeParam);
  60470. params = params || {};
  60471. this.nodeSpec = 'SMALL'; //取值范围: ['SMALL','MEDIUM','LARGE'] 以及自定义的环境规格名称
  60472. this.nodeCount = 1; //要创建vm的个数
  60473. this.nodeName = ''; //vm名称
  60474. this.password = ''; //vm的密码,空表示随机分配
  60475. this.description = ''; //描述信息
  60476. this.physicalMachineName = ''; //vm所属的物理机名称.
  60477. this.ips = []; //vm的ip,空数组表示随机分配
  60478. this.userName = ''; //vm所属用户
  60479. Util_Util.extend(this, params);
  60480. });
  60481. ;// CONCATENATED MODULE: ./src/common/iManager/iManager.js
  60482. function iManager_typeof(obj) { "@babel/helpers - typeof"; return iManager_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, iManager_typeof(obj); }
  60483. function iManager_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  60484. function iManager_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  60485. function iManager_createClass(Constructor, protoProps, staticProps) { if (protoProps) iManager_defineProperties(Constructor.prototype, protoProps); if (staticProps) iManager_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  60486. function iManager_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) iManager_setPrototypeOf(subClass, superClass); }
  60487. function iManager_setPrototypeOf(o, p) { iManager_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return iManager_setPrototypeOf(o, p); }
  60488. function iManager_createSuper(Derived) { var hasNativeReflectConstruct = iManager_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = iManager_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = iManager_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return iManager_possibleConstructorReturn(this, result); }; }
  60489. function iManager_possibleConstructorReturn(self, call) { if (call && (iManager_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return iManager_assertThisInitialized(self); }
  60490. function iManager_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  60491. function iManager_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  60492. function iManager_getPrototypeOf(o) { iManager_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return iManager_getPrototypeOf(o); }
  60493. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  60494. * This program are made available under the terms of the Apache License, Version 2.0
  60495. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  60496. /**
  60497. * @class IManager
  60498. * @aliasclass iManager
  60499. * @deprecatedclass SuperMap.iManager
  60500. * @classdesc iManager 服务类。
  60501. * @category iManager
  60502. * @modulecategory Services
  60503. * @param {string} serviceUrl - iManager 首页地址。
  60504. * @usage
  60505. */
  60506. var IManager = /*#__PURE__*/function (_IManagerServiceBase) {
  60507. iManager_inherits(IManager, _IManagerServiceBase);
  60508. var _super = iManager_createSuper(IManager);
  60509. function IManager(iManagerUrl) {
  60510. iManager_classCallCheck(this, IManager);
  60511. return _super.call(this, iManagerUrl);
  60512. }
  60513. /**
  60514. * @function IManager.prototype.load
  60515. * @description 获取所有服务接口,验证是否已登录授权。
  60516. * @returns {Promise} Promise 对象。
  60517. */
  60518. iManager_createClass(IManager, [{
  60519. key: "load",
  60520. value: function load() {
  60521. return this.request("GET", this.serviceUrl + '/web/api/service.json');
  60522. }
  60523. /**
  60524. * @function IManager.prototype.createIServer
  60525. * @param {IManagerCreateNodeParam} createParam - 创建参数。
  60526. * @description 创建 iServer。
  60527. * @returns {Promise} Promise 对象。
  60528. */
  60529. }, {
  60530. key: "createIServer",
  60531. value: function createIServer(createParam) {
  60532. return this.request("POST", this.serviceUrl + '/icloud/web/nodes/server.json', new IManagerCreateNodeParam(createParam));
  60533. }
  60534. /**
  60535. * @function IManager.prototype.createIPortal
  60536. * @param {IManagerCreateNodeParam} createParam - 创建参数。
  60537. * @description 创建 iPortal。
  60538. * @returns {Promise} Promise 对象。
  60539. */
  60540. }, {
  60541. key: "createIPortal",
  60542. value: function createIPortal(createParam) {
  60543. return this.request("POST", this.serviceUrl + '/icloud/web/nodes/portal.json', new IManagerCreateNodeParam(createParam));
  60544. }
  60545. /**
  60546. * @function IManager.prototype.iServerList
  60547. * @description 获取所有创建的 iServer。
  60548. * @returns {Promise} Promise 对象。
  60549. */
  60550. }, {
  60551. key: "iServerList",
  60552. value: function iServerList() {
  60553. return this.request("GET", this.serviceUrl + '/icloud/web/nodes/server.json');
  60554. }
  60555. /**
  60556. * @function IManager.prototype.iPortalList
  60557. * @description 获取所有创建的 iPortal。
  60558. * @returns {Promise} Promise 对象。
  60559. */
  60560. }, {
  60561. key: "iPortalList",
  60562. value: function iPortalList() {
  60563. return this.request("GET", this.serviceUrl + '/icloud/web/nodes/portal.json');
  60564. }
  60565. /**
  60566. * @function IManager.prototype.startNodes
  60567. * @param {Array.<string>} ids - 需要启动节点的 ID 数组。e.g:['1']。
  60568. * @description 启动节点。
  60569. * @returns {Promise} Promise 对象。
  60570. */
  60571. }, {
  60572. key: "startNodes",
  60573. value: function startNodes(ids) {
  60574. return this.request("POST", this.serviceUrl + '/icloud/web/nodes/started.json', ids);
  60575. }
  60576. /**
  60577. * @function IManager.prototype.stopNodes
  60578. * @param {Array.<string>} ids - 需要停止节点的 ID 数组。e.g:['1']。
  60579. * @description 停止节点。
  60580. * @returns {Promise} Promise 对象。
  60581. */
  60582. }, {
  60583. key: "stopNodes",
  60584. value: function stopNodes(ids) {
  60585. return this.request("POST", this.serviceUrl + '/icloud/web/nodes/stopped.json', ids);
  60586. }
  60587. }]);
  60588. return IManager;
  60589. }(IManagerServiceBase);
  60590. ;// CONCATENATED MODULE: ./src/common/iManager/index.js
  60591. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  60592. * This program are made available under the terms of the Apache License, Version 2.0
  60593. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  60594. ;// CONCATENATED MODULE: ./src/common/iPortal/iPortalServiceBase.js
  60595. function iPortalServiceBase_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  60596. function iPortalServiceBase_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  60597. function iPortalServiceBase_createClass(Constructor, protoProps, staticProps) { if (protoProps) iPortalServiceBase_defineProperties(Constructor.prototype, protoProps); if (staticProps) iPortalServiceBase_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  60598. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  60599. * This program are made available under the terms of the Apache License, Version 2.0
  60600. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  60601. /**
  60602. * @class IPortalServiceBase
  60603. * @aliasclass iPortalServiceBase
  60604. * @deprecatedclass SuperMap.iPortalServiceBase
  60605. * @classdesc iPortal 服务基类(有权限限制的类需要实现此类)。
  60606. * @category iPortal/Online Core
  60607. * @param {string} url - 服务地址。
  60608. * @param {Object} options - 可选参数。
  60609. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  60610. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  60611. * @param {Object} [options.headers] - 请求头。
  60612. * @usage
  60613. */
  60614. var IPortalServiceBase = /*#__PURE__*/function () {
  60615. function IPortalServiceBase(url, options) {
  60616. iPortalServiceBase_classCallCheck(this, IPortalServiceBase);
  60617. options = options || {};
  60618. this.serviceUrl = url;
  60619. this.CLASS_NAME = "SuperMap.iPortalServiceBase";
  60620. this.withCredentials = options.withCredentials || false;
  60621. this.crossOrigin = options.crossOrigin;
  60622. this.headers = options.headers;
  60623. }
  60624. /**
  60625. * @function IPortalServiceBase.prototype.request
  60626. * @description 子类统一通过该方法发送请求。
  60627. * @param {string} [method='GET'] - 请求类型。
  60628. * @param {string} url - 服务地址。
  60629. * @param {Object} param - 请求参数。
  60630. * @param {Object} [requestOptions] - fetch 请求配置项。
  60631. * @returns {Promise} 返回包含请求结果的 Promise 对象。
  60632. */
  60633. iPortalServiceBase_createClass(IPortalServiceBase, [{
  60634. key: "request",
  60635. value: function request(method, url, param) {
  60636. var requestOptions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {
  60637. headers: this.headers,
  60638. crossOrigin: this.crossOrigin,
  60639. withCredentials: this.withCredentials
  60640. };
  60641. url = SecurityManager.appendCredential(url);
  60642. return FetchRequest.commit(method, url, param, requestOptions).then(function (response) {
  60643. return response.json();
  60644. });
  60645. }
  60646. }]);
  60647. return IPortalServiceBase;
  60648. }();
  60649. ;// CONCATENATED MODULE: ./src/common/iPortal/iPortalQueryParam.js
  60650. function iPortalQueryParam_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  60651. function iPortalQueryParam_createClass(Constructor, protoProps, staticProps) { if (protoProps) iPortalQueryParam_defineProperties(Constructor.prototype, protoProps); if (staticProps) iPortalQueryParam_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  60652. function iPortalQueryParam_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  60653. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  60654. * This program are made available under the terms of the Apache License, Version 2.0
  60655. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  60656. /**
  60657. * @class IPortalQueryParam
  60658. * @aliasclass iPortalQueryParam
  60659. * @deprecatedclass SuperMap.iPortalQueryParam
  60660. * @classdesc iPortal 资源查询参数。
  60661. * @version 10.0.1
  60662. * @category iPortal/Online Resources ResourcesQuery
  60663. * @param {Object} params - 可选参数。
  60664. * @param {ResourceType} [params.resourceType] - 资源类型。
  60665. * @param {number} [params.pageSize] - 分页中每页大小。
  60666. * @param {number} [params.currentPage] - 分页页码。
  60667. * @param {OrderBy} [params.orderBy] - 排序字段。
  60668. * @param {OrderType} [params.orderType] - 根据升序还是降序过滤。
  60669. * @param {SearchType} [params.searchType] - 根据查询的范围进行过滤。
  60670. * @param {Array} [params.tags] - 标签。
  60671. * @param {Array} [params.dirIds] - 目录 ID。
  60672. * @param {Array} [params.resourceSubTypes] - 根据资源的子类型进行过滤。
  60673. * @param {AggregationTypes} [params.aggregationTypes] - 聚合查询的类型。
  60674. * @param {string} [params.text] - 搜索的关键词。
  60675. * @param {Array} [params.groupIds] - 根据群组进行过滤。
  60676. * @param {Array} [params.departmentIds] - 根据部门进行过滤。
  60677. * @usage
  60678. */
  60679. var IPortalQueryParam = /*#__PURE__*/iPortalQueryParam_createClass(function IPortalQueryParam(params) {
  60680. iPortalQueryParam_classCallCheck(this, IPortalQueryParam);
  60681. params = params || {};
  60682. this.resourceType = ""; // 空为全部 MAP SERVICE SCENE DATA INSIGHTS_WORKSPACE MAP_DASHBOARD
  60683. this.pageSize = 12; // 每页多少条
  60684. this.currentPage = 1; // 第几页
  60685. this.orderBy = "UPDATETIME"; // UPDATETIME HEATLEVEL
  60686. this.orderType = "DESC"; // DESC ASC
  60687. this.searchType = "PUBLIC"; // PUBLIC SHARETOME_RES MYDEPARTMENT_RES MYGROUP_RES MY_RES
  60688. this.tags = []; // 标签
  60689. this.dirIds = []; // 类别
  60690. this.resourceSubTypes = []; // 类型
  60691. this.aggregationTypes = []; // TAG TYPE SUBTYPE
  60692. this.text = ""; // 搜索字段
  60693. this.groupIds = []; // 群组Id过滤
  60694. this.departmentIds = []; // 部门Id过滤
  60695. Util_Util.extend(this, params);
  60696. });
  60697. ;// CONCATENATED MODULE: ./src/common/iPortal/iPortalQueryResult.js
  60698. function iPortalQueryResult_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  60699. function iPortalQueryResult_createClass(Constructor, protoProps, staticProps) { if (protoProps) iPortalQueryResult_defineProperties(Constructor.prototype, protoProps); if (staticProps) iPortalQueryResult_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  60700. function iPortalQueryResult_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  60701. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  60702. * This program are made available under the terms of the Apache License, Version 2.0
  60703. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  60704. /**
  60705. * @class IPortalQueryResult
  60706. * @aliasclass iPortalQueryResult
  60707. * @deprecatedclass SuperMap.iPortalQueryResult
  60708. * @classdesc iPortal 资源结果集封装类。
  60709. * @version 10.0.1
  60710. * @category iPortal/Online Resources ResourcesQuery
  60711. * @param {Object} queryResult - 可选参数。
  60712. * @param {Array} [queryResult.content] - 页面内容。
  60713. * @param {number} [queryResult.total] - 总记录数。
  60714. * @param {number} [queryResult.currentPage] - 当前第几页。
  60715. * @param {number} [queryResult.pageSize] - 每页大小。
  60716. * @param {Object} [queryResult.aggregations] - 聚合查询的结果。
  60717. * @usage
  60718. */
  60719. var IPortalQueryResult = /*#__PURE__*/iPortalQueryResult_createClass(function IPortalQueryResult(queryResult) {
  60720. iPortalQueryResult_classCallCheck(this, IPortalQueryResult);
  60721. queryResult = queryResult || {};
  60722. this.content = [];
  60723. this.total = 0;
  60724. this.currentPage = 1;
  60725. this.pageSize = 12;
  60726. this.aggregations = null;
  60727. Util_Util.extend(this, queryResult);
  60728. });
  60729. ;// CONCATENATED MODULE: ./src/common/iPortal/iPortalResource.js
  60730. function iPortalResource_typeof(obj) { "@babel/helpers - typeof"; return iPortalResource_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, iPortalResource_typeof(obj); }
  60731. function iPortalResource_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  60732. function iPortalResource_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  60733. function iPortalResource_createClass(Constructor, protoProps, staticProps) { if (protoProps) iPortalResource_defineProperties(Constructor.prototype, protoProps); if (staticProps) iPortalResource_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  60734. function iPortalResource_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) iPortalResource_setPrototypeOf(subClass, superClass); }
  60735. function iPortalResource_setPrototypeOf(o, p) { iPortalResource_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return iPortalResource_setPrototypeOf(o, p); }
  60736. function iPortalResource_createSuper(Derived) { var hasNativeReflectConstruct = iPortalResource_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = iPortalResource_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = iPortalResource_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return iPortalResource_possibleConstructorReturn(this, result); }; }
  60737. function iPortalResource_possibleConstructorReturn(self, call) { if (call && (iPortalResource_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return iPortalResource_assertThisInitialized(self); }
  60738. function iPortalResource_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  60739. function iPortalResource_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  60740. function iPortalResource_getPrototypeOf(o) { iPortalResource_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return iPortalResource_getPrototypeOf(o); }
  60741. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  60742. * This program are made available under the terms of the Apache License, Version 2.0
  60743. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  60744. /**
  60745. * @class IPortalResource
  60746. * @aliasclass iPortalResource
  60747. * @deprecatedclass SuperMap.iPortalResource
  60748. * @classdesc iPortal 资源详情类。
  60749. * @version 10.0.1
  60750. * @category iPortal/Online Resources
  60751. * @param {string} portalUrl - 服务地址。
  60752. * @param {Object} resourceInfo - 可选参数。
  60753. * @param {Array} [resourceInfo.authorizeSetting] - 资源的授权信息。
  60754. * @param {string} [resourceInfo.bounds] - 资源的坐标范围。
  60755. * @param {string} [resourceInfo.bounds4326] - 资源的坐标范围,转换为EPSG 4326坐标系统后的地理范围。
  60756. * @param {string} [resourceInfo.checkStatus] - 资源的审核状态,可以是:空,SUCCESSFUL,UNCHECKED,FAILED。
  60757. * @param {Date} [resourceInfo.createTime] - 资源的创建时间。
  60758. * @param {string} [resourceInfo.description] - 资源描述。
  60759. * @param {number} [resourceInfo.dirId] - 资源所在的门户目录的ID。
  60760. * @param {number} [resourceInfo.epsgCode] - 门户资源基于的坐标系的EPSG值。
  60761. * @param {number} [resourceInfo.heatLevel] - 记录资源的访问量或下载量。
  60762. * @param {string} [resourceInfo.id] - 资源存储到ElasticSearch中的文档ID。
  60763. * @param {string} [resourceInfo.name] - 资源名称。
  60764. * @param {number} [resourceInfo.personalDirId] - 资源所在的个人目录的ID。
  60765. * @param {number} [resourceInfo.resourceId] - 资源表(maps,services等)里的ID。
  60766. * @param {string} [resourceInfo.resourceSubType] - 某类资源的具体子类型。
  60767. * @param {ResourceType} [resourceInfo.resourceType] - 资源类型。
  60768. * @param {number} [resourceInfo.serviceRootUrlId] - 批量注册服务时,服务根地址的ID。
  60769. * @param {Array} [resourceInfo.tags] - 资源的标签。
  60770. * @param {string} [resourceInfo.thumbnail] - 资源的缩略图。
  60771. * @param {Date} [resourceInfo.updateTime] - 资源的更新时间。
  60772. * @param {string} [resourceInfo.userName] - 搜索的关键词。
  60773. * @param {Object} [resourceInfo.sourceJSON] - 提供了门户项目返回的所有信息。
  60774. * @extends {IPortalServiceBase}
  60775. * @usage
  60776. */
  60777. var IPortalResource = /*#__PURE__*/function (_IPortalServiceBase) {
  60778. iPortalResource_inherits(IPortalResource, _IPortalServiceBase);
  60779. var _super = iPortalResource_createSuper(IPortalResource);
  60780. function IPortalResource(portalUrl, resourceInfo) {
  60781. var _this;
  60782. iPortalResource_classCallCheck(this, IPortalResource);
  60783. _this = _super.call(this, portalUrl);
  60784. resourceInfo = resourceInfo || {};
  60785. _this.authorizeSetting = [];
  60786. _this.bounds = "";
  60787. _this.bounds4326 = "";
  60788. _this.checkStatus = "";
  60789. _this.createTime = 0;
  60790. _this.description = null;
  60791. _this.dirId = null;
  60792. _this.epsgCode = 0;
  60793. _this.heatLevel = 0;
  60794. _this.id = 0;
  60795. _this.name = "";
  60796. _this.personalDirId = null;
  60797. _this.resourceId = 0;
  60798. _this.resourceSubType = null;
  60799. _this.resourceType = null;
  60800. _this.serviceRootUrlId = null;
  60801. _this.tags = null;
  60802. _this.thumbnail = null;
  60803. _this.updateTime = 0;
  60804. _this.userName = "";
  60805. _this.sourceJSON = {}; //返回门户资源详细信息
  60806. Util_Util.extend(iPortalResource_assertThisInitialized(_this), resourceInfo); // INSIGHTS_WORKSPACE MAP_DASHBOARD
  60807. _this.resourceUrl = portalUrl + "/web/" + _this.resourceType.replace("_", "").toLowerCase() + "s/" + _this.resourceId;
  60808. if (_this.withCredentials) {
  60809. _this.resourceUrl = portalUrl + "/web/mycontent/" + _this.resourceType.replace("_", "").toLowerCase() + "s/" + _this.resourceId;
  60810. }
  60811. // if (this.id) {
  60812. // this.mapUrl = mapUrl + "/" + this.id;
  60813. // }
  60814. return _this;
  60815. }
  60816. /**
  60817. * @function IPortalResource.prototype.load
  60818. * @description 加载资源信息。
  60819. * @returns {Promise} 返回 Promise 对象。如果成功,Promise 没有返回值,请求返回结果自动填充到该类的属性中;如果失败,Promise 返回值包含错误信息。
  60820. */
  60821. iPortalResource_createClass(IPortalResource, [{
  60822. key: "load",
  60823. value: function load() {
  60824. var me = this;
  60825. return me.request("GET", me.resourceUrl + ".json").then(function (resourceInfo) {
  60826. if (resourceInfo.error) {
  60827. return resourceInfo;
  60828. }
  60829. me.sourceJSON = resourceInfo;
  60830. });
  60831. }
  60832. /**
  60833. * @function IPortalResource.prototype.update
  60834. * @description 更新资源属性信息。
  60835. * @returns {Promise} 返回包含更新操作状态的 Promise 对象。
  60836. */
  60837. }, {
  60838. key: "update",
  60839. value: function update() {
  60840. var resourceName = this.resourceType.replace("_", "").toLowerCase();
  60841. var options = {
  60842. headers: {
  60843. 'Content-Type': 'application/x-www-form-urlencoded'
  60844. }
  60845. };
  60846. if (resourceName === 'data') {
  60847. this.resourceUrl = this.resourceUrl + "/attributes.json";
  60848. }
  60849. var entity = JSON.stringify(this.sourceJSON);
  60850. //对服务资源进行编辑时,请求体内容只留关键字字段(目前如果是全部字段 更新返回成功 但其实没有真正的更新)
  60851. if (resourceName === 'service') {
  60852. var serviceInfo = {
  60853. authorizeSetting: this.sourceJSON.authorizeSetting,
  60854. metadata: this.sourceJSON.metadata,
  60855. tags: this.sourceJSON.tags,
  60856. thumbnail: this.sourceJSON.thumbnail,
  60857. tokenRefreshUrl: this.sourceJSON.tokenRefreshUrl
  60858. };
  60859. entity = JSON.stringify(serviceInfo);
  60860. }
  60861. return this.request("PUT", this.resourceUrl, entity, options);
  60862. }
  60863. }]);
  60864. return IPortalResource;
  60865. }(IPortalServiceBase);
  60866. ;// CONCATENATED MODULE: ./src/common/iPortal/iPortalShareParam.js
  60867. function iPortalShareParam_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  60868. function iPortalShareParam_createClass(Constructor, protoProps, staticProps) { if (protoProps) iPortalShareParam_defineProperties(Constructor.prototype, protoProps); if (staticProps) iPortalShareParam_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  60869. function iPortalShareParam_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  60870. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  60871. * This program are made available under the terms of the Apache License, Version 2.0
  60872. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  60873. /**
  60874. * @class IPortalShareParam
  60875. * @aliasclass iPortalShareParam
  60876. * @deprecatedclass SuperMap.iPortalShareParam
  60877. * @classdesc iPortal 资源共享参数。
  60878. * @version 10.0.1
  60879. * @category iPortal/Online Resources ResourcesShare
  60880. * @param {Object} params - 可选参数。
  60881. * @param {ResourceType} [params.resourceType] - 资源类型。
  60882. * @param {Array} [params.ids] - 资源的ID数组。
  60883. * @param {IPortalShareEntity} [params.entities] - 资源的实体共享参数。
  60884. * @usage
  60885. */
  60886. var IPortalShareParam = /*#__PURE__*/iPortalShareParam_createClass(function IPortalShareParam(params) {
  60887. iPortalShareParam_classCallCheck(this, IPortalShareParam);
  60888. params = params || {};
  60889. this.ids = [];
  60890. this.entities = [];
  60891. this.resourceType = ""; // MAP SERVICE SCENE DATA INSIGHTS_WORKSPACE MAP_DASHBOARD
  60892. Util_Util.extend(this, params);
  60893. });
  60894. ;// CONCATENATED MODULE: ./src/common/iPortal/iPortal.js
  60895. function iPortal_typeof(obj) { "@babel/helpers - typeof"; return iPortal_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, iPortal_typeof(obj); }
  60896. function iPortal_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  60897. function iPortal_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  60898. function iPortal_createClass(Constructor, protoProps, staticProps) { if (protoProps) iPortal_defineProperties(Constructor.prototype, protoProps); if (staticProps) iPortal_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  60899. function iPortal_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) iPortal_setPrototypeOf(subClass, superClass); }
  60900. function iPortal_setPrototypeOf(o, p) { iPortal_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return iPortal_setPrototypeOf(o, p); }
  60901. function iPortal_createSuper(Derived) { var hasNativeReflectConstruct = iPortal_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = iPortal_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = iPortal_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return iPortal_possibleConstructorReturn(this, result); }; }
  60902. function iPortal_possibleConstructorReturn(self, call) { if (call && (iPortal_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return iPortal_assertThisInitialized(self); }
  60903. function iPortal_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  60904. function iPortal_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  60905. function iPortal_getPrototypeOf(o) { iPortal_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return iPortal_getPrototypeOf(o); }
  60906. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  60907. * This program are made available under the terms of the Apache License, Version 2.0
  60908. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  60909. /**
  60910. * @class IPortal
  60911. * @aliasclass iPortal
  60912. * @deprecatedclass SuperMap.iPortal
  60913. * @classdesc 对接 SuperMap iPortal 基础服务。
  60914. * @category iPortal/Online Resources
  60915. * @modulecategory Services
  60916. * @extends {IPortalServiceBase}
  60917. * @param {string} iportalUrl - 服务地址。
  60918. * @param {Object} options - 可选参数。
  60919. * @param {boolean} [options.withCredentials] - 请求是否携带 cookie。
  60920. * @usage
  60921. */
  60922. var IPortal = /*#__PURE__*/function (_IPortalServiceBase) {
  60923. iPortal_inherits(IPortal, _IPortalServiceBase);
  60924. var _super = iPortal_createSuper(IPortal);
  60925. function IPortal(iportalUrl, options) {
  60926. var _this;
  60927. iPortal_classCallCheck(this, IPortal);
  60928. _this = _super.call(this, iportalUrl, options);
  60929. _this.iportalUrl = iportalUrl;
  60930. options = options || {};
  60931. _this.withCredentials = options.withCredentials || false;
  60932. return _this;
  60933. }
  60934. /**
  60935. * @function IPortal.prototype.load
  60936. * @description 加载页面。
  60937. * @returns {Promise} 包含 iportal web 资源信息的 Promise 对象。
  60938. */
  60939. iPortal_createClass(IPortal, [{
  60940. key: "load",
  60941. value: function load() {
  60942. return FetchRequest.get(this.iportalUrl + "/web");
  60943. }
  60944. /**
  60945. * @function IPortal.prototype.queryResources
  60946. * @description 查询资源。
  60947. * @version 10.0.1
  60948. * @param {IPortalQueryParam} queryParams - 查询参数。
  60949. * @returns {Promise} 包含所有资源结果的 Promise 对象。
  60950. */
  60951. }, {
  60952. key: "queryResources",
  60953. value: function queryResources(queryParams) {
  60954. if (!(queryParams instanceof IPortalQueryParam)) {
  60955. return new Promise(function (resolve) {
  60956. resolve("queryParams is not instanceof iPortalQueryParam !");
  60957. });
  60958. }
  60959. var me = this;
  60960. var resourceUrl = this.iportalUrl + "/gateway/catalog/resource/search.json";
  60961. queryParams.t = new Date().getTime();
  60962. return this.request("GET", resourceUrl, queryParams).then(function (result) {
  60963. var content = [];
  60964. (result.content || []).forEach(function (item) {
  60965. content.push(new IPortalResource(me.iportalUrl, item));
  60966. });
  60967. var queryResult = new IPortalQueryResult();
  60968. queryResult.content = content;
  60969. queryResult.total = result.total;
  60970. queryResult.currentPage = result.currentPage;
  60971. queryResult.pageSize = result.pageSize;
  60972. queryResult.aggregations = result.aggregations;
  60973. return queryResult;
  60974. });
  60975. }
  60976. /**
  60977. * @function IPortal.prototype.updateResourcesShareSetting
  60978. * @description 更新共享设置。
  60979. * @version 10.0.1
  60980. * @param {IPortalShareParam} shareParams - 共享的参数。
  60981. * @returns {Promise} 包含共享资源结果的 Promise 对象。
  60982. */
  60983. }, {
  60984. key: "updateResourcesShareSetting",
  60985. value: function updateResourcesShareSetting(shareParams) {
  60986. if (!(shareParams instanceof IPortalShareParam)) {
  60987. return new Promise(function (resolve) {
  60988. resolve("shareParams is not instanceof iPortalShareParam !");
  60989. });
  60990. }
  60991. var resourceUrlName = shareParams.resourceType.replace("_", "").toLowerCase() + "s";
  60992. if (resourceUrlName === "datas") {
  60993. resourceUrlName = "mycontent/" + resourceUrlName;
  60994. }
  60995. var cloneShareParams = {
  60996. ids: shareParams.ids,
  60997. entities: shareParams.entities
  60998. };
  60999. var shareUrl = this.iportalUrl + "/web/" + resourceUrlName + "/sharesetting.json";
  61000. return this.request("PUT", shareUrl, JSON.stringify(cloneShareParams)).then(function (result) {
  61001. return result;
  61002. });
  61003. }
  61004. }]);
  61005. return IPortal;
  61006. }(IPortalServiceBase);
  61007. ;// CONCATENATED MODULE: ./src/common/iPortal/iPortalShareEntity.js
  61008. function iPortalShareEntity_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  61009. function iPortalShareEntity_createClass(Constructor, protoProps, staticProps) { if (protoProps) iPortalShareEntity_defineProperties(Constructor.prototype, protoProps); if (staticProps) iPortalShareEntity_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  61010. function iPortalShareEntity_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  61011. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  61012. * This program are made available under the terms of the Apache License, Version 2.0
  61013. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  61014. /**
  61015. * @class IPortalShareEntity
  61016. * @aliasclass iPortalShareEntity
  61017. * @deprecatedclass SuperMap.iPortalShareEntity
  61018. * @classdesc iPortal 资源共享实体参数。
  61019. * @version 10.0.1
  61020. * @category iPortal/Online Resources ResourcesShare
  61021. * @param {Object} shareEntity - 可选参数。
  61022. * @param {PermissionType} [shareEntity.permissionType] - 权限类型。
  61023. * @param {EntityType} [shareEntity.entityType] - 实体类型。
  61024. * @param {string} [shareEntity.entityName] - 实体 Name。对应的 USER(用户)、ROLE(角色)、GROUP(用户组)、IPORTALGROUP(群组)的名称。
  61025. * @param {number} [shareEntity.entityId] - 实体的 ID。用于群组的授权。
  61026. * @usage
  61027. */
  61028. var IPortalShareEntity = /*#__PURE__*/iPortalShareEntity_createClass(function IPortalShareEntity(shareEntity) {
  61029. iPortalShareEntity_classCallCheck(this, IPortalShareEntity);
  61030. shareEntity = shareEntity || {};
  61031. this.permissionType = ""; // SEARCH READ READWRITE DOWNLOAD
  61032. this.entityType = ""; // USER DEPARTMENT IPORTALGROUP
  61033. this.entityName = "GUEST"; // GUEST or 具体用户 name
  61034. this.entityId = null;
  61035. Util_Util.extend(this, shareEntity);
  61036. });
  61037. ;// CONCATENATED MODULE: ./src/common/iPortal/iPortalAddResourceParam.js
  61038. function iPortalAddResourceParam_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  61039. function iPortalAddResourceParam_createClass(Constructor, protoProps, staticProps) { if (protoProps) iPortalAddResourceParam_defineProperties(Constructor.prototype, protoProps); if (staticProps) iPortalAddResourceParam_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  61040. function iPortalAddResourceParam_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  61041. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  61042. * This program are made available under the terms of the Apache License, Version 2.0
  61043. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  61044. /**
  61045. * @class IPortalAddResourceParam
  61046. * @aliasclass iPortalAddResourceParam
  61047. * @deprecatedclass SuperMap.iPortalAddResourceParam
  61048. * @classdesc iPortal 添加资源参数。
  61049. * @version 10.0.1
  61050. * @category iPortal/Online Resources ResourcesShare
  61051. * @param {Object} params - 可选参数。
  61052. * @param {string} [params.rootUrl] - 服务地址。
  61053. * @param {Array} [params.tags] - 标签。
  61054. * @param {IPortalShareEntity} [params.entities] - 资源的实体共享参数。
  61055. * @usage
  61056. */
  61057. var IPortalAddResourceParam = /*#__PURE__*/iPortalAddResourceParam_createClass(function IPortalAddResourceParam(params) {
  61058. iPortalAddResourceParam_classCallCheck(this, IPortalAddResourceParam);
  61059. params = params || {};
  61060. this.rootUrl = "";
  61061. this.tags = [];
  61062. this.entities = [];
  61063. Util_Util.extend(this, params);
  61064. });
  61065. ;// CONCATENATED MODULE: ./src/common/iPortal/iPortalRegisterServiceParam.js
  61066. function iPortalRegisterServiceParam_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  61067. function iPortalRegisterServiceParam_createClass(Constructor, protoProps, staticProps) { if (protoProps) iPortalRegisterServiceParam_defineProperties(Constructor.prototype, protoProps); if (staticProps) iPortalRegisterServiceParam_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  61068. function iPortalRegisterServiceParam_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  61069. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  61070. * This program are made available under the terms of the Apache License, Version 2.0
  61071. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  61072. /**
  61073. * @class IPortalRegisterServiceParam
  61074. * @aliasclass iPortalRegisterServiceParam
  61075. * @deprecatedclass SuperMap.iPortalRegisterServiceParam
  61076. * @classdesc iPortal 注册服务参数。
  61077. * @version 10.0.1
  61078. * @category iPortal/Online Resources Data
  61079. * @param {Object} params - 可选参数。
  61080. * @param {string} [params.type] - 服务类型。
  61081. * @param {Array} [params.tags] - 服务标签。
  61082. * @param {IPortalShareEntity} [params.entities] - 资源的实体共享参数。
  61083. * @param {Object} [params.metadata] - 服务元信息。
  61084. * @param {Array} [params.addedMapNames] - 地图服务列表。
  61085. * @param {Array} [params.addedSceneNames] - 场景服务列表。
  61086. * @usage
  61087. */
  61088. var IPortalRegisterServiceParam = /*#__PURE__*/iPortalRegisterServiceParam_createClass(function IPortalRegisterServiceParam(params) {
  61089. iPortalRegisterServiceParam_classCallCheck(this, IPortalRegisterServiceParam);
  61090. params = params || {};
  61091. this.type = ""; // SUPERMAP_REST ARCGIS_REST WMS WFS WCS WPS WMTS OTHERS
  61092. this.tags = [];
  61093. this.entities = [];
  61094. this.metadata = {};
  61095. this.addedMapNames = [];
  61096. this.addedSceneNames = [];
  61097. Util_Util.extend(this, params);
  61098. });
  61099. ;// CONCATENATED MODULE: ./src/common/iPortal/iPortalAddDataParam.js
  61100. function iPortalAddDataParam_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  61101. function iPortalAddDataParam_createClass(Constructor, protoProps, staticProps) { if (protoProps) iPortalAddDataParam_defineProperties(Constructor.prototype, protoProps); if (staticProps) iPortalAddDataParam_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  61102. function iPortalAddDataParam_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  61103. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  61104. * This program are made available under the terms of the Apache License, Version 2.0
  61105. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  61106. /**
  61107. * @class IPortalAddDataParam
  61108. * @aliasclass iPortalAddDataParam
  61109. * @deprecatedclass SuperMap.iPortalAddDataParam
  61110. * @classdesc iPortal 上传/注册数据所需的参数。
  61111. * @version 10.0.1
  61112. * @category iPortal/Online Resources Data
  61113. * @param {Object} params - 参数。
  61114. * @param {string} params.fileName - 文件名称。
  61115. * @param {DataItemType} params.type - 数据类型。
  61116. * @param {Array} [params.tags] - 数据的标签。
  61117. * @param {IPortalDataMetaInfoParam} [params.dataMetaInfo] - 数据元信息。
  61118. * @usage
  61119. */
  61120. var IPortalAddDataParam = /*#__PURE__*/iPortalAddDataParam_createClass(function IPortalAddDataParam(params) {
  61121. iPortalAddDataParam_classCallCheck(this, IPortalAddDataParam);
  61122. params = params || {};
  61123. this.fileName = "";
  61124. this.type = "";
  61125. this.tags = [];
  61126. this.dataMetaInfo = {};
  61127. Util_Util.extend(this, params);
  61128. });
  61129. ;// CONCATENATED MODULE: ./src/common/iPortal/iPortalDataMetaInfoParam.js
  61130. function iPortalDataMetaInfoParam_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  61131. function iPortalDataMetaInfoParam_createClass(Constructor, protoProps, staticProps) { if (protoProps) iPortalDataMetaInfoParam_defineProperties(Constructor.prototype, protoProps); if (staticProps) iPortalDataMetaInfoParam_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  61132. function iPortalDataMetaInfoParam_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  61133. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  61134. * This program are made available under the terms of the Apache License, Version 2.0
  61135. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  61136. /**
  61137. * @class IPortalDataMetaInfoParam
  61138. * @aliasclass iPortalDataMetaInfoParam
  61139. * @deprecatedclass SuperMap.iPortalDataMetaInfoParam
  61140. * @classdesc iPortal 上传数据/注册数据元信息所需的参数。
  61141. * @version 10.0.1
  61142. * @category iPortal/Online Resources Data
  61143. * @param {Object} params - 参数。
  61144. * @param {string} params.xField - X 坐标字段。
  61145. * @param {string} params.yField - Y 坐标字段。
  61146. * @param {number} params.xIndex - x所在列(关系型存储下CSV或EXCEL数据时必填)。
  61147. * @param {number} params.yIndex - y所在列(关系型存储下CSV或EXCEL数据时必填)。
  61148. * @param {Array.<string>} [params.fieldTypes] - 设置字段类型(关系型存储下CSV或EXCEL数据时可选填)。默认类型为:WTEXT。该参数按照CSV文件字段顺序从左到右依次设置,其中默认字段类型可省略不设置。例如,CSV文件中有10个字段,如果只需设定第1,2,4个字段,可设置为['a','b',,'c']。
  61149. * @param {string} params.separator - 分隔符(关系型存储下CSV数据时必填)。
  61150. * @param {boolean} params.firstRowIsHead - 是否带表头(关系型存储下CSV数据时必填)。
  61151. * @param {boolean} params.url - HDFS注册目录地址。
  61152. * @param {IPortalDataStoreInfoParam} params.dataStoreInfo - 注册数据时的数据存储信息。
  61153. * @usage
  61154. */
  61155. var IPortalDataMetaInfoParam = /*#__PURE__*/iPortalDataMetaInfoParam_createClass(function IPortalDataMetaInfoParam(params) {
  61156. iPortalDataMetaInfoParam_classCallCheck(this, IPortalDataMetaInfoParam);
  61157. params = params || {};
  61158. this.xField = "";
  61159. this.yField = "";
  61160. this.fileEncoding = "UTF-8";
  61161. this.xIndex = 1;
  61162. this.yIndex = 1;
  61163. this.fieldTypes = [];
  61164. this.separator = "";
  61165. this.firstRowIsHead = true;
  61166. this.url = "";
  61167. this.dataStoreInfo = {};
  61168. Util_Util.extend(this, params);
  61169. });
  61170. ;// CONCATENATED MODULE: ./src/common/iPortal/iPortalDataStoreInfoParam.js
  61171. function iPortalDataStoreInfoParam_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  61172. function iPortalDataStoreInfoParam_createClass(Constructor, protoProps, staticProps) { if (protoProps) iPortalDataStoreInfoParam_defineProperties(Constructor.prototype, protoProps); if (staticProps) iPortalDataStoreInfoParam_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  61173. function iPortalDataStoreInfoParam_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  61174. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  61175. * This program are made available under the terms of the Apache License, Version 2.0
  61176. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  61177. /**
  61178. * @class IPortalDataStoreInfoParam
  61179. * @aliasclass iPortalDataStoreInfoParam
  61180. * @deprecatedclass SuperMap.iPortalDataStoreInfoParam
  61181. * @classdesc iPortal 注册一个HBASE HDFS数据存储类。
  61182. * @version 10.0.1
  61183. * @category iPortal/Online Resources Data
  61184. * @param {Object} params - 参数。
  61185. * @param {string} params.type - 大数据文件共享类型和空间数据库类型,包括大数据文件共享HDFS 目录(HDFS)和空间数据库HBASE。
  61186. * @param {string} params.url - HDFS数据存储目录地址。
  61187. * @param {IPortalDataConnectionInfoParam} [params.connectionInfo] - HBASE空间数据库服务的连接信息。
  61188. * @usage
  61189. */
  61190. var IPortalDataStoreInfoParam = /*#__PURE__*/iPortalDataStoreInfoParam_createClass(function IPortalDataStoreInfoParam(params) {
  61191. iPortalDataStoreInfoParam_classCallCheck(this, IPortalDataStoreInfoParam);
  61192. params = params || {};
  61193. this.type = "";
  61194. this.url = "";
  61195. this.connectionInfo = {};
  61196. Util_Util.extend(this, params);
  61197. });
  61198. ;// CONCATENATED MODULE: ./src/common/iPortal/iPortalDataConnectionInfoParam.js
  61199. function iPortalDataConnectionInfoParam_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  61200. function iPortalDataConnectionInfoParam_createClass(Constructor, protoProps, staticProps) { if (protoProps) iPortalDataConnectionInfoParam_defineProperties(Constructor.prototype, protoProps); if (staticProps) iPortalDataConnectionInfoParam_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  61201. function iPortalDataConnectionInfoParam_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  61202. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  61203. * This program are made available under the terms of the Apache License, Version 2.0
  61204. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  61205. /**
  61206. * @class IPortalDataConnectionInfoParam
  61207. * @aliasclass iPortalDataConnectionInfoParam
  61208. * @deprecatedclass SuperMap.iPortalDataConnectionInfoParam
  61209. * @classdesc iPortal HBASE数据源连接信息类。
  61210. * @version 10.0.1
  61211. * @category iPortal/Online Resources Data
  61212. * @param {Object} params - 参数。
  61213. * @param {string} params.dataBase - 数据源连接的数据库名。
  61214. * @param {string} params.server - 服务地址。
  61215. * @usage
  61216. */
  61217. var IPortalDataConnectionInfoParam = /*#__PURE__*/iPortalDataConnectionInfoParam_createClass(function IPortalDataConnectionInfoParam(params) {
  61218. iPortalDataConnectionInfoParam_classCallCheck(this, IPortalDataConnectionInfoParam);
  61219. params = params || {};
  61220. this.dataBase = "";
  61221. this.server = "";
  61222. Util_Util.extend(this, params);
  61223. });
  61224. ;// CONCATENATED MODULE: ./src/common/iPortal/iPortalUser.js
  61225. function iPortalUser_typeof(obj) { "@babel/helpers - typeof"; return iPortalUser_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, iPortalUser_typeof(obj); }
  61226. function iPortalUser_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  61227. function iPortalUser_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  61228. function iPortalUser_createClass(Constructor, protoProps, staticProps) { if (protoProps) iPortalUser_defineProperties(Constructor.prototype, protoProps); if (staticProps) iPortalUser_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  61229. function iPortalUser_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) iPortalUser_setPrototypeOf(subClass, superClass); }
  61230. function iPortalUser_setPrototypeOf(o, p) { iPortalUser_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return iPortalUser_setPrototypeOf(o, p); }
  61231. function iPortalUser_createSuper(Derived) { var hasNativeReflectConstruct = iPortalUser_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = iPortalUser_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = iPortalUser_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return iPortalUser_possibleConstructorReturn(this, result); }; }
  61232. function iPortalUser_possibleConstructorReturn(self, call) { if (call && (iPortalUser_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return iPortalUser_assertThisInitialized(self); }
  61233. function iPortalUser_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  61234. function iPortalUser_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  61235. function iPortalUser_getPrototypeOf(o) { iPortalUser_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return iPortalUser_getPrototypeOf(o); }
  61236. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  61237. * This program are made available under the terms of the Apache License, Version 2.0
  61238. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  61239. /**
  61240. * @class IPortalUser
  61241. * @aliasclass iPortalUser
  61242. * @deprecatedclass SuperMap.iPortalUser
  61243. * @classdesc iPortal 门户中用户信息的封装类。用于管理用户资源,包括可删除,添加资源。
  61244. * @version 10.0.1
  61245. * @category iPortal/Online Resources
  61246. * @param {string} iportalUrl - 服务地址。
  61247. * @extends {IPortalServiceBase}
  61248. * @usage
  61249. */
  61250. var IPortalUser = /*#__PURE__*/function (_IPortalServiceBase) {
  61251. iPortalUser_inherits(IPortalUser, _IPortalServiceBase);
  61252. var _super = iPortalUser_createSuper(IPortalUser);
  61253. function IPortalUser(iportalUrl) {
  61254. var _this;
  61255. iPortalUser_classCallCheck(this, IPortalUser);
  61256. _this = _super.call(this, iportalUrl);
  61257. _this.iportalUrl = iportalUrl;
  61258. return _this;
  61259. }
  61260. /**
  61261. * @function IPortalUser.prototype.deleteResources
  61262. * @description 删除资源。
  61263. * @param {Object} params - 删除资源所需的参数对象:{ids,resourceType}。
  61264. * @returns {Promise} 返回包含删除操作状态的 Promise 对象。
  61265. */
  61266. iPortalUser_createClass(IPortalUser, [{
  61267. key: "deleteResources",
  61268. value: function deleteResources(params) {
  61269. var resourceName = params.resourceType.replace("_", "").toLowerCase();
  61270. var deleteResourceUrl = this.iportalUrl + "/web/" + resourceName + "s.json?ids=" + encodeURI(JSON.stringify(params.ids));
  61271. if (resourceName === 'data') {
  61272. deleteResourceUrl = this.iportalUrl + "/web/mycontent/datas/delete.json";
  61273. return this.request("POST", deleteResourceUrl, JSON.stringify(params.ids));
  61274. }
  61275. return this.request("DELETE", deleteResourceUrl);
  61276. }
  61277. /**
  61278. * @function IPortalUser.prototype.addMap
  61279. * @description 添加地图。
  61280. * @version 10.1.0
  61281. * @param {IPortalAddResourceParam} addMapParams - 添加地图的参数。
  61282. * @returns {Promise} 返回包含添加地图结果的 Promise 对象。
  61283. */
  61284. }, {
  61285. key: "addMap",
  61286. value: function addMap(addMapParams) {
  61287. if (!(addMapParams instanceof IPortalAddResourceParam)) {
  61288. return this.getErrMsgPromise("addMapParams is not instanceof IPortalAddResourceParam !");
  61289. }
  61290. var cloneAddMapParams = {
  61291. rootUrl: addMapParams.rootUrl,
  61292. tags: addMapParams.tags,
  61293. authorizeSetting: addMapParams.entities
  61294. };
  61295. var addMapUrl = this.iportalUrl + "/web/maps/batchaddmaps.json";
  61296. return this.request("POST", addMapUrl, JSON.stringify(cloneAddMapParams)).then(function (result) {
  61297. return result;
  61298. });
  61299. }
  61300. /**
  61301. * @function IPortalUser.prototype.addScene
  61302. * @description 添加场景。
  61303. * @version 10.1.0
  61304. * @param {IPortalAddResourceParam} addSceneParams - 添加场景的参数。
  61305. * @returns {Promise} 返回包含添加场景结果的 Promise 对象。
  61306. */
  61307. }, {
  61308. key: "addScene",
  61309. value: function addScene(addSceneParams) {
  61310. if (!(addSceneParams instanceof IPortalAddResourceParam)) {
  61311. return this.getErrMsgPromise("addSceneParams is not instanceof IPortalAddResourceParam !");
  61312. }
  61313. var cloneAddSceneParams = {
  61314. rootUrl: addSceneParams.rootUrl,
  61315. tags: addSceneParams.tags,
  61316. authorizeSetting: addSceneParams.entities
  61317. };
  61318. var addSceneUrl = this.iportalUrl + "/web/scenes/batchaddscenes.json";
  61319. return this.request("POST", addSceneUrl, JSON.stringify(cloneAddSceneParams)).then(function (result) {
  61320. return result;
  61321. });
  61322. }
  61323. /**
  61324. * @function IPortalUser.prototype.registerService
  61325. * @description 注册服务。
  61326. * @version 10.1.0
  61327. * @param {IPortalRegisterServiceParam} registerParams - 注册服务的参数。
  61328. * @returns {Promise} 返回包含注册服务结果的 Promise 对象。
  61329. */
  61330. }, {
  61331. key: "registerService",
  61332. value: function registerService(registerParams) {
  61333. if (!(registerParams instanceof IPortalRegisterServiceParam)) {
  61334. return this.getErrMsgPromise("registerParams is not instanceof IPortalRegisterServiceParam !");
  61335. }
  61336. var cloneRegisterParams = {
  61337. type: registerParams.type,
  61338. tags: registerParams.tags,
  61339. authorizeSetting: registerParams.entities,
  61340. metadata: registerParams.metadata,
  61341. addedMapNames: registerParams.addedMapNames,
  61342. addedSceneNames: registerParams.addedSceneNames
  61343. };
  61344. var registerUrl = this.iportalUrl + "/web/services.json";
  61345. return this.request("POST", registerUrl, JSON.stringify(cloneRegisterParams)).then(function (result) {
  61346. return result;
  61347. });
  61348. }
  61349. /**
  61350. * @function IPortalUser.prototype.getErrMsgPromise
  61351. * @description 获取包含错误信息的Promise对象。
  61352. * @version 10.1.0
  61353. * @param {string} errMsg - 传入的错误信息。
  61354. * @returns {Promise} 返回包含错误信息的 Promise 对象。
  61355. */
  61356. }, {
  61357. key: "getErrMsgPromise",
  61358. value: function getErrMsgPromise(errMsg) {
  61359. return new Promise(function (resolve) {
  61360. resolve(errMsg);
  61361. });
  61362. }
  61363. /**
  61364. * @function IPortalUser.prototype.uploadDataRequest
  61365. * @description 上传数据。
  61366. * @version 10.1.0
  61367. * @param {number} id - 上传数据的资源ID。
  61368. * @param {Object} formData - 请求体为文本数据流。
  61369. * @returns {Promise} 返回包含上传数据操作的 Promise 对象。
  61370. */
  61371. }, {
  61372. key: "uploadDataRequest",
  61373. value: function uploadDataRequest(id, formData) {
  61374. var uploadDataUrl = this.iportalUrl + "/web/mycontent/datas/" + id + "/upload.json";
  61375. return this.request("POST", uploadDataUrl, formData);
  61376. }
  61377. /**
  61378. * @function IPortalUser.prototype.addData
  61379. * @description 上传/注册数据。
  61380. * @version 10.1.0
  61381. * @param {IPortalAddDataParam} params - 上传/注册数据所需的参数。
  61382. * @param {Object} [formData] - 请求体为文本数据流(上传数据时传入)。
  61383. * @returns {Promise} 返回上传/注册数据的 Promise 对象。
  61384. */
  61385. }, {
  61386. key: "addData",
  61387. value: function addData(params, formData) {
  61388. var _this2 = this;
  61389. if (!(params instanceof IPortalAddDataParam)) {
  61390. return this.getErrMsgPromise("params is not instanceof iPortalAddDataParam !");
  61391. }
  61392. var datasUrl = this.iportalUrl + "/web/mycontent/datas.json";
  61393. var entity = {
  61394. fileName: params.fileName,
  61395. tags: params.tags,
  61396. type: params.type
  61397. };
  61398. var type = params.type.toLowerCase();
  61399. var dataMetaInfo;
  61400. if (type === "excel" || type === "csv") {
  61401. if (!(params.dataMetaInfo instanceof IPortalDataMetaInfoParam)) {
  61402. return this.getErrMsgPromise("params.dataMetaInfo is not instanceof iPortalDataMetaInfoParam !");
  61403. }
  61404. dataMetaInfo = {
  61405. xField: params.dataMetaInfo.xField,
  61406. yField: params.dataMetaInfo.yField
  61407. };
  61408. if (type === 'csv') {
  61409. dataMetaInfo.fileEncoding = params.dataMetaInfo.fileEncoding;
  61410. }
  61411. entity.coordType = "WGS84";
  61412. entity.dataMetaInfo = dataMetaInfo;
  61413. } else if (type === "hdfs" || type === "hbase") {
  61414. if (!(params.dataMetaInfo instanceof IPortalDataMetaInfoParam)) {
  61415. return this.getErrMsgPromise("params.dataMetaInfo is not instanceof iPortalDataMetaInfoParam !");
  61416. }
  61417. if (!(params.dataMetaInfo.dataStoreInfo instanceof IPortalDataStoreInfoParam)) {
  61418. return this.getErrMsgPromise("params.dataMetaInfo.dataStoreInfo is not instanceof iPortalDataStoreInfoParam !");
  61419. }
  61420. var dataStoreInfo = {
  61421. type: params.dataMetaInfo.dataStoreInfo.type
  61422. };
  61423. switch (type) {
  61424. case "hdfs":
  61425. dataStoreInfo.url = params.dataMetaInfo.dataStoreInfo.url;
  61426. dataMetaInfo = {
  61427. url: params.dataMetaInfo.url,
  61428. dataStoreInfo: dataStoreInfo
  61429. };
  61430. break;
  61431. case "hbase":
  61432. if (!(params.dataMetaInfo.dataStoreInfo.connectionInfo instanceof IPortalDataConnectionInfoParam)) {
  61433. return this.getErrMsgPromise("params.dataMetaInfo.dataStoreInfo.connectionInfo is not instanceof iPortalDataConnectionInfoParam !");
  61434. }
  61435. dataStoreInfo.connectionInfo = {
  61436. dataBase: params.dataMetaInfo.dataStoreInfo.connectionInfo.dataBase,
  61437. server: params.dataMetaInfo.dataStoreInfo.connectionInfo.server,
  61438. engineType: 'HBASE'
  61439. };
  61440. dataStoreInfo.datastoreType = "SPATIAL"; //该字段SPATIAL表示HBASE注册
  61441. dataMetaInfo = {
  61442. dataStoreInfo: dataStoreInfo
  61443. };
  61444. break;
  61445. }
  61446. entity.dataMetaInfo = dataMetaInfo;
  61447. }
  61448. return this.request("POST", datasUrl, JSON.stringify(entity)).then(function (res) {
  61449. if (type === "hdfs" || type === "hbase") {
  61450. return res;
  61451. } else {
  61452. if (res.childID) {
  61453. return _this2.uploadDataRequest(res.childID, formData);
  61454. } else {
  61455. return res.customResult;
  61456. }
  61457. }
  61458. });
  61459. }
  61460. /**
  61461. * @function IPortalUser.prototype.publishOrUnpublish
  61462. * @description 发布/取消发布。
  61463. * @version 10.1.0
  61464. * @param {Object} options - 发布/取消发布数据服务所需的参数。
  61465. * @param {Object} options.dataId - 数据项ID。
  61466. * @param {Object} options.serviceType - 发布的服务类型,目前支持发布的服务类型包括:RESTDATA, RESTMAP, RESTREALSPACE, RESTSPATIALANALYST。
  61467. * @param {Object} [options.dataServiceId] - 发布的服务 ID。
  61468. * @param {boolean} forPublish - 是否取消发布。
  61469. * @returns {Promise} 返回发布/取消发布数据服务的 Promise 对象。
  61470. */
  61471. }, {
  61472. key: "publishOrUnpublish",
  61473. value: function publishOrUnpublish(option, forPublish) {
  61474. if (!option.dataId || !option.serviceType) {
  61475. return this.getErrMsgPromise("option.dataID and option.serviceType are Required!");
  61476. }
  61477. var dataId = option.dataId;
  61478. var dataServiceId = option.dataServiceId;
  61479. var serviceType = option.serviceType;
  61480. var publishUrl = this.iportalUrl + "/web/mycontent/datas/" + dataId + "/publishstatus.json?serviceType=" + serviceType;
  61481. if (dataServiceId) {
  61482. publishUrl += "&dataServiceId=" + dataServiceId;
  61483. }
  61484. return this.request("PUT", publishUrl, JSON.stringify(forPublish)).then(function (res) {
  61485. // 发起服务状态查询
  61486. if (forPublish) {
  61487. // 发布服务的结果异步处理
  61488. // var publishStateUrl = this.iportalUrl + "web/mycontent/datas/" + dataId + "/publishstatus.rjson";
  61489. if (!dataServiceId) {
  61490. // 发布服务时会回传serviceIDs,发布服务之前serviceIDs为空
  61491. dataServiceId = res.customResult;
  61492. }
  61493. return dataServiceId;
  61494. } else {
  61495. // 取消发布的结果同步处理
  61496. return res;
  61497. }
  61498. });
  61499. }
  61500. /**
  61501. * @function IPortalUser.prototype.getDataPublishedStatus
  61502. * @description 查询服务状态,发起服务状态查询。
  61503. * @version 10.1.0
  61504. * @param {number} dataId - 查询服务状态的数据项ID。
  61505. * @param {string} dataServiceId - 发布的服务ID。
  61506. * @returns {Promise} 返回查询服务状态的 Promise 对象。
  61507. */
  61508. }, {
  61509. key: "getDataPublishedStatus",
  61510. value: function getDataPublishedStatus(dataId, dataServiceId) {
  61511. var publishStateUrl = this.iportalUrl + "/web/mycontent/datas/" + dataId + "/publishstatus.json?dataServiceId=" + dataServiceId + "&forPublish=true";
  61512. return this.request("GET", publishStateUrl);
  61513. }
  61514. /**
  61515. * @function IPortalUser.prototype.unPublishedDataService
  61516. * @description 取消发布。
  61517. * @version 10.1.0
  61518. * @param {Object} options - 取消发布服务具体参数。
  61519. * @param {Object} options.dataId - 数据项ID。
  61520. * @param {Object} options.serviceType - 发布的服务类型,目前支持发布的服务类型包括:RESTDATA, RESTMAP, RESTREALSPACE, RESTSPATIALANALYST。
  61521. * @param {Object} [options.dataServiceId] - 发布的服务 ID。
  61522. * @returns {Promise} 返回取消发布数据服务的 Promise 对象。
  61523. */
  61524. }, {
  61525. key: "unPublishDataService",
  61526. value: function unPublishDataService(option) {
  61527. return this.publishOrUnpublish(option, false);
  61528. }
  61529. /**
  61530. * @function IPortalUser.prototype.publishedDataService
  61531. * @description 发布数据服务。
  61532. * @version 10.1.0
  61533. * @param {Object} options - 发布数据服务具体参数。
  61534. * @param {Object} options.dataId - 数据项ID。
  61535. * @param {Object} options.serviceType - 发布的服务类型,目前支持发布的服务类型包括:RESTDATA, RESTMAP, RESTREALSPACE, RESTSPATIALANALYST。
  61536. * @param {Object} [options.dataServiceId] - 发布的服务 ID。
  61537. * @returns {Promise} 返回发布数据服务的 Promise 对象。
  61538. */
  61539. }, {
  61540. key: "publishDataService",
  61541. value: function publishDataService(option) {
  61542. return this.publishOrUnpublish(option, true);
  61543. }
  61544. }]);
  61545. return IPortalUser;
  61546. }(IPortalServiceBase);
  61547. ;// CONCATENATED MODULE: ./src/common/iPortal/index.js
  61548. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  61549. * This program are made available under the terms of the Apache License, Version 2.0
  61550. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  61551. ;// CONCATENATED MODULE: ./src/common/iServer/AggregationParameter.js
  61552. function AggregationParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  61553. function AggregationParameter_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  61554. function AggregationParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) AggregationParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) AggregationParameter_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  61555. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  61556. * This program are made available under the terms of the Apache License, Version 2.0
  61557. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  61558. /**
  61559. * @class AggregationParameter
  61560. * @deprecatedclass SuperMap.AggregationParameter
  61561. * @classdesc 聚合查询参数设置,该参数仅支持数据来源 Elasticsearch 服务的数据服务。
  61562. * @category iServer Data FeatureResults
  61563. * @param {Object} options - 参数。
  61564. * @param {string} options.aggName - 聚合名称。
  61565. * @param {string} options.aggFieldName - 聚合字段。
  61566. * @usage
  61567. */
  61568. var AggregationParameter = /*#__PURE__*/function () {
  61569. function AggregationParameter(options) {
  61570. AggregationParameter_classCallCheck(this, AggregationParameter);
  61571. /**
  61572. * @member {string} AggregationParameter.prototype.aggName
  61573. * @description 聚合名称。
  61574. */
  61575. this.aggName = null;
  61576. /**
  61577. * @member {string} AggregationParameter.prototype.aggFieldName
  61578. * @description 聚合字段。
  61579. */
  61580. this.aggFieldName = null;
  61581. this.CLASS_NAME = 'SuperMap.AggregationParameter';
  61582. Util_Util.extend(this, options);
  61583. }
  61584. AggregationParameter_createClass(AggregationParameter, [{
  61585. key: "destroy",
  61586. value: function destroy() {
  61587. var me = this;
  61588. me.aggName = null;
  61589. me.aggFieldName = null;
  61590. me.aggType = null;
  61591. }
  61592. }]);
  61593. return AggregationParameter;
  61594. }();
  61595. ;// CONCATENATED MODULE: ./src/common/iServer/BucketAggParameter.js
  61596. function BucketAggParameter_typeof(obj) { "@babel/helpers - typeof"; return BucketAggParameter_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, BucketAggParameter_typeof(obj); }
  61597. function BucketAggParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  61598. function BucketAggParameter_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  61599. function BucketAggParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) BucketAggParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) BucketAggParameter_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  61600. function BucketAggParameter_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) BucketAggParameter_setPrototypeOf(subClass, superClass); }
  61601. function BucketAggParameter_setPrototypeOf(o, p) { BucketAggParameter_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return BucketAggParameter_setPrototypeOf(o, p); }
  61602. function BucketAggParameter_createSuper(Derived) { var hasNativeReflectConstruct = BucketAggParameter_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = BucketAggParameter_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = BucketAggParameter_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return BucketAggParameter_possibleConstructorReturn(this, result); }; }
  61603. function BucketAggParameter_possibleConstructorReturn(self, call) { if (call && (BucketAggParameter_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return BucketAggParameter_assertThisInitialized(self); }
  61604. function BucketAggParameter_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  61605. function BucketAggParameter_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  61606. function BucketAggParameter_getPrototypeOf(o) { BucketAggParameter_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return BucketAggParameter_getPrototypeOf(o); }
  61607. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  61608. * This program are made available under the terms of the Apache License, Version 2.0
  61609. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  61610. /**
  61611. * @class BucketAggParameter
  61612. * @deprecatedclass SuperMap.BucketAggParameter
  61613. * @classdesc 子聚合类查询参数设置,该参数仅支持数据来源 Elasticsearch 服务的Supermap iServer的rest数据服务。
  61614. * @category iServer Data FeatureResults
  61615. * @param {Object} options - 参数。
  61616. * @param {Array.<MetricsAggParameter>} options.subAggs - 子聚合类集合。
  61617. * @extends {AggregationParameter}
  61618. * @usage
  61619. */
  61620. var BucketAggParameter = /*#__PURE__*/function (_AggregationParameter) {
  61621. BucketAggParameter_inherits(BucketAggParameter, _AggregationParameter);
  61622. var _super = BucketAggParameter_createSuper(BucketAggParameter);
  61623. function BucketAggParameter(options) {
  61624. var _this;
  61625. BucketAggParameter_classCallCheck(this, BucketAggParameter);
  61626. _this = _super.call(this);
  61627. /**
  61628. * @member {Array.<MetricsAggParameter>} BucketAggParameter.prototype.subAggs
  61629. * @description 子聚合类集合。
  61630. */
  61631. _this.subAggs = null;
  61632. _this.aggType = null;
  61633. _this.CLASS_NAME = 'SuperMap.BucketAggParameter';
  61634. Util_Util.extend(BucketAggParameter_assertThisInitialized(_this), options);
  61635. return _this;
  61636. }
  61637. BucketAggParameter_createClass(BucketAggParameter, [{
  61638. key: "destroy",
  61639. value: function destroy() {
  61640. var me = this;
  61641. if (me.subAggs) {
  61642. me.subAggs = null;
  61643. }
  61644. }
  61645. }]);
  61646. return BucketAggParameter;
  61647. }(AggregationParameter);
  61648. ;// CONCATENATED MODULE: ./src/common/iServer/MetricsAggParameter.js
  61649. function MetricsAggParameter_typeof(obj) { "@babel/helpers - typeof"; return MetricsAggParameter_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, MetricsAggParameter_typeof(obj); }
  61650. function MetricsAggParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  61651. function MetricsAggParameter_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  61652. function MetricsAggParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) MetricsAggParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) MetricsAggParameter_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  61653. function MetricsAggParameter_get() { if (typeof Reflect !== "undefined" && Reflect.get) { MetricsAggParameter_get = Reflect.get.bind(); } else { MetricsAggParameter_get = function _get(target, property, receiver) { var base = MetricsAggParameter_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return MetricsAggParameter_get.apply(this, arguments); }
  61654. function MetricsAggParameter_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = MetricsAggParameter_getPrototypeOf(object); if (object === null) break; } return object; }
  61655. function MetricsAggParameter_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) MetricsAggParameter_setPrototypeOf(subClass, superClass); }
  61656. function MetricsAggParameter_setPrototypeOf(o, p) { MetricsAggParameter_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return MetricsAggParameter_setPrototypeOf(o, p); }
  61657. function MetricsAggParameter_createSuper(Derived) { var hasNativeReflectConstruct = MetricsAggParameter_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = MetricsAggParameter_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = MetricsAggParameter_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return MetricsAggParameter_possibleConstructorReturn(this, result); }; }
  61658. function MetricsAggParameter_possibleConstructorReturn(self, call) { if (call && (MetricsAggParameter_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return MetricsAggParameter_assertThisInitialized(self); }
  61659. function MetricsAggParameter_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  61660. function MetricsAggParameter_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  61661. function MetricsAggParameter_getPrototypeOf(o) { MetricsAggParameter_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return MetricsAggParameter_getPrototypeOf(o); }
  61662. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  61663. * This program are made available under the terms of the Apache License, Version 2.0
  61664. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  61665. /**
  61666. * @class MetricsAggParameter
  61667. * @deprecatedclass SuperMap.MetricsAggParameter
  61668. * @classdesc 指标聚合查询参数类,该参数仅支持数据来源 Elasticsearch 服务的Supermap iServer的rest数据服务。
  61669. * @category iServer Data FeatureResults
  61670. * @param {Object} options - 可选参数。
  61671. * @param {MetricsAggType} [options.aggType = 'avg'] - 聚合类型。
  61672. * @extends {AggregationParameter}
  61673. * @usage
  61674. */
  61675. var MetricsAggParameter = /*#__PURE__*/function (_AggregationParameter) {
  61676. MetricsAggParameter_inherits(MetricsAggParameter, _AggregationParameter);
  61677. var _super = MetricsAggParameter_createSuper(MetricsAggParameter);
  61678. function MetricsAggParameter(option) {
  61679. var _this;
  61680. MetricsAggParameter_classCallCheck(this, MetricsAggParameter);
  61681. _this = _super.call(this);
  61682. /**
  61683. * @member {MetricsAggType} [MetricsAggParameter.prototype.aggType=MetricsAggType.AVG]
  61684. * @description 指标聚合类型。
  61685. */
  61686. _this.aggType = MetricsAggType.AVG;
  61687. Util_Util.extend(MetricsAggParameter_assertThisInitialized(_this), option);
  61688. _this.CLASS_NAME = 'SuperMap.MetricsAggParameter';
  61689. return _this;
  61690. }
  61691. MetricsAggParameter_createClass(MetricsAggParameter, [{
  61692. key: "destroy",
  61693. value: function destroy() {
  61694. MetricsAggParameter_get(MetricsAggParameter_getPrototypeOf(MetricsAggParameter.prototype), "destroy", this).call(this);
  61695. var me = this;
  61696. me.aggType = null;
  61697. }
  61698. }]);
  61699. return MetricsAggParameter;
  61700. }(AggregationParameter);
  61701. ;// CONCATENATED MODULE: ./src/common/iServer/ClipParameter.js
  61702. function ClipParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  61703. function ClipParameter_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  61704. function ClipParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) ClipParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) ClipParameter_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  61705. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  61706. * This program are made available under the terms of the Apache License, Version 2.0
  61707. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  61708. /**
  61709. * @class ClipParameter
  61710. * @deprecatedclass SuperMap.ClipParameter
  61711. * @category iServer SpatialAnalyst InterpolationAnalyst
  61712. * @classdesc 用于裁剪的参数。优先使用用户指定的裁剪区域多边形进行裁剪,也可以通过指定数据源和数据集名,从而使用指定数据集的边界多边形进行裁剪。
  61713. * @param {Object} options - 可选参数。
  61714. * @param {string} [options.clipDatasetName] - 裁剪的数据集名。
  61715. * @param {string} [options.clipDatasourceName] - 裁剪的数据集所在数据源的名字。
  61716. * @param {GeometryPolygon|L.Polygon|L.GeoJSON|ol.geom.Polygon|ol.format.GeoJSON|GeoJSONObject} [options.clipRegion] - 用户指定的裁剪区域。
  61717. * @param {boolean} [options.isClipInRegion=true] - 是否对裁剪区内的数据集进行裁剪。
  61718. * @param {boolean} [options.isExactClip=true] - 是否使用精确裁剪。
  61719. * @usage
  61720. */
  61721. var ClipParameter = /*#__PURE__*/function () {
  61722. function ClipParameter(options) {
  61723. ClipParameter_classCallCheck(this, ClipParameter);
  61724. /**
  61725. * @member {string} ClipParameter.prototype.clipDatasetName
  61726. * @description 用于裁剪的数据集名,clipDatasetName 与 clipRegion 必须设置一个。
  61727. */
  61728. this.clipDatasetName = null;
  61729. /**
  61730. * @member {string} ClipParameter.prototype.clipDatasourceName
  61731. * @description 用于裁剪的数据集所在数据源的名字。当 clipRegion 不设置时起作用。
  61732. */
  61733. this.clipDatasourceName = null;
  61734. /**
  61735. * @member {GeometryPolygon|L.Polygon|L.GeoJSON|ol.geom.Polygon|ol.format.GeoJSON|GeoJSONObject} ClipParameter.prototype.clipRegion
  61736. * @description 用户指定的裁剪区域,优先使用,clipDatasetName 与 clipRegion 必须设置一个。
  61737. */
  61738. this.clipRegion = null;
  61739. /**
  61740. * @member {boolean} [ClipParameter.prototype.isClipInRegion=true]
  61741. * @description 是否对裁剪区内的数据集进行裁剪。若为 true,则对裁剪区域内的结果进行裁剪,若为 false,则对裁剪区域外的结果进行裁剪。
  61742. */
  61743. this.isClipInRegion = true;
  61744. /**
  61745. * @member {boolean} [ClipParameter.prototype.isExactClip=true]
  61746. * @description 是否使用精确裁剪。
  61747. */
  61748. this.isExactClip = null;
  61749. if (options) {
  61750. Util_Util.extend(this, options);
  61751. }
  61752. this.CLASS_NAME = "SuperMap.ClipParameter";
  61753. }
  61754. /**
  61755. * @function ClipParameter.prototype.destroy
  61756. * @description 释放资源,将引用资源的属性置空。
  61757. */
  61758. ClipParameter_createClass(ClipParameter, [{
  61759. key: "destroy",
  61760. value: function destroy() {
  61761. var me = this;
  61762. me.clipDatasetName = null;
  61763. me.clipDatasourceName = null;
  61764. me.clipRegion = null;
  61765. me.isClipInRegion = null;
  61766. me.isExactClip = null;
  61767. }
  61768. /**
  61769. * @function ClipParameter.prototype.toJSON
  61770. * @description 将 ClipParameter 对象转化为 JSON 字符串。
  61771. * @returns {string} 返回转换后的 JSON 字符串。
  61772. */
  61773. }, {
  61774. key: "toJSON",
  61775. value: function toJSON() {
  61776. return Util_Util.toJSON({
  61777. isClipInRegion: this.isClipInRegion,
  61778. clipDatasetName: this.clipDatasetName,
  61779. clipDatasourceName: this.clipDatasourceName,
  61780. isExactClip: this.isExactClip,
  61781. clipRegion: ServerGeometry.fromGeometry(this.clipRegion)
  61782. });
  61783. }
  61784. }]);
  61785. return ClipParameter;
  61786. }();
  61787. ;// CONCATENATED MODULE: ./src/common/iServer/GeoHashGridAggParameter.js
  61788. function GeoHashGridAggParameter_typeof(obj) { "@babel/helpers - typeof"; return GeoHashGridAggParameter_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, GeoHashGridAggParameter_typeof(obj); }
  61789. function GeoHashGridAggParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  61790. function GeoHashGridAggParameter_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  61791. function GeoHashGridAggParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) GeoHashGridAggParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) GeoHashGridAggParameter_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  61792. function GeoHashGridAggParameter_get() { if (typeof Reflect !== "undefined" && Reflect.get) { GeoHashGridAggParameter_get = Reflect.get.bind(); } else { GeoHashGridAggParameter_get = function _get(target, property, receiver) { var base = GeoHashGridAggParameter_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return GeoHashGridAggParameter_get.apply(this, arguments); }
  61793. function GeoHashGridAggParameter_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GeoHashGridAggParameter_getPrototypeOf(object); if (object === null) break; } return object; }
  61794. function GeoHashGridAggParameter_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) GeoHashGridAggParameter_setPrototypeOf(subClass, superClass); }
  61795. function GeoHashGridAggParameter_setPrototypeOf(o, p) { GeoHashGridAggParameter_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GeoHashGridAggParameter_setPrototypeOf(o, p); }
  61796. function GeoHashGridAggParameter_createSuper(Derived) { var hasNativeReflectConstruct = GeoHashGridAggParameter_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = GeoHashGridAggParameter_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = GeoHashGridAggParameter_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return GeoHashGridAggParameter_possibleConstructorReturn(this, result); }; }
  61797. function GeoHashGridAggParameter_possibleConstructorReturn(self, call) { if (call && (GeoHashGridAggParameter_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return GeoHashGridAggParameter_assertThisInitialized(self); }
  61798. function GeoHashGridAggParameter_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  61799. function GeoHashGridAggParameter_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  61800. function GeoHashGridAggParameter_getPrototypeOf(o) { GeoHashGridAggParameter_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GeoHashGridAggParameter_getPrototypeOf(o); }
  61801. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  61802. * This program are made available under the terms of the Apache License, Version 2.0
  61803. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  61804. /**
  61805. * @class GeoHashGridAggParameter
  61806. * @deprecatedclass SuperMap.GeoHashGridAggParameter
  61807. * @classdesc 格网聚合查询参数类,该参数仅支持数据来源 Elasticsearch 服务的Supermap iServer的rest数据服务。
  61808. * @category iServer Data FeatureResults
  61809. * @param {Object} options - 可选参数。
  61810. * @param {number} [options.precision=5] - 精度。
  61811. * @extends {BucketAggParameter}
  61812. * @usage
  61813. */
  61814. var GeoHashGridAggParameter = /*#__PURE__*/function (_BucketAggParameter) {
  61815. GeoHashGridAggParameter_inherits(GeoHashGridAggParameter, _BucketAggParameter);
  61816. var _super = GeoHashGridAggParameter_createSuper(GeoHashGridAggParameter);
  61817. function GeoHashGridAggParameter(options) {
  61818. var _this;
  61819. GeoHashGridAggParameter_classCallCheck(this, GeoHashGridAggParameter);
  61820. _this = _super.call(this);
  61821. /**
  61822. * @member {number} [GeoHashGridAggParameter.prototype.precision=5]
  61823. * @description 网格中数字的精度。
  61824. */
  61825. _this.precision = 5;
  61826. Util_Util.extend(GeoHashGridAggParameter_assertThisInitialized(_this), options);
  61827. /**
  61828. * @member {BucketAggType} [GeoHashGridAggParameter.prototype.aggType=BucketAggType.GEOHASH_GRID]
  61829. * @description 格网聚合类型。
  61830. */
  61831. _this.aggType = BucketAggType.GEOHASH_GRID;
  61832. _this.CLASS_NAME = 'SuperMap.GeoHashGridAggParameter';
  61833. return _this;
  61834. }
  61835. GeoHashGridAggParameter_createClass(GeoHashGridAggParameter, [{
  61836. key: "destroy",
  61837. value: function destroy() {
  61838. GeoHashGridAggParameter_get(GeoHashGridAggParameter_getPrototypeOf(GeoHashGridAggParameter.prototype), "destroy", this).call(this);
  61839. this.aggType = null;
  61840. this.precision = null;
  61841. }
  61842. /**
  61843. * @function GeoHashGridAggParameter.toJsonParameters
  61844. * @description 将对象转为 JSON 格式。
  61845. * @param param 转换对象。
  61846. * @returns {Object}
  61847. */
  61848. }], [{
  61849. key: "toJsonParameters",
  61850. value: function toJsonParameters(param) {
  61851. var parameters = {
  61852. aggName: param.aggName,
  61853. aggFieldName: param.aggFieldName,
  61854. aggType: param.aggType,
  61855. precision: param.precision
  61856. };
  61857. return Util_Util.toJson(parameters);
  61858. }
  61859. }]);
  61860. return GeoHashGridAggParameter;
  61861. }(BucketAggParameter);
  61862. ;// CONCATENATED MODULE: ./src/common/iServer/LabelMatrixCell.js
  61863. function LabelMatrixCell_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  61864. function LabelMatrixCell_createClass(Constructor, protoProps, staticProps) { if (protoProps) LabelMatrixCell_defineProperties(Constructor.prototype, protoProps); if (staticProps) LabelMatrixCell_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  61865. function LabelMatrixCell_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  61866. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  61867. * This program are made available under the terms of the Apache License, Version 2.0
  61868. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  61869. /**
  61870. * @class LabelMatrixCell
  61871. * @deprecatedclass SuperMap.LabelMatrixCell
  61872. * @category iServer Map Theme
  61873. * @classdesc 矩阵标签元素抽象类。该类可以包含 n*n 个矩阵标签元素,矩阵标签元素的类型可以是图片,符号,标签专题图等。
  61874. * 符号类型的矩阵标签元素类、图片类型的矩阵标签元素类和专题图类型的矩阵标签元素类均继承自该类。
  61875. * @usage
  61876. */
  61877. var LabelMatrixCell = /*#__PURE__*/LabelMatrixCell_createClass(function LabelMatrixCell() {
  61878. LabelMatrixCell_classCallCheck(this, LabelMatrixCell);
  61879. this.CLASS_NAME = "LabelMatrixCell";
  61880. });
  61881. ;// CONCATENATED MODULE: ./src/common/iServer/LabelImageCell.js
  61882. function LabelImageCell_typeof(obj) { "@babel/helpers - typeof"; return LabelImageCell_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, LabelImageCell_typeof(obj); }
  61883. function LabelImageCell_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  61884. function LabelImageCell_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  61885. function LabelImageCell_createClass(Constructor, protoProps, staticProps) { if (protoProps) LabelImageCell_defineProperties(Constructor.prototype, protoProps); if (staticProps) LabelImageCell_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  61886. function LabelImageCell_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) LabelImageCell_setPrototypeOf(subClass, superClass); }
  61887. function LabelImageCell_setPrototypeOf(o, p) { LabelImageCell_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return LabelImageCell_setPrototypeOf(o, p); }
  61888. function LabelImageCell_createSuper(Derived) { var hasNativeReflectConstruct = LabelImageCell_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = LabelImageCell_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = LabelImageCell_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return LabelImageCell_possibleConstructorReturn(this, result); }; }
  61889. function LabelImageCell_possibleConstructorReturn(self, call) { if (call && (LabelImageCell_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return LabelImageCell_assertThisInitialized(self); }
  61890. function LabelImageCell_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  61891. function LabelImageCell_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  61892. function LabelImageCell_getPrototypeOf(o) { LabelImageCell_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return LabelImageCell_getPrototypeOf(o); }
  61893. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  61894. * This program are made available under the terms of the Apache License, Version 2.0
  61895. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  61896. /**
  61897. * @class LabelImageCell
  61898. * @deprecatedclass SuperMap.LabelImageCell
  61899. * @category iServer Map Theme
  61900. * @classdesc 图片类型的矩阵标签元素类。该类继承自 {@link LabelMatrixCell}类,主要对矩阵标签中的专题图类型的矩阵标签元素进行设置。
  61901. * 矩阵标签专题图是标签专题图(ThemeLabel)的一种,其中矩阵标签中的填充元素又可分为图片类型({@link LabelImageCell})、
  61902. * 符号类型({@link LabelSymbolCell})、专题图类型({@link LabelThemeCell})三种,该类是这三种类型的矩阵标签元素其中的一种,
  61903. * 用于定义符号类型的矩阵标签,如符号 ID 字段名称(符号 ID 与 SuperMap 桌面产品中点、线、面符号的 ID 对应)、大小等。
  61904. * 用户在实现矩阵标签专题图时只需将定义好的矩阵标签元素赋值予 {@link ThemeLabel#matrixCells} 属性即可。matrixCells 是一个二维数组,
  61905. * 每一维可以是任意类型的矩阵标签元素组成的数组(也可是单个标签元素组成的数组,即数组中只有一个元素)。
  61906. * @extends {LabelMatrixCell}
  61907. * @param {Object} options - 可选参数。
  61908. * @param {number} [options.height=0] - 设置图片的高度,单位为毫米。
  61909. * @param {string} [options.pathField] - 设置矩阵标签元素所使用图片的路径。
  61910. * @param {number} [options.rotation=0.0] - 图片的旋转角度。逆时针方向为正方向,单位为度,精确到0.1度。
  61911. * @param {number} [options.width=0] - 设置图片的宽度,单位为毫米。
  61912. * @param {boolean} [options.sizeFixed=false] - 是否固定图片的大小。
  61913. * @usage
  61914. */
  61915. var LabelImageCell = /*#__PURE__*/function (_LabelMatrixCell) {
  61916. LabelImageCell_inherits(LabelImageCell, _LabelMatrixCell);
  61917. var _super = LabelImageCell_createSuper(LabelImageCell);
  61918. function LabelImageCell(options) {
  61919. var _this;
  61920. LabelImageCell_classCallCheck(this, LabelImageCell);
  61921. _this = _super.call(this, options);
  61922. /**
  61923. * @member {number} LabelImageCell.prototype.height
  61924. * @description 设置图片的高度,单位为毫米。
  61925. */
  61926. _this.height = 0;
  61927. /**
  61928. * @member {string} LabelImageCell.prototype.pathField
  61929. * @description 设置矩阵标签元素所使用的图片路径对应的字段名。
  61930. */
  61931. _this.pathField = null;
  61932. /**
  61933. * @member {number} [LabelImageCell.prototype.rotation=0.0]
  61934. * @description 图片的旋转角度。逆时针方向为正方向,单位为度,精确到0.1度。
  61935. */
  61936. _this.rotation = 0.0;
  61937. /**
  61938. * @member {number} LabelImageCell.prototype.width
  61939. * @description 设置图片的宽度,单位为毫米。
  61940. */
  61941. _this.width = 0;
  61942. /**
  61943. * @member {boolean} [LabelImageCell.prototype.sizeFixed=false]
  61944. * @description 是否固定图片的大小。
  61945. */
  61946. _this.sizeFixed = false;
  61947. /**
  61948. * @member {string} LabelImageCell.prototype.type
  61949. * @description 制作矩阵专题图时是必须的。
  61950. */
  61951. _this.type = "IMAGE";
  61952. if (options) {
  61953. Util_Util.extend(LabelImageCell_assertThisInitialized(_this), options);
  61954. }
  61955. _this.CLASS_NAME = "SuperMap.LabelImageCell";
  61956. return _this;
  61957. }
  61958. /**
  61959. * @function LabelImageCell.prototype.destroy
  61960. * @description 释放资源,将引用资源的属性置空。
  61961. */
  61962. LabelImageCell_createClass(LabelImageCell, [{
  61963. key: "destroy",
  61964. value: function destroy() {
  61965. var me = this;
  61966. me.height = null;
  61967. me.pathField = null;
  61968. me.rotation = null;
  61969. me.width = null;
  61970. me.sizeFixed = null;
  61971. }
  61972. }]);
  61973. return LabelImageCell;
  61974. }(LabelMatrixCell);
  61975. ;// CONCATENATED MODULE: ./src/common/iServer/LabelSymbolCell.js
  61976. function LabelSymbolCell_typeof(obj) { "@babel/helpers - typeof"; return LabelSymbolCell_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, LabelSymbolCell_typeof(obj); }
  61977. function LabelSymbolCell_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  61978. function LabelSymbolCell_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  61979. function LabelSymbolCell_createClass(Constructor, protoProps, staticProps) { if (protoProps) LabelSymbolCell_defineProperties(Constructor.prototype, protoProps); if (staticProps) LabelSymbolCell_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  61980. function LabelSymbolCell_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) LabelSymbolCell_setPrototypeOf(subClass, superClass); }
  61981. function LabelSymbolCell_setPrototypeOf(o, p) { LabelSymbolCell_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return LabelSymbolCell_setPrototypeOf(o, p); }
  61982. function LabelSymbolCell_createSuper(Derived) { var hasNativeReflectConstruct = LabelSymbolCell_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = LabelSymbolCell_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = LabelSymbolCell_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return LabelSymbolCell_possibleConstructorReturn(this, result); }; }
  61983. function LabelSymbolCell_possibleConstructorReturn(self, call) { if (call && (LabelSymbolCell_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return LabelSymbolCell_assertThisInitialized(self); }
  61984. function LabelSymbolCell_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  61985. function LabelSymbolCell_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  61986. function LabelSymbolCell_getPrototypeOf(o) { LabelSymbolCell_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return LabelSymbolCell_getPrototypeOf(o); }
  61987. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  61988. * This program are made available under the terms of the Apache License, Version 2.0
  61989. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  61990. /**
  61991. * @class LabelSymbolCell
  61992. * @deprecatedclass SuperMap.LabelSymbolCell
  61993. * @category iServer Map Theme
  61994. * @classdesc 符号类型的矩阵标签元素类。
  61995. * 该类继承自 {@link LabelMatrixCell}类,主要对矩阵标签中的专题图类型的矩阵标签元素进行设置。
  61996. * 矩阵标签专题图是标签专题图({@link ThemeLabel})的一种,其中矩阵标签中的填充元素又可分为图片类型({@link LabelImageCell})、
  61997. * 符号类型({@link LabelSymbolCell})、专题图类型({@link LabelThemeCell})三种,该类是这三种类型的矩阵标签元素其中的一种,
  61998. * 用于定义符号类型的矩阵标签,如符号 ID 字段名称(符号 ID 与 SuperMap 桌面产品中点、线、面符号的 ID 对应)、大小等。
  61999. * 用户在实现矩阵标签专题图时只需将定义好的矩阵标签元素赋值予 {@link ThemeLabel#matrixCells} 属性即可。matrixCells 属性是一个二维数组,
  62000. * 每一维可以是任意类型的矩阵标签元素组成的数组(也可是单个标签元素组成的数组,即数组中只有一个元素)。
  62001. * @extends {LabelMatrixCell}
  62002. * @param {Object} options - 参数。
  62003. * @param {ServerStyle} options.style - 获取或设置符号样式。
  62004. * @param {string} options.symbolIDField - 符号 ID 或符号 ID 所对应的字段名称。
  62005. * @usage
  62006. */
  62007. var LabelSymbolCell = /*#__PURE__*/function (_LabelMatrixCell) {
  62008. LabelSymbolCell_inherits(LabelSymbolCell, _LabelMatrixCell);
  62009. var _super = LabelSymbolCell_createSuper(LabelSymbolCell);
  62010. function LabelSymbolCell(options) {
  62011. var _this;
  62012. LabelSymbolCell_classCallCheck(this, LabelSymbolCell);
  62013. _this = _super.call(this, options);
  62014. /**
  62015. * @member {ServerStyle} LabelSymbolCell.prototype.style
  62016. * @description 获取或设置符号样式—— {@link ServerStyle} 对象,包括符号大小({@link ServerStyle#markerSize})
  62017. * 和符号旋转({@link ServerStyle#markerAngle})角度,其中用于设置符号 ID 的属性({@link ServerStyle#markerSymbolID})在此处不起作用。
  62018. */
  62019. _this.style = new ServerStyle();
  62020. /**
  62021. * @member {string} LabelSymbolCell.prototype.symbolIDField
  62022. * @description 获取或设置符号 ID 或符号 ID 所对应的字段名称。
  62023. */
  62024. _this.symbolIDField = null;
  62025. /**
  62026. * @member {string} LabelSymbolCell.prototype.type
  62027. * @description 制作矩阵专题图时是必须的。
  62028. */
  62029. _this.type = "SYMBOL";
  62030. if (options) {
  62031. Util_Util.extend(LabelSymbolCell_assertThisInitialized(_this), options);
  62032. }
  62033. _this.CLASS_NAME = "SuperMap.LabelSymbolCell";
  62034. return _this;
  62035. }
  62036. /**
  62037. * @function LabelSymbolCell.prototype.destroy
  62038. * @description 释放资源,将引用资源的属性置空。
  62039. */
  62040. LabelSymbolCell_createClass(LabelSymbolCell, [{
  62041. key: "destroy",
  62042. value: function destroy() {
  62043. var me = this;
  62044. if (me.style) {
  62045. me.style.destroy();
  62046. me.style = null;
  62047. }
  62048. me.symbolIDField = null;
  62049. }
  62050. }]);
  62051. return LabelSymbolCell;
  62052. }(LabelMatrixCell);
  62053. ;// CONCATENATED MODULE: ./src/common/iServer/LabelThemeCell.js
  62054. function LabelThemeCell_typeof(obj) { "@babel/helpers - typeof"; return LabelThemeCell_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, LabelThemeCell_typeof(obj); }
  62055. function LabelThemeCell_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  62056. function LabelThemeCell_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  62057. function LabelThemeCell_createClass(Constructor, protoProps, staticProps) { if (protoProps) LabelThemeCell_defineProperties(Constructor.prototype, protoProps); if (staticProps) LabelThemeCell_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  62058. function LabelThemeCell_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) LabelThemeCell_setPrototypeOf(subClass, superClass); }
  62059. function LabelThemeCell_setPrototypeOf(o, p) { LabelThemeCell_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return LabelThemeCell_setPrototypeOf(o, p); }
  62060. function LabelThemeCell_createSuper(Derived) { var hasNativeReflectConstruct = LabelThemeCell_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = LabelThemeCell_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = LabelThemeCell_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return LabelThemeCell_possibleConstructorReturn(this, result); }; }
  62061. function LabelThemeCell_possibleConstructorReturn(self, call) { if (call && (LabelThemeCell_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return LabelThemeCell_assertThisInitialized(self); }
  62062. function LabelThemeCell_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  62063. function LabelThemeCell_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  62064. function LabelThemeCell_getPrototypeOf(o) { LabelThemeCell_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return LabelThemeCell_getPrototypeOf(o); }
  62065. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  62066. * This program are made available under the terms of the Apache License, Version 2.0
  62067. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  62068. /**
  62069. * @class LabelThemeCell
  62070. * @deprecatedclass SuperMap.LabelThemeCell
  62071. * @category iServer Map Theme
  62072. * @classdesc 专题图类型的矩阵标签元素类。
  62073. * 该类继承自 {@link LabelMatrixCell} 类,主要对矩阵标签中的专题图类型的矩阵标签元素进行设置。
  62074. * 矩阵标签专题图是标签专题图({@link ThemeLabel})的一种,其中矩阵标签中的填充元素又可分为图片类型({@link LabelImageCell})、
  62075. * 符号类型({@link LabelSymbolCell})、专题图类型({@link LabelThemeCell})三种,该类是这三种类型的矩阵标签元素其中的一种,
  62076. * 用于定义符号类型的矩阵标签,如符号 ID 字段名称(符号 ID 与 SuperMap 桌面产品中点、线、面符号的 ID 对应)、大小等。
  62077. * 用户在实现矩阵标签专题图时只需将定义好的矩阵标签元素赋值予 {@link ThemeLabel#matrixCells} 属性即可。matrixCells 属性是一个二维数组,
  62078. * 每一维可以是任意类型的矩阵标签元素组成的数组(也可是单个标签元素组成的数组,即数组中只有一个元素)。
  62079. * @extends {LabelMatrixCell}
  62080. * @param {Object} options -参数。
  62081. * @param {ThemeLabel} options.themeLabel - 作为矩阵标签元素的标签专题图类。
  62082. * @usage
  62083. */
  62084. var LabelThemeCell = /*#__PURE__*/function (_LabelMatrixCell) {
  62085. LabelThemeCell_inherits(LabelThemeCell, _LabelMatrixCell);
  62086. var _super = LabelThemeCell_createSuper(LabelThemeCell);
  62087. function LabelThemeCell(options) {
  62088. var _this;
  62089. LabelThemeCell_classCallCheck(this, LabelThemeCell);
  62090. _this = _super.call(this, options);
  62091. /**
  62092. * @member {ThemeLabel} LabelThemeCell.prototype.themeLabel
  62093. * @description 使用专题图对象作为矩阵标签的一个元素。
  62094. */
  62095. _this.themeLabel = new ThemeLabel();
  62096. /**
  62097. * @member {string} LabelThemeCell.prototype.type
  62098. * @description 制作矩阵专题图时是必须的。
  62099. */
  62100. _this.type = "THEME";
  62101. if (options) {
  62102. Util_Util.extend(LabelThemeCell_assertThisInitialized(_this), options);
  62103. }
  62104. _this.CLASS_NAME = " SuperMap.LabelThemeCell";
  62105. return _this;
  62106. }
  62107. /**
  62108. * @function LabelThemeCell.prototype.destroy
  62109. * @description 释放资源,将引用资源的属性置空。
  62110. */
  62111. LabelThemeCell_createClass(LabelThemeCell, [{
  62112. key: "destroy",
  62113. value: function destroy() {
  62114. var me = this;
  62115. if (me.themeLabel) {
  62116. me.themeLabel.destroy();
  62117. me.themeLabel = null;
  62118. }
  62119. }
  62120. }]);
  62121. return LabelThemeCell;
  62122. }(LabelMatrixCell);
  62123. ;// CONCATENATED MODULE: ./src/common/iServer/LayerStatus.js
  62124. function LayerStatus_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  62125. function LayerStatus_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  62126. function LayerStatus_createClass(Constructor, protoProps, staticProps) { if (protoProps) LayerStatus_defineProperties(Constructor.prototype, protoProps); if (staticProps) LayerStatus_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  62127. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  62128. * This program are made available under the terms of the Apache License, Version 2.0
  62129. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  62130. /**
  62131. * @class LayerStatus
  62132. * @deprecatedclass SuperMap.LayerStatus
  62133. * @category iServer Map TempLayersSet
  62134. * @classdesc 子图层显示参数类。该类存储了各个子图层的名字和是否可见的状态。
  62135. * @param {Object} options - 参数。
  62136. * @param {string} options.layerName - 图层名称。
  62137. * @param {boolean} [options.isVisible=true] - 图层是否可见,true 表示可见。
  62138. * @param {string} [options.displayFilter] - 图层显示 SQL 过滤条件。
  62139. * @usage
  62140. */
  62141. var LayerStatus = /*#__PURE__*/function () {
  62142. function LayerStatus(options) {
  62143. LayerStatus_classCallCheck(this, LayerStatus);
  62144. /**
  62145. * @member {string} LayerStatus.prototype.layerName
  62146. * @description 获取或设置图层名称。
  62147. */
  62148. this.layerName = null;
  62149. /**
  62150. * @member {boolean} LayerStatus.prototype.isVisible
  62151. * @description 获取或设置图层是否可见,true 表示可见。
  62152. */
  62153. this.isVisible = null;
  62154. /**
  62155. * @member {string} [LayerStatus.prototype.displayFilter]
  62156. * @description 图层显示 SQL 过滤条件,如 layerStatus.displayFilter = "smid < 10",表示仅显示 smid 值小于 10 的对象。
  62157. */
  62158. this.displayFilter = null;
  62159. /**
  62160. * @member {Object} [LayerStatus.prototype.fieldValuesDisplayFilter]
  62161. * @property {Array.<number>} values - 要过滤的值。
  62162. * @property {string} fieldName - 要过滤的字段名称只支持数字类型的字段。
  62163. * @property {string} fieldValuesDisplayMode - 目前有两个 DISPLAY/DISABLE。当为 DISPLAY 时,表示只显示以上设置的相应属性值的要素,否则表示不显示以上设置的相应属性值的要素。
  62164. */
  62165. this.fieldValuesDisplayFilter = null;
  62166. if (options) {
  62167. Util_Util.extend(this, options);
  62168. }
  62169. this.CLASS_NAME = "SuperMap.LayerStatus";
  62170. }
  62171. /**
  62172. * @function LayerStatus.prototype.destroy
  62173. * @description 释放资源,将引用资源的属性置空。
  62174. */
  62175. LayerStatus_createClass(LayerStatus, [{
  62176. key: "destroy",
  62177. value: function destroy() {
  62178. var me = this;
  62179. me.layerName = null;
  62180. me.isVisible = null;
  62181. me.displayFilter = null;
  62182. }
  62183. /**
  62184. * @function LayerStatus.prototype.toJSON
  62185. * @description 生成对应的 JSON。
  62186. * @returns {Object} 对应的 JSON。
  62187. */
  62188. }, {
  62189. key: "toJSON",
  62190. value: function toJSON() {
  62191. var json = '{';
  62192. json += '"type":"UGC",';
  62193. var v = [];
  62194. if (this.layerName) {
  62195. v.push('"name":"' + this.layerName + '"');
  62196. v.push('"visible":' + this.isVisible);
  62197. }
  62198. if (this.displayFilter) {
  62199. v.push('"displayFilter":"' + this.displayFilter + '"');
  62200. }
  62201. if (this.minScale || this.minScale == 0) {
  62202. v.push('"minScale":' + this.minScale);
  62203. }
  62204. if (this.maxScale || this.maxScale == 0) {
  62205. v.push('"maxScale":' + this.maxScale);
  62206. }
  62207. if (this.fieldValuesDisplayFilter) {
  62208. v.push('"fieldValuesDisplayFilter":' + Util_Util.toJSON(this.fieldValuesDisplayFilter));
  62209. }
  62210. json += v;
  62211. json += '}';
  62212. return json;
  62213. }
  62214. }]);
  62215. return LayerStatus;
  62216. }();
  62217. ;// CONCATENATED MODULE: ./src/common/iServer/LinkItem.js
  62218. function LinkItem_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  62219. function LinkItem_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  62220. function LinkItem_createClass(Constructor, protoProps, staticProps) { if (protoProps) LinkItem_defineProperties(Constructor.prototype, protoProps); if (staticProps) LinkItem_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  62221. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  62222. * This program are made available under the terms of the Apache License, Version 2.0
  62223. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  62224. /**
  62225. * @class LinkItem
  62226. * @deprecatedclass SuperMap.LinkItem
  62227. * @constructs LinkItem
  62228. * @category iServer Data FeatureResults
  62229. * @classdesc 关联信息类。该类用于矢量数据集与外部表的关联。外部表是另一个数据集(其中纯属性数据集中没有空间几何信息)中的 DBMS 表,
  62230. * 矢量数据集与外部表可以属于不同的数据源,但数据源类型目前只支持 SQL Server 和 Oracle 类型。使用 LinkItem 时,
  62231. * 空间数据和属性数据必须满足关联条件,即主空间数据集与外部属性表之间存在关联字段。{@link LinkItem}
  62232. * 只支持左连接,UDB、PostgreSQL 和 DB2 数据源不支持 {@link LinkItem};另外,用于建立关联关系的两个表可以不在同一个数据源下。注意:<br>
  62233. * 1.使用 {@link LinkItem} 的约束条件为:空间数据和属性数据必须有关联条件,即主空间数据集与外部属性表之间存在关联字段;<br>
  62234. * 2.使用外关联表制作专题图时,所关联的字段必须设置表名,例如,如果所关联的字段为 BaseMap_R 数据集的 SmID,就要写成 BaseMap_R.SMID。
  62235. * @param {Object} options - 参数。
  62236. * @param {DatasourceConnectionInfo} options.datasourceConnectionInfo - 关联的外部数据源信息。
  62237. * @param {Array.<string>} options.foreignKeys - 主空间数据集的外键。
  62238. * @param {string} options.foreignTable - 关联的外部属性表的名称。
  62239. * @param {Array.<string>} options.linkFields - 欲保留的外部属性表的字段。
  62240. * @param {string} options.linkFilter - 与外部属性表的连接条件。
  62241. * @param {string} options.name - 此关联信息对象的名称。
  62242. * @param {Array.<string>} options.primaryKeys - 关联的外部属性表的主键。
  62243. * @example 下面以 SQL 查询说明 linkitem 的使用方法:
  62244. * function queryBySQL() {
  62245. * // 设置关联的外部数据库信息,alias表示数据库别名
  62246. * var dc = new DatasourceConnectionInfo({
  62247. * dataBase: "RelQuery",
  62248. * server: "{ip}:{port}",
  62249. * user: "sa",
  62250. * password: "map",
  62251. * driver: "SQL Server",
  62252. * connect: true,
  62253. * OpenLinkTable: false,
  62254. * alias: "RelQuery",
  62255. * engineType: EngineType.SQLPLUS,
  62256. * readOnly: false,
  62257. * exclusive: false
  62258. * });
  62259. * // 设置关联信息
  62260. * var linkItem = new LinkItem({
  62261. * datasourceConnectionInfo: dc,
  62262. * foreignKeys: ["name"],
  62263. * foreignTable: "Pop_2011",
  62264. * linkFields: ["SmID as Pid","pop"],
  62265. * name: "link",
  62266. * primatryKeys: ["name"],
  62267. * });
  62268. * // 设置查询参数,在查询参数中添加linkItem关联条件信息
  62269. * var queryParam, queryBySQLParams, queryBySQLService;
  62270. * queryParam = new FilterParameter({
  62271. * name: "Province@RelQuery",
  62272. * fields: ["SmID","name"],
  62273. * attributeFilter: "SmID<7",
  62274. * linkItems: [linkItem]
  62275. * }),
  62276. * queryBySQLParams = new QueryBySQLParameters({
  62277. * queryParams: [queryParam]
  62278. * }),
  62279. * queryBySQLService = new QueryBySQLService(url, {
  62280. * eventListeners: {
  62281. * "processCompleted": processCompleted,
  62282. * "processFailed": processFailed
  62283. * }
  62284. * });
  62285. * queryBySQLService.processAsync(queryBySQLParams);
  62286. * }
  62287. * function processCompleted(queryEventArgs) {//todo}
  62288. * function processFailed(e) {//todo}
  62289. * @usage
  62290. */
  62291. var LinkItem = /*#__PURE__*/function () {
  62292. function LinkItem(options) {
  62293. LinkItem_classCallCheck(this, LinkItem);
  62294. /**
  62295. * @member {DatasourceConnectionInfo} LinkItem.prototype.datasourceConnectionInfo
  62296. * @description 关联的外部数据源信息。
  62297. */
  62298. this.datasourceConnectionInfo = null;
  62299. /**
  62300. * @member {Array.<string>} LinkItem.prototype.foreignKeys
  62301. * @description 主空间数据集的外键。
  62302. */
  62303. this.foreignKeys = null;
  62304. /**
  62305. * @member {string} LinkItem.prototype.foreignTable
  62306. * @description 关联的外部属性表的名称,目前仅支持 Supermap 管理的表,即另一个矢量数据集所对应的 DBMS 表。
  62307. */
  62308. this.foreignTable = null;
  62309. /**
  62310. * @member {Array.<string>} LinkItem.prototype.linkFields
  62311. * @description 欲保留的外部属性表的字段。如果不设置字段或者设置的字段在外部属性表中不存在的话则不返回任何外部属性表的属性信息。如果欲保留的外部表字段与主表字段存在同名,则还需要指定一个不存在字段名作为外部表的字段别名。
  62312. */
  62313. this.linkFields = null;
  62314. /**
  62315. * @member {string} LinkItem.prototype.linkFilter
  62316. * @description 与外部属性表的连接条件。
  62317. */
  62318. this.linkFilter = null;
  62319. /**
  62320. * @member {string} LinkItem.prototype.name
  62321. * @description 此关联信息对象的名称。
  62322. */
  62323. this.name = null;
  62324. /**
  62325. * @member {Array.<string>} LinkItem.prototype.primaryKeys
  62326. * @description 需要关联的外部属性表的主键。
  62327. */
  62328. this.primaryKeys = null;
  62329. if (options) {
  62330. Util_Util.extend(this, options);
  62331. }
  62332. this.CLASS_NAME = "SuperMap.LinkItem";
  62333. }
  62334. /**
  62335. * @function LinkItem.prototype.destroy
  62336. * @description 释放资源,将引用资源的属性置空。
  62337. */
  62338. LinkItem_createClass(LinkItem, [{
  62339. key: "destroy",
  62340. value: function destroy() {
  62341. var me = this;
  62342. if (me.datasourceConnectionInfo instanceof DatasourceConnectionInfo) {
  62343. me.datasourceConnectionInfo.destroy();
  62344. me.datasourceConnectionInfo = null;
  62345. }
  62346. me.foreignKeys = null;
  62347. me.foreignTable = null;
  62348. me.linkFields = null;
  62349. me.linkFilter = null;
  62350. me.name = null;
  62351. me.primaryKeys = null;
  62352. }
  62353. }]);
  62354. return LinkItem;
  62355. }();
  62356. ;// CONCATENATED MODULE: ./src/common/iServer/OverlapDisplayedOptions.js
  62357. function OverlapDisplayedOptions_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  62358. function OverlapDisplayedOptions_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  62359. function OverlapDisplayedOptions_createClass(Constructor, protoProps, staticProps) { if (protoProps) OverlapDisplayedOptions_defineProperties(Constructor.prototype, protoProps); if (staticProps) OverlapDisplayedOptions_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  62360. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  62361. * This program are made available under the terms of the Apache License, Version 2.0
  62362. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  62363. /**
  62364. * @class OverlapDisplayedOptions
  62365. * @deprecatedclass SuperMap.OverlapDisplayedOptions
  62366. * @category iServer Map Layer
  62367. * @classdesc 地图压盖过滤显示选项。在文本或专题图元素显示较密集的区域,文本之间或专题元素之间会发生相互压盖的现象,
  62368. * 该类可以分别控制各种类型的对象的压盖显示情况,进而很好地处理地图中各种类型对象的压盖显示问题。
  62369. * @param {Object} options - 可选参数。
  62370. * @param {boolean} [options.allowPointOverlap=true] - 点和点压盖时是否显示压盖的点对象。
  62371. * @param {boolean} [options.allowPointWithTextDisplay=true] - 标签和相应普通图层上的点是否一起过滤显示,如果过滤显示,
  62372. * 只以图层集合中对应数据集的索引最小的图层的点风格来绘制点。
  62373. * @param {boolean} [options.allowTextOverlap=false] - 文本压盖时是否显示压盖的文本对象。
  62374. * @param {boolean} [options.allowTextAndPointOverlap=true] - 文本和点压盖时是否显示压盖的文本或点对象(此属性不处理文本之间的压盖和点之间的压盖)。
  62375. * @param {boolean} [options.allowThemeGraduatedSymbolOverlap=false] - 等级符号元素压盖时是否显示压盖的等级符号元素。
  62376. * @param {boolean} [options.allowThemeGraphOverlap=false] - 统计专题图元素压盖时是否显示压盖的统计专题图元素。
  62377. * @param {number} [options.horizontalOverlappedSpaceSize=0] - 两个对象之间的横向压盖间距,单位为 0.1 毫米,跟 verticalOverlappedSpaceSize 结合使用,
  62378. * 当两个对象的横向间距小于该值,且纵向间距小于 verticalOverlappedSpaceSize 时认为压盖。
  62379. * @param {number} [options.verticalOverlappedSpaceSize=0] - 两个对象之间的纵向压盖间距,单位为 0.1 毫米,跟 horizontalOverlappedSpaceSize 结合使用,
  62380. * 当两个对象的纵向间距小于该值,且横向间距小于 horizontalOverlappedSpaceSize 时认为压盖。
  62381. * @usage
  62382. */
  62383. var OverlapDisplayedOptions = /*#__PURE__*/function () {
  62384. function OverlapDisplayedOptions(options) {
  62385. OverlapDisplayedOptions_classCallCheck(this, OverlapDisplayedOptions);
  62386. options = options || {};
  62387. /**
  62388. * @member {boolean} [OverlapDisplayedOptions.prototype.allowPointOverlap=true]
  62389. * @description 点和点压盖时是否显示压盖的点对象。
  62390. */
  62391. this.allowPointOverlap = true;
  62392. /**
  62393. * @member {boolean} [OverlapDisplayedOptions.prototype.allowPointWithTextDisplay=true]
  62394. * @description 标签和相应普通图层上的点是否一起过滤显示,如果过滤显示,
  62395. * 只以图层集合中对应数据集的索引最小的图层的点风格来绘制点。
  62396. */
  62397. this.allowPointWithTextDisplay = true;
  62398. /**
  62399. * @member {boolean} [OverlapDisplayedOptions.prototype.allowTextOverlap=false]
  62400. * @description 文本压盖时是否显示压盖的文本对象。
  62401. */
  62402. this.allowTextOverlap = false;
  62403. /**
  62404. * @member {boolean} [OverlapDisplayedOptions.prototype.allowTextAndPointOverlap=true]
  62405. * @description 文本和点压盖时是否显示压盖的文本或点对象(此属性不处理文本之间的压盖和点之间的压盖)。
  62406. */
  62407. this.allowTextAndPointOverlap = true;
  62408. /**
  62409. * @member {boolean} [OverlapDisplayedOptions.prototype.allowThemeGraduatedSymbolOverlap=false]
  62410. * @description 等级符号元素压盖时是否显示压盖的等级符号元素。
  62411. */
  62412. this.allowThemeGraduatedSymbolOverlap = false;
  62413. /**
  62414. * @member {boolean} [OverlapDisplayedOptions.prototype.allowThemeGraphOverlap=false]
  62415. * @description 统计专题图元素压盖时是否显示压盖的统计专题图元素。
  62416. */
  62417. this.allowThemeGraphOverlap = false;
  62418. /**
  62419. * @member {number} [OverlapDisplayedOptions.prototype.horizontalOverlappedSpaceSize=0]
  62420. * @description 两个对象之间的横向压盖间距,单位为0.1毫米,跟 verticalOverlappedSpaceSize 结合使用,
  62421. * 当两个对象的横向间距小于该值,且纵向间距小于 verticalOverlappedSpaceSize 时认为压盖。
  62422. */
  62423. this.horizontalOverlappedSpaceSize = 0;
  62424. /**
  62425. * @member {number} [OverlapDisplayedOptions.prototype.verticalOverlappedSpaceSize=0]
  62426. * @description 两个对象之间的纵向压盖间距,单位为0.1毫米,跟 horizontalOverlappedSpaceSize 结合使用,
  62427. * 当两个对象的纵向间距小于该值,且横向间距小于 horizontalOverlappedSpaceSize 时认为压盖。
  62428. */
  62429. this.verticalOverlappedSpaceSize = 0;
  62430. Util_Util.extend(this, options);
  62431. this.ugcLayer = new UGCLayer(options);
  62432. this.CLASS_NAME = "SuperMap.OverlapDisplayedOptions";
  62433. }
  62434. /**
  62435. * @function OverlapDisplayedOptions.prototype.destroy
  62436. * @description 释放资源,将资源的属性置空。
  62437. */
  62438. OverlapDisplayedOptions_createClass(OverlapDisplayedOptions, [{
  62439. key: "destroy",
  62440. value: function destroy() {
  62441. Util_Util.reset(this);
  62442. }
  62443. /**
  62444. * @function OverlapDisplayedOptions.prototype.fromJson
  62445. * @description 将服务端 JSON 对象转换成当前客户端对象。
  62446. * @param {Object} jsonObject - 要转换的 JSON 对象。
  62447. */
  62448. }, {
  62449. key: "fromJson",
  62450. value: function fromJson(jsonObject) {
  62451. this.ugcLayer.fromJson.apply(this, [jsonObject]);
  62452. }
  62453. /**
  62454. * @function OverlapDisplayedOptions.prototype.toServerJSONObject
  62455. * @description 转换成对应的 JSON 格式对象。
  62456. * @returns {Object} 对应的 JSON 格式对象。
  62457. */
  62458. }, {
  62459. key: "toServerJSONObject",
  62460. value: function toServerJSONObject() {
  62461. var jsonObject = this.ugcLayer.toServerJSONObject.apply(this, arguments);
  62462. return jsonObject;
  62463. }
  62464. /**
  62465. * @function OverlapDisplayedOptions.prototype.toString
  62466. * @description 转换成对应的 tileLayer 请求瓦片时 overlapDisplayedOptions 参数。
  62467. * @returns {string} 对应的 tileLayer 请求瓦片时 overlapDisplayedOptions 参数。
  62468. */
  62469. }, {
  62470. key: "toString",
  62471. value: function toString() {
  62472. var jsonObject = this.ugcLayer.toServerJSONObject.apply(this, arguments);
  62473. var str = "{";
  62474. for (var attr in jsonObject) {
  62475. if (jsonObject.hasOwnProperty(attr)) {
  62476. str += "'" + attr + "':" + jsonObject[attr] + ",";
  62477. }
  62478. }
  62479. str = str.substr(0, str.length - 1);
  62480. str += "}";
  62481. return str;
  62482. }
  62483. }]);
  62484. return OverlapDisplayedOptions;
  62485. }();
  62486. ;// CONCATENATED MODULE: ./src/common/iServer/SetLayerInfoParameters.js
  62487. function SetLayerInfoParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  62488. function SetLayerInfoParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  62489. function SetLayerInfoParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) SetLayerInfoParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) SetLayerInfoParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  62490. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  62491. * This program are made available under the terms of the Apache License, Version 2.0
  62492. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  62493. /**
  62494. * @class SetLayerInfoParameters
  62495. * @deprecatedclass SuperMap.SetLayerInfoParameters
  62496. * @category iServer Map TempLayersSet
  62497. * @classdesc 设置图层信息参数类。
  62498. * @param {Object} options - 参数。
  62499. * @param {string} options.resourceID - 临时图层的资源 ID。
  62500. * @param {string} options.tempLayerName - 临时图层下的子图层名。
  62501. * @param {string} options.layerInfo - 要更新的图层信息。
  62502. * @usage
  62503. */
  62504. var SetLayerInfoParameters = /*#__PURE__*/function () {
  62505. function SetLayerInfoParameters(options) {
  62506. SetLayerInfoParameters_classCallCheck(this, SetLayerInfoParameters);
  62507. options = options || {};
  62508. /**
  62509. * @member {string} SetLayerInfoParameters.prototype.resourceID
  62510. * @description 临时图层的资源 ID。
  62511. */
  62512. this.resourceID = null;
  62513. /**
  62514. * @member {string} SetLayerInfoParameters.prototype.tempLayerName
  62515. * @description 临时图层下子图层(或者其子图层)名,如:Countries@World.3@@World。
  62516. */
  62517. this.tempLayerName = null;
  62518. /**
  62519. * @member {Object} SetLayerInfoParameters.prototype.layerInfo
  62520. * @description 要更新的图层信息(包含修改和未修改的所有字段)。该参数可以通过图层信息服务获取,然后对返回值中 subLayers.layers[i] 图层信息属性进行修改。
  62521. */
  62522. this.layerInfo = null;
  62523. Util_Util.extend(this, options);
  62524. this.CLASS_NAME = "SuperMap.SetLayerInfoParameters";
  62525. }
  62526. /**
  62527. * @function SetLayerInfoParameters.prototype.destroy
  62528. * @description 释放资源,将引用资源的属性置空。
  62529. */
  62530. SetLayerInfoParameters_createClass(SetLayerInfoParameters, [{
  62531. key: "destroy",
  62532. value: function destroy() {
  62533. var me = this;
  62534. me.resourceID = null;
  62535. me.tempLayerName = null;
  62536. me.layerInfo = null;
  62537. }
  62538. }]);
  62539. return SetLayerInfoParameters;
  62540. }();
  62541. ;// CONCATENATED MODULE: ./src/common/iServer/SetLayersInfoParameters.js
  62542. function SetLayersInfoParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  62543. function SetLayersInfoParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  62544. function SetLayersInfoParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) SetLayersInfoParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) SetLayersInfoParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  62545. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  62546. * This program are made available under the terms of the Apache License, Version 2.0
  62547. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  62548. /**
  62549. * @class SetLayersInfoParameters
  62550. * @deprecatedclass SuperMap.SetLayersInfoParameters
  62551. * @category iServer Map TempLayersSet
  62552. * @classdesc 设置图层信息参数类。
  62553. * @param {Object} options - 参数。
  62554. * @param {boolean} [options.isTempLayers=false] - 是否是临时图层。
  62555. * @param {string} options.resourceID - 临时图层资源 ID。
  62556. * @param {Object} options.layersInfo - 要更新的图层信息。
  62557. * @usage
  62558. */
  62559. var SetLayersInfoParameters = /*#__PURE__*/function () {
  62560. function SetLayersInfoParameters(options) {
  62561. SetLayersInfoParameters_classCallCheck(this, SetLayersInfoParameters);
  62562. options = options || {};
  62563. /**
  62564. * @member {boolean} [SetLayersInfoParameters.prototype.isTempLayers=false]
  62565. * @description 是否是临时图层。
  62566. */
  62567. this.isTempLayers = null;
  62568. /**
  62569. * @member {string} SetLayersInfoParameters.prototype.resourceID
  62570. * @description 临时图层资源 ID。
  62571. */
  62572. this.resourceID = null;
  62573. /**
  62574. * @member {Object} SetLayersInfoParameters.prototype.layersInfo
  62575. * @description 要更新的图层信息(包含修改和未修改的所有字段)。该参数可以通过图层信息服务获取,然后对返回值中 subLayers.layers[i] 图层信息属性进行修改。
  62576. */
  62577. this.layersInfo = null;
  62578. Util_Util.extend(this, options);
  62579. this.CLASS_NAME = "SuperMap.SetLayersInfoParameters";
  62580. }
  62581. /**
  62582. * @function SetLayersInfoParameters.prototype.destroy
  62583. * @description 释放资源,将引用资源的属性置空。
  62584. */
  62585. SetLayersInfoParameters_createClass(SetLayersInfoParameters, [{
  62586. key: "destroy",
  62587. value: function destroy() {
  62588. var me = this;
  62589. me.isTempLayers = null;
  62590. me.resourceID = null;
  62591. me.layersInfo = null;
  62592. }
  62593. }]);
  62594. return SetLayersInfoParameters;
  62595. }();
  62596. ;// CONCATENATED MODULE: ./src/common/iServer/SupplyCenter.js
  62597. function SupplyCenter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  62598. function SupplyCenter_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  62599. function SupplyCenter_createClass(Constructor, protoProps, staticProps) { if (protoProps) SupplyCenter_defineProperties(Constructor.prototype, protoProps); if (staticProps) SupplyCenter_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  62600. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  62601. * This program are made available under the terms of the Apache License, Version 2.0
  62602. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  62603. /**
  62604. * @class SupplyCenter
  62605. * @deprecatedclass SuperMap.SupplyCenter
  62606. * @category iServer NetworkAnalyst Location
  62607. * @classdesc 资源供给中心类。在资源分配和选址分区分析两个功能中使用。
  62608. * @param {Object} options - 参数。
  62609. * @param {number} options.maxWeight - 最大耗费值。
  62610. * @param {number} options.nodeID - 结点 ID 号。资源供给中心必须是结点。
  62611. * @param {number} options.resourceValue - 能提供的最大服务量或商品数量。
  62612. * @param {SupplyCenterType} [options.type] - 资源供给中心点的类型常量。
  62613. * @usage
  62614. */
  62615. var SupplyCenter = /*#__PURE__*/function () {
  62616. function SupplyCenter(options) {
  62617. SupplyCenter_classCallCheck(this, SupplyCenter);
  62618. /**
  62619. * @member {number} SupplyCenter.prototype.maxWeight
  62620. * @description 资源供给中心的最大耗费值。中心点最大阻值设置越小,表示中心点所提供的资源可影响范围越大。
  62621. * 最大阻力值是用来限制需求点到中心点的花费。
  62622. * 如果需求点(弧段或结点)到此中心的花费大于最大阻力值,则该需求点不属于该资源供给中心提供资源的范围。
  62623. */
  62624. this.maxWeight = null;
  62625. /**
  62626. * @member {number} SupplyCenter.prototype.nodeID
  62627. * @description 资源供给中心点的结点 ID 号,资源供给中心必须是结点。
  62628. */
  62629. this.nodeID = null;
  62630. /**
  62631. * @member {number} SupplyCenter.prototype.resourceValue
  62632. * @description 资源供给中心能提供的最大服务量或商品数量。例如资源中心为学校,资源中心资源量表示该学校能够接纳多少学生。
  62633. */
  62634. this.resourceValue = null;
  62635. /**
  62636. * @member {SupplyCenterType} [SupplyCenter.prototype.type]
  62637. * @description 资源供给中心点的类型常量。资源供给中心点的类型包括非中心,固定中心和可选中心。
  62638. * 固定中心用于资源分配分析;固定中心和可选中心用于选址分析;非中心在两种网络分析时都不予考虑。
  62639. */
  62640. this.type = null;
  62641. if (options) {
  62642. Util_Util.extend(this, options);
  62643. }
  62644. this.CLASS_NAME = "SuperMap.SupplyCenter";
  62645. }
  62646. /**
  62647. * @function SupplyCenter.prototype.destroy
  62648. * @description 释放资源,将引用资源的属性置空。
  62649. */
  62650. SupplyCenter_createClass(SupplyCenter, [{
  62651. key: "destroy",
  62652. value: function destroy() {
  62653. var me = this;
  62654. me.maxWeight = null;
  62655. me.nodeID = null;
  62656. me.resourceValue = null;
  62657. me.type = null;
  62658. }
  62659. /**
  62660. * @function SupplyCenter.fromJson
  62661. * @description 将服务端 JSON 对象转换成当前客户端对象。
  62662. * @param {Object} jsonObject - 要转换的 JSON 对象。
  62663. * @returns {SupplyCenter} SupplyCenter 对象。
  62664. */
  62665. }], [{
  62666. key: "fromJson",
  62667. value: function fromJson(jsonObject) {
  62668. if (!jsonObject) {
  62669. return;
  62670. }
  62671. return new SupplyCenter({
  62672. maxWeight: jsonObject.maxWeight,
  62673. nodeID: jsonObject.nodeID,
  62674. resourceValue: jsonObject.resourceValue,
  62675. type: jsonObject.type
  62676. });
  62677. }
  62678. }]);
  62679. return SupplyCenter;
  62680. }();
  62681. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeFlow.js
  62682. function ThemeFlow_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  62683. function ThemeFlow_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  62684. function ThemeFlow_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeFlow_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeFlow_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  62685. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  62686. * This program are made available under the terms of the Apache License, Version 2.0
  62687. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  62688. /**
  62689. * @class ThemeFlow
  62690. * @deprecatedclass SuperMap.ThemeFlow
  62691. * @private
  62692. * @category iServer Map Theme
  62693. * @classdesc 标签或符号流动显示和牵引线风格设置类。
  62694. * 通过该类可以设置专题图中符号是否流动显示、是否使用牵引线以及牵引线风格。
  62695. * @param {Object} options - 可选参数。
  62696. * @param {boolean} [options.flowEnabled=false] - 是否流动显示标签或符号。
  62697. * @param {boolean} [options.leaderLineDisplayed=false] - 是否显示标签或符号和它标注的对象之间的牵引线。
  62698. * @param {ServerStyle} [options.leaderLineStyle] - 标签或符号与其标注对象之间牵引线的风格。
  62699. * @usage
  62700. */
  62701. var ThemeFlow = /*#__PURE__*/function () {
  62702. function ThemeFlow(options) {
  62703. ThemeFlow_classCallCheck(this, ThemeFlow);
  62704. /**
  62705. * @member {boolean} [ThemeFlow.prototype.flowEnabled=false]
  62706. * @description 是否流动显示标签或符号。<br>
  62707. * 对于标签专题图而言,对于跨越比较大的区域和线条状的几何对象,在一个地图窗口中不能完全显示的情况下,如果其标签位置比较固定,
  62708. * 在当前地图窗口中该对象的标签不可见,则需要通过平移地图来查看对象的标签信息。如果采用了流动显示的效果,在当前地图窗口中,对象即使是部分显示,
  62709. * 其标签也会显示在当前地图窗口中。当平移地图时,对象的标签会随之移动,以保证在当前地图窗口中部分或全部显示的对象其标签都可见,从而可以方便地查看各要素的标签信息。
  62710. */
  62711. this.flowEnabled = false;
  62712. /**
  62713. * @member {boolean} [ThemeFlow.prototype.leaderLineDisplayed=false]
  62714. * @description 是否显示标签或符号和它标注的对象之间的牵引线。false表示不显示标签或符号和它标注的对象之间的牵引线。<br>
  62715. * 只有当 flowEnabled 为 true 时,牵引线才起作用。在当标签流动显示时,其位置不固定,由于牵引线始终指向要素的内点,
  62716. * 因而通过牵引线显示功能可以找到流动的标签或符号实际对应的要素。或者渲染符号偏移它所指向的对象时,图与对象之间可以采用牵引线进行连接。
  62717. */
  62718. this.leaderLineDisplayed = false;
  62719. /**
  62720. * @member {ServerStyle} ThemeFlow.prototype.leaderLineStyle
  62721. * @description 标签或符号与其标注对象之间牵引线的风格。
  62722. */
  62723. this.leaderLineStyle = new ServerStyle();
  62724. if (options) {
  62725. Util_Util.extend(this, options);
  62726. }
  62727. this.CLASS_NAME = "SuperMap.ThemeFlow";
  62728. }
  62729. /**
  62730. * @function ThemeFlow.prototype.destroy
  62731. * @description 释放资源,将引用资源的属性置空。
  62732. */
  62733. ThemeFlow_createClass(ThemeFlow, [{
  62734. key: "destroy",
  62735. value: function destroy() {
  62736. var me = this;
  62737. me.flowEnabled = null;
  62738. me.leaderLineDisplayed = null;
  62739. if (me.leaderLineStyle) {
  62740. me.leaderLineStyle.destroy();
  62741. me.leaderLineStyle = null;
  62742. }
  62743. }
  62744. /**
  62745. * @function ThemeFlow.fromObj
  62746. * @description 从传入对象获取标签或符号流动显示和牵引线风格设置类。
  62747. * @param {Object} obj - 传入对象。
  62748. * @returns {ThemeFlow} ThemeFlow 对象。
  62749. */
  62750. }], [{
  62751. key: "fromObj",
  62752. value: function fromObj(obj) {
  62753. if (!obj) {
  62754. return;
  62755. }
  62756. var res = new ThemeFlow();
  62757. Util_Util.copy(res, obj);
  62758. res.leaderLineStyle = ServerStyle.fromJson(obj.leaderLineStyle);
  62759. return res;
  62760. }
  62761. }]);
  62762. return ThemeFlow;
  62763. }();
  62764. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeGridRangeItem.js
  62765. function ThemeGridRangeItem_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  62766. function ThemeGridRangeItem_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  62767. function ThemeGridRangeItem_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeGridRangeItem_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeGridRangeItem_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  62768. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  62769. * This program are made available under the terms of the Apache License, Version 2.0
  62770. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  62771. /**
  62772. * @class ThemeGridRangeItem
  62773. * @deprecatedclass SuperMap.ThemeGridRangeItem
  62774. * @category iServer Map Theme
  62775. * @classdesc 栅格分段专题图子项类。在栅格分段专题图中,将栅格值按照某种分段模式被分成多个范围段。
  62776. * 本类用来设置每个范围段的分段起始值、终止值、名称和颜色等。每个分段所表示的范围为 [Start,End)。
  62777. * @param {Object} options - 参数。
  62778. * @param {ServerColor} options.color - 栅格分段专题图中每一个分段专题图子项的对应的颜色。
  62779. * @param {string} [options.caption] - 栅格分段专题图子项的标题。
  62780. * @param {number} [options.end=0] - 栅格分段专题图子项的终止值。
  62781. * @param {number} [options.start=0] - 栅格分段专题图子项的起始值。
  62782. * @param {boolean} [options.visible=true] - 栅格分段专题图子项是否可见。
  62783. * @usage
  62784. */
  62785. var ThemeGridRangeItem = /*#__PURE__*/function () {
  62786. function ThemeGridRangeItem(options) {
  62787. ThemeGridRangeItem_classCallCheck(this, ThemeGridRangeItem);
  62788. /**
  62789. * @member {string} [ThemeGridRangeItem.prototype.caption]
  62790. * @description 栅格分段专题图子项的标题。
  62791. */
  62792. this.caption = null;
  62793. /**
  62794. * @member {ServerColor} ThemeGridRangeItem.prototype.color
  62795. * @description 栅格分段专题图中每一个分段专题图子项的对应的颜色。
  62796. */
  62797. this.color = new ServerColor();
  62798. /**
  62799. * @member {number} [ThemeGridRangeItem.prototype.end=0]
  62800. * @description 栅格分段专题图子项的终止值,即该段专题值范围的最大值。
  62801. */
  62802. this.end = 0;
  62803. /**
  62804. * @member {number} [ThemeGridRangeItem.prototype.start=0]
  62805. * @description 栅格分段专题图子项的起始值,即该段专题值范围的最小值。
  62806. */
  62807. this.start = 0;
  62808. /**
  62809. * @member {boolean} [ThemeGridRangeItem.prototype.visible=true]
  62810. * @description 栅格分段专题图子项是否可见。
  62811. */
  62812. this.visible = true;
  62813. if (options) {
  62814. Util_Util.extend(this, options);
  62815. }
  62816. this.CLASS_NAME = "SuperMap.ThemeGridRangeItem";
  62817. }
  62818. /**
  62819. * @function ThemeGridRangeItem.prototype.destroy
  62820. * @description 释放资源,将引用资源的属性置空。
  62821. */
  62822. ThemeGridRangeItem_createClass(ThemeGridRangeItem, [{
  62823. key: "destroy",
  62824. value: function destroy() {
  62825. var me = this;
  62826. me.caption = null;
  62827. me.end = null;
  62828. me.start = null;
  62829. //需要验证是够存在destroy方法
  62830. if (me.color) {
  62831. me.color.destroy();
  62832. me.color = null;
  62833. }
  62834. me.visible = null;
  62835. }
  62836. /**
  62837. * @function ThemeGridRangeItem.prototype.toServerJSONObject
  62838. * @description 转换成对应的 JSON 格式对象。
  62839. * @returns {Object} 对应的 JSON 格式对象。
  62840. */
  62841. }, {
  62842. key: "toServerJSONObject",
  62843. value: function toServerJSONObject() {
  62844. var obj = {};
  62845. obj = Util_Util.copyAttributes(obj, this);
  62846. if (obj.color) {
  62847. if (obj.color.toServerJSONObject) {
  62848. obj.color = obj.color.toServerJSONObject();
  62849. }
  62850. }
  62851. return obj;
  62852. }
  62853. /**
  62854. * @function ThemeGridRangeItem.fromObj
  62855. * @description 从传入对象获取栅格分段专题图子项类。
  62856. * @param {Object} obj - 传入对象。
  62857. * @returns {ThemeGridRangeItem} ThemeGridRangeItem 对象。
  62858. */
  62859. }], [{
  62860. key: "fromObj",
  62861. value: function fromObj(obj) {
  62862. if (!obj) {
  62863. return;
  62864. }
  62865. var res = new ThemeGridRangeItem();
  62866. Util_Util.copy(res, obj);
  62867. res.color = ServerColor.fromJson(obj.color);
  62868. return res;
  62869. }
  62870. }]);
  62871. return ThemeGridRangeItem;
  62872. }();
  62873. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeGridRange.js
  62874. function ThemeGridRange_typeof(obj) { "@babel/helpers - typeof"; return ThemeGridRange_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, ThemeGridRange_typeof(obj); }
  62875. function ThemeGridRange_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  62876. function ThemeGridRange_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  62877. function ThemeGridRange_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeGridRange_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeGridRange_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  62878. function ThemeGridRange_get() { if (typeof Reflect !== "undefined" && Reflect.get) { ThemeGridRange_get = Reflect.get.bind(); } else { ThemeGridRange_get = function _get(target, property, receiver) { var base = ThemeGridRange_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return ThemeGridRange_get.apply(this, arguments); }
  62879. function ThemeGridRange_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ThemeGridRange_getPrototypeOf(object); if (object === null) break; } return object; }
  62880. function ThemeGridRange_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) ThemeGridRange_setPrototypeOf(subClass, superClass); }
  62881. function ThemeGridRange_setPrototypeOf(o, p) { ThemeGridRange_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ThemeGridRange_setPrototypeOf(o, p); }
  62882. function ThemeGridRange_createSuper(Derived) { var hasNativeReflectConstruct = ThemeGridRange_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = ThemeGridRange_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = ThemeGridRange_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return ThemeGridRange_possibleConstructorReturn(this, result); }; }
  62883. function ThemeGridRange_possibleConstructorReturn(self, call) { if (call && (ThemeGridRange_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return ThemeGridRange_assertThisInitialized(self); }
  62884. function ThemeGridRange_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  62885. function ThemeGridRange_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  62886. function ThemeGridRange_getPrototypeOf(o) { ThemeGridRange_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ThemeGridRange_getPrototypeOf(o); }
  62887. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  62888. * This program are made available under the terms of the Apache License, Version 2.0
  62889. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  62890. /**
  62891. * @class ThemeGridRange
  62892. * @deprecatedclass SuperMap.ThemeGridRange
  62893. * @category iServer Map Theme
  62894. * @classdesc 栅格分段专题图。栅格分段专题图,是将所有单元格的值按照某种分段方式分成多个范围段,值在同一个范围段中的单元格使用相同的颜色进行显示。一般用来反映连续分布现象的数量或程度特征。
  62895. * 比如某年的全国降水量分布图,将各气象站点的观测值经过内插之后生成的栅格数据进行分段显示。
  62896. * 该类类似于分段专题图类,不同点在于分段专题图的操作对象是矢量数据,而栅格分段专题图的操作对象是栅格数据。
  62897. * @extends {CommonTheme}
  62898. * @param {Object} options - 参数。
  62899. * @param {Array.<ThemeGridRangeItem>} options.items - 栅格分段专题图子项数组。
  62900. * @param {boolean} [options.reverseColor=false] - 是否对栅格分段专题图中分段的颜色风格进行反序显示。
  62901. * @param {RangeMode} [options.rangeMode=RangeMode.EQUALINTERVAL] - 分段专题图的分段模式。
  62902. * @param {number} [options.rangeParameter=0] - 分段参数。
  62903. * @param {ColorGradientType} [options.colorGradientType=ColorGradientType.YELLOW_RED] - 渐变颜色枚举类。
  62904. * @usage
  62905. */
  62906. var ThemeGridRange = /*#__PURE__*/function (_Theme) {
  62907. ThemeGridRange_inherits(ThemeGridRange, _Theme);
  62908. var _super = ThemeGridRange_createSuper(ThemeGridRange);
  62909. function ThemeGridRange(options) {
  62910. var _this;
  62911. ThemeGridRange_classCallCheck(this, ThemeGridRange);
  62912. _this = _super.call(this, "GRIDRANGE", options);
  62913. /**
  62914. * @member {Array.<ThemeGridRangeItem>} ThemeGridRange.prototype.items
  62915. * @description 栅格分段专题图子项数组。<br>
  62916. * 在栅格分段专题图中,将栅格值按照某种分段模式被分成多个范围段。
  62917. * 本类用来设置每个栅格范围段的分段起始值、终止值、名称和颜色等。每个分段所表示的范围为 [Start,End)。
  62918. */
  62919. _this.items = null;
  62920. /**
  62921. * @member {RangeMode} [ThemeGridRange.prototype.rangeMode=RangeMode.EQUALINTERVAL]
  62922. * @description 分段专题图的分段模式。<br>
  62923. * 在栅格分段专题图中,作为专题变量的字段或表达式的值按照某种分段方式被分成多个范围段。
  62924. * 目前 SuperMap 提供的分段方式包括:等距离分段法、平方根分段法、标准差分段法、对数分段法、等计数分段法和自定义距离法,
  62925. * 显然这些分段方法根据一定的距离进行分段,因而范围分段专题图所基于的专题变量必须为数值型。
  62926. */
  62927. _this.rangeMode = RangeMode.EQUALINTERVAL;
  62928. /**
  62929. * @member {number} [ThemeGridRange.prototype.rangeParameter=0]
  62930. * @description 分段参数。<br>
  62931. * 当分段模式为等距离分段法,平方根分段,对数分段法,等计数分段法其中一种模式时,该参数用于设置分段个数,必设;当分段模式为标准差分段法时,
  62932. * 该参数不起作用;当分段模式为自定义距离时,该参数用于设置自定义距离。
  62933. */
  62934. _this.rangeParameter = 0;
  62935. /**
  62936. * @member {ColorGradientType} [ThemeGridRange.prototype.colorGradientType=ColorGradientType.YELLOW_RED]
  62937. * @description 渐变颜色枚举类。
  62938. *
  62939. */
  62940. _this.colorGradientType = ColorGradientType.YELLOW_RED;
  62941. /**
  62942. * @member {boolean} ThemeGridRange.prototype.reverseColor
  62943. * @description 是否对栅格分段专题图中分段的颜色风格进行反序显示。
  62944. */
  62945. _this.reverseColor = false;
  62946. if (options) {
  62947. Util_Util.extend(ThemeGridRange_assertThisInitialized(_this), options);
  62948. }
  62949. _this.CLASS_NAME = "SuperMap.ThemeGridRange";
  62950. return _this;
  62951. }
  62952. /**
  62953. * @function ThemeGridRange.prototype.destroy
  62954. * @override
  62955. */
  62956. ThemeGridRange_createClass(ThemeGridRange, [{
  62957. key: "destroy",
  62958. value: function destroy() {
  62959. ThemeGridRange_get(ThemeGridRange_getPrototypeOf(ThemeGridRange.prototype), "destroy", this).call(this);
  62960. var me = this;
  62961. if (me.items) {
  62962. if (me.items.length > 0) {
  62963. for (var item in me.items) {
  62964. me.items[item].destroy();
  62965. me.items[item] = null;
  62966. }
  62967. }
  62968. me.items = null;
  62969. }
  62970. me.reverseColor = null;
  62971. me.rangeMode = null;
  62972. me.rangeParameter = null;
  62973. me.colorGradientType = null;
  62974. }
  62975. /**
  62976. * @function ThemeGridRange.fromObj
  62977. * @description 从传入对象获取栅格分段专题图。
  62978. * @param {Object} obj - 传入对象。
  62979. * @returns {ThemeGridRange} ThemeGridRange 对象。
  62980. */
  62981. }], [{
  62982. key: "fromObj",
  62983. value: function fromObj(obj) {
  62984. if (!obj) {
  62985. return;
  62986. }
  62987. var res = new ThemeGridRange();
  62988. Util_Util.copy(res, obj);
  62989. var itemsR = obj.items;
  62990. var len = itemsR ? itemsR.length : 0;
  62991. res.items = [];
  62992. for (var i = 0; i < len; i++) {
  62993. res.items.push(ThemeGridRangeItem.fromObj(itemsR[i]));
  62994. }
  62995. return res;
  62996. }
  62997. }]);
  62998. return ThemeGridRange;
  62999. }(Theme);
  63000. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeGridUniqueItem.js
  63001. function ThemeGridUniqueItem_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  63002. function ThemeGridUniqueItem_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  63003. function ThemeGridUniqueItem_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeGridUniqueItem_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeGridUniqueItem_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  63004. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  63005. * This program are made available under the terms of the Apache License, Version 2.0
  63006. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  63007. /**
  63008. * @class ThemeGridUniqueItem
  63009. * @deprecatedclass SuperMap.ThemeGridUniqueItem
  63010. * @category iServer Map Theme
  63011. * @classdesc 栅格单值专题图子项类。
  63012. * 栅格单值专题图是将值相同的单元格归为一类,每一类是一个专题图子项。
  63013. * @param {Object} options - 可选参数。
  63014. * @param {string} [options.caption] - 子项的名称。
  63015. * @param {ServerColor} [options.color] - 子项的显示颜色。
  63016. * @param {number} options.unique - 子项的专题值,即单元格的值,值相同的单元格位于一个子项内。
  63017. * @param {boolean} [options.visible=true] - 子项是否可见。
  63018. * @usage
  63019. */
  63020. var ThemeGridUniqueItem = /*#__PURE__*/function () {
  63021. function ThemeGridUniqueItem(options) {
  63022. ThemeGridUniqueItem_classCallCheck(this, ThemeGridUniqueItem);
  63023. /**
  63024. * @member {string} [ThemeGridUniqueItem.prototype.caption]
  63025. * @description 栅格单值专题图子项的名称。
  63026. */
  63027. this.caption = null;
  63028. /**
  63029. * @member {ServerColor} [ThemeGridUniqueItem.prototype.color]
  63030. * @description 栅格单值专题图子项的显示颜色。
  63031. */
  63032. this.color = new ServerColor();
  63033. /**
  63034. * @member {number} ThemeGridUniqueItem.prototype.unique
  63035. * @description 栅格单值专题图子项的专题值,即单元格的值,值相同的单元格位于一个子项内。
  63036. */
  63037. this.unique = null;
  63038. /**
  63039. * @member {boolean} [ThemeGridUniqueItem.prototype.visible=true]
  63040. * @description 栅格单值专题图子项是否可见。
  63041. */
  63042. this.visible = true;
  63043. if (options) {
  63044. Util_Util.extend(this, options);
  63045. }
  63046. this.CLASS_NAME = "SuperMap.ThemeGridUniqueItem";
  63047. }
  63048. /**
  63049. * @function ThemeGridUniqueItem.prototype.destroy
  63050. * @description 释放资源,将引用资源的属性置空。
  63051. */
  63052. ThemeGridUniqueItem_createClass(ThemeGridUniqueItem, [{
  63053. key: "destroy",
  63054. value: function destroy() {
  63055. var me = this;
  63056. me.caption = null;
  63057. me.unique = null;
  63058. if (me.color) {
  63059. me.color.destroy();
  63060. me.color = null;
  63061. }
  63062. me.visible = null;
  63063. }
  63064. /**
  63065. * @function ThemeGridUniqueItem.prototype.toServerJSONObject
  63066. * @description 转换成对应的 JSON 格式对象。
  63067. * @returns {Object} 对应的 JSON 格式对象。
  63068. */
  63069. }, {
  63070. key: "toServerJSONObject",
  63071. value: function toServerJSONObject() {
  63072. var obj = {};
  63073. obj = Util_Util.copyAttributes(obj, this);
  63074. if (obj.color) {
  63075. if (obj.color.toServerJSONObject) {
  63076. obj.color = obj.color.toServerJSONObject();
  63077. }
  63078. }
  63079. return obj;
  63080. }
  63081. /**
  63082. * @function ThemeGridUniqueItem.fromObj
  63083. * @description 从传入对象获取栅格单值专题图子项类。
  63084. * @param {Object} obj - 传入对象。
  63085. * @returns {ThemeGridUniqueItem} ThemeGridUniqueItem 对象。
  63086. */
  63087. }], [{
  63088. key: "fromObj",
  63089. value: function fromObj(obj) {
  63090. var res = new ThemeGridUniqueItem();
  63091. Util_Util.copy(res, obj);
  63092. res.color = ServerColor.fromJson(obj.color);
  63093. return res;
  63094. }
  63095. }]);
  63096. return ThemeGridUniqueItem;
  63097. }();
  63098. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeGridUnique.js
  63099. function ThemeGridUnique_typeof(obj) { "@babel/helpers - typeof"; return ThemeGridUnique_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, ThemeGridUnique_typeof(obj); }
  63100. function ThemeGridUnique_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  63101. function ThemeGridUnique_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  63102. function ThemeGridUnique_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeGridUnique_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeGridUnique_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  63103. function ThemeGridUnique_get() { if (typeof Reflect !== "undefined" && Reflect.get) { ThemeGridUnique_get = Reflect.get.bind(); } else { ThemeGridUnique_get = function _get(target, property, receiver) { var base = ThemeGridUnique_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return ThemeGridUnique_get.apply(this, arguments); }
  63104. function ThemeGridUnique_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ThemeGridUnique_getPrototypeOf(object); if (object === null) break; } return object; }
  63105. function ThemeGridUnique_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) ThemeGridUnique_setPrototypeOf(subClass, superClass); }
  63106. function ThemeGridUnique_setPrototypeOf(o, p) { ThemeGridUnique_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ThemeGridUnique_setPrototypeOf(o, p); }
  63107. function ThemeGridUnique_createSuper(Derived) { var hasNativeReflectConstruct = ThemeGridUnique_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = ThemeGridUnique_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = ThemeGridUnique_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return ThemeGridUnique_possibleConstructorReturn(this, result); }; }
  63108. function ThemeGridUnique_possibleConstructorReturn(self, call) { if (call && (ThemeGridUnique_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return ThemeGridUnique_assertThisInitialized(self); }
  63109. function ThemeGridUnique_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  63110. function ThemeGridUnique_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  63111. function ThemeGridUnique_getPrototypeOf(o) { ThemeGridUnique_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ThemeGridUnique_getPrototypeOf(o); }
  63112. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  63113. * This program are made available under the terms of the Apache License, Version 2.0
  63114. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  63115. /**
  63116. * @class ThemeGridUnique
  63117. * @deprecatedclass SuperMap.ThemeGridUnique
  63118. * @category iServer Map Theme
  63119. * @classdesc 栅格单值专题图类。栅格单值专题图是将单元格值相同的归为一类,为每一类设定一种颜色,从而用来区分不同的类别。
  63120. * 适用于离散栅格数据和部分连续栅格数据,对于单元格值各不相同的那些连续栅格数据,使用栅格单值专题图不具有任何意义。
  63121. * @extends {CommonTheme}
  63122. * @param {Object} options - 参数。
  63123. * @param {Array.<ThemeGridUniqueItem>} options.items - 栅格单值专题图子项数组。
  63124. * @param {ServerColor} [options.defaultcolor] - 栅格单值专题图的默认颜色。
  63125. * @usage
  63126. */
  63127. var ThemeGridUnique = /*#__PURE__*/function (_Theme) {
  63128. ThemeGridUnique_inherits(ThemeGridUnique, _Theme);
  63129. var _super = ThemeGridUnique_createSuper(ThemeGridUnique);
  63130. function ThemeGridUnique(options) {
  63131. var _this;
  63132. ThemeGridUnique_classCallCheck(this, ThemeGridUnique);
  63133. _this = _super.call(this, "GRIDUNIQUE", options);
  63134. /**
  63135. * @member {ServerColor} ThemeGridUnique.prototype.defaultcolor
  63136. * @description 栅格单值专题图的默认颜色。
  63137. * 对于那些未在格网单值专题图子项之列的要素使用该颜色显示。
  63138. */
  63139. _this.defaultcolor = new ServerColor();
  63140. /**
  63141. * @member {Array.<ThemeGridUniqueItem>} ThemeGridUnique.prototype.items
  63142. * @description 栅格单值专题图子项数组。
  63143. * 栅格单值专题图将值相同的单元格归为一类,每一类是一个专题图子项。
  63144. */
  63145. _this.items = null;
  63146. if (options) {
  63147. Util_Util.extend(ThemeGridUnique_assertThisInitialized(_this), options);
  63148. }
  63149. _this.CLASS_NAME = "SuperMap.ThemeGridUnique";
  63150. return _this;
  63151. }
  63152. /**
  63153. * @function ThemeGridUnique.prototype.destroy
  63154. * @override
  63155. */
  63156. ThemeGridUnique_createClass(ThemeGridUnique, [{
  63157. key: "destroy",
  63158. value: function destroy() {
  63159. ThemeGridUnique_get(ThemeGridUnique_getPrototypeOf(ThemeGridUnique.prototype), "destroy", this).call(this);
  63160. var me = this;
  63161. if (me.items) {
  63162. if (me.items.length > 0) {
  63163. for (var item in me.items) {
  63164. me.items[item].destroy();
  63165. me.items[item] = null;
  63166. }
  63167. }
  63168. me.items = null;
  63169. }
  63170. if (me.defaultcolor) {
  63171. me.defaultcolor.destroy();
  63172. me.defaultcolor = null;
  63173. }
  63174. }
  63175. /**
  63176. * @function ThemeGridUnique.prototype.toServerJSONObject
  63177. * @description 转换成对应的 JSON 格式对象。
  63178. * @returns {Object} 对应的 JSON 格式对象
  63179. */
  63180. }, {
  63181. key: "toServerJSONObject",
  63182. value: function toServerJSONObject() {
  63183. var obj = {};
  63184. obj = Util_Util.copyAttributes(obj, this);
  63185. if (obj.defaultcolor) {
  63186. if (obj.defaultcolor.toServerJSONObject) {
  63187. obj.defaultcolor = obj.defaultcolor.toServerJSONObject();
  63188. }
  63189. }
  63190. if (obj.items) {
  63191. var items = [],
  63192. len = obj.items.length;
  63193. for (var i = 0; i < len; i++) {
  63194. items.push(obj.items[i].toServerJSONObject());
  63195. }
  63196. obj.items = items;
  63197. }
  63198. return obj;
  63199. }
  63200. /**
  63201. * @function ThemeGridUnique.fromObj
  63202. * @description 从传入对象获取栅格单值专题图类。
  63203. * @param {Object} obj - 传入对象
  63204. * @returns {ThemeGridUnique} ThemeGridUnique 对象
  63205. */
  63206. }], [{
  63207. key: "fromObj",
  63208. value: function fromObj(obj) {
  63209. var res = new ThemeGridUnique();
  63210. var uItems = obj.items;
  63211. var len = uItems ? uItems.length : 0;
  63212. Util_Util.extend(res, obj);
  63213. res.items = [];
  63214. res.defaultcolor = ServerColor.fromJson(obj.defaultcolor);
  63215. for (var i = 0; i < len; i++) {
  63216. res.items.push(ThemeGridUniqueItem.fromObj(uItems[i]));
  63217. }
  63218. return res;
  63219. }
  63220. }]);
  63221. return ThemeGridUnique;
  63222. }(Theme);
  63223. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeLabelUniqueItem.js
  63224. function ThemeLabelUniqueItem_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  63225. function ThemeLabelUniqueItem_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  63226. function ThemeLabelUniqueItem_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeLabelUniqueItem_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeLabelUniqueItem_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  63227. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  63228. * This program are made available under the terms of the Apache License, Version 2.0
  63229. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  63230. /**
  63231. * @class ThemeLabelUniqueItem
  63232. * @deprecatedclass SuperMap.ThemeLabelUniqueItem
  63233. * @category iServer Map Theme
  63234. * @classdesc 单值标签专题图的子项。标签专题图用专题值对点、线、面等对象做标注,值得注意的是,单值标签专题图允许用户通过 uniqueExpression
  63235. * 字段指定用于单值的字段,同一值的标签具有相同的显示风格,其中每一个值就是一个专题图子项,
  63236. * 每一个子项都具有其名称、风格、指定的单值、X 方向偏移量和 Y 方向偏移量。
  63237. * @param {Object} options - 参数。
  63238. * @param {string} options.unique - 子项的值,可以为数字、字符串等。
  63239. * @param {string} [options.caption] - 子项的名称。
  63240. * @param {number} [options.offsetX=0] - 标签在 X 方向偏移量。
  63241. * @param {number} [options.offsetY=0] - 标签在 Y 方向偏移量。
  63242. * @param {boolean} [options.visible=true] - 子项是否可见。
  63243. * @param {ServerTextStyle} [options.style] - 子项文本的显示风格。
  63244. * @usage
  63245. */
  63246. var ThemeLabelUniqueItem = /*#__PURE__*/function () {
  63247. function ThemeLabelUniqueItem(options) {
  63248. ThemeLabelUniqueItem_classCallCheck(this, ThemeLabelUniqueItem);
  63249. /**
  63250. * @member {string} [ThemeLabelUniqueItem.prototype.caption]
  63251. * @description 标签专题子项的标题。
  63252. */
  63253. this.caption = null;
  63254. /**
  63255. * @member {string} ThemeLabelUniqueItem.prototype.unique
  63256. * @description 单值专题图子项的值,可以为数字、字符串等。
  63257. */
  63258. this.unique = null;
  63259. /**
  63260. * @member {number} [ThemeLabelUniqueItem.prototype.offsetX=0]
  63261. * @description 标签在 X 方向偏移量。
  63262. */
  63263. this.offsetX = 0;
  63264. /**
  63265. * @member {number} [ThemeLabelUniqueItem.prototype.offsetY=0]
  63266. * @description 标签在 Y 方向偏移量。
  63267. */
  63268. this.offsetY = 0;
  63269. /**
  63270. * @member {boolean} [ThemeLabelUniqueItem.prototype.visible=true]
  63271. * @description 标签专题图子项是否可见。如果标签专题图子项可见,则为 true,否则为 false。
  63272. */
  63273. this.visible = true;
  63274. /**
  63275. * @member {ServerTextStyle} ThemeLabelUniqueItem.prototype.style
  63276. * @description 标签专题图子项文本的显示风格。各种风格的优先级从高到低为:<br>
  63277. * uniformMixedStyle(标签文本的复合风格),ThemeLabelUniqueItem.style(单值子项的文本风格),uniformStyle(统一文本风格)。
  63278. */
  63279. this.style = new ServerTextStyle();
  63280. if (options) {
  63281. Util_Util.extend(this, options);
  63282. }
  63283. this.CLASS_NAME = "SuperMap.ThemeLabelUniqueItem";
  63284. }
  63285. /**
  63286. * @function ThemeLabelUniqueItem.prototype.destroy
  63287. * @description 释放资源,将引用资源的属性置空。
  63288. */
  63289. ThemeLabelUniqueItem_createClass(ThemeLabelUniqueItem, [{
  63290. key: "destroy",
  63291. value: function destroy() {
  63292. var me = this;
  63293. me.unique = null;
  63294. me.caption = null;
  63295. me.offsetX = null;
  63296. me.offsetY = null;
  63297. if (me.style) {
  63298. me.style.destroy();
  63299. me.style = null;
  63300. }
  63301. me.visible = null;
  63302. }
  63303. /**
  63304. * @function ThemeLabelUniqueItem.fromObj
  63305. * @description 从传入对象获取单值标签专题图的子项类。
  63306. * @param {Object} obj - 传入对象。
  63307. * @returns {ThemeLabelUniqueItem} ThemeLabelUniqueItem 对象。
  63308. */
  63309. }], [{
  63310. key: "fromObj",
  63311. value: function fromObj(obj) {
  63312. if (!obj) {
  63313. return;
  63314. }
  63315. var t = new ThemeLabelUniqueItem();
  63316. Util_Util.copy(t, obj);
  63317. return t;
  63318. }
  63319. }]);
  63320. return ThemeLabelUniqueItem;
  63321. }();
  63322. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeMemoryData.js
  63323. function ThemeMemoryData_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  63324. function ThemeMemoryData_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  63325. function ThemeMemoryData_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeMemoryData_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeMemoryData_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  63326. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  63327. * This program are made available under the terms of the Apache License, Version 2.0
  63328. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  63329. /**
  63330. * @class ThemeMemoryData
  63331. * @deprecatedclass SuperMap.ThemeMemoryData
  63332. * @category iServer Map Theme
  63333. * @classdesc 专题图内存数据类。
  63334. * @param {Array} srcData - 原始值数组。
  63335. * @param {Array} targetData - 外部值数组。
  63336. * @usage
  63337. */
  63338. var ThemeMemoryData = /*#__PURE__*/function () {
  63339. function ThemeMemoryData(srcData, targetData) {
  63340. ThemeMemoryData_classCallCheck(this, ThemeMemoryData);
  63341. /**
  63342. * @member {Array} ThemeMemoryData.prototype.srcData
  63343. * @description 原始值数组,该属性值将被 targetData 属性所指定的值替换掉,然后制作专题图,但数据库中的值并不会改变。
  63344. */
  63345. this.srcData = srcData;
  63346. /**
  63347. * @member {Array} ThemeMemoryData.prototype.targetData
  63348. * @description 外部值数组,即用于制作专题图的内存数据,设定该属性值后,会将 srcData 属性所指定的原始值替换掉制作专题图,但数据库中的值并不会改变。
  63349. */
  63350. this.targetData = targetData;
  63351. this.CLASS_NAME = "SuperMap.ThemeMemoryData";
  63352. }
  63353. /**
  63354. * @function ThemeMemoryData.prototype.destroy
  63355. * @description 释放资源,将引用资源的属性置空。
  63356. */
  63357. ThemeMemoryData_createClass(ThemeMemoryData, [{
  63358. key: "destroy",
  63359. value: function destroy() {
  63360. var me = this;
  63361. me.srcData = null;
  63362. me.targetData = null;
  63363. }
  63364. /**
  63365. * @function ThemeMemoryData.prototype.toJSON
  63366. * @description 将 ThemeMemoryData 对象转化为 JSON 字符串。
  63367. * @returns {string} 返回转换后的 JSON 字符串。
  63368. */
  63369. }, {
  63370. key: "toJSON",
  63371. value: function toJSON() {
  63372. if (this.srcData && this.targetData) {
  63373. var memoryDataStr = "";
  63374. var count = Math.min(this.srcData.length, this.targetData.length);
  63375. for (var i = 0; i < count; i++) {
  63376. memoryDataStr += "\'" + this.srcData[i] + "\':\'" + this.targetData[i] + "\',";
  63377. }
  63378. //去除多余的逗号
  63379. if (i > 0) {
  63380. memoryDataStr = memoryDataStr.substring(0, memoryDataStr.length - 1);
  63381. }
  63382. return "{" + memoryDataStr + "}";
  63383. } else {
  63384. return null;
  63385. }
  63386. }
  63387. }]);
  63388. return ThemeMemoryData;
  63389. }();
  63390. ;// CONCATENATED MODULE: ./src/common/iServer/TransferLine.js
  63391. function TransferLine_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  63392. function TransferLine_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  63393. function TransferLine_createClass(Constructor, protoProps, staticProps) { if (protoProps) TransferLine_defineProperties(Constructor.prototype, protoProps); if (staticProps) TransferLine_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  63394. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  63395. * This program are made available under the terms of the Apache License, Version 2.0
  63396. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  63397. /**
  63398. * @class TransferLine
  63399. * @deprecatedclass SuperMap.TransferLine
  63400. * @category iServer TrafficTransferAnalyst TransferPath
  63401. * @classdesc 换乘路线信息类。
  63402. * @param {Object} options - 参数。
  63403. * @param {number} options.lineID - 乘车路线 ID。
  63404. * @param {string} options.lineName - 乘车路线名称。
  63405. * @param {string} options.lineAliasName - 乘车路线别名。
  63406. * @param {number} options.startStopIndex - 上车站点在本公交路线中的索引。
  63407. * @param {string} options.startStopName - 上车站点名称。
  63408. * @param {string} options.startStopAliasName - 上车站点别名。
  63409. * @param {number} options.endStopIndex - 下车站点在本公交路线中的索引。
  63410. * @param {string} options.endStopName - 下车站点名称。
  63411. * @param {string} options.endStopAliasName - 下车站点别名。
  63412. * @usage
  63413. */
  63414. var TransferLine = /*#__PURE__*/function () {
  63415. function TransferLine(options) {
  63416. TransferLine_classCallCheck(this, TransferLine);
  63417. options = options || {};
  63418. /**
  63419. * @member {number} TransferLine.prototype.lineID
  63420. * @description 乘车路线 ID。
  63421. */
  63422. this.lineID = null;
  63423. /**
  63424. * @member {string} TransferLine.prototype.lineName
  63425. * @description 乘车路线名称。
  63426. */
  63427. this.lineName = null;
  63428. /**
  63429. * @member {string} TransferLine.prototype.lineAliasName
  63430. * @description 乘车路线别名。
  63431. */
  63432. this.lineAliasName = null;
  63433. /**
  63434. * @member {number} TransferLine.prototype.startStopIndex
  63435. * @description 上车站点在本公交路线中的索引。
  63436. */
  63437. this.startStopIndex = null;
  63438. /**
  63439. * @member {string} TransferLine.prototype.startStopName
  63440. * @description 上车站点名称。
  63441. */
  63442. this.startStopName = null;
  63443. /**
  63444. * @member {string} TransferLine.prototype.startStopAliasName
  63445. * @description 上车站点别名。
  63446. */
  63447. this.startStopAliasName = null;
  63448. /**
  63449. * @member {number} TransferLine.prototype.endStopIndex
  63450. * @description 下车站点在本公交路线中的索引。
  63451. */
  63452. this.endStopIndex = null;
  63453. /**
  63454. * @member {string} TransferLine.prototype.endStopName
  63455. * @description 下车站点名称。
  63456. */
  63457. this.endStopName = null;
  63458. /**
  63459. * @member {string} TransferLine.prototype.endStopAliasName
  63460. * @description 下车站点别名。
  63461. */
  63462. this.endStopAliasName = null;
  63463. Util_Util.extend(this, options);
  63464. this.CLASS_NAME = "SuperMap.TransferLine";
  63465. }
  63466. /**
  63467. * @function TransferLine.prototype.destroy
  63468. * @description 释放资源,将引用资源的属性置空。
  63469. */
  63470. TransferLine_createClass(TransferLine, [{
  63471. key: "destroy",
  63472. value: function destroy() {
  63473. Util_Util.reset(this);
  63474. }
  63475. /**
  63476. * @function TransferLine.fromJson
  63477. * @description 将返回结果转化为 {@link TransferLine} 对象。
  63478. * @param {Object} jsonObject - 新的返回结果。
  63479. * @returns {TransferLine} 转化后的 {@link TransferLine} 对象。
  63480. */
  63481. }], [{
  63482. key: "fromJson",
  63483. value: function fromJson(jsonObject) {
  63484. if (!jsonObject) {
  63485. return;
  63486. }
  63487. return new TransferLine({
  63488. lineID: jsonObject['lineID'],
  63489. lineName: jsonObject['lineName'],
  63490. lineAliasName: jsonObject['lineAliasName'],
  63491. startStopIndex: jsonObject['startStopIndex'],
  63492. startStopName: jsonObject['startStopName'],
  63493. startStopAliasName: jsonObject['startStopAliasName'],
  63494. endStopIndex: jsonObject['endStopIndex'],
  63495. endStopName: jsonObject['endStopName'],
  63496. endStopAliasName: jsonObject['endStopAliasName']
  63497. });
  63498. }
  63499. }]);
  63500. return TransferLine;
  63501. }();
  63502. ;// CONCATENATED MODULE: ./src/common/iServer/RasterFunctionParameter.js
  63503. function RasterFunctionParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  63504. function RasterFunctionParameter_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  63505. function RasterFunctionParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) RasterFunctionParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) RasterFunctionParameter_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  63506. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  63507. * This program are made available under the terms of the Apache License, Version 2.0
  63508. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  63509. /**
  63510. * @class RasterFunctionParameter
  63511. * @deprecatedclass SuperMap.RasterFunctionParameter
  63512. * @category iServer Map Tile
  63513. * @classdesc iServer 地图服务栅格分析参数基类。
  63514. * @param {Object} options - 参数。
  63515. * @param {RasterFunctionType} options.type - 栅格分析方法。
  63516. * @usage
  63517. */
  63518. var RasterFunctionParameter = /*#__PURE__*/function () {
  63519. function RasterFunctionParameter(options) {
  63520. RasterFunctionParameter_classCallCheck(this, RasterFunctionParameter);
  63521. options = options || {};
  63522. /**
  63523. * @member {RasterFunctionType} [RasterFunctionParameter.prototype.type]
  63524. * @description 栅格分析方法。
  63525. */
  63526. this.type = null;
  63527. Util_Util.extend(this, options);
  63528. this.CLASS_NAME = 'SuperMap.RasterFunctionParameter';
  63529. }
  63530. /**
  63531. * @function RasterFunctionParameter.prototype.destroy
  63532. * @description 释放资源,将资源的属性置空。
  63533. */
  63534. RasterFunctionParameter_createClass(RasterFunctionParameter, [{
  63535. key: "destroy",
  63536. value: function destroy() {
  63537. this.type = null;
  63538. }
  63539. }]);
  63540. return RasterFunctionParameter;
  63541. }();
  63542. ;// CONCATENATED MODULE: ./src/common/iServer/NDVIParameter.js
  63543. function NDVIParameter_typeof(obj) { "@babel/helpers - typeof"; return NDVIParameter_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, NDVIParameter_typeof(obj); }
  63544. function NDVIParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  63545. function NDVIParameter_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  63546. function NDVIParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) NDVIParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) NDVIParameter_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  63547. function NDVIParameter_get() { if (typeof Reflect !== "undefined" && Reflect.get) { NDVIParameter_get = Reflect.get.bind(); } else { NDVIParameter_get = function _get(target, property, receiver) { var base = NDVIParameter_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return NDVIParameter_get.apply(this, arguments); }
  63548. function NDVIParameter_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = NDVIParameter_getPrototypeOf(object); if (object === null) break; } return object; }
  63549. function NDVIParameter_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) NDVIParameter_setPrototypeOf(subClass, superClass); }
  63550. function NDVIParameter_setPrototypeOf(o, p) { NDVIParameter_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return NDVIParameter_setPrototypeOf(o, p); }
  63551. function NDVIParameter_createSuper(Derived) { var hasNativeReflectConstruct = NDVIParameter_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = NDVIParameter_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = NDVIParameter_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return NDVIParameter_possibleConstructorReturn(this, result); }; }
  63552. function NDVIParameter_possibleConstructorReturn(self, call) { if (call && (NDVIParameter_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return NDVIParameter_assertThisInitialized(self); }
  63553. function NDVIParameter_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  63554. function NDVIParameter_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  63555. function NDVIParameter_getPrototypeOf(o) { NDVIParameter_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return NDVIParameter_getPrototypeOf(o); }
  63556. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  63557. * This program are made available under the terms of the Apache License, Version 2.0
  63558. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  63559. /**
  63560. * @class NDVIParameter
  63561. * @deprecatedclass SuperMap.NDVIParameter
  63562. * @category iServer Map Tile
  63563. * @classdesc 归一化植被指数参数类。
  63564. * @param {Object} options - 参数。
  63565. * @param {number} [options.redIndex=0] - 红光谱波段索引。
  63566. * @param {number} [options.nirIndex=1] - 近红外光谱波段索引。
  63567. * @param {string} [options.colorMap="0:ffffe5ff;0.1:f7fcb9ff;0.2:d9f0a3ff;0.3:addd8eff;0.4:78c679ff;0.5:41ab5dff;0.6:238443ff;0.7:006837ff;1:004529ff"] - 颜色表。由栅格的中断值和颜色停止之间的映射组成的,如0.3->d9f0a3ff 指的是[0,0.3)显示d9f0a3ff。仅单波段数据时设定。
  63568. * @extends {RasterFunctionParameter}
  63569. * @usage
  63570. */
  63571. var NDVIParameter = /*#__PURE__*/function (_RasterFunctionParame) {
  63572. NDVIParameter_inherits(NDVIParameter, _RasterFunctionParame);
  63573. var _super = NDVIParameter_createSuper(NDVIParameter);
  63574. function NDVIParameter(options) {
  63575. var _this;
  63576. NDVIParameter_classCallCheck(this, NDVIParameter);
  63577. _this = _super.call(this, options);
  63578. /**
  63579. * @member {number} [NDVIParameter.prototype.redIndex=0]
  63580. * @description 红光谱波段索引。
  63581. */
  63582. _this.redIndex = 0;
  63583. /**
  63584. * @member {number} [NDVIParameter.prototype.nirIndex=1]
  63585. * @description 近红外光谱波段索引。
  63586. */
  63587. _this.nirIndex = 1;
  63588. /**
  63589. * @member {string} [NDVIParameter.prototype.colorMap="0:ffffe5ff;0.1:f7fcb9ff;0.2:d9f0a3ff;0.3:addd8eff;0.4:78c679ff;0.5:41ab5dff;0.6:238443ff;0.7:006837ff;1:004529ff"]
  63590. * @description 颜色表。由栅格的中断值和颜色停止之间的映射组成的,如0.3->d9f0a3ff 指的是[0,0.3)显示d9f0a3ff。仅单波段数据时设定。
  63591. */
  63592. _this.colorMap = '0:ffffe5ff;0.1:f7fcb9ff;0.2:d9f0a3ff;0.3:addd8eff;0.4:78c679ff;0.5:41ab5dff;0.6:238443ff;0.7:006837ff;1:004529ff';
  63593. /**
  63594. * @member {RasterFunctionType} [NDVIParameter.prototype.type]
  63595. * @description 栅格分析方法。
  63596. */
  63597. _this.type = RasterFunctionType.NDVI;
  63598. Util_Util.extend(NDVIParameter_assertThisInitialized(_this), options);
  63599. _this.CLASS_NAME = 'SuperMap.NDVIParameter';
  63600. return _this;
  63601. }
  63602. /**
  63603. * @function NDVIParameter.prototype.destroy
  63604. * @override
  63605. */
  63606. NDVIParameter_createClass(NDVIParameter, [{
  63607. key: "destroy",
  63608. value: function destroy() {
  63609. NDVIParameter_get(NDVIParameter_getPrototypeOf(NDVIParameter.prototype), "destroy", this).call(this);
  63610. this.redIndex = null;
  63611. this.nirIndex = null;
  63612. this.colorMap = null;
  63613. }
  63614. /**
  63615. * @function NDVIParameter.prototype.toJSON
  63616. * @description 将 NDVIParameter 对象转化为 JSON 字符串。
  63617. * @returns {string} 返回转换后的 JSON 字符串。
  63618. */
  63619. }, {
  63620. key: "toJSON",
  63621. value: function toJSON() {
  63622. return {
  63623. redIndex: this.redIndex,
  63624. nirIndex: this.nirIndex,
  63625. colorMap: this.colorMap,
  63626. type: this.type
  63627. };
  63628. }
  63629. }]);
  63630. return NDVIParameter;
  63631. }(RasterFunctionParameter);
  63632. ;// CONCATENATED MODULE: ./src/common/iServer/HillshadeParameter.js
  63633. function HillshadeParameter_typeof(obj) { "@babel/helpers - typeof"; return HillshadeParameter_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, HillshadeParameter_typeof(obj); }
  63634. function HillshadeParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  63635. function HillshadeParameter_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  63636. function HillshadeParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) HillshadeParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) HillshadeParameter_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  63637. function HillshadeParameter_get() { if (typeof Reflect !== "undefined" && Reflect.get) { HillshadeParameter_get = Reflect.get.bind(); } else { HillshadeParameter_get = function _get(target, property, receiver) { var base = HillshadeParameter_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return HillshadeParameter_get.apply(this, arguments); }
  63638. function HillshadeParameter_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = HillshadeParameter_getPrototypeOf(object); if (object === null) break; } return object; }
  63639. function HillshadeParameter_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) HillshadeParameter_setPrototypeOf(subClass, superClass); }
  63640. function HillshadeParameter_setPrototypeOf(o, p) { HillshadeParameter_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return HillshadeParameter_setPrototypeOf(o, p); }
  63641. function HillshadeParameter_createSuper(Derived) { var hasNativeReflectConstruct = HillshadeParameter_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = HillshadeParameter_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = HillshadeParameter_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return HillshadeParameter_possibleConstructorReturn(this, result); }; }
  63642. function HillshadeParameter_possibleConstructorReturn(self, call) { if (call && (HillshadeParameter_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return HillshadeParameter_assertThisInitialized(self); }
  63643. function HillshadeParameter_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  63644. function HillshadeParameter_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  63645. function HillshadeParameter_getPrototypeOf(o) { HillshadeParameter_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return HillshadeParameter_getPrototypeOf(o); }
  63646. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  63647. * This program are made available under the terms of the Apache License, Version 2.0
  63648. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  63649. /**
  63650. * @class HillshadeParameter
  63651. * @deprecatedclass SuperMap.HillshadeParameter
  63652. * @category iServer Map Tile
  63653. * @classdesc 阴影面分析参数类。
  63654. * @param {Object} options - 可选参数。
  63655. * @param {number} [options.altitude=45] - 高于地平线的光源高度角。高度角由正度数表示,0 度代表地平线,而 90 度代表头顶正上方。
  63656. * @param {number} [options.azimuth=315] - 光源的方位角。方位角由0到360度之间的正度数表示,以北为基准方向按顺时针进行测量。
  63657. * @param {number} [options.zFactor=1] - 一个表面 z 单位中地面 x,y 单位的数量。z 单位与输入表面的 x,y 单位不同时,可使用 z 因子调整 z 单位的测量单位。计算最终输出表面时,将用 z 因子乘以输入表面的 z 值。
  63658. * z 单位与输入表面的 x,y 单位不同时,可使用 z 因子调整 z 单位的测量单位。计算最终输出表面时,将用 z 因子乘以输入表面的 z 值。
  63659. * 如果 x,y 单位和 z 单位采用相同的测量单位,则 z 因子为 1。这是默认设置。
  63660. * 如果 x,y 单位和 z 单位采用不同的测量单位,则必须将 z 因子设置为适当的因子,否则会得到错误的结果。例如,如果 z 单位是英尺而 x,y 单位是米,则应使用 z 因子 0.3048 将 z 单位从英尺转换为米(1 英尺 = 0.3048 米)。
  63661. * 如果输入栅格位于球面坐标系中(如十进制度球面坐标系),则生成的山体阴影可能看起来很独特。这是因为水平地面单位与高程 z 单位之间的测量值存在差异。由于经度的长度随着纬度而变化,因此需要为该纬度指定一个适当的 z 因子。如果 x,y 单位是十进制度而 Z 单位是米,特定纬度的一些合适的 Z 因子为:
  63662. * Latitude Z-factor
  63663. * 0 0.00000898
  63664. * 10 0.00000912
  63665. * 20 0.00000956
  63666. * 30 0.00001036
  63667. * 40 0.00001171
  63668. * 50 0.00001395
  63669. * 60 0.00001792
  63670. * 70 0.00002619
  63671. * 80 0.00005156
  63672. * @extends {RasterFunctionParameter}
  63673. * @usage
  63674. */
  63675. var HillshadeParameter = /*#__PURE__*/function (_RasterFunctionParame) {
  63676. HillshadeParameter_inherits(HillshadeParameter, _RasterFunctionParame);
  63677. var _super = HillshadeParameter_createSuper(HillshadeParameter);
  63678. function HillshadeParameter(options) {
  63679. var _this;
  63680. HillshadeParameter_classCallCheck(this, HillshadeParameter);
  63681. _this = _super.call(this, options);
  63682. /**
  63683. * @member {number} [HillshadeParameter.prototype.altitude = 45]
  63684. * @description 高于地平线的光源高度角。高度角由正度数表示,0 度代表地平线,而 90 度代表头顶正上方。
  63685. */
  63686. _this.altitude = 45;
  63687. /**
  63688. * @member {number} [HillshadeParameter.prototype.azimuth = 315]
  63689. * @description 光源的方位角。方位角由0到360度之间的正度数表示,以北为基准方向按顺时针进行测量。
  63690. */
  63691. _this.azimuth = 315;
  63692. /**
  63693. * @member {number} [HillshadeParameter.prototype.zFactor = 1]
  63694. * @description 一个表面 z 单位中地面 x,y 单位的数量。z 单位与输入表面的 x,y 单位不同时,可使用 z 因子调整 z 单位的测量单位。计算最终输出表面时,将用 z 因子乘以输入表面的 z 值。
  63695. */
  63696. _this.zFactor = 1;
  63697. /**
  63698. * @member {RasterFunctionType} HillshadeParameter.prototype.type
  63699. * @description 栅格分析方法。
  63700. */
  63701. _this.type = RasterFunctionType.HILLSHADE;
  63702. Util_Util.extend(HillshadeParameter_assertThisInitialized(_this), options);
  63703. _this.CLASS_NAME = 'SuperMap.HillshadeParameter';
  63704. return _this;
  63705. }
  63706. /**
  63707. * @function HillshadeParameter.prototype.destroy
  63708. * @override
  63709. */
  63710. HillshadeParameter_createClass(HillshadeParameter, [{
  63711. key: "destroy",
  63712. value: function destroy() {
  63713. HillshadeParameter_get(HillshadeParameter_getPrototypeOf(HillshadeParameter.prototype), "destroy", this).call(this);
  63714. this.altitude = null;
  63715. this.azimuth = null;
  63716. this.zFactor = null;
  63717. }
  63718. /**
  63719. * @function HillshadeParameter.prototype.toJSON
  63720. * @description 将 HillshadeParameter 对象转化为 JSON 字符串。
  63721. * @returns {string} 返回转换后的 JSON 字符串。
  63722. */
  63723. }, {
  63724. key: "toJSON",
  63725. value: function toJSON() {
  63726. return {
  63727. altitude: this.altitude,
  63728. azimuth: this.azimuth,
  63729. zFactor: this.zFactor,
  63730. type: this.type
  63731. };
  63732. }
  63733. }]);
  63734. return HillshadeParameter;
  63735. }(RasterFunctionParameter);
  63736. ;// CONCATENATED MODULE: ./src/common/iServer/WebPrintingJobCustomItems.js
  63737. function WebPrintingJobCustomItems_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  63738. function WebPrintingJobCustomItems_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  63739. function WebPrintingJobCustomItems_createClass(Constructor, protoProps, staticProps) { if (protoProps) WebPrintingJobCustomItems_defineProperties(Constructor.prototype, protoProps); if (staticProps) WebPrintingJobCustomItems_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  63740. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  63741. * This program are made available under the terms of the Apache License, Version 2.0
  63742. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  63743. /**
  63744. * @class WebPrintingJobCustomItems
  63745. * @deprecatedclass SuperMap.WebPrintingJobCustomItems
  63746. * @classdesc Web 打印图例元素参数类。
  63747. * @version 10.1.0
  63748. * @category iServer WebPrintingJob
  63749. * @param {Object} option - 参数。
  63750. * @param {string} option.name - 图例元素的名称。
  63751. * @param {string} option.picAsUrl - 图例元素 Base64 格式图片。
  63752. * @param {string} [option.picAsBase64] - 图例元素图片的获取地址。如果已填了 URL 参数,此参数可不传。
  63753. * @usage
  63754. */
  63755. var WebPrintingJobCustomItems = /*#__PURE__*/function () {
  63756. function WebPrintingJobCustomItems(option) {
  63757. WebPrintingJobCustomItems_classCallCheck(this, WebPrintingJobCustomItems);
  63758. /**
  63759. * @member {string} WebPrintingJobCustomItems.prototype.name
  63760. * @description 图例元素的名称。
  63761. */
  63762. this.name = null;
  63763. /**
  63764. * @member {string} [WebPrintingJobCustomItems.prototype.picAsUrl]
  63765. * @description 图例元素 Base64 格式图片。
  63766. */
  63767. this.picAsUrl = null;
  63768. /**
  63769. * @member {string} [WebPrintingJobCustomItems.prototype.picAsBase64]
  63770. * @description 图例元素图片的获取地址。
  63771. */
  63772. this.picAsBase64 = null;
  63773. this.CLASS_NAME = 'SuperMap.WebPrintingJobCustomItems';
  63774. Util_Util.extend(this, option);
  63775. }
  63776. /**
  63777. * @function WebPrintingJobCustomItems.prototype.destroy
  63778. * @description 释放资源,将引用资源的属性置空。
  63779. */
  63780. WebPrintingJobCustomItems_createClass(WebPrintingJobCustomItems, [{
  63781. key: "destroy",
  63782. value: function destroy() {
  63783. var me = this;
  63784. me.name = null;
  63785. me.picAsUrl = null;
  63786. me.picAsBase64 = null;
  63787. }
  63788. /**
  63789. * @function WebPrintingJobCustomItems.prototype.toJSON
  63790. * @description 将 WebPrintingJobCustomItems 对象转化为 JSON 字符串。
  63791. * @returns {string} 转换后的 JSON 字符串。
  63792. */
  63793. }, {
  63794. key: "toJSON",
  63795. value: function toJSON() {
  63796. var params = {
  63797. name: this.name
  63798. };
  63799. if (this.title) {
  63800. params.title = this.title;
  63801. }
  63802. if (this.picAsUrl) {
  63803. params.picAsUrl = this.picAsUrl;
  63804. } else if (this.picAsBase64) {
  63805. params.picAsBase64 = this.picAsBase64.replace(/^data:.+;base64,/, '');
  63806. }
  63807. return Util_Util.toJSON(params);
  63808. }
  63809. }]);
  63810. return WebPrintingJobCustomItems;
  63811. }();
  63812. ;// CONCATENATED MODULE: ./src/common/iServer/WebPrintingJobImage.js
  63813. function WebPrintingJobImage_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  63814. function WebPrintingJobImage_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  63815. function WebPrintingJobImage_createClass(Constructor, protoProps, staticProps) { if (protoProps) WebPrintingJobImage_defineProperties(Constructor.prototype, protoProps); if (staticProps) WebPrintingJobImage_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  63816. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  63817. * This program are made available under the terms of the Apache License, Version 2.0
  63818. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  63819. /**
  63820. * @class WebPrintingJobImage
  63821. * @deprecatedclass SuperMap.WebPrintingJobImage
  63822. * @classdesc 表达小地图的静态图片参数类。
  63823. * @version 10.1.0
  63824. * @category iServer WebPrintingJob
  63825. * @param {Object} option - 参数。
  63826. * @param {string} option.picAsUrl - 小地图的图片 URL 地址。
  63827. * @param {string} [option.picAsBase64] - 小地图的base64位图片信息。如果已填了 URL 参数,此参数可不传。
  63828. * @usage
  63829. */
  63830. var WebPrintingJobImage = /*#__PURE__*/function () {
  63831. function WebPrintingJobImage(option) {
  63832. WebPrintingJobImage_classCallCheck(this, WebPrintingJobImage);
  63833. /**
  63834. * @member {string} [WebPrintingJobImage.prototype.picAsUrl]
  63835. * @description 小地图的图片 URL 地址。
  63836. */
  63837. this.picAsUrl = null;
  63838. /**
  63839. * @member {string} [WebPrintingJobImage.prototype.picAsBase64]
  63840. * @description 小地图的base64位图片信息。
  63841. */
  63842. this.picAsBase64 = null;
  63843. this.CLASS_NAME = 'SuperMap.WebPrintingJobImage';
  63844. Util_Util.extend(this, option);
  63845. }
  63846. /**
  63847. * @function WebPrintingJobImage.prototype.destroy
  63848. * @description 释放资源,将引用资源的属性置空。
  63849. */
  63850. WebPrintingJobImage_createClass(WebPrintingJobImage, [{
  63851. key: "destroy",
  63852. value: function destroy() {
  63853. this.picAsUrl = null;
  63854. this.picAsBase64 = null;
  63855. }
  63856. /**
  63857. * @function WebPrintingJobImage.prototype.toJSON
  63858. * @description 将 WebPrintingJobImage 对象转化为 JSON 字符串。
  63859. * @returns {string} 转换后的 JSON 字符串。
  63860. */
  63861. }, {
  63862. key: "toJSON",
  63863. value: function toJSON() {
  63864. var params = {};
  63865. if (this.picAsUrl) {
  63866. params.picAsUrl = this.picAsUrl;
  63867. }
  63868. if (this.picAsBase64) {
  63869. params.picAsBase64 = this.picAsBase64.replace(/^data:.+;base64,/, '');
  63870. }
  63871. return Util_Util.toJSON(params);
  63872. }
  63873. }]);
  63874. return WebPrintingJobImage;
  63875. }();
  63876. ;// CONCATENATED MODULE: ./src/common/iServer/WebPrintingJobLayers.js
  63877. function WebPrintingJobLayers_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  63878. function WebPrintingJobLayers_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  63879. function WebPrintingJobLayers_createClass(Constructor, protoProps, staticProps) { if (protoProps) WebPrintingJobLayers_defineProperties(Constructor.prototype, protoProps); if (staticProps) WebPrintingJobLayers_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  63880. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  63881. * This program are made available under the terms of the Apache License, Version 2.0
  63882. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  63883. /**
  63884. * @class WebPrintingJobLayers
  63885. * @deprecatedclass SuperMap.WebPrintingJobLayers
  63886. * @classdesc 将图例添加到布局的业务图层参数类。
  63887. * @version 10.1.0
  63888. * @category iServer WebPrintingJob
  63889. * @param {Object} option - 参数。
  63890. * @param {string} option.name - 图层 name 的字符串。此 name 必须唯一,并且必须与定义业务图层的 LegendOptions_layers 元素中的图层 name 匹配。
  63891. * @usage
  63892. */
  63893. var WebPrintingJobLayers = /*#__PURE__*/function () {
  63894. function WebPrintingJobLayers(option) {
  63895. WebPrintingJobLayers_classCallCheck(this, WebPrintingJobLayers);
  63896. /**
  63897. * @member {string} WebPrintingJobLayers.prototype.name
  63898. * @description 图层 name。
  63899. */
  63900. this.name = null;
  63901. /**
  63902. * @member {string} WebPrintingJobLayers.prototype.layerType
  63903. * @description 图层 type。
  63904. */
  63905. this.layerType = null;
  63906. /**
  63907. * @member {string} WebPrintingJobLayers.prototype.url
  63908. * @description 图层 URL。
  63909. */
  63910. this.url = null;
  63911. this.CLASS_NAME = 'SuperMap.WebPrintingJobLayers';
  63912. Util_Util.extend(this, option);
  63913. }
  63914. /**
  63915. * @function WebPrintingJobLayers.prototype.destroy
  63916. * @description 释放资源,将引用资源的属性置空。
  63917. */
  63918. WebPrintingJobLayers_createClass(WebPrintingJobLayers, [{
  63919. key: "destroy",
  63920. value: function destroy() {
  63921. this.name = null;
  63922. this.layerType = null;
  63923. this.url = null;
  63924. }
  63925. }]);
  63926. return WebPrintingJobLayers;
  63927. }();
  63928. ;// CONCATENATED MODULE: ./src/common/iServer/WebPrintingJobLegendOptions.js
  63929. function WebPrintingJobLegendOptions_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  63930. function WebPrintingJobLegendOptions_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  63931. function WebPrintingJobLegendOptions_createClass(Constructor, protoProps, staticProps) { if (protoProps) WebPrintingJobLegendOptions_defineProperties(Constructor.prototype, protoProps); if (staticProps) WebPrintingJobLegendOptions_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  63932. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  63933. * This program are made available under the terms of the Apache License, Version 2.0
  63934. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  63935. /**
  63936. * @class WebPrintingJobLegendOptions
  63937. * @deprecatedclass SuperMap.WebPrintingJobLegendOptions
  63938. * @classdesc Web 打印图例参数类。
  63939. * @version 10.1.0
  63940. * @category iServer WebPrintingJob
  63941. * @param {Object} option - 参数。
  63942. * @param {string} [option.title] - 图例名称。
  63943. * @param {string} [option.picAsUrl] - 图例的图片 URL 地址。
  63944. * @param {string} [option.picAsBase64] - 图例的 base64 位图片信息。
  63945. * @param {WebPrintingJobLayers} [option.layers] - 图例的布局业务图层参数类。
  63946. * @param {WebPrintingJobCustomItems} [option.customItems] - 自定义图例元素参数类。
  63947. * @usage
  63948. */
  63949. var WebPrintingJobLegendOptions = /*#__PURE__*/function () {
  63950. function WebPrintingJobLegendOptions(option) {
  63951. WebPrintingJobLegendOptions_classCallCheck(this, WebPrintingJobLegendOptions);
  63952. /**
  63953. * @member {string} WebPrintingJobLegendOptions.prototype.title
  63954. * @description 图例名称。
  63955. */
  63956. this.title = null;
  63957. /**
  63958. * @member {string} [WebPrintingJobLegendOptions.prototype.picAsUrl]
  63959. * @description 图例的图片 URL 地址。
  63960. */
  63961. this.picAsUrl = null;
  63962. /**
  63963. * @member {string} [WebPrintingJobLegendOptions.prototype.picAsBase64]
  63964. * @description 图例的 base64 位图片信息。
  63965. */
  63966. this.picAsBase64 = null;
  63967. /**
  63968. * @member {WebPrintingJobLayers} [WebPrintingJobLegendOptions.prototype.layers]
  63969. * @description 图例的布局业务图层参数类。
  63970. */
  63971. this.layers = null;
  63972. /**
  63973. * @member {WebPrintingJobCustomItems} [WebPrintingJobLegendOptions.prototype.customItems]
  63974. * @description 自定义图例元素参数类。
  63975. */
  63976. this.customItems = null;
  63977. this.CLASS_NAME = 'SuperMap.WebPrintingJobLegendOptions';
  63978. Util_Util.extend(this, option);
  63979. }
  63980. /**
  63981. * @function WebPrintingJobLegendOptions.prototype.destroy
  63982. * @description 释放资源,将引用资源的属性置空。
  63983. */
  63984. WebPrintingJobLegendOptions_createClass(WebPrintingJobLegendOptions, [{
  63985. key: "destroy",
  63986. value: function destroy() {
  63987. this.title = null;
  63988. this.picAsUrl = null;
  63989. this.picAsBase64 = null;
  63990. if (this.layers instanceof WebPrintingJobLayers) {
  63991. this.layers.destroy();
  63992. this.layers = null;
  63993. }
  63994. if (this.customItems instanceof WebPrintingJobCustomItems) {
  63995. this.customItems.destroy();
  63996. this.customItems = null;
  63997. }
  63998. }
  63999. /**
  64000. * @function WebPrintingJobLegendOptions.prototype.toJSON
  64001. * @description 将 WebPrintingJobLegendOptions 对象转化为 JSON 字符串。
  64002. * @returns {string} 转换后的 JSON 字符串。
  64003. */
  64004. }, {
  64005. key: "toJSON",
  64006. value: function toJSON() {
  64007. var params = {
  64008. title: this.title || ""
  64009. };
  64010. if (this.picAsUrl) {
  64011. params.picAsUrl = this.picAsUrl;
  64012. } else if (this.picAsBase64) {
  64013. params.picAsBase64 = this.picAsBase64.replace(/^data:.+;base64,/, '');
  64014. } else if (this.customItems) {
  64015. params.customItems = this.customItems;
  64016. }
  64017. return Util_Util.toJSON(params);
  64018. }
  64019. }]);
  64020. return WebPrintingJobLegendOptions;
  64021. }();
  64022. ;// CONCATENATED MODULE: ./src/common/iServer/WebPrintingJobLittleMapOptions.js
  64023. function WebPrintingJobLittleMapOptions_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  64024. function WebPrintingJobLittleMapOptions_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  64025. function WebPrintingJobLittleMapOptions_createClass(Constructor, protoProps, staticProps) { if (protoProps) WebPrintingJobLittleMapOptions_defineProperties(Constructor.prototype, protoProps); if (staticProps) WebPrintingJobLittleMapOptions_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  64026. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  64027. * This program are made available under the terms of the Apache License, Version 2.0
  64028. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  64029. /**
  64030. * @class WebPrintingJobLittleMapOptions
  64031. * @deprecatedclass SuperMap.WebPrintingJobLittleMapOptions
  64032. * @classdesc Web 打印小地图参数类。
  64033. * @version 10.1.0
  64034. * @category iServer WebPrintingJob
  64035. * @param {Object} option - 参数。
  64036. * @param {GeometryPoint|L.Point|L.LatLng|ol.geom.Point|mapboxgl.LngLat|mapboxgl.Point|Array.<number>} option.center - 小地图的中心点。
  64037. * @param {number} [option.scale] - 小地图的比例尺。
  64038. * @param {Array.<string>} [option.layerNames] - 指定 WebMap中图层名称的列表,用于渲染小地图。
  64039. * @param {WebPrintingJobImage} [option.image] - 表达小地图的静态图类。
  64040. * @param {WebPrintingJobLayers} [option.layers] - 指定 WebMap 中的 layers 图层类。
  64041. * @usage
  64042. */
  64043. var WebPrintingJobLittleMapOptions = /*#__PURE__*/function () {
  64044. function WebPrintingJobLittleMapOptions(option) {
  64045. WebPrintingJobLittleMapOptions_classCallCheck(this, WebPrintingJobLittleMapOptions);
  64046. /**
  64047. * @member {GeometryPoint|L.Point|L.LatLng|ol.geom.Point|mapboxgl.LngLat|mapboxgl.Point|Array.<number>} WebPrintingJobLittleMapOptions.prototype.center
  64048. * @description 小地图的中心点。
  64049. */
  64050. this.center = null;
  64051. /**
  64052. * @member {number} [WebPrintingJobLittleMapOptions.prototype.scale]
  64053. * @description 小地图的比例尺。
  64054. */
  64055. this.scale = null;
  64056. /**
  64057. * @member {Array.<string>} WebPrintingJobLittleMapOptions.prototype.layerNames
  64058. * @description 指定 WebMap中图层名称的列表,用于渲染小地图。
  64059. */
  64060. this.layerNames = null;
  64061. /**
  64062. * @member {WebPrintingJobImage} [WebPrintingJobLittleMapOptions.prototype.image]
  64063. * @description 表达小地图的静态图类。暂不支持。
  64064. */
  64065. this.image = null;
  64066. /**
  64067. * @member {WebPrintingJobLayers} [WebPrintingJobLittleMapOptions.prototype.layers]
  64068. * @description 指定 WebMap 中的 layers 图层类。
  64069. */
  64070. this.layers = null;
  64071. this.CLASS_NAME = 'SuperMap.WebPrintingJobLittleMapOptions';
  64072. Util_Util.extend(this, option);
  64073. }
  64074. /**
  64075. * @function WebPrintingJobLittleMapOptions.prototype.destroy
  64076. * @description 释放资源,将引用资源的属性置空。
  64077. */
  64078. WebPrintingJobLittleMapOptions_createClass(WebPrintingJobLittleMapOptions, [{
  64079. key: "destroy",
  64080. value: function destroy() {
  64081. this.center = null;
  64082. this.scale = null;
  64083. this.layerNames = null;
  64084. if (this.image instanceof WebPrintingJobImage) {
  64085. this.image.destroy();
  64086. this.image = null;
  64087. }
  64088. if (this.layers instanceof WebPrintingJobLayers) {
  64089. this.layers.destroy();
  64090. this.layers = null;
  64091. }
  64092. }
  64093. /**
  64094. * @function WebPrintingJobLittleMapOptions.prototype.toJSON
  64095. * @description 将 WebPrintingJobLittleMapOptions 对象转化为 JSON 字符串。
  64096. * @returns {string} 转换后的 JSON 字符串。
  64097. */
  64098. }, {
  64099. key: "toJSON",
  64100. value: function toJSON() {
  64101. var params = {
  64102. scale: this.scale,
  64103. center: this.center
  64104. };
  64105. if (this.layerNames) {
  64106. params.layerNames = this.layerNames;
  64107. } else if (this.layers) {
  64108. params.layers = this.layers;
  64109. }
  64110. if (this.image) {
  64111. params.image = this.image;
  64112. }
  64113. return Util_Util.toJSON(params);
  64114. }
  64115. }]);
  64116. return WebPrintingJobLittleMapOptions;
  64117. }();
  64118. ;// CONCATENATED MODULE: ./src/common/iServer/WebPrintingJobNorthArrowOptions.js
  64119. function WebPrintingJobNorthArrowOptions_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  64120. function WebPrintingJobNorthArrowOptions_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  64121. function WebPrintingJobNorthArrowOptions_createClass(Constructor, protoProps, staticProps) { if (protoProps) WebPrintingJobNorthArrowOptions_defineProperties(Constructor.prototype, protoProps); if (staticProps) WebPrintingJobNorthArrowOptions_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  64122. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  64123. * This program are made available under the terms of the Apache License, Version 2.0
  64124. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  64125. /**
  64126. * @class WebPrintingJobNorthArrowOptions
  64127. * @deprecatedclass SuperMap.WebPrintingJobNorthArrowOptions
  64128. * @classdesc Web 打印地图指北针参数类。
  64129. * @version 10.1.0
  64130. * @category iServer WebPrintingJob
  64131. * @param {Object} option - 参数。
  64132. * @param {string} option.picAsUrl - 指北针的图片 URL 地址。
  64133. * @param {string} [option.picAsBase64] - 指北针的base64位图片信息。
  64134. * @usage
  64135. */
  64136. var WebPrintingJobNorthArrowOptions = /*#__PURE__*/function () {
  64137. function WebPrintingJobNorthArrowOptions(option) {
  64138. WebPrintingJobNorthArrowOptions_classCallCheck(this, WebPrintingJobNorthArrowOptions);
  64139. /**
  64140. * @member {string} WebPrintingJobNorthArrowOptions.prototype.picAsUrl
  64141. * @description 指北针的图片 URL 地址。
  64142. */
  64143. this.picAsUrl = null;
  64144. /**
  64145. * @member {string} [WebPrintingJobNorthArrowOptions.prototype.picAsBase64]
  64146. * @description 指北针的base64位图片信息。
  64147. */
  64148. this.picAsBase64 = null;
  64149. this.CLASS_NAME = 'SuperMap.WebPrintingJobNorthArrowOptions';
  64150. Util_Util.extend(this, option);
  64151. }
  64152. /**
  64153. * @function WebPrintingJobNorthArrowOptions.prototype.destroy
  64154. * @description 释放资源,将引用资源的属性置空。
  64155. */
  64156. WebPrintingJobNorthArrowOptions_createClass(WebPrintingJobNorthArrowOptions, [{
  64157. key: "destroy",
  64158. value: function destroy() {
  64159. this.picAsUrl = null;
  64160. this.picAsBase64 = null;
  64161. }
  64162. /**
  64163. * @function WebPrintingJobNorthArrowOptions.prototype.toJSON
  64164. * @description 将 WebPrintingJobNorthArrowOptions 对象转化为 JSON 字符串。
  64165. * @returns {string} 转换后的 JSON 字符串。
  64166. */
  64167. }, {
  64168. key: "toJSON",
  64169. value: function toJSON() {
  64170. var params = {};
  64171. if (this.picAsUrl) {
  64172. params.picAsUrl = this.picAsUrl;
  64173. } else if (this.picAsBase64) {
  64174. params.picAsBase64 = this.picAsBase64.replace(/^data:.+;base64,/, '');
  64175. }
  64176. return Util_Util.toJSON(params);
  64177. }
  64178. }]);
  64179. return WebPrintingJobNorthArrowOptions;
  64180. }();
  64181. ;// CONCATENATED MODULE: ./src/common/iServer/WebPrintingJobScaleBarOptions.js
  64182. function WebPrintingJobScaleBarOptions_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  64183. function WebPrintingJobScaleBarOptions_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  64184. function WebPrintingJobScaleBarOptions_createClass(Constructor, protoProps, staticProps) { if (protoProps) WebPrintingJobScaleBarOptions_defineProperties(Constructor.prototype, protoProps); if (staticProps) WebPrintingJobScaleBarOptions_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  64185. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  64186. * This program are made available under the terms of the Apache License, Version 2.0
  64187. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  64188. /**
  64189. * @class WebPrintingJobScaleBarOptions
  64190. * @deprecatedclass SuperMap.WebPrintingJobScaleBarOptions
  64191. * @classdesc Web 打印比例尺参数类。
  64192. * @category iServer WebPrintingJob
  64193. * @version 10.1.0
  64194. * @param {Object} option - 参数。
  64195. * @param {string} [option.scaleText] - 比例尺文本信息。例如:1:1000000。
  64196. * @param {WebScaleOrientationType} [option.orientation] - 比例尺的方位样式。
  64197. * @param {WebScaleType} [option.type] - 比例尺的样式。
  64198. * @param {number} [option.intervals] - 比例尺条的段数。
  64199. * @param {WebScaleUnit} [option.unit] - 比例尺的单位制。
  64200. * @usage
  64201. */
  64202. var WebPrintingJobScaleBarOptions = /*#__PURE__*/function () {
  64203. function WebPrintingJobScaleBarOptions(option) {
  64204. WebPrintingJobScaleBarOptions_classCallCheck(this, WebPrintingJobScaleBarOptions);
  64205. /**
  64206. * @member {string} WebPrintingJobScaleBarOptions.prototype.scaleText
  64207. * @description 比例尺文本信息。
  64208. */
  64209. this.scaleText = null;
  64210. /**
  64211. * @member {WebScaleOrientationType} [WebPrintingJobScaleBarOptions.prototype.orientation]
  64212. * @description 比例尺的方位样式。
  64213. */
  64214. this.orientation = null;
  64215. /**
  64216. * @member {WebScaleType} [WebPrintingJobScaleBarOptions.prototype.type]
  64217. * @description 比例尺的样式。
  64218. */
  64219. this.type = null;
  64220. /**
  64221. * @member {Object} [WebPrintingJobScaleBarOptions.prototype.intervals]
  64222. * @description 比例尺条的段数。
  64223. */
  64224. this.intervals = null;
  64225. /**
  64226. * @member {WebScaleUnit} [WebPrintingJobScaleBarOptions.prototype.unit]
  64227. * @description 比例尺的单位制。
  64228. */
  64229. this.unit = null;
  64230. this.CLASS_NAME = 'SuperMap.WebPrintingJobScaleBarOptions';
  64231. Util_Util.extend(this, option);
  64232. }
  64233. /**
  64234. * @function WebPrintingJobScaleBarOptions.prototype.destroy
  64235. * @description 释放资源,将引用资源的属性置空。
  64236. */
  64237. WebPrintingJobScaleBarOptions_createClass(WebPrintingJobScaleBarOptions, [{
  64238. key: "destroy",
  64239. value: function destroy() {
  64240. this.scaleText = null;
  64241. this.orientation = null;
  64242. this.type = null;
  64243. this.intervals = null;
  64244. this.unit = null;
  64245. }
  64246. /**
  64247. * @function WebPrintingJobScaleBarOptions.prototype.toJSON
  64248. * @description 将 WebPrintingJobScaleBarOptions 对象转化为 JSON 字符串。
  64249. * @returns {string} 转换后的 JSON 字符串。
  64250. */
  64251. }, {
  64252. key: "toJSON",
  64253. value: function toJSON() {
  64254. var params = {
  64255. scaleText: this.scaleText || "",
  64256. type: this.type || "BAR",
  64257. intervals: this.intervals || "",
  64258. unit: this.unit || "METER"
  64259. };
  64260. if (this.orientation) {
  64261. params.orientation = this.orientation;
  64262. }
  64263. return Util_Util.toJSON(params);
  64264. }
  64265. }]);
  64266. return WebPrintingJobScaleBarOptions;
  64267. }();
  64268. ;// CONCATENATED MODULE: ./src/common/iServer/WebPrintingJobContent.js
  64269. function WebPrintingJobContent_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  64270. function WebPrintingJobContent_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  64271. function WebPrintingJobContent_createClass(Constructor, protoProps, staticProps) { if (protoProps) WebPrintingJobContent_defineProperties(Constructor.prototype, protoProps); if (staticProps) WebPrintingJobContent_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  64272. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  64273. * This program are made available under the terms of the Apache License, Version 2.0
  64274. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  64275. /**
  64276. * @class WebPrintingJobContent
  64277. * @deprecatedclass SuperMap.WebPrintingJobContent
  64278. * @classdesc Web 打印内容参数类。
  64279. * @version 10.1.0
  64280. * @category iServer WebPrintingJob
  64281. * @param {Object} option - 参数。
  64282. * @param {string} option.type - Web 打印内容支持的类型。目前支持的类型:WEBMAP。
  64283. * @param {string} [option.url] - 待打印的 SuperMap iPortal WebMap 的 URL 地址。例如:http://supermapiportal:8190/iportal/web/maps/{mapid}/map.rjson 。
  64284. * @param {string} [option.token] - 如果待打印的是 SuperMap iPortal 用户私有的 WebMap,需要提供 SuperMap iPortal 用户的 token。
  64285. * @param {WebMapSummaryObject} [option.value] - 传递的是一个符合 SuperMap WebMap 规范的 WebMap 的 JSON 表达,也可以是一个完整的 SuperMap iPortal 数据上图制作的 WebMap 的 JSON 表达。如果已填了 URL 参数,此参数可不传。
  64286. * @usage
  64287. */
  64288. var WebPrintingJobContent = /*#__PURE__*/function () {
  64289. function WebPrintingJobContent(option) {
  64290. WebPrintingJobContent_classCallCheck(this, WebPrintingJobContent);
  64291. /**
  64292. * @member {string} WebPrintingJobContent.prototype.type
  64293. * @description Web 打印内容支持的类型。
  64294. */
  64295. this.type = null;
  64296. /**
  64297. * @member {string} [WebPrintingJobContent.prototype.url]
  64298. * @description 待打印的 SuperMap iPortal WebMap 的 URL 地址。
  64299. */
  64300. this.url = null;
  64301. /**
  64302. * @member {string} [WebPrintingJobContent.prototype.token]
  64303. * @description 如果待打印的是 SuperMap iPortal 用户私有的 WebMap,需要提供 SuperMap iPortal 用户的 token。
  64304. */
  64305. this.token = null;
  64306. /**
  64307. * @member {WebMapSummaryObject} [WebPrintingJobContent.prototype.value]
  64308. * @description 传递的是一个符合 SuperMap WebMap 规范的 WebMap 的 JSON 表达,也可以是一个完整的 SuperMap iPortal 数据上图制作的 WebMap 的 JSON 表达。
  64309. */
  64310. this.value = null;
  64311. this.CLASS_NAME = 'SuperMap.WebPrintingJobContent';
  64312. Util_Util.extend(this, option);
  64313. }
  64314. /**
  64315. * @function WebPrintingJobContent.prototype.destroy
  64316. * @description 释放资源,将引用资源的属性置空。
  64317. */
  64318. WebPrintingJobContent_createClass(WebPrintingJobContent, [{
  64319. key: "destroy",
  64320. value: function destroy() {
  64321. this.type = false || "WEBMAP";
  64322. this.url = null;
  64323. this.token = null;
  64324. this.value = null;
  64325. }
  64326. /**
  64327. * @function WebPrintingJobContent.prototype.toJSON
  64328. * @description 将 WebPrintingJobContent 对象转化为 JSON 字符串。
  64329. * @returns {string} 转换后的 JSON 字符串。
  64330. */
  64331. }, {
  64332. key: "toJSON",
  64333. value: function toJSON() {
  64334. var params = {
  64335. type: this.type
  64336. };
  64337. if (this.token) {
  64338. params.token = this.token;
  64339. }
  64340. if (this.url) {
  64341. params.url = this.url;
  64342. } else if (this.value) {
  64343. params.value = this.value;
  64344. }
  64345. return Util_Util.toJSON(params);
  64346. }
  64347. }]);
  64348. return WebPrintingJobContent;
  64349. }();
  64350. ;// CONCATENATED MODULE: ./src/common/iServer/WebPrintingJobLayoutOptions.js
  64351. function WebPrintingJobLayoutOptions_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  64352. function WebPrintingJobLayoutOptions_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  64353. function WebPrintingJobLayoutOptions_createClass(Constructor, protoProps, staticProps) { if (protoProps) WebPrintingJobLayoutOptions_defineProperties(Constructor.prototype, protoProps); if (staticProps) WebPrintingJobLayoutOptions_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  64354. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  64355. * This program are made available under the terms of the Apache License, Version 2.0
  64356. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  64357. /**
  64358. * @class WebPrintingJobLayoutOptions
  64359. * @deprecatedclass SuperMap.WebPrintingJobLayoutOptions
  64360. * @classdesc Web 打印的布局参数类。
  64361. * @version 10.1.0
  64362. * @category iServer WebPrintingJob
  64363. * @param {Object} option - 参数。
  64364. * @param {string} option.templateName - 布局模板的名称。
  64365. * @param {string} option.title - 地图主标题名称。
  64366. * @param {string} option.subTitle - 地图副标题名称。
  64367. * @param {string} option.author - 作者名称。
  64368. * @param {string} option.copyright - 版权信息。
  64369. * @param {WebPrintingJobLittleMapOptions} option.littleMapOptions - 小地图参数类。
  64370. * @param {WebPrintingJobLegendOptions} option.legendOptions - 图例参数类。
  64371. * @param {WebPrintingJobScaleBarOptions} [option.scaleBarOptions] - 地图比例尺参数类。
  64372. * @param {WebPrintingJobNorthArrowOptions} [option.northArrowOptions] - 地图指北针参数类。
  64373. * @usage
  64374. */
  64375. var WebPrintingJobLayoutOptions = /*#__PURE__*/function () {
  64376. function WebPrintingJobLayoutOptions(option) {
  64377. WebPrintingJobLayoutOptions_classCallCheck(this, WebPrintingJobLayoutOptions);
  64378. /**
  64379. * @member {string} WebPrintingJobLayoutOptions.prototype.templateName
  64380. * @description 布局模板的名称。
  64381. */
  64382. this.templateName = null;
  64383. /**
  64384. * @member {string} WebPrintingJobLayoutOptions.prototype.title
  64385. * @description 地图主标题名称。
  64386. */
  64387. this.title = null;
  64388. /**
  64389. * @member {string} WebPrintingJobLayoutOptions.prototype.subTitle
  64390. * @description 地图副标题名称。
  64391. */
  64392. this.subTitle = null;
  64393. /**
  64394. * @member {string} WebPrintingJobLayoutOptions.prototype.author
  64395. * @description 地图作者名称。
  64396. */
  64397. this.author = null;
  64398. /**
  64399. * @member {string} WebPrintingJobLayoutOptions.prototype.copyright
  64400. * @description 地图版权信息。
  64401. */
  64402. this.copyright = null;
  64403. /**
  64404. * @member {WebPrintingJobScaleBarOptions} [WebPrintingJobLayoutOptions.prototype.scaleBarOptions]
  64405. * @description 地图比例尺参数类。
  64406. */
  64407. this.scaleBarOptions = null;
  64408. /**
  64409. * @member {WebPrintingJobNorthArrowOptions} [WebPrintingJobLayoutOptions.prototype.northArrowOptions]
  64410. * @description 地图指北针参数类。
  64411. */
  64412. this.northArrowOptions = null;
  64413. /**
  64414. * @member {WebPrintingJobLittleMapOptions} WebPrintingJobLayoutOptions.prototype.littleMapOptions
  64415. * @description 小地图参数类。
  64416. */
  64417. this.littleMapOptions = null;
  64418. /**
  64419. * @member {WebPrintingJobLegendOptions} WebPrintingJobLayoutOptions.prototype.legendOptions
  64420. * @description 图例参数类。
  64421. */
  64422. this.legendOptions = null;
  64423. this.CLASS_NAME = 'SuperMap.WebPrintingJobLayoutOptions';
  64424. Util_Util.extend(this, option);
  64425. }
  64426. /**
  64427. * @function WebPrintingJobLayoutOptions.prototype.destroy
  64428. * @description 释放资源,将引用资源的属性置空。
  64429. */
  64430. WebPrintingJobLayoutOptions_createClass(WebPrintingJobLayoutOptions, [{
  64431. key: "destroy",
  64432. value: function destroy() {
  64433. this.templateName = null;
  64434. this.title = null;
  64435. this.subTitle = null;
  64436. this.author = null;
  64437. this.copyright = null;
  64438. if (this.scaleBarOptions instanceof WebPrintingJobScaleBarOptions) {
  64439. this.scaleBarOptions.destroy();
  64440. this.scaleBarOptions = null;
  64441. }
  64442. if (this.northArrowOptions instanceof WebPrintingJobNorthArrowOptions) {
  64443. this.northArrowOptions.destroy();
  64444. this.northArrowOptions = null;
  64445. }
  64446. if (this.littleMapOptions instanceof WebPrintingJobLittleMapOptions) {
  64447. this.littleMapOptions.destroy();
  64448. this.littleMapOptions = null;
  64449. }
  64450. if (this.legendOptions instanceof WebPrintingJobLegendOptions) {
  64451. this.legendOptions.destroy();
  64452. this.legendOptions = null;
  64453. }
  64454. }
  64455. /**
  64456. * @function WebPrintingJobLayoutOptions.prototype.toJSON
  64457. * @description 将 WebPrintingJobLayoutOptions 对象转化为 JSON 字符串。
  64458. * @returns {string} 转换后的 JSON 字符串。
  64459. */
  64460. }, {
  64461. key: "toJSON",
  64462. value: function toJSON() {
  64463. var params = {
  64464. templateName: this.templateName,
  64465. title: this.title,
  64466. subTitle: this.subTitle,
  64467. author: this.author,
  64468. copyright: this.copyright
  64469. };
  64470. if (this.scaleBarOptions) {
  64471. params.scaleBarOptions = this.scaleBarOptions;
  64472. }
  64473. if (this.northArrowOptions) {
  64474. params.northArrowOptions = this.northArrowOptions;
  64475. }
  64476. if (this.littleMapOptions) {
  64477. params.littleMapOptions = this.littleMapOptions;
  64478. }
  64479. if (this.legendOptions) {
  64480. params.legendOptions = this.legendOptions;
  64481. }
  64482. return Util_Util.toJSON(params);
  64483. }
  64484. }]);
  64485. return WebPrintingJobLayoutOptions;
  64486. }();
  64487. ;// CONCATENATED MODULE: ./src/common/iServer/WebPrintingJobExportOptions.js
  64488. function WebPrintingJobExportOptions_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  64489. function WebPrintingJobExportOptions_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  64490. function WebPrintingJobExportOptions_createClass(Constructor, protoProps, staticProps) { if (protoProps) WebPrintingJobExportOptions_defineProperties(Constructor.prototype, protoProps); if (staticProps) WebPrintingJobExportOptions_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  64491. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  64492. * This program are made available under the terms of the Apache License, Version 2.0
  64493. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  64494. /**
  64495. * @class WebPrintingJobExportOptions
  64496. * @deprecatedclass SuperMap.WebPrintingJobExportOptions
  64497. * @classdesc Web 打印的输出参数类。
  64498. * @version 10.1.0
  64499. * @category iServer WebPrintingJob
  64500. * @param {Object} option - 参数。
  64501. * @param {WebExportFormatType} option.format - Web 打印输出的格式,目前支持:PNG、PDF。
  64502. * @param {number} [option.dpi=96] - Web 打印输出的分辨率,单位为每英寸点数。默认值为 96 DPI。
  64503. * @param {number} [option.scale] - Web 打印输出的地图比例尺。
  64504. * @param {number} [option.rotation] - Web 打印输出的地图角度。
  64505. * @param {GeometryPoint|L.Point|L.LatLng|ol.geom.Point|mapboxgl.LngLat|mapboxgl.Point|Array.<number>} [option.center] - Web 打印输出的地图中心点。
  64506. * @usage
  64507. */
  64508. var WebPrintingJobExportOptions = /*#__PURE__*/function () {
  64509. function WebPrintingJobExportOptions(option) {
  64510. WebPrintingJobExportOptions_classCallCheck(this, WebPrintingJobExportOptions);
  64511. /**
  64512. * @member {WebExportFormatType} WebPrintingJobExportOptions.prototype.format
  64513. * @description Web 打印输出的格式。
  64514. */
  64515. this.format = null;
  64516. /**
  64517. * @member {number} [WebPrintingJobExportOptions.prototype.dpi=96]
  64518. * @description Web 打印输出的分辨率,单位为每英寸点数。
  64519. */
  64520. this.dpi = 96;
  64521. /**
  64522. * @member {number} [WebPrintingJobExportOptions.prototype.scale]
  64523. * @description Web 打印输出的地图比例尺。
  64524. */
  64525. this.scale = null;
  64526. /**
  64527. * @member {number} [WebPrintingJobExportOptions.prototype.rotation]
  64528. * @description Web 打印输出的地图角度。
  64529. */
  64530. this.rotation = null;
  64531. /**
  64532. * @member {GeometryPoint|L.Point|L.LatLng|ol.geom.Point|mapboxgl.LngLat|mapboxgl.Point|Array.<number>} [WebPrintingJobExportOptions.prototype.center]
  64533. * @description Web 打印输出的地图中心点。
  64534. */
  64535. this.center = null;
  64536. this.CLASS_NAME = 'SuperMap.WebPrintingJobExportOptions';
  64537. Util_Util.extend(this, option);
  64538. }
  64539. /**
  64540. * @function WebPrintingJobExportOptions.prototype.destroy
  64541. * @description 释放资源,将引用资源的属性置空。
  64542. */
  64543. WebPrintingJobExportOptions_createClass(WebPrintingJobExportOptions, [{
  64544. key: "destroy",
  64545. value: function destroy() {
  64546. this.format = null;
  64547. this.dpi = null;
  64548. this.scale = null;
  64549. this.rotation = null;
  64550. this.center = null;
  64551. this.outputSize = null;
  64552. }
  64553. /**
  64554. * @function WebPrintingJobExportOptions.prototype.toJSON
  64555. * @description 将 WebPrintingJobExportOptions 对象转化为 JSON 字符串。
  64556. * @returns {string} 转换后的 JSON 字符串。
  64557. */
  64558. }, {
  64559. key: "toJSON",
  64560. value: function toJSON() {
  64561. var params = {
  64562. format: this.format || "PDF",
  64563. dpi: this.dpi,
  64564. scale: this.scale,
  64565. center: this.center
  64566. };
  64567. if (this.rotation) {
  64568. params.rotation = this.rotation;
  64569. }
  64570. if (this.outputSize) {
  64571. params.outputSize = this.outputSize;
  64572. }
  64573. return Util_Util.toJSON(params);
  64574. }
  64575. }]);
  64576. return WebPrintingJobExportOptions;
  64577. }();
  64578. ;// CONCATENATED MODULE: ./src/common/iServer/WebPrintingJobParameters.js
  64579. function WebPrintingJobParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  64580. function WebPrintingJobParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  64581. function WebPrintingJobParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) WebPrintingJobParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) WebPrintingJobParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  64582. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  64583. * This program are made available under the terms of the Apache License, Version 2.0
  64584. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  64585. /**
  64586. * @class WebPrintingJobParameters
  64587. * @deprecatedclass SuperMap.WebPrintingJobParameters
  64588. * @category iServer WebPrintingJob
  64589. * @version 10.1.0
  64590. * @classdesc Web 打印参数类。
  64591. * @param {Object} options - 参数。
  64592. * @param {WebPrintingJobContent} options.content - Web 打印的内容类。
  64593. * @param {WebPrintingJobLayoutOptions} options.layoutOptions - Web 打印的布局类,包含各种布局元素的设置。
  64594. * @param {WebPrintingJobExportOptions} options.exportOptions - Web 打印的输出类,包含 DPI、页面大小等。
  64595. * @usage
  64596. */
  64597. var WebPrintingJobParameters = /*#__PURE__*/function () {
  64598. function WebPrintingJobParameters(options) {
  64599. WebPrintingJobParameters_classCallCheck(this, WebPrintingJobParameters);
  64600. if (!options) {
  64601. return;
  64602. }
  64603. /**
  64604. * @member {WebPrintingJobContent} WebPrintingJobParameters.prototype.content
  64605. * @description Web 打印的内容类。
  64606. */
  64607. this.content = null;
  64608. /**
  64609. * @member {WebPrintingJobLayoutOptions} WebPrintingJobParameters.prototype.layoutOptions
  64610. * @description Web 打印的布局类,包含各种布局元素的设置。
  64611. */
  64612. this.layoutOptions = null;
  64613. /**
  64614. * @member {WebPrintingJobExportOptions} WebPrintingJobParameters.prototype.exportOptions
  64615. * @description Web 打印的输出类,包含 DPI、页面大小等。
  64616. */
  64617. this.exportOptions = null;
  64618. Util_Util.extend(this, options);
  64619. this.CLASS_NAME = 'SuperMap.WebPrintingJobParameters';
  64620. }
  64621. /**
  64622. * @function WebPrintingJobParameters.prototype.destroy
  64623. * @description 释放资源,将引用资源的属性置空。
  64624. */
  64625. WebPrintingJobParameters_createClass(WebPrintingJobParameters, [{
  64626. key: "destroy",
  64627. value: function destroy() {
  64628. if (this.content instanceof WebPrintingJobContent) {
  64629. this.content.destroy();
  64630. this.content = null;
  64631. }
  64632. if (this.layoutOptions instanceof WebPrintingJobLayoutOptions) {
  64633. this.layoutOptions.destroy();
  64634. this.layoutOptions = null;
  64635. }
  64636. if (this.exportOptions instanceof WebPrintingJobExportOptions) {
  64637. this.exportOptions.destroy();
  64638. this.exportOptions = null;
  64639. }
  64640. }
  64641. }]);
  64642. return WebPrintingJobParameters;
  64643. }();
  64644. ;// CONCATENATED MODULE: ./src/common/iServer/FieldsFilter.js
  64645. function FieldsFilter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  64646. function FieldsFilter_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  64647. function FieldsFilter_createClass(Constructor, protoProps, staticProps) { if (protoProps) FieldsFilter_defineProperties(Constructor.prototype, protoProps); if (staticProps) FieldsFilter_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  64648. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  64649. * This program are made available under the terms of the Apache License, Version 2.0
  64650. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  64651. /**
  64652. * @class FieldsFilter
  64653. * @deprecatedclass SuperMap.FieldsFilter
  64654. * @category iServer Data Field
  64655. * @classdesc 指定返回的用于描述 Feature 的字段。
  64656. * @param {Object} options - 可选参数。
  64657. * @param {Array.<string>} [options.include] 对返回的字段内容进行过滤,需保留的字段列表。
  64658. * @param {Array.<string>} [options.exclude] 对返回的字段内容进行过滤,需排除的字段列表。
  64659. * @usage
  64660. */
  64661. var FieldsFilter = /*#__PURE__*/function () {
  64662. function FieldsFilter(options) {
  64663. FieldsFilter_classCallCheck(this, FieldsFilter);
  64664. /**
  64665. * @description 对返回的字段内容进行过滤,需保留的字段列表。
  64666. * @member {Array.<string>} FieldsFilter.prototype.include
  64667. */
  64668. this.include = undefined;
  64669. /**
  64670. * @description 对返回的字段内容进行过滤,需排除的字段列表。
  64671. * @member {Array.<string>} FieldsFilter.prototype.exclude
  64672. */
  64673. this.exclude = undefined;
  64674. this.CLASS_NAME = 'SuperMap.FieldsFilter';
  64675. Util_Util.extend(this, options);
  64676. }
  64677. /**
  64678. * @function FieldsFilter.prototype.destroy
  64679. * @description 释放资源,将引用资源的属性置空。
  64680. */
  64681. FieldsFilter_createClass(FieldsFilter, [{
  64682. key: "destroy",
  64683. value: function destroy() {
  64684. var me = this;
  64685. me.include = undefined;
  64686. me.exclude = undefined;
  64687. }
  64688. /**
  64689. * @function FieldsFilter.prototype.constructFromObject
  64690. * @description 目标对象新增该类的可选参数。
  64691. * @param {Object} data 要转换的数据。
  64692. * @param {FieldsFilter} obj 返回的模型。
  64693. * @return {FieldsFilter} 返回结果。
  64694. */
  64695. }], [{
  64696. key: "constructFromObject",
  64697. value: function constructFromObject(data, obj) {
  64698. if (data) {
  64699. obj = obj || new FieldsFilter();
  64700. if (data.hasOwnProperty('include')) {
  64701. obj.include = data.include;
  64702. }
  64703. if (data.hasOwnProperty('exclude')) {
  64704. obj.exclude = data.exclude;
  64705. }
  64706. }
  64707. return obj;
  64708. }
  64709. }]);
  64710. return FieldsFilter;
  64711. }();
  64712. ;// CONCATENATED MODULE: ./src/common/iServer/Sortby.js
  64713. function Sortby_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  64714. function Sortby_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  64715. function Sortby_createClass(Constructor, protoProps, staticProps) { if (protoProps) Sortby_defineProperties(Constructor.prototype, protoProps); if (staticProps) Sortby_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  64716. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  64717. * This program are made available under the terms of the Apache License, Version 2.0
  64718. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  64719. /**
  64720. * @class Sortby
  64721. * @deprecatedclass SuperMap.Sortby
  64722. * @classdesc 通过指定字段进行排序的方法类。
  64723. * @category BaseTypes Util
  64724. * @param {Object} options - 参数。
  64725. * @param {string} options.field 属性名称。
  64726. * @param {Sortby.Direction} options.direction 排序规则,默认升序。
  64727. * @usage
  64728. */
  64729. var Sortby = /*#__PURE__*/function () {
  64730. function Sortby(options) {
  64731. Sortby_classCallCheck(this, Sortby);
  64732. /**
  64733. * @description 属性名称。
  64734. * @member {string} Sortby.prototype.field
  64735. */
  64736. this.field = undefined;
  64737. /**
  64738. * @description 排序规则。
  64739. * @member {Sortby.Direction} Sortby.prototype.direction
  64740. * @default Sortby.Direction.ASC
  64741. */
  64742. this.direction = Sortby.Direction.ASC;
  64743. this.CLASS_NAME = 'SuperMap.Sortby';
  64744. Util_Util.extend(this, options);
  64745. }
  64746. /**
  64747. * @function Sortby.prototype.destroy
  64748. * @description 释放资源,将引用资源的属性置空。
  64749. */
  64750. Sortby_createClass(Sortby, [{
  64751. key: "destroy",
  64752. value: function destroy() {
  64753. var me = this;
  64754. me.field = undefined;
  64755. me.direction = 'ASC';
  64756. }
  64757. /**
  64758. * @function Sortby.prototype.constructFromObject
  64759. * @description 目标对象新增该类的可选参数。
  64760. * @param {Object} data 要转换的数据。
  64761. * @param {Sortby} obj 返回的模型。
  64762. * @return {Sortby} 返回结果。
  64763. */
  64764. }], [{
  64765. key: "constructFromObject",
  64766. value: function constructFromObject(data, obj) {
  64767. if (data) {
  64768. obj = obj || new Sortby();
  64769. if (data.hasOwnProperty('field')) {
  64770. obj.field = data.field;
  64771. }
  64772. if (data.hasOwnProperty('direction')) {
  64773. obj.direction = data.direction;
  64774. }
  64775. }
  64776. return obj;
  64777. }
  64778. }]);
  64779. return Sortby;
  64780. }();
  64781. /**
  64782. * @enum Direction
  64783. * @description 排序的类型枚举。
  64784. * @memberOf Sortby
  64785. * @readonly
  64786. * @type {string}
  64787. */
  64788. Sortby.Direction = {
  64789. /** 升序。 */
  64790. ASC: 'ASC',
  64791. /** 降序。 */
  64792. DESC: 'DESC'
  64793. };
  64794. ;// CONCATENATED MODULE: ./src/common/iServer/ImageSearchParameter.js
  64795. function ImageSearchParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  64796. function ImageSearchParameter_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  64797. function ImageSearchParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) ImageSearchParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) ImageSearchParameter_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  64798. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  64799. * This program are made available under the terms of the Apache License, Version 2.0
  64800. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  64801. /**
  64802. * @class ImageSearchParameter
  64803. * @deprecatedclass SuperMap.ImageSearchParameter
  64804. * @classdesc 影像服务查询参数类。
  64805. * @category iServer Image
  64806. * @param {Object} options - 可选参数。
  64807. * @param {Array.<number>} [options.bbox] 指定查询范围。只有具有几何对象(geometry)属性的Features,并且该几何对象与该参数指定的范围相交的 Features 才会被选择出来。该参数可以包含4个数值或者6个数值,这取决于使用的坐标参考系统是否包含高程值: * 左下角坐标轴 1 的值 * 左下角坐标轴 2 的值 * 坐标轴 3 的最小值(可选) * 右上角坐标轴 1 的值 * 右上角坐标轴 2 的值 * 坐标轴 3 的最大值(可选) 坐标参考系统为 WGS 84 经度/纬度 (http://www.opengis.net/def/crs/OGC/1.3/CRS84)。对于 “WGS 84 经度/纬度” 坐标参考系统,该参数值的格式通常为:最小经度,最小纬度,最大经度,最大纬度。如果包含了高程值,该参数的格式为:最小经度,最小纬度,最小高程值,最大经度,最大纬度,最大高程值。如果一个 Feature 具有多个空间几何对象(geometry)属性,由服务器决定是否使用单一的空间几何对象属性,还是使用所有相关的几何对象作为最终的查询空间范围。
  64808. * @param {Array.<string>} [options.collections] 影像集合的ID数组,将在该指定的Collection中搜索Items。
  64809. * @param {Array.<string>} [options.ids] 只返回指定 Item 的 ID 数组中的Item。返回的 Item 的 ID 值数组。设置了该参数,所有其他过滤器参数(除了next和limit)将被忽略。
  64810. * @param {number} [options.limit] 返回的最大结果数,即响应文档包含的 Item 的数目。
  64811. * @param {FieldsFilter} [options.fields] 通过‘include’和‘exclude’属性分别指定哪些字段包含在查询结果的 Feature 描述中,哪些需要排除。返回结果中的stac_version,id,bbox,assets,links,geometry,type,properties这些字段为必须字段,若要返回结果中不含这种字段信息,需要显示地进行排除设置,如:排除geometry和bbox字段;在POST请求中,则需要将这些字段添加到“exclude”字段中,例如: "fields": { "exclude": ["geometry","bbox"] } } 。而对于返回的“properties”对象中的扩展字段内容,可以将字段前添加到‘include’字段中,如: "fields": { "include": ["properties.SmFileName","properties.SmHighPS"] } ,表示properties.SmFileName和properties.SmHighPS 属性都包含在查询结果中。
  64812. * @param {Object} [options.query] 定义查询哪些属性,查询运算符将应用于这些属性。运算符包括:eq、neq、gt、lt、gte、lte、startsWith、endsWith、contains、in。其中in是Array.<string>类型,例如:{ "SmFileName": { "eq":"B49C001002.tif" }}
  64813. * @param {Array.<Sortby>} [options.sortby] 由包含属性名称和排序规则的对象构成的数组。
  64814. * @usage
  64815. */
  64816. var ImageSearchParameter = /*#__PURE__*/function () {
  64817. function ImageSearchParameter(options) {
  64818. ImageSearchParameter_classCallCheck(this, ImageSearchParameter);
  64819. /**
  64820. * @description 指定查询范围。只有具有几何对象(geometry)属性的Features,并且该几何对象与该参数指定的范围相交的 Features 才会被选择出来该参数可以包含4个数值或者6个数值,这取决于使用的坐标参考系统是否包含高程值: * 左下角坐标轴 1 的值 * 左下角坐标轴 2 的值 * 坐标轴 3 的最小值(可选) * 右上角坐标轴 1 的值 * 右上角坐标轴 2 的值 * 坐标轴 3 的最大值(可选) 坐标参考系统为 WGS 84 经度/纬度 (http://www.opengis.net/def/crs/OGC/1.3/CRS84). 对于 “WGS 84 经度/纬度” 坐标参考系统,该参数值的格式通常为:最小经度,最小纬度,最大经度,最大纬度。如果包含了高程值,该参数的格式为:最小经度,最小纬度,最小高程值,最大经度,最大纬度,最大高程值。如果一个 Feature 具有多个空间几何对象(geometry)属性,由服务器决定是否使用单一的空间几何对象属性,还是使用所有相关的几何对象作为最终的查询空间范围。
  64821. * @member {Array.<number>} ImageSearchParameter.prototype.bbox
  64822. */
  64823. this.bbox = undefined;
  64824. /**
  64825. * @description 影像集合的ID数组,将在该指定的Collection中搜索Items。
  64826. * @member {Array.<string>} ImageSearchParameter.prototype.collections
  64827. */
  64828. this.collections = undefined;
  64829. /**
  64830. * @description 返回的 Item 的 ID 值数组。设置了该参数,所有其他过滤器参数(除了next和limit)将被忽略。
  64831. * @member {Array.<string>} ImageSearchParameter.prototype.ids
  64832. */
  64833. this.ids = undefined;
  64834. /**
  64835. * @description 单页返回的最大结果数。最小值为1,最大值为10000。
  64836. * @member {number} ImageSearchParameter.prototype.limit
  64837. */
  64838. this.limit = undefined;
  64839. /**
  64840. * @description 通过‘include’和‘exclude’属性分别指定哪些字段包含在查询结果的 Feature 描述中,哪些需要排除。返回结果中的stac_version,id,bbox,assets,links,geometry,type,properties这些字段为必须字段,若要返回结果中不含这种字段信息,需要显示地进行排除设置,如:排除geometry和bbox字段;在POST请求中,则需要将这些字段添加到“exclude”字段中,例如: "fields": { "exclude": ["geometry","bbox"] } } 。而对于返回的“properties”对象中的扩展字段内容,可以将字段前添加到‘include’字段中,如: "fields": { "include": ["properties.SmFileName","properties.SmHighPS"] } } ,表示properties.SmFileName和properties.SmHighPS 属性都包含在查询结果中。
  64841. * @member {FieldsFilter} ImageSearchParameter.prototype.fields
  64842. */
  64843. this.fields = undefined;
  64844. /**
  64845. * @description 定义查询哪些属性,查询运算符将应用于这些属性。
  64846. * @member {Object} ImageSearchParameter.prototype.query
  64847. */
  64848. this.query = undefined;
  64849. /**
  64850. * @description 由包含属性名称和排序规则的对象构成的数组。
  64851. * @member {Array.<Sortby>} ImageSearchParameter.prototype.sortby
  64852. */
  64853. this.sortby = undefined;
  64854. this.CLASS_NAME = 'SuperMap.ImageSearchParameter';
  64855. Util_Util.extend(this, options);
  64856. }
  64857. /**
  64858. * @function ImageSearchParameter.prototype.destroy
  64859. * @description 释放资源,将引用资源的属性置空。
  64860. */
  64861. ImageSearchParameter_createClass(ImageSearchParameter, [{
  64862. key: "destroy",
  64863. value: function destroy() {
  64864. var me = this;
  64865. me.bbox = undefined;
  64866. me.collections = undefined;
  64867. me.ids = undefined;
  64868. me.limit = undefined;
  64869. me.fields = undefined;
  64870. me.query = undefined;
  64871. me.sortby = undefined;
  64872. }
  64873. /**
  64874. * @function ImageSearchParameter.prototype.constructFromObject
  64875. * @description 目标对象新增该类的可选参数。
  64876. * @param {Object} data 要转换的数据。
  64877. * @param {ImageSearchParameter} obj 返回的模型。
  64878. * @return {ImageSearchParameter} 返回结果。
  64879. */
  64880. }], [{
  64881. key: "constructFromObject",
  64882. value: function constructFromObject(data, obj) {
  64883. if (data) {
  64884. obj = obj || new ImageSearchParameter();
  64885. if (data.hasOwnProperty('bbox')) {
  64886. obj.bbox = data.bbox;
  64887. }
  64888. if (data.hasOwnProperty('collections')) {
  64889. obj.collections = data.collections;
  64890. }
  64891. if (data.hasOwnProperty('ids')) {
  64892. obj.ids = data.ids;
  64893. }
  64894. if (data.hasOwnProperty('limit')) {
  64895. obj.limit = data.limit;
  64896. }
  64897. if (data.hasOwnProperty('fields')) {
  64898. obj.fields = FieldsFilter.constructFromObject && FieldsFilter.constructFromObject(data.fields, {}) || data.fields;
  64899. }
  64900. if (data.hasOwnProperty('query')) {
  64901. obj.query = data.query;
  64902. }
  64903. if (data.hasOwnProperty('sortby')) {
  64904. obj.sortby = data.sortby;
  64905. if (data.sortby) {
  64906. obj.sortby = data.sortby.map(function (item) {
  64907. return Sortby.constructFromObject && Sortby.constructFromObject(item, {}) || item;
  64908. });
  64909. }
  64910. }
  64911. }
  64912. return obj;
  64913. }
  64914. }]);
  64915. return ImageSearchParameter;
  64916. }();
  64917. ;// CONCATENATED MODULE: ./src/common/iServer/ImageStretchOption.js
  64918. function ImageStretchOption_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  64919. function ImageStretchOption_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  64920. function ImageStretchOption_createClass(Constructor, protoProps, staticProps) { if (protoProps) ImageStretchOption_defineProperties(Constructor.prototype, protoProps); if (staticProps) ImageStretchOption_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  64921. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  64922. * This program are made available under the terms of the Apache License, Version 2.0
  64923. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  64924. /**
  64925. * @class ImageStretchOption
  64926. * @deprecatedclass SuperMap.ImageStretchOption
  64927. * @classdesc 影像拉伸类。
  64928. * @category iServer Image
  64929. * @param {Object} options - 可选参数。
  64930. * @param {ImageStretchOption.StretchType} [options.stretchType] 影像拉伸类型。该属性的值有以下几种情况:NONE,无拉伸;GAUSSIAN,高斯拉伸;PERCENTCLIP,百分比截断拉伸;MINIMUMMAXIMUM,最值拉伸;STANDARDDEVIATION,标准差拉伸。
  64931. * @param {number} [options.stdevCoefficient] 标准差系数。
  64932. * @param {number} [options.gaussianCoefficient] 高斯系数。
  64933. * @param {boolean} [options.useMedianValue] 高斯拉伸时,是否使用中间值,若该属性值为true,表示使用中间值;false,表示使用平均值。
  64934. * @param {number} [options.minPercent] 使用百分比截断拉伸时,排除影像直方图最低值区域的像元,该参数值为这部分像元占总像元百分比。
  64935. * @param {number} [options.maxPercent] 使用百分比截断拉伸时,排除影像直方图最高值区域的像元,该参数值为这部分像元占总像元百分比。
  64936. * @usage
  64937. */
  64938. var ImageStretchOption = /*#__PURE__*/function () {
  64939. function ImageStretchOption(options) {
  64940. ImageStretchOption_classCallCheck(this, ImageStretchOption);
  64941. /**
  64942. * @description 影像拉伸类型。该属性的值有以下几种情况:NONE,无拉伸;GAUSSIAN,高斯拉伸;PERCENTCLIP,百分比截断拉伸;MINIMUMMAXIMUM,最值拉伸;STANDARDDEVIATION,标准差拉伸。
  64943. * @member {ImageStretchOption.StretchType} ImageStretchOption.prototype.stretchType
  64944. */
  64945. this.stretchType = undefined;
  64946. /**
  64947. * @description 标准差系数。
  64948. * @member {number} ImageStretchOption.prototype.stdevCoefficient
  64949. */
  64950. this.stdevCoefficient = undefined;
  64951. /**
  64952. * @description 高斯系数。
  64953. * @member {number} ImageStretchOption.prototype.gaussianCoefficient
  64954. */
  64955. this.gaussianCoefficient = undefined;
  64956. /**
  64957. * @description 高斯拉伸时,是否使用中间值,若该属性值为true,表示使用中间值;false,表示使用平均值。
  64958. * @member {boolean} ImageStretchOption.prototype.useMedianValue
  64959. */
  64960. this.useMedianValue = undefined;
  64961. /**
  64962. * @description 使用百分比截断拉伸时,排除影像直方图最低值区域的像元,该参数值为这部分像元占总像元百分比。
  64963. * @member {number} ImageStretchOption.prototype.minPercent
  64964. */
  64965. this.minPercent = undefined;
  64966. /**
  64967. * @description 使用百分比截断拉伸时,排除影像直方图最高值区域的像元,该参数值为这部分像元占总像元百分比。
  64968. * @member {number} ImageStretchOption.prototype.maxPercent
  64969. */
  64970. this.maxPercent = undefined;
  64971. this.CLASS_NAME = 'SuperMap.ImageStretchOption';
  64972. Util_Util.extend(this, options);
  64973. }
  64974. /**
  64975. * @function ImageStretchOption.prototype.destroy
  64976. * @description 释放资源,将引用资源的属性置空。
  64977. */
  64978. ImageStretchOption_createClass(ImageStretchOption, [{
  64979. key: "destroy",
  64980. value: function destroy() {
  64981. var me = this;
  64982. me.stretchType = undefined;
  64983. me.stdevCoefficient = undefined;
  64984. me.gaussianCoefficient = undefined;
  64985. me.useMedianValue = undefined;
  64986. me.minPercent = undefined;
  64987. me.maxPercent = undefined;
  64988. }
  64989. /**
  64990. * @function ImageStretchOption.prototype.constructFromObject
  64991. * @description 目标对象新增该类的可选参数。
  64992. * @param {Object} data 要转换的数据。
  64993. * @param {ImageStretchOption} obj 返回的模型。
  64994. * @return {ImageStretchOption} 返回结果。
  64995. */
  64996. }], [{
  64997. key: "constructFromObject",
  64998. value: function constructFromObject(data, obj) {
  64999. if (data) {
  65000. obj = obj || new ImageStretchOption();
  65001. if (data.hasOwnProperty('stretchType')) {
  65002. obj.stretchType = data.stretchType;
  65003. }
  65004. if (data.hasOwnProperty('stdevCoefficient')) {
  65005. obj.stdevCoefficient = data.stdevCoefficient;
  65006. }
  65007. if (data.hasOwnProperty('gaussianCoefficient')) {
  65008. obj.gaussianCoefficient = data.gaussianCoefficient;
  65009. }
  65010. if (data.hasOwnProperty('useMedianValue')) {
  65011. obj.useMedianValue = data.useMedianValue;
  65012. }
  65013. if (data.hasOwnProperty('minPercent')) {
  65014. obj.minPercent = data.minPercent;
  65015. }
  65016. if (data.hasOwnProperty('maxPercent')) {
  65017. obj.maxPercent = data.maxPercent;
  65018. }
  65019. }
  65020. return obj;
  65021. }
  65022. }]);
  65023. return ImageStretchOption;
  65024. }();
  65025. /**
  65026. * @enum StretchType
  65027. * @description 影像拉伸类型枚举。
  65028. * @memberOf ImageStretchOption
  65029. * @readonly
  65030. * @type {string}
  65031. */
  65032. ImageStretchOption.StretchType = {
  65033. /** 无拉伸。 */
  65034. NONE: 'NONE',
  65035. /** 高斯拉伸。 */
  65036. GAUSSIAN: 'GAUSSIAN',
  65037. /** 百分比截断拉伸。 */
  65038. PERCENTCLIP: 'PERCENTCLIP',
  65039. /** 最值拉伸。 */
  65040. MINIMUMMAXIMUM: 'MINIMUMMAXIMUM',
  65041. /** 标准差拉伸。 */
  65042. STANDARDDEVIATION: 'STANDARDDEVIATION'
  65043. };
  65044. ;// CONCATENATED MODULE: ./src/common/iServer/ImageRenderingRule.js
  65045. function ImageRenderingRule_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  65046. function ImageRenderingRule_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  65047. function ImageRenderingRule_createClass(Constructor, protoProps, staticProps) { if (protoProps) ImageRenderingRule_defineProperties(Constructor.prototype, protoProps); if (staticProps) ImageRenderingRule_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  65048. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  65049. * This program are made available under the terms of the Apache License, Version 2.0
  65050. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  65051. /**
  65052. * @class ImageRenderingRule
  65053. * @deprecatedclass SuperMap.ImageRenderingRule
  65054. * @classdesc 定义请求的影像如何进行渲染或者处理,如:影像的拉伸显示方式、颜色表、波段组合以及应用栅格函数进行快速处理等。
  65055. * @category iServer Image
  65056. * @param {Object} options - 可选参数。
  65057. * @param {ImageRenderingRule.DisplayMode} [options.displayMode] 影像显示模式,其中:Composite表示多波段组合显示;Stretched表示单波段拉伸显示。
  65058. * @param {string} [options.displayBands] 影像显示的波段或者波段组合。若影像的显示模式为STRETCHED,该属性指定一个波段的索引号(波段索引号从0开始计数);若影像的显示模式为COMPOSITE,该属性为组合的波段索引号,例如:属性值3,2,1表示采用4波段、3波段、2波段分别对应 R、G、B颜色通道进行组合显示。
  65059. * @param {ImageStretchOption} [options.stretchOption] 影像的拉伸参数。
  65060. * @param {ImageRenderingRule.InterpolationMode} [options.interpolationMode] 影像显示时使用的插值算法。
  65061. * @param {Array.<string>} [options.colorScheme] 影像拉伸显示的颜色方案。颜色方案为RGBA颜色数组。RGBA是代表Red(红色)Green(绿色)Blue(蓝色)和Alpha的色彩空间。Alpha值可以省略不写,表示完全不透明。Alpha通道表示不透明度参数,若该值为0表示完全透明。例如:"255,0,0","0,255,0","0,0,255" 表示由红色、绿色、蓝色三种颜色构成的色带。
  65062. * @param {Array.<string>} [options.colorTable] 影像的颜色表。颜色表为栅格值与RGBA颜色值的对照表。RGBA是代表Red(红色)Green(绿色)Blue(蓝色)和Alpha的色彩空间。Alpha值可以省略不写,表示完全不透明。Alpha通道表示不透明度参数,若该值为0表示完全透明。以下示例表示该颜色对照表由三组构成,第一组高程值为500,对应的颜色为红色;第二组高程值为700,对应的颜色为绿色;第三组高程值为700,对应的颜色为蓝色。示例:"500: 255,0,0", "700: 0,255,0" , "900: 0,0,255"。
  65063. * @param {number} [options.brightness] 影像显示的亮度。数值范围为-100到100,增加亮度为正,降低亮度为负。
  65064. * @param {number} [options.contrast] 影像显示的对比度。数值范围为-100到100,增加对比度为正,降低对比度为负。
  65065. * @param {string} [options.noData] 影像的无值。影像为多波段时,通过逗号分隔 R,G,B 颜色通道对应波段的无值。
  65066. * @param {string} [options.noDataColor] 影像的无值的显示颜色,支持RGB颜色,例如:255,0,0(红色),那么无值将以指定的红色显示。
  65067. * @param {boolean} [options.noDataTransparent] 无值是否透明显示,true表示透明显示无值;否则为false。
  65068. * @param {string} [options.backgroundValue] 影像的背景值。影像为多波段时,通过逗号分隔 R,G,B 颜色通道对应波段的背景值。
  65069. * @param {string} [options.backgroundColor] 指定背景值的颜色。支持指定RGB颜色,例如:255,0,0(红色),那么背景值将以指定的红色显示。
  65070. * @param {boolean} [options.backgroundTransparent] 背景值是否透明显示,true表示透明显示背景值;否则为false。
  65071. * @param {Array.<ImageGFHillShade|ImageGFSlope|ImageGFAspect|ImageGFOrtho>} [options.gridFunctions] 栅格函数链。
  65072. * @usage
  65073. */
  65074. var ImageRenderingRule = /*#__PURE__*/function () {
  65075. function ImageRenderingRule(options) {
  65076. ImageRenderingRule_classCallCheck(this, ImageRenderingRule);
  65077. /**
  65078. * @description 影像显示模式,其中:Composite表示多波段组合显示;Stretched表示单波段拉伸显示。
  65079. * @member {ImageRenderingRule.DisplayMode} ImageRenderingRule.prototype.displayMode
  65080. */
  65081. this.displayMode = undefined;
  65082. /**
  65083. * @description 影像显示的波段或者波段组合。该参数为一个数组,数组元素为波段索引号。若影像的显示模式为Stretched,该属性指定一个显示的波段;若影像的显示模式为Composite,该属性为组合的波段索引号,例如:属性值4,3,2表示采用4波段、3波段、2波段分别对应 R、G、B颜色通道进行组合显示。
  65084. * @member {string} ImageRenderingRule.prototype.displayBands
  65085. */
  65086. this.displayBands = undefined;
  65087. /**
  65088. * @description 影像的拉伸参数。
  65089. * @member {ImageStretchOption} ImageRenderingRule.prototype.stretchOption
  65090. */
  65091. this.stretchOption = undefined;
  65092. /**
  65093. * @description 影像显示时使用的插值算法。
  65094. * @member {ImageRenderingRule.InterpolationMode} ImageRenderingRule.prototype.interpolationMode
  65095. */
  65096. this.interpolationMode = undefined;
  65097. /**
  65098. * @description 影像拉伸显示的颜色方案。颜色方案为RGBA颜色数组。RGBA是代表Red(红色)Green(绿色)Blue(蓝色)和Alpha的色彩空间。Alpha值可以省略不写,表示完全不透明。Alpha通道表示不透明度参数,若该值为0表示完全透明。例如:"255,0,0","0,255,0","0,0,255" 表示由红色、绿色、蓝色三种颜色构成的色带。
  65099. * @member {Array.<string>} ImageRenderingRule.prototype.colorScheme
  65100. */
  65101. this.colorScheme = undefined;
  65102. /**
  65103. * @description 影像的颜色表。颜色表为栅格值与RGBA颜色值的对照表。RGBA是代表Red(红色)Green(绿色)Blue(蓝色)和Alpha的色彩空间。Alpha值可以省略不写,表示完全不透明。Alpha通道表示不透明度参数,若该值为0表示完全透明。以下示例表示该颜色对照表由三组构成,第一组高程值为500,对应的颜色为红色;第二组高程值为700,对应的颜色为绿色;第三组高程值为700,对应的颜色为蓝色。示例:"500: 255,0,0", "700: 0,255,0" , "900: 0,0,255"
  65104. * @member {Array.<string>} ImageRenderingRule.prototype.colorTable
  65105. */
  65106. this.colorTable = undefined;
  65107. /**
  65108. * @description 影像显示的亮度。数值范围为-100到100,增加亮度为正,降低亮度为负。
  65109. * @member {number} ImageRenderingRule.prototype.brightness
  65110. */
  65111. this.brightness = undefined;
  65112. /**
  65113. * @description 影像显示的对比度。数值范围为-100到100,增加对比度为正,降低对比度为负。
  65114. * @member {number} ImageRenderingRule.prototype.contrast
  65115. */
  65116. this.contrast = undefined;
  65117. /**
  65118. * @description 影像的无值。影像为多波段时,通过逗号分隔 R,G,B 颜色通道对应波段的无值。
  65119. * @member {string} ImageRenderingRule.prototype.noData
  65120. */
  65121. this.noData = undefined;
  65122. /**
  65123. * @description 影像的无值的显示颜色,支持RGB颜色,例如:255,0,0(红色),那么无值将以指定的红色显示。
  65124. * @member {string} ImageRenderingRule.prototype.noDataColor
  65125. */
  65126. this.noDataColor = undefined;
  65127. /**
  65128. * @description 无值是否透明显示,true表示透明显示无值;否则为false。
  65129. * @member {boolean} ImageRenderingRule.prototype.noDataTransparent
  65130. */
  65131. this.noDataTransparent = undefined;
  65132. /**
  65133. * @description 影像的背景值。影像为多波段时,通过逗号分隔 R,G,B 颜色通道对应波段的背景值。
  65134. * @member {string} ImageRenderingRule.prototype.backgroundValue
  65135. */
  65136. this.backgroundValue = undefined;
  65137. /**
  65138. * @description 指定背景值的颜色。支持指定RGB颜色,例如:255,0,0(红色),那么背景值将以指定的红色显示。
  65139. * @member {string} ImageRenderingRule.prototype.backgroundColor
  65140. */
  65141. this.backgroundColor = undefined;
  65142. /**
  65143. * @description 背景值是否透明显示,true表示透明显示背景值;否则为false。
  65144. * @member {boolean} ImageRenderingRule.prototype.backgroundTransparent
  65145. */
  65146. this.backgroundTransparent = undefined;
  65147. /**
  65148. * @description 栅格函数选项,通过应用栅格函数,可以对影像进行快速显示处理。
  65149. * @member {Array.<ImageGFHillShade|ImageGFSlope|ImageGFAspect|ImageGFOrtho>} ImageRenderingRule.prototype.gridFunctions
  65150. */
  65151. this.gridFunctions = undefined;
  65152. this.CLASS_NAME = 'SuperMap.ImageRenderingRule';
  65153. Util_Util.extend(this, options);
  65154. }
  65155. /**
  65156. * @function ImageRenderingRule.prototype.destroy
  65157. * @description 释放资源,将引用资源的属性置空。
  65158. */
  65159. ImageRenderingRule_createClass(ImageRenderingRule, [{
  65160. key: "destroy",
  65161. value: function destroy() {
  65162. var me = this;
  65163. me.displayMode = undefined;
  65164. me.displayBands = undefined;
  65165. me.stretchOption = undefined;
  65166. me.interpolationMode = undefined;
  65167. me.colorScheme = undefined;
  65168. me.colorTable = undefined;
  65169. me.brightness = undefined;
  65170. me.contrast = undefined;
  65171. me.noData = undefined;
  65172. me.noDataColor = undefined;
  65173. me.noDataTransparent = undefined;
  65174. me.backgroundValue = undefined;
  65175. me.backgroundColor = undefined;
  65176. me.backgroundTransparent = undefined;
  65177. me.gridFuncOptions = undefined;
  65178. }
  65179. /**
  65180. * @function ImageRenderingRule.prototype.constructFromObject
  65181. * @description 目标对象新增该类的可选参数。
  65182. * @param {Object} data 要转换的数据。
  65183. * @param {ImageRenderingRule} obj 返回的模型。
  65184. * @return {ImageRenderingRule} 返回结果。
  65185. */
  65186. }], [{
  65187. key: "constructFromObject",
  65188. value: function constructFromObject(data, obj) {
  65189. if (data) {
  65190. obj = obj || new ImageRenderingRule();
  65191. if (data.hasOwnProperty('displayMode')) {
  65192. obj.displayMode = data.displayMode;
  65193. }
  65194. if (data.hasOwnProperty('displayBands')) {
  65195. obj.displayBands = data.displayBands;
  65196. }
  65197. if (data.hasOwnProperty('stretchOption')) {
  65198. obj.stretchOption = ImageStretchOption.constructFromObject && ImageStretchOption.constructFromObject(data.stretchOption, {}) || data.stretchOption;
  65199. }
  65200. if (data.hasOwnProperty('interpolationMode')) {
  65201. obj.interpolationMode = data.interpolationMode;
  65202. }
  65203. if (data.hasOwnProperty('colorScheme')) {
  65204. obj.colorScheme = data.colorScheme;
  65205. }
  65206. if (data.hasOwnProperty('colorTable')) {
  65207. obj.colorTable = data.colorTable;
  65208. }
  65209. if (data.hasOwnProperty('brightness')) {
  65210. obj.brightness = data.brightness;
  65211. }
  65212. if (data.hasOwnProperty('contrast')) {
  65213. obj.contrast = data.contrast;
  65214. }
  65215. if (data.hasOwnProperty('noData')) {
  65216. obj.noData = data.noData;
  65217. }
  65218. if (data.hasOwnProperty('noDataColor')) {
  65219. obj.noDataColor = data.noDataColor;
  65220. }
  65221. if (data.hasOwnProperty('backgroundValue')) {
  65222. obj.backgroundValue = data.backgroundValue;
  65223. }
  65224. if (data.hasOwnProperty('noDataTransparent')) {
  65225. obj.noDataTransparent = data.noDataTransparent;
  65226. }
  65227. if (data.hasOwnProperty('backgroundColor')) {
  65228. obj.backgroundColor = data.backgroundColor;
  65229. }
  65230. if (data.hasOwnProperty('backgroundTransparent')) {
  65231. obj.backgroundTransparent = data.backgroundTransparent;
  65232. }
  65233. if (data.hasOwnProperty('gridFunctions')) {
  65234. obj.gridFunctions = data.gridFunctions;
  65235. }
  65236. }
  65237. return obj;
  65238. }
  65239. }]);
  65240. return ImageRenderingRule;
  65241. }();
  65242. /**
  65243. * @enum DisplayMode
  65244. * @description 影像显示模式。
  65245. * @memberOf ImageRenderingRule
  65246. * @readonly
  65247. * @type {string}
  65248. */
  65249. ImageRenderingRule.DisplayMode = {
  65250. COMPOSITE: 'COMPOSITE',
  65251. STRETCHED: 'Stretched'
  65252. };
  65253. /**
  65254. * @enum InterpolationMode
  65255. * @description 影像显示时使用的插值算法枚举。
  65256. * @memberOf ImageRenderingRule
  65257. * @readonly
  65258. * @type {string}
  65259. */
  65260. ImageRenderingRule.InterpolationMode = {
  65261. /** 最邻近插值模式。 */
  65262. NEARESTNEIGHBOR: 'NEARESTNEIGHBOR',
  65263. /** 高质量的双线性插值模式。 */
  65264. HIGHQUALITYBILINEAR: 'HIGHQUALITYBILINEAR',
  65265. /** 默认插值模式。 */
  65266. DEFAULT: 'DEFAULT'
  65267. };
  65268. ;// CONCATENATED MODULE: ./src/common/iServer/ImageGFHillShade.js
  65269. function ImageGFHillShade_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  65270. function ImageGFHillShade_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  65271. function ImageGFHillShade_createClass(Constructor, protoProps, staticProps) { if (protoProps) ImageGFHillShade_defineProperties(Constructor.prototype, protoProps); if (staticProps) ImageGFHillShade_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  65272. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  65273. * This program are made available under the terms of the Apache License, Version 2.0
  65274. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  65275. /**
  65276. * @class ImageGFHillShade
  65277. * @deprecatedclass SuperMap.ImageGFHillShade
  65278. * @classdesc 栅格函数对象:对DEM数据生成三维晕渲图。
  65279. * @category iServer Image
  65280. * @param {Object} options - 可选参数。
  65281. * @param {string} [options.girdFuncName='GFHillShade'] 栅格函数名称,参数值为:GFHillShade。
  65282. * @param {number} [options.Azimuth = 315] 光源方位角。用于确定光源的方向,是从光源所在位置的正北方向线起,依顺时针方向到光源与目标方向线的夹角,范围为 0-360 度,以正北方向为 0 度,依顺时针方向递增。默认值为:315。
  65283. * @param {number} [options.Altitude = 45] 光源高度角。用于确定光源照射的倾斜角度,是光源与目标的方向线与水平面间的夹角,范围为 0-90 度。当光源高度角为 90 度时,光源正射地表。默认值为:45。
  65284. * @param {number} [options.ZFactor = 1] 高程缩放系数。如果设置为 1.0,表示不缩放。默认值为:1。
  65285. * @usage
  65286. */
  65287. var ImageGFHillShade = /*#__PURE__*/function () {
  65288. function ImageGFHillShade(options) {
  65289. ImageGFHillShade_classCallCheck(this, ImageGFHillShade);
  65290. /**
  65291. * @description 栅格函数名称,参数值为:GFHillShade。
  65292. * @member {string} ImageGFHillShade.prototype.girdFuncName
  65293. * @default 'GFHillShade'
  65294. */
  65295. this.girdFuncName = 'GFHillShade';
  65296. /**
  65297. * @description 光源方位角。用于确定光源的方向,是从光源所在位置的正北方向线起,依顺时针方向到光源与目标方向线的夹角,范围为 0-360 度,以正北方向为 0 度,依顺时针方向递增。默认值为:315。
  65298. * @member {number} ImageGFHillShade.prototype.Azimuth
  65299. */
  65300. this.Azimuth = 315;
  65301. /**
  65302. * @description 光源高度角。用于确定光源照射的倾斜角度,是光源与目标的方向线与水平面间的夹角,范围为 0-90 度。当光源高度角为 90 度时,光源正射地表。默认值为:45。
  65303. * @member {number} ImageGFHillShade.prototype.Altitude
  65304. */
  65305. this.Altitude = 45;
  65306. /**
  65307. * @description 高程缩放系数。如果设置为 1.0,表示不缩放。默认值为:1。
  65308. * @member {number} ImageGFHillShade.prototype.ZFactor
  65309. */
  65310. this.ZFactor = 1;
  65311. this.CLASS_NAME = 'SuperMap.ImageGFHillShade';
  65312. Util_Util.extend(this, options);
  65313. }
  65314. /**
  65315. * @function ImageGFHillShade.prototype.destroy
  65316. * @description 释放资源,将引用资源的属性置空。
  65317. */
  65318. ImageGFHillShade_createClass(ImageGFHillShade, [{
  65319. key: "destroy",
  65320. value: function destroy() {
  65321. var me = this;
  65322. me.girdFuncName = 'GFHillShade';
  65323. me.Azimuth = 315;
  65324. me.Altitude = 45;
  65325. me.ZFactor = 1;
  65326. }
  65327. /**
  65328. * @function ImageGFHillShade.prototype.constructFromObject
  65329. * @description 目标对象新增该类的可选参数。
  65330. * @param {Object} data 要转换的数据。
  65331. * @param {ImageGFHillShade} obj 返回的模型。
  65332. * @return {ImageGFHillShade} 返回结果。
  65333. */
  65334. }], [{
  65335. key: "constructFromObject",
  65336. value: function constructFromObject(data, obj) {
  65337. if (data) {
  65338. obj = obj || new ImageGFHillShade();
  65339. if (data.hasOwnProperty('girdFuncName')) {
  65340. obj.girdFuncName = data.girdFuncName;
  65341. }
  65342. if (data.hasOwnProperty('Azimuth')) {
  65343. obj.Azimuth = data.Azimuth;
  65344. }
  65345. if (data.hasOwnProperty('Altitude')) {
  65346. obj.Altitude = data.Altitude;
  65347. }
  65348. if (data.hasOwnProperty('ZFactor')) {
  65349. obj.ZFactor = data.ZFactor;
  65350. }
  65351. }
  65352. return obj;
  65353. }
  65354. }]);
  65355. return ImageGFHillShade;
  65356. }();
  65357. ;// CONCATENATED MODULE: ./src/common/iServer/ImageGFAspect.js
  65358. function ImageGFAspect_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  65359. function ImageGFAspect_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  65360. function ImageGFAspect_createClass(Constructor, protoProps, staticProps) { if (protoProps) ImageGFAspect_defineProperties(Constructor.prototype, protoProps); if (staticProps) ImageGFAspect_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  65361. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  65362. * This program are made available under the terms of the Apache License, Version 2.0
  65363. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  65364. /**
  65365. * @class ImageGFAspect
  65366. * @deprecatedclass SuperMap.ImageGFAspect
  65367. * @classdesc 栅格函数对象:对DEM数据生成坡向渲图。
  65368. * @category iServer Image
  65369. * @param {Object} options -可选参数。
  65370. * @param {string} [options.girdFuncName='GFAspect'] 栅格函数名称,参数值为:GFAspect。
  65371. * @param {number} [options.Azimuth] 光源方位角,固定为360度。
  65372. * @usage
  65373. */
  65374. var ImageGFAspect = /*#__PURE__*/function () {
  65375. function ImageGFAspect(options) {
  65376. ImageGFAspect_classCallCheck(this, ImageGFAspect);
  65377. /**
  65378. * @description 栅格函数名称,参数值为:GFAspect。
  65379. * @member {string} ImageGFAspect.prototype.girdFuncName
  65380. * @default 'GFAspect'
  65381. */
  65382. this.girdFuncName = 'GFAspect';
  65383. /**
  65384. * @description 光源方位角,固定为360度。
  65385. * @member {number} ImageGFAspect.prototype.Azimuth
  65386. */
  65387. this.Azimuth = undefined;
  65388. this.CLASS_NAME = 'SuperMap.ImageGFAspect';
  65389. Util_Util.extend(this, options);
  65390. }
  65391. /**
  65392. * @function ImageGFAspect.prototype.destroy
  65393. * @description 释放资源,将引用资源的属性置空。
  65394. */
  65395. ImageGFAspect_createClass(ImageGFAspect, [{
  65396. key: "destroy",
  65397. value: function destroy() {
  65398. var me = this;
  65399. me.girdFuncName = 'GFAspect';
  65400. me.Azimuth = undefined;
  65401. }
  65402. /**
  65403. * @function ImageGFAspect.prototype.constructFromObject
  65404. * @description 目标对象新增该类的可选参数。
  65405. * @param {Object} data 要转换的数据。
  65406. * @param {ImageGFAspect} obj 返回的模型。
  65407. * @return {ImageGFAspect} 返回结果。
  65408. */
  65409. }], [{
  65410. key: "constructFromObject",
  65411. value: function constructFromObject(data, obj) {
  65412. if (data) {
  65413. obj = obj || new ImageGFAspect();
  65414. if (data.hasOwnProperty('girdFuncName')) {
  65415. obj.girdFuncName = data.girdFuncName;
  65416. }
  65417. if (data.hasOwnProperty('Azimuth')) {
  65418. obj.Azimuth = data.Azimuth;
  65419. }
  65420. }
  65421. return obj;
  65422. }
  65423. }]);
  65424. return ImageGFAspect;
  65425. }();
  65426. ;// CONCATENATED MODULE: ./src/common/iServer/ImageGFOrtho.js
  65427. function ImageGFOrtho_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  65428. function ImageGFOrtho_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  65429. function ImageGFOrtho_createClass(Constructor, protoProps, staticProps) { if (protoProps) ImageGFOrtho_defineProperties(Constructor.prototype, protoProps); if (staticProps) ImageGFOrtho_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  65430. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  65431. * This program are made available under the terms of the Apache License, Version 2.0
  65432. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  65433. /**
  65434. * @class ImageGFOrtho
  65435. * @deprecatedclass SuperMap.ImageGFOrtho
  65436. * @classdesc 栅格函数对象:对DEM数据生成三维晕渲图。该栅格函数不需要输入参数,采用系统默认设置。
  65437. * @category iServer Image
  65438. * @param {Object} options - 可选参数。
  65439. * @param {string} [options.girdFuncName='GFOrtho'] 栅格函数名称,参数值为:GFOrtho。
  65440. * @usage
  65441. */
  65442. var ImageGFOrtho = /*#__PURE__*/function () {
  65443. function ImageGFOrtho(options) {
  65444. ImageGFOrtho_classCallCheck(this, ImageGFOrtho);
  65445. /**
  65446. * @description 栅格函数名称,参数值为:GFOrtho。
  65447. * @member {string} ImageGFOrtho.prototype.girdFuncName
  65448. * @default 'GFOrtho'
  65449. */
  65450. this.girdFuncName = 'GFOrtho';
  65451. this.CLASS_NAME = 'SuperMap.ImageGFOrtho';
  65452. Util_Util.extend(this, options);
  65453. }
  65454. /**
  65455. * @function ImageGFOrtho.prototype.destroy
  65456. * @description 释放资源,将引用资源的属性置空。
  65457. */
  65458. ImageGFOrtho_createClass(ImageGFOrtho, [{
  65459. key: "destroy",
  65460. value: function destroy() {
  65461. var me = this;
  65462. me.girdFuncName = 'GFOrtho';
  65463. }
  65464. /**
  65465. * @function ImageGFOrtho.prototype.constructFromObject
  65466. * @description 目标对象新增该类的可选参数。
  65467. * @param {Object} data 要转换的数据。
  65468. * @param {ImageGFOrtho} obj 返回的模型。
  65469. * @return {ImageGFOrtho} 返回结果。
  65470. */
  65471. }], [{
  65472. key: "constructFromObject",
  65473. value: function constructFromObject(data, obj) {
  65474. if (data) {
  65475. obj = obj || new ImageGFOrtho();
  65476. if (data.hasOwnProperty('girdFuncName')) {
  65477. obj.girdFuncName = data.girdFuncName;
  65478. }
  65479. }
  65480. return obj;
  65481. }
  65482. }]);
  65483. return ImageGFOrtho;
  65484. }();
  65485. ;// CONCATENATED MODULE: ./src/common/iServer/ImageGFSlope.js
  65486. function ImageGFSlope_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  65487. function ImageGFSlope_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  65488. function ImageGFSlope_createClass(Constructor, protoProps, staticProps) { if (protoProps) ImageGFSlope_defineProperties(Constructor.prototype, protoProps); if (staticProps) ImageGFSlope_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  65489. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  65490. * This program are made available under the terms of the Apache License, Version 2.0
  65491. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  65492. /**
  65493. * @class ImageGFSlope
  65494. * @deprecatedclass SuperMap.ImageGFSlope
  65495. * @classdesc 栅格函数对象:对DEM数据生成坡度图。
  65496. * @category iServer Image
  65497. * @param {Object} options - 可选参数。
  65498. * @param {string} [options.girdFuncName='GFSlope'] 栅格函数名称,参数值为:GFSlope。
  65499. * @param {number} [options.Altitude = 45] 光源高度角。用于确定光源照射的倾斜角度,是光源与目标的方向线与水平面间的夹角,范围为 0-90 度。当光源高度角为 90 度时,光源正射地表。默认值为:45。
  65500. * @param {number} [options.ZFactor = 1] 高程缩放系数。如果设置为 1.0,表示不缩放。默认值为:1。
  65501. * @usage
  65502. */
  65503. var ImageGFSlope = /*#__PURE__*/function () {
  65504. function ImageGFSlope(options) {
  65505. ImageGFSlope_classCallCheck(this, ImageGFSlope);
  65506. /**
  65507. * @description 栅格函数名称,参数值为:GFSlope。
  65508. * @member {string} ImageGFSlope.prototype.girdFuncName
  65509. * @default 'GFSlope'
  65510. */
  65511. this.girdFuncName = 'GFSlope';
  65512. /**
  65513. * @description 光源高度角。用于确定光源照射的倾斜角度,是光源与目标的方向线与水平面间的夹角,范围为 0-90 度。当光源高度角为 90 度时,光源正射地表。默认值为:45。
  65514. * @member {number} ImageGFSlope.prototype.Altitude
  65515. */
  65516. this.Altitude = 45;
  65517. /**
  65518. * @description 高程缩放系数。如果设置为 1.0,表示不缩放。默认值为:1。
  65519. * @member {number} ImageGFSlope.prototype.ZFactor
  65520. */
  65521. this.ZFactor = 1;
  65522. this.CLASS_NAME = 'SuperMap.ImageGFSlope';
  65523. Util_Util.extend(this, options);
  65524. }
  65525. /**
  65526. * @function ImageGFSlope.prototype.destroy
  65527. * @description 释放资源,将引用资源的属性置空。
  65528. */
  65529. ImageGFSlope_createClass(ImageGFSlope, [{
  65530. key: "destroy",
  65531. value: function destroy() {
  65532. var me = this;
  65533. me.girdFuncName = 'GFSlope';
  65534. me.Altitude = 45;
  65535. me.ZFactor = 1;
  65536. }
  65537. /**
  65538. * @function ImageGFSlope.prototype.constructFromObject
  65539. * @description 目标对象新增该类的可选参数。
  65540. * @param {Object} data 要转换的数据。
  65541. * @param {ImageGFSlope} obj 返回的模型。
  65542. * @return {ImageGFSlope} 返回结果。
  65543. */
  65544. }], [{
  65545. key: "constructFromObject",
  65546. value: function constructFromObject(data, obj) {
  65547. if (data) {
  65548. obj = obj || new ImageGFSlope();
  65549. if (data.hasOwnProperty('girdFuncName')) {
  65550. obj.girdFuncName = data.girdFuncName;
  65551. }
  65552. if (data.hasOwnProperty('Altitude')) {
  65553. obj.Altitude = data.Altitude;
  65554. }
  65555. if (data.hasOwnProperty('ZFactor')) {
  65556. obj.ZFactor = data.ZFactor;
  65557. }
  65558. }
  65559. return obj;
  65560. }
  65561. }]);
  65562. return ImageGFSlope;
  65563. }();
  65564. ;// CONCATENATED MODULE: ./src/common/iServer/KnowledgeGraphNodeParameter.js
  65565. function KnowledgeGraphNodeParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  65566. function KnowledgeGraphNodeParameter_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  65567. function KnowledgeGraphNodeParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) KnowledgeGraphNodeParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) KnowledgeGraphNodeParameter_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  65568. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  65569. * This program are made available under the terms of the Apache License, Version 2.0
  65570. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  65571. /**
  65572. * @private
  65573. * @class KnowledgeGraphNodeParameter
  65574. * @deprecatedclass SuperMap.KnowledgeGraphNodeParameter
  65575. * @classdesc 知识图谱实体的参数设置。
  65576. * @category iServer KnowledgeGraph
  65577. * @version 11.1.0
  65578. * @param {Object} options - 参数。
  65579. * @param {string} options.id - 实体id。
  65580. * @param {Array.<string>} [options.labels] - 实体分类。
  65581. * @param {Object} [options.properties] - 属性。
  65582. * @usage
  65583. */
  65584. // {
  65585. // "id": 5348024557502471,
  65586. // "properties": {
  65587. // "server": "test1",
  65588. // "_labelfieldname": "FEATUREGUID",
  65589. // "_entityname": "院落",
  65590. // "_bindfindid": "院落@ST_YARDA@1",
  65591. // "FEATUREGUID": "{409E615B-A545-4E07-872D-B12EDA0B4A1A}",
  65592. // "_findid": 1,
  65593. // "ENTITYNAME": "公共管理与公共服务"
  65594. // },
  65595. // "labels": ["院落"]
  65596. // }
  65597. var KnowledgeGraphNodeParameter = /*#__PURE__*/(/* unused pure expression or super */ null && (function () {
  65598. function KnowledgeGraphNodeParameter(options) {
  65599. KnowledgeGraphNodeParameter_classCallCheck(this, KnowledgeGraphNodeParameter);
  65600. /**
  65601. * @member {string} KnowledgeGraphNodeParameter.prototype.id
  65602. * @description 实体ID。
  65603. */
  65604. this.id = null;
  65605. /**
  65606. * @member {Array.<string>} KnowledgeGraphNodeParameter.prototype.labels
  65607. * @description 实体分类。
  65608. */
  65609. this.labels = null;
  65610. /**
  65611. * @member {Object} KnowledgeGraphNodeParameter.prototype.properties
  65612. * @description 实体属性。
  65613. */
  65614. this.properties = null;
  65615. this.CLASS_NAME = 'SuperMap.KnowledgeGraphNodeParameter';
  65616. Util.extend(this, options);
  65617. }
  65618. KnowledgeGraphNodeParameter_createClass(KnowledgeGraphNodeParameter, [{
  65619. key: "destroy",
  65620. value: function destroy() {
  65621. var me = this;
  65622. me.id = null;
  65623. me.labels = null;
  65624. me.properties = null;
  65625. }
  65626. }]);
  65627. return KnowledgeGraphNodeParameter;
  65628. }()));
  65629. ;// CONCATENATED MODULE: ./src/common/iServer/KnowledgeGraphEdgeParameter.js
  65630. function KnowledgeGraphEdgeParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  65631. function KnowledgeGraphEdgeParameter_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  65632. function KnowledgeGraphEdgeParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) KnowledgeGraphEdgeParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) KnowledgeGraphEdgeParameter_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  65633. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  65634. * This program are made available under the terms of the Apache License, Version 2.0
  65635. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  65636. /**
  65637. * @private
  65638. * @class KnowledgeGraphEdgeParameter
  65639. * @deprecatedclass SuperMap.KnowledgeGraphEdgeParameter
  65640. * @classdesc 知识图谱关系的参数设置。
  65641. * @category iServer KnowledgeGraph
  65642. * @version 11.1.0
  65643. * @param {Object} options - 参数。
  65644. * @param {string} options.id - 边id。
  65645. * @param {string} options.start - 开始实体id。
  65646. * @param {string} options.end - 结束实体id。
  65647. * @param {string} [options.type] - 标签,关系。
  65648. * @param {Object} [options.properties] - 属性。
  65649. * @usage
  65650. */
  65651. var KnowledgeGraphEdgeParameter = /*#__PURE__*/(/* unused pure expression or super */ null && (function () {
  65652. function KnowledgeGraphEdgeParameter(options) {
  65653. KnowledgeGraphEdgeParameter_classCallCheck(this, KnowledgeGraphEdgeParameter);
  65654. /**
  65655. * @member {string} KnowledgeGraphEdgeParameter.prototype.id
  65656. * @description 边id。
  65657. */
  65658. this.id = null;
  65659. /**
  65660. * @member {string} KnowledgeGraphEdgeParameter.prototype.start
  65661. * @description 开始实体id。
  65662. */
  65663. this.start = null;
  65664. /**
  65665. * @member {string} KnowledgeGraphEdgeParameter.prototype.end
  65666. * @description 结束实体id。
  65667. */
  65668. this.end = null;
  65669. /**
  65670. * @member {string} KnowledgeGraphEdgeParameter.prototype.type
  65671. * @description 标签,关系。
  65672. */
  65673. this.type = null;
  65674. /**
  65675. * @member {Object} KnowledgeGraphEdgeParameter.prototype.properties
  65676. * @description 实体属性。
  65677. */
  65678. this.properties = null;
  65679. this.CLASS_NAME = 'SuperMap.KnowledgeGraphEdgeParameter';
  65680. Util.extend(this, options);
  65681. }
  65682. KnowledgeGraphEdgeParameter_createClass(KnowledgeGraphEdgeParameter, [{
  65683. key: "destroy",
  65684. value: function destroy() {
  65685. var me = this;
  65686. me.id = null;
  65687. me.start = null;
  65688. me.end = null;
  65689. me.type = null;
  65690. me.properties = null;
  65691. }
  65692. }]);
  65693. return KnowledgeGraphEdgeParameter;
  65694. }()));
  65695. ;// CONCATENATED MODULE: ./src/common/iServer/index.js
  65696. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  65697. * This program are made available under the terms of the Apache License, Version 2.0
  65698. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  65699. ;// CONCATENATED MODULE: ./src/common/online/OnlineResources.js
  65700. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  65701. * This program are made available under the terms of the Apache License, Version 2.0
  65702. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  65703. /**
  65704. * @enum ServiceStatus
  65705. * @category BaseTypes Constant
  65706. * @description 服务发布状态。
  65707. * @usage
  65708. * ```
  65709. * // 浏览器
  65710. * <script type="text/javascript" src="{cdn}"></script>
  65711. * <script>
  65712. * const result = {namespace}.ServiceStatus.DOES_NOT_INVOLVE;
  65713. *
  65714. * </script>
  65715. * // ES6 Import
  65716. * import { ServiceStatus } from '{npm}';
  65717. *
  65718. * const result = ServiceStatus.DOES_NOT_INVOLVE;
  65719. * ```
  65720. */
  65721. var ServiceStatus = {
  65722. /** 不涉及,不可发布。 */
  65723. DOES_NOT_INVOLVE: "DOES_NOT_INVOLVE",
  65724. /** 发布失败。 */
  65725. PUBLISH_FAILED: "PUBLISH_FAILED",
  65726. /** 已发布。 */
  65727. PUBLISHED: "PUBLISHED",
  65728. /** 正在发布。 */
  65729. PUBLISHING: "PUBLISHING",
  65730. /** 未发布。 */
  65731. UNPUBLISHED: "UNPUBLISHED",
  65732. /** 取消服务失败。 */
  65733. UNPUBLISHED_FAILED: "UNPUBLISHED_FAILED"
  65734. };
  65735. /**
  65736. * @enum DataItemOrderBy
  65737. * @category BaseTypes Constant
  65738. * @description 数据排序字段。
  65739. * @usage
  65740. * ```
  65741. * // 浏览器
  65742. * <script type="text/javascript" src="{cdn}"></script>
  65743. * <script>
  65744. * const result = {namespace}.DataItemOrderBy.FILENAME;
  65745. *
  65746. * </script>
  65747. * // ES6 Import
  65748. * import { DataItemOrderBy } from '{npm}';
  65749. *
  65750. * const result = DataItemOrderBy.FILENAME;
  65751. * ```
  65752. */
  65753. var DataItemOrderBy = {
  65754. /** 文件名。 */
  65755. FILENAME: "FILENAME",
  65756. /** ID。 */
  65757. ID: "ID",
  65758. /** 最后修改时间。 */
  65759. LASTMODIFIEDTIME: "LASTMODIFIEDTIME",
  65760. /** 作者昵称。 */
  65761. NICKNAME: "NICKNAME",
  65762. /** SERVICESTATUS。 */
  65763. SERVICESTATUS: "SERVICESTATUS",
  65764. /** 大小。 */
  65765. SIZE: "SIZE",
  65766. /** 状态。 */
  65767. STATUS: "STATUS",
  65768. /** 类型。 */
  65769. TYPE: "TYPE",
  65770. /** 更新时间。 */
  65771. UPDATETIME: "UPDATETIME",
  65772. /** 作者名。 */
  65773. USERNAME: "USERNAME"
  65774. };
  65775. /**
  65776. * @enum FilterField {number}
  65777. * @category BaseTypes Constant
  65778. * @description 关键字查询时的过滤字段。
  65779. * @usage
  65780. * ```
  65781. * // 浏览器
  65782. * <script type="text/javascript" src="{cdn}"></script>
  65783. * <script>
  65784. * const result = {namespace}.FilterField.LINKPAGE;
  65785. *
  65786. * </script>
  65787. * // ES6 Import
  65788. * import { FilterField } from '{npm}';
  65789. *
  65790. * const result = FilterField.LINKPAGE;
  65791. * ```
  65792. */
  65793. var FilterField = {
  65794. /** 服务地址。 */
  65795. LINKPAGE: "LINKPAGE",
  65796. /** 服务中包含的地图的名称。 */
  65797. MAPTITLE: "MAPTITLE",
  65798. /** 服务创建者昵称。 */
  65799. NICKNAME: "NICKNAME",
  65800. /** 服务名称。 */
  65801. RESTITLE: "RESTITLE",
  65802. /** 服务创建者用户名。 */
  65803. USERNAME: "USERNAME"
  65804. };
  65805. ;// CONCATENATED MODULE: ./src/common/online/OnlineServiceBase.js
  65806. function OnlineServiceBase_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  65807. function OnlineServiceBase_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  65808. function OnlineServiceBase_createClass(Constructor, protoProps, staticProps) { if (protoProps) OnlineServiceBase_defineProperties(Constructor.prototype, protoProps); if (staticProps) OnlineServiceBase_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  65809. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  65810. * This program are made available under the terms of the Apache License, Version 2.0
  65811. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  65812. /**
  65813. * @class OnlineServiceBase
  65814. * @deprecatedclass SuperMap.OnlineServiceBase
  65815. * @classdesc Online 服务基类(使用 key 作为权限限制的类需要实现此类)。
  65816. * @category iPortal/Online Core
  65817. * @param {Object} options - 可选参数。
  65818. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  65819. * @param {Object} [options.headers] - 请求头。
  65820. * @usage
  65821. */
  65822. var OnlineServiceBase = /*#__PURE__*/function () {
  65823. function OnlineServiceBase(options) {
  65824. OnlineServiceBase_classCallCheck(this, OnlineServiceBase);
  65825. options = options || {};
  65826. Util_Util.extend(this, options);
  65827. this.CLASS_NAME = "SuperMap.OnlineServiceBase";
  65828. }
  65829. /**
  65830. * @function OnlineServiceBase.prototype.request
  65831. * @description 请求 online 服务
  65832. * @param {string} [method='GET'] - 请求方式, 'GET', 'PUT', 'POST', 'DELETE'。
  65833. * @param {string} url - 服务地址。
  65834. * @param {Object} param - URL 查询参数。
  65835. * @param {Object} [requestOptions] - http 请求参数, 比如请求头,超时时间等。
  65836. * @returns {Promise} 包含请求结果的 Promise 对象。
  65837. */
  65838. OnlineServiceBase_createClass(OnlineServiceBase, [{
  65839. key: "request",
  65840. value: function request(method, url, param) {
  65841. var requestOptions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
  65842. url = SecurityManager.appendCredential(url);
  65843. requestOptions['crossOrigin'] = this.options.crossOrigin;
  65844. requestOptions['headers'] = this.options.headers;
  65845. return FetchRequest.commit(method, url, param, requestOptions).then(function (response) {
  65846. return response.json();
  65847. });
  65848. }
  65849. }]);
  65850. return OnlineServiceBase;
  65851. }();
  65852. ;// CONCATENATED MODULE: ./src/common/online/OnlineData.js
  65853. function OnlineData_typeof(obj) { "@babel/helpers - typeof"; return OnlineData_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, OnlineData_typeof(obj); }
  65854. function OnlineData_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  65855. function OnlineData_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  65856. function OnlineData_createClass(Constructor, protoProps, staticProps) { if (protoProps) OnlineData_defineProperties(Constructor.prototype, protoProps); if (staticProps) OnlineData_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  65857. function OnlineData_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) OnlineData_setPrototypeOf(subClass, superClass); }
  65858. function OnlineData_setPrototypeOf(o, p) { OnlineData_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return OnlineData_setPrototypeOf(o, p); }
  65859. function OnlineData_createSuper(Derived) { var hasNativeReflectConstruct = OnlineData_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = OnlineData_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = OnlineData_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return OnlineData_possibleConstructorReturn(this, result); }; }
  65860. function OnlineData_possibleConstructorReturn(self, call) { if (call && (OnlineData_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return OnlineData_assertThisInitialized(self); }
  65861. function OnlineData_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  65862. function OnlineData_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  65863. function OnlineData_getPrototypeOf(o) { OnlineData_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return OnlineData_getPrototypeOf(o); }
  65864. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  65865. * This program are made available under the terms of the Apache License, Version 2.0
  65866. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  65867. /**
  65868. * @class OnlineData
  65869. * @deprecatedclass SuperMap.OnlineData
  65870. * @classdesc Online myData 服务。
  65871. * @category iPortal/Online Resources Data
  65872. * @param {string} serviceRootUrl - 服务地址。
  65873. * @param {Object} options - 可选参数。
  65874. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  65875. * @param {Object} [options.headers] - 请求头。
  65876. * @usage
  65877. * @extends OnlineServiceBase
  65878. */
  65879. var OnlineData = /*#__PURE__*/function (_OnlineServiceBase) {
  65880. OnlineData_inherits(OnlineData, _OnlineServiceBase);
  65881. var _super = OnlineData_createSuper(OnlineData);
  65882. //TODO 目前并没有对接服务支持的所有操作,日后需要补充完整
  65883. function OnlineData(serviceRootUrl, options) {
  65884. var _this;
  65885. OnlineData_classCallCheck(this, OnlineData);
  65886. _this = _super.call(this, serviceRootUrl);
  65887. options = options || {};
  65888. //MD5
  65889. _this.MD5 = null;
  65890. //文件类型。
  65891. _this.type = null;
  65892. //数据上传者名称。
  65893. _this.userName = null;
  65894. //文件名称。
  65895. _this.fileName = null;
  65896. //文件大小,单位为 B 。
  65897. _this.size = null;
  65898. //服务发布状态。
  65899. _this.serviceStatus = null;
  65900. //服务 id 。
  65901. _this.serviceId = null;
  65902. //数据项 id 。
  65903. _this.id = null;
  65904. //最后修改时间。
  65905. _this.lastModfiedTime = null;
  65906. //文件状态。
  65907. _this.status = null;
  65908. //数据文件存储 id 。
  65909. _this.storageId = null;
  65910. //数据的发布信息。
  65911. _this.publishInfo = null;
  65912. //数据的权限信息。
  65913. _this.authorizeSetting = null;
  65914. //用户的昵称。
  65915. _this.nickname = null;
  65916. //数据的标签。
  65917. _this.tags = [];
  65918. //数据的描述信息。
  65919. _this.description = null;
  65920. //数据发布的服务信息集合。
  65921. _this.dataItemServices = null;
  65922. //数据坐标类型。
  65923. _this.coordType = null;
  65924. //数据审核信息
  65925. _this.dataCheckResult = null;
  65926. //数据元数据信息
  65927. _this.dataMetaInfo = null;
  65928. //数据的缩略图路径。
  65929. _this.thumbnail = null;
  65930. Util_Util.extend(OnlineData_assertThisInitialized(_this), options);
  65931. if (_this.id) {
  65932. _this.serviceUrl = serviceRootUrl + "/" + _this.id;
  65933. }
  65934. _this.CLASS_NAME = "SuperMap.OnlineData";
  65935. return _this;
  65936. }
  65937. /**
  65938. * @function OnlineData.prototype.load
  65939. * @description 通过 URL 请求获取该服务完整信息。
  65940. * @returns {Promise} 不包含请求结果的 Promise 对象,请求返回结果自动填充到该类属性中。
  65941. */
  65942. OnlineData_createClass(OnlineData, [{
  65943. key: "load",
  65944. value: function load() {
  65945. if (!this.serviceUrl) {
  65946. return;
  65947. }
  65948. var me = this;
  65949. return me.request("GET", this.serviceUrl).then(function (result) {
  65950. Util_Util.extend(me, result);
  65951. });
  65952. }
  65953. /**
  65954. * @function OnlineData.prototype.getPublishedServices
  65955. * @description 获取数据发布的所有服务。
  65956. * @returns {Object} 数据发布的所有服务。
  65957. */
  65958. }, {
  65959. key: "getPublishedServices",
  65960. value: function getPublishedServices() {
  65961. return this.dataItemServices;
  65962. }
  65963. /**
  65964. * @function OnlineData.prototype.getAuthorizeSetting
  65965. * @description 获取数据的权限信息。
  65966. * @returns {Object} 权限信息。
  65967. */
  65968. }, {
  65969. key: "getAuthorizeSetting",
  65970. value: function getAuthorizeSetting() {
  65971. return this.authorizeSetting;
  65972. }
  65973. }]);
  65974. return OnlineData;
  65975. }(OnlineServiceBase);
  65976. ;// CONCATENATED MODULE: ./src/common/online/Online.js
  65977. function Online_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  65978. function Online_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  65979. function Online_createClass(Constructor, protoProps, staticProps) { if (protoProps) Online_defineProperties(Constructor.prototype, protoProps); if (staticProps) Online_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  65980. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  65981. * This program are made available under the terms of the Apache License, Version 2.0
  65982. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  65983. /**
  65984. * @class Online
  65985. * @deprecatedclass SuperMap.Online
  65986. * @classdesc 对接 SuperMap Online 所有基础服务。
  65987. * @category iPortal/Online Resources
  65988. * @modulecategory Services
  65989. * @example
  65990. * var online=new Online();
  65991. * var services = online.queryDatas(param);
  65992. * service.then(function(services){
  65993. * var service= services[0];
  65994. * service.updateDataInfo();
  65995. * })
  65996. * @usage
  65997. */
  65998. var Online = /*#__PURE__*/function () {
  65999. //TODO 目前并没有对接Online的所有操作,需要补充完整
  66000. //所有查询返回的是一个Promise,在外部使用的时候通过Promise的then方法获取异步结果
  66001. function Online() {
  66002. Online_classCallCheck(this, Online);
  66003. this.rootUrl = "https://www.supermapol.com";
  66004. this.webUrl = this.rootUrl + "/web";
  66005. var mContentUrl = this.webUrl + "/mycontent";
  66006. this.mDatasUrl = mContentUrl + "/datas";
  66007. this.CLASS_NAME = "SuperMap.Online";
  66008. }
  66009. /**
  66010. * @function Online.prototype.load
  66011. * @description 加载 online,验证 online 是否可用。
  66012. * @returns {Promise} 包含网络请求结果的 Promise 对象。
  66013. */
  66014. Online_createClass(Online, [{
  66015. key: "load",
  66016. value: function load() {
  66017. return FetchRequest.get(this.rootUrl).then(function (response) {
  66018. return response;
  66019. });
  66020. }
  66021. /**
  66022. * @function Online.prototype.login
  66023. * @description 登录Online
  66024. */
  66025. }, {
  66026. key: "login",
  66027. value: function login() {
  66028. SecurityManager.loginOnline(this.rootUrl, true);
  66029. }
  66030. /**
  66031. * @function Online.prototype.queryDatas
  66032. * @description 查询 Online “我的内容” 下 “我的数据” 服务(需要登录状态获取),并返回可操作的服务对象。
  66033. * @param {OnlineQueryDatasParameter} parameter - myDatas 服务资源查询参数。
  66034. * @returns {Promise} 包含所有数据服务信息的 Promise 对象。
  66035. */
  66036. }, {
  66037. key: "queryDatas",
  66038. value: function queryDatas(parameter) {
  66039. var me = this,
  66040. url = me.mDatasUrl;
  66041. if (parameter) {
  66042. parameter = parameter.toJSON();
  66043. }
  66044. return FetchRequest.get(url, parameter).then(function (json) {
  66045. if (!json || !json.content || json.content.length < 1) {
  66046. return;
  66047. }
  66048. var services = [],
  66049. contents = json.content,
  66050. len = contents.length;
  66051. for (var i = 0; i < len; i++) {
  66052. var content = contents[i];
  66053. var service = new OnlineData(me.mDatasUrl, content);
  66054. services.push(service);
  66055. }
  66056. return services;
  66057. });
  66058. }
  66059. }]);
  66060. return Online;
  66061. }();
  66062. ;// CONCATENATED MODULE: ./src/common/online/OnlineQueryDatasParameter.js
  66063. function OnlineQueryDatasParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  66064. function OnlineQueryDatasParameter_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  66065. function OnlineQueryDatasParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) OnlineQueryDatasParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) OnlineQueryDatasParameter_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  66066. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  66067. * This program are made available under the terms of the Apache License, Version 2.0
  66068. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  66069. /**
  66070. * @class OnlineQueryDatasParameter
  66071. * @deprecatedclass SuperMap.OnlineQueryDatasParameter
  66072. * @classdesc myDatas 服务资源查询参数。
  66073. * @category iPortal/Online Resources Data
  66074. * @param {Object} options - 参数。
  66075. * @usage
  66076. */
  66077. var OnlineQueryDatasParameter = /*#__PURE__*/function () {
  66078. function OnlineQueryDatasParameter(options) {
  66079. OnlineQueryDatasParameter_classCallCheck(this, OnlineQueryDatasParameter);
  66080. options = options || {};
  66081. /**
  66082. * @member {Array.<string>} OnlineQueryDatasParameter.prototype.userNames
  66083. * @description 数据作者名。可以根据数据作者名查询,默认查询全部。
  66084. */
  66085. this.userNames = null;
  66086. /**
  66087. * @member {Array.<Object>} OnlineQueryDatasParameter.prototype.types
  66088. * @description 数据类型。
  66089. */
  66090. this.types = null;
  66091. /**
  66092. * @member {string} OnlineQueryDatasParameter.prototype.fileName
  66093. * @description 文件名称。
  66094. */
  66095. this.fileName = null;
  66096. /**
  66097. * @member {string} OnlineQueryDatasParameter.prototype.serviceStatuses
  66098. * @description 服务发布状态。
  66099. */
  66100. this.serviceStatuses = null;
  66101. /**
  66102. * @member {string} OnlineQueryDatasParameter.prototype.serviceId
  66103. * @description 服务 ID。
  66104. */
  66105. this.serviceId = null;
  66106. /**
  66107. * @member {Array.<number>} OnlineQueryDatasParameter.prototype.ids
  66108. * @description 由数据项 ID 组成的整型数组。
  66109. */
  66110. this.ids = null;
  66111. /**
  66112. * @member {Array.<string>} OnlineQueryDatasParameter.prototype.keywords
  66113. * @description 关键字。
  66114. */
  66115. this.keywords = null;
  66116. /**
  66117. * @member {string} OnlineQueryDatasParameter.prototype.orderBy
  66118. * @description 排序字段。
  66119. */
  66120. this.orderBy = null;
  66121. /**
  66122. * @member {Array.<string>} OnlineQueryDatasParameter.prototype.tags
  66123. * @description 数据的标签。
  66124. */
  66125. this.tags = null;
  66126. /**
  66127. * @member {Array.<string>} OnlineQueryDatasParameter.prototype.filterFields
  66128. * @description 用于关键字查询时的过滤字段。
  66129. */
  66130. this.filterFields = null;
  66131. Util_Util.extend(this, options);
  66132. this.CLASS_NAME = "SuperMap.OnlineQueryDatasParameter";
  66133. }
  66134. /**
  66135. * @function OnlineQueryDatasParameter.prototype.toJSON
  66136. * @description 返回对应的 JSON 对象。
  66137. * @returns {Object} 对应的 JSON 对象。
  66138. */
  66139. OnlineQueryDatasParameter_createClass(OnlineQueryDatasParameter, [{
  66140. key: "toJSON",
  66141. value: function toJSON() {
  66142. var me = this;
  66143. var jsonObj = {
  66144. "types": me.types,
  66145. "fileName": me.fileName,
  66146. "serviceStatuses": me.serviceStatuses,
  66147. "serviceId": me.serviceId,
  66148. "ids": me.ids,
  66149. "keywords": me.keywords,
  66150. "orderBy": me.orderBy,
  66151. "tags": me.tags,
  66152. "filterFields": me.filterFields
  66153. };
  66154. for (var key in jsonObj) {
  66155. if (jsonObj[key] == null) {
  66156. delete jsonObj[key];
  66157. }
  66158. }
  66159. return jsonObj;
  66160. }
  66161. }]);
  66162. return OnlineQueryDatasParameter;
  66163. }();
  66164. ;// CONCATENATED MODULE: ./src/common/online/index.js
  66165. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  66166. * This program are made available under the terms of the Apache License, Version 2.0
  66167. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  66168. ;// CONCATENATED MODULE: ./src/common/security/KeyServiceParameter.js
  66169. function KeyServiceParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  66170. function KeyServiceParameter_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  66171. function KeyServiceParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) KeyServiceParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) KeyServiceParameter_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  66172. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  66173. * This program are made available under the terms of the Apache License, Version 2.0
  66174. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  66175. /**
  66176. * @class KeyServiceParameter
  66177. * @deprecatedclass SuperMap.KeyServiceParameter
  66178. * @classdesc key申请参数
  66179. * @category Security
  66180. * @param {Object} options - 参数。
  66181. * @param {string} options.name - 申请服务名称。
  66182. * @param {number} options.serviceIds - 服务 ID。
  66183. * @param {ClientType} [options.clientType=ClientType.SERVER] - 服务端类型。
  66184. * @param {number} options.limitation - 有效期
  66185. * @usage
  66186. */
  66187. var KeyServiceParameter = /*#__PURE__*/function () {
  66188. function KeyServiceParameter(options) {
  66189. KeyServiceParameter_classCallCheck(this, KeyServiceParameter);
  66190. this.name = null;
  66191. this.serviceIds = null;
  66192. this.clientType = ClientType.SERVER;
  66193. this.limitation = null;
  66194. Util_Util.extend(this, options);
  66195. this.CLASS_NAME = "SuperMap.KeyServiceParameter";
  66196. }
  66197. /**
  66198. * @function KeyServiceParameter.prototype.toJSON
  66199. * @description 转换成 JSON 对象
  66200. * @returns {Object} 参数的 JSON 对象
  66201. */
  66202. KeyServiceParameter_createClass(KeyServiceParameter, [{
  66203. key: "toJSON",
  66204. value: function toJSON() {
  66205. return {
  66206. name: this.name,
  66207. serviceIds: this.serviceIds,
  66208. clientType: this.clientType,
  66209. limitation: this.limitation
  66210. };
  66211. }
  66212. }]);
  66213. return KeyServiceParameter;
  66214. }();
  66215. ;// CONCATENATED MODULE: ./src/common/security/ServerInfo.js
  66216. function ServerInfo_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  66217. function ServerInfo_createClass(Constructor, protoProps, staticProps) { if (protoProps) ServerInfo_defineProperties(Constructor.prototype, protoProps); if (staticProps) ServerInfo_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  66218. function ServerInfo_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  66219. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  66220. * This program are made available under the terms of the Apache License, Version 2.0
  66221. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  66222. /**
  66223. * @class ServerInfo
  66224. * @deprecatedclass SuperMap.ServerInfo
  66225. * @classdesc 服务器信息(安全相关),包含服务器类型,服务地址,token服务地址等。
  66226. * @category Security
  66227. * @param {string} type - 服务器类型。
  66228. * @param {Object} options - 参数。
  66229. * @param {string} options.server - 服务器地址,如:http://supermapiserver:8090/iserver。
  66230. * @param {string} [options.tokenServiceUrl] - 如:http://supermapiserver:8090/iserver/services/security/tokens.json。
  66231. * @param {string} [options.keyServiceUrl] - 如:http://supermapiserver:8092/web/mycontent/keys/register.json。
  66232. * @usage
  66233. */
  66234. var ServerInfo = /*#__PURE__*/ServerInfo_createClass(function ServerInfo(type, options) {
  66235. ServerInfo_classCallCheck(this, ServerInfo);
  66236. /**
  66237. * @member {ServerType} ServerInfo.prototype.type
  66238. * @description 服务器类型。
  66239. */
  66240. this.type = type;
  66241. /**
  66242. * @member {string} ServerInfo.prototype.server
  66243. * @description 服务器地址。
  66244. */
  66245. this.server = null;
  66246. /**
  66247. * @member {string} [ServerInfo.prototype.tokenServiceUrl]
  66248. * @description 如:http://supermapiserver:8090/iserver/services/security/tokens.json。
  66249. */
  66250. this.tokenServiceUrl = null;
  66251. /**
  66252. * @member {string} [ServerInfo.prototype.keyServiceUrl]
  66253. * @description 如:http://supermapiserver:8092/web/mycontent/keys/register.json。
  66254. */
  66255. this.keyServiceUrl = null;
  66256. Util_Util.extend(this, options);
  66257. this.CLASS_NAME = "SuperMap.ServerInfo";
  66258. this.type = this.type || ServerType.ISERVER;
  66259. if (!this.server) {
  66260. console.error('server url require is not undefined');
  66261. }
  66262. // var patten = /http:\/\/([^\/]+)/i;
  66263. //this.server = this.server.match(patten)[0];
  66264. var tokenServiceSuffix = "/services/security/tokens";
  66265. if (this.type === ServerType.ISERVER && this.server.indexOf("iserver") < 0) {
  66266. tokenServiceSuffix = "/iserver" + tokenServiceSuffix;
  66267. }
  66268. if (!this.tokenServiceUrl) {
  66269. this.tokenServiceUrl = Util_Util.urlPathAppend(this.server, tokenServiceSuffix);
  66270. }
  66271. if (!this.keyServiceUrl) {
  66272. if (this.type === ServerType.IPORTAL) {
  66273. this.keyServiceUrl = Util_Util.urlPathAppend(this.server, "/web/mycontent/keys/register");
  66274. } else if (this.type === ServerType.ONLINE) {
  66275. this.keyServiceUrl = Util_Util.urlPathAppend(this.server, "/web/mycontent/keys");
  66276. }
  66277. }
  66278. });
  66279. ;// CONCATENATED MODULE: ./src/common/security/TokenServiceParameter.js
  66280. function TokenServiceParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  66281. function TokenServiceParameter_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  66282. function TokenServiceParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) TokenServiceParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) TokenServiceParameter_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  66283. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  66284. * This program are made available under the terms of the Apache License, Version 2.0
  66285. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  66286. /**
  66287. * @class TokenServiceParameter
  66288. * @deprecatedclass SuperMap.TokenServiceParameter
  66289. * @classdesc token 申请参数。
  66290. * @category Security
  66291. * @param {Object} options - 参数。
  66292. * @param {string} options.username - 用户名。
  66293. * @param {string} options.password - 密码。
  66294. * @param {ClientType} [options.clientType='ClientType.NONE'] - token 申请的客户端标识类型。
  66295. * @param {string} [options.ip] - clientType=IP 时,此为必选参数。
  66296. * @param {string} [options.referer] -clientType=Referer 时,此为必选参数。如果按照指定 URL 的方式申请令牌,则设置相应的 URL。
  66297. * @param {number} [options.expiration=60] - 申请令牌的有效期,从发布令牌的时间开始计算,单位为分钟。
  66298. * @usage
  66299. *
  66300. */
  66301. var TokenServiceParameter = /*#__PURE__*/function () {
  66302. function TokenServiceParameter(options) {
  66303. TokenServiceParameter_classCallCheck(this, TokenServiceParameter);
  66304. /**
  66305. * @member {string} TokenServiceParameter.prototype.userName
  66306. * @description 用户名。
  66307. */
  66308. this.userName = null;
  66309. /**
  66310. * @member {string} TokenServiceParameter.prototype.password
  66311. * @description 密码。
  66312. */
  66313. this.password = null;
  66314. /**
  66315. * @member {ClientType} TokenServiceParameter.prototype.clientType
  66316. * @description token 申请的客户端标识类型。
  66317. */
  66318. this.clientType = ClientType.NONE;
  66319. /**
  66320. * @member {string} [TokenServiceParameter.prototype.ip]
  66321. * @description clientType=IP 时,此为必选参数。
  66322. */
  66323. this.ip = null;
  66324. /**
  66325. * @member {string} [TokenServiceParameter.prototype.referer]
  66326. * @description clientType=Referer 时,此为必选参数。如果按照指定 URL 的方式申请令牌,则设置相应的 URL。
  66327. */
  66328. this.referer = null;
  66329. /**
  66330. * @member {number} TokenServiceParameter.prototype.expiration
  66331. * @description 申请令牌的有效期,从发布令牌的时间开始计算,单位为分钟。
  66332. */
  66333. this.expiration = 60;
  66334. Util_Util.extend(this, options);
  66335. this.CLASS_NAME = "SuperMap.TokenServiceParameter";
  66336. }
  66337. /**
  66338. * @function TokenServiceParameter.prototype.toJSON
  66339. * @description 将所有信息转成 JSON 字符串。
  66340. * @returns {string} 参数的 JSON 字符串。
  66341. */
  66342. TokenServiceParameter_createClass(TokenServiceParameter, [{
  66343. key: "toJSON",
  66344. value: function toJSON() {
  66345. return {
  66346. userName: this.userName,
  66347. password: this.password,
  66348. clientType: this.clientType,
  66349. ip: this.ip,
  66350. referer: this.referer,
  66351. expiration: this.expiration
  66352. };
  66353. }
  66354. }]);
  66355. return TokenServiceParameter;
  66356. }();
  66357. ;// CONCATENATED MODULE: ./src/common/security/index.js
  66358. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  66359. * This program are made available under the terms of the Apache License, Version 2.0
  66360. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  66361. ;// CONCATENATED MODULE: external "function(){try{return elasticsearch}catch(e){return {}}}()"
  66362. var external_function_try_return_elasticsearch_catch_e_return_namespaceObject = function(){try{return elasticsearch}catch(e){return {}}}();
  66363. var external_function_try_return_elasticsearch_catch_e_return_default = /*#__PURE__*/__webpack_require__.n(external_function_try_return_elasticsearch_catch_e_return_namespaceObject);
  66364. ;// CONCATENATED MODULE: ./src/common/thirdparty/elasticsearch/ElasticSearch.js
  66365. function ElasticSearch_toConsumableArray(arr) { return ElasticSearch_arrayWithoutHoles(arr) || ElasticSearch_iterableToArray(arr) || ElasticSearch_unsupportedIterableToArray(arr) || ElasticSearch_nonIterableSpread(); }
  66366. function ElasticSearch_nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
  66367. function ElasticSearch_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return ElasticSearch_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return ElasticSearch_arrayLikeToArray(o, minLen); }
  66368. function ElasticSearch_iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
  66369. function ElasticSearch_arrayWithoutHoles(arr) { if (Array.isArray(arr)) return ElasticSearch_arrayLikeToArray(arr); }
  66370. function ElasticSearch_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
  66371. function ElasticSearch_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  66372. 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); } }
  66373. function ElasticSearch_createClass(Constructor, protoProps, staticProps) { if (protoProps) ElasticSearch_defineProperties(Constructor.prototype, protoProps); if (staticProps) ElasticSearch_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  66374. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  66375. * This program are made available under the terms of the Apache License, Version 2.0
  66376. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  66377. /**
  66378. * @class ElasticSearch
  66379. * @deprecatedclass SuperMap.ElasticSearch
  66380. * @classdesc ElasticSearch服务类。
  66381. * @category ElasticSearch
  66382. * @modulecategory Services
  66383. * @param {string} url - ElasticSearch服务地址。
  66384. * @param {Object} options - 参数。
  66385. * @param {function} [options.change] - 服务器返回数据后执行的函数。废弃,不建议使用。使用search或msearch方法。
  66386. * @param {boolean} [options.openGeoFence=false] - 是否开启地理围栏验证,默认为不开启。
  66387. * @param {function} [options.outOfGeoFence] - 数据超出地理围栏后执行的函数。
  66388. * @param {Object} [options.geoFence] - 地理围栏。
  66389. * @description
  66390. * <h3 style="font-size: 20px;margin-top: 20px;margin-bottom: 10px;">11.1.0</h3>
  66391. * 该功能依赖<a href="https://github.com/elastic/elasticsearch">@elastic/elasticsearch</a>, webpack5或其他不包含Node.js Polyfills的打包工具,需要加入相关配置,以webpack为例:<br/>
  66392. <p style="margin-top:10px;">首先安装相关Polyfills</p><pre><code>npm i stream-http https-browserify stream-browserify tty-browserify browserify-zlib os-browserify buffer url assert process -D</code></pre>
  66393. 然后配置webpack<pre><code>module.exports: {
  66394. resolve: {
  66395. alias: {
  66396. process: 'process/browser',
  66397. },
  66398. mainFields: ['browser', 'main'],
  66399. fallback: {
  66400. fs: false,
  66401. http: require.resolve('stream-http'),
  66402. https: require.resolve('https-browserify'),
  66403. os: require.resolve('os-browserify/browser'),
  66404. stream: require.resolve('stream-browserify'),
  66405. tty: require.resolve('tty-browserify'),
  66406. zlib: require.resolve('browserify-zlib')
  66407. }
  66408. }
  66409. plugins: [
  66410. new webpack.ProvidePlugin({
  66411. process: 'process/browser',
  66412. Buffer: ['buffer', 'Buffer']
  66413. }),
  66414. ]
  66415. }</code></pre>
  66416. * @usage
  66417. */
  66418. var ElasticSearch = /*#__PURE__*/function () {
  66419. function ElasticSearch(url, options) {
  66420. ElasticSearch_classCallCheck(this, ElasticSearch);
  66421. options = options || {};
  66422. /**
  66423. * @member {string} ElasticSearch.prototype.url
  66424. * @description ElasticSearch服务地址。
  66425. */
  66426. this.url = url;
  66427. /**
  66428. * @member {Object} ElasticSearch.prototype.client
  66429. * @description client ES客户端。
  66430. */
  66431. try {
  66432. // 老版本
  66433. this.client = new (external_function_try_return_elasticsearch_catch_e_return_default()).Client({
  66434. host: this.url
  66435. });
  66436. } catch (e) {
  66437. // 新版本
  66438. this.client = new (external_function_try_return_elasticsearch_catch_e_return_default()).Client({
  66439. node: {
  66440. url: new URL(this.url)
  66441. }
  66442. });
  66443. }
  66444. /**
  66445. * @deprecated
  66446. * @member {function} [ElasticSearch.prototype.change]
  66447. * @description 服务器返回数据后执行的函数。废弃,不建议使用。使用search或msearch方法。
  66448. */
  66449. this.change = null;
  66450. /**
  66451. * @member {boolean} [ElasticSearch.prototype.openGeoFence=false]
  66452. * @description 是否开启地理围栏验证,默认为不开启。
  66453. */
  66454. this.openGeoFence = false;
  66455. /**
  66456. * @member {function} [ElasticSearch.prototype.outOfGeoFence]
  66457. * @description 数据超出地理围栏后执行的函数。
  66458. */
  66459. this.outOfGeoFence = null;
  66460. /**
  66461. * @member {Object} [ElasticSearch.prototype.geoFence]
  66462. * @description 地理围栏。
  66463. * @example {
  66464. * radius: 1000,//单位是m
  66465. * center: [104.40, 30.43],
  66466. * unit: 'meter|degree'
  66467. * }
  66468. */
  66469. this.geoFence = null;
  66470. /*
  66471. * Constant: EVENT_TYPES
  66472. * {Array.<String>}
  66473. * 此类支持的事件类型。
  66474. *
  66475. */
  66476. this.EVENT_TYPES = ['change', 'error', 'outOfGeoFence'];
  66477. /**
  66478. * @member {Events} ElasticSearch.prototype.events
  66479. * @description 事件。
  66480. */
  66481. this.events = new Events(this, null, this.EVENT_TYPES);
  66482. /**
  66483. * @member {Object} ElasticSearch.prototype.eventListeners
  66484. * @description 监听器对象,在构造函数中设置此参数(可选),对 MapService 支持的两个事件 processCompleted 、processFailed 进行监听,
  66485. * 相当于调用 Events.on(eventListeners)。
  66486. */
  66487. this.eventListeners = null;
  66488. Util_Util.extend(this, options);
  66489. if (this.eventListeners instanceof Object) {
  66490. this.events.on(this.eventListeners);
  66491. }
  66492. }
  66493. /**
  66494. * @function ElasticSearch.prototype.setGeoFence
  66495. * @description 设置地理围栏,openGeoFence参数为true的时候,设置的地理围栏才生效。
  66496. * @param {Geometry} geoFence - 地理围栏。
  66497. */
  66498. ElasticSearch_createClass(ElasticSearch, [{
  66499. key: "setGeoFence",
  66500. value: function setGeoFence(geoFence) {
  66501. this.geoFence = geoFence;
  66502. }
  66503. /**
  66504. * @function ElasticSearch.prototype.bulk
  66505. * @description 批量操作API,允许执行多个索引/删除操作。
  66506. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-bulk}</br>
  66507. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-bulk.html}</br>
  66508. * @param {Object} params - 参数。
  66509. * @param {function} callback - 回调函数。
  66510. */
  66511. }, {
  66512. key: "bulk",
  66513. value: function bulk(params, callback) {
  66514. return this.client.bulk(params, this._handleCallback(callback));
  66515. }
  66516. /**
  66517. * @function ElasticSearch.prototype.clearScroll
  66518. * @description 通过指定scroll参数进行查询来清除已经创建的scroll请求。
  66519. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-clearscroll}</br>
  66520. *更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-scroll.html}</br>
  66521. * @param {Object} params - 参数。
  66522. * @param {function} callback - 回调函数。
  66523. */
  66524. }, {
  66525. key: "clearScroll",
  66526. value: function clearScroll(params, callback) {
  66527. return this.client.clearScroll(params, this._handleCallback(callback));
  66528. }
  66529. /**
  66530. * @function ElasticSearch.prototype.count
  66531. * @description 获取集群、索引、类型或查询的文档个数。
  66532. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-count}</br>
  66533. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-count.html}</br>
  66534. * @param {Object} params - 参数。
  66535. * @param {function} callback - 回调函数。
  66536. */
  66537. }, {
  66538. key: "count",
  66539. value: function count(params, callback) {
  66540. return this.client.count(params, this._handleCallback(callback));
  66541. }
  66542. /**
  66543. * @function ElasticSearch.prototype.create
  66544. * @description 在特定索引中添加一个类型化的JSON文档,使其可搜索。如果具有相同index,type且ID已经存在的文档将发生错误。</br>
  66545. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-create}
  66546. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-index_.html}
  66547. * @param {Object} params - 参数。
  66548. * @param {function} callback - 回调函数。
  66549. */
  66550. }, {
  66551. key: "create",
  66552. value: function create(params, callback) {
  66553. return this.client.create(params, this._handleCallback(callback));
  66554. }
  66555. /**
  66556. * @function ElasticSearch.prototype.delete
  66557. * @description 根据其ID从特定索引中删除键入的JSON文档。
  66558. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-delete}</br>
  66559. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-delete.html}</br>
  66560. * @param {Object} params - 参数。
  66561. * @param {function} callback - 回调函数。
  66562. */
  66563. }, {
  66564. key: "delete",
  66565. value: function _delete(params, callback) {
  66566. return this.client["delete"](params, this._handleCallback(callback));
  66567. }
  66568. /**
  66569. * @function ElasticSearch.prototype.deleteByQuery
  66570. * @description 根据其ID从特定索引中删除键入的JSON文档。
  66571. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-deletebyquery}</br>
  66572. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-delete-by-query.html}</br>
  66573. * @param {Object} params - 参数。
  66574. * @param {function} callback - 回调函数。
  66575. */
  66576. }, {
  66577. key: "deleteByQuery",
  66578. value: function deleteByQuery(params, callback) {
  66579. return this.client.deleteByQuery(params, this._handleCallback(callback));
  66580. }
  66581. /**
  66582. * @function ElasticSearch.prototype.deleteScript
  66583. * @description 根据其ID删除脚本。</br>
  66584. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-deletescript}</br>
  66585. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-scripting.html}</br>
  66586. * @param {Object} params - 参数。
  66587. * @param {function} callback - 回调函数。
  66588. */
  66589. }, {
  66590. key: "deleteScript",
  66591. value: function deleteScript(params, callback) {
  66592. return this.client.deleteScript(params, this._handleCallback(callback));
  66593. }
  66594. /**
  66595. * @function ElasticSearch.prototype.deleteTemplate
  66596. * @description 根据其ID删除模板。</br>
  66597. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-deletetemplate}</br>
  66598. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html}</br>
  66599. * @param {Object} params - 参数。
  66600. * @param {function} callback - 回调函数。
  66601. */
  66602. }, {
  66603. key: "deleteTemplate",
  66604. value: function deleteTemplate(params, callback) {
  66605. return this.client.deleteTemplate(params, this._handleCallback(callback));
  66606. }
  66607. /**
  66608. * @function ElasticSearch.prototype.exists
  66609. * @description 检查给定文档是否存在。</br>
  66610. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-exists}</br>
  66611. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-get.html}</br>
  66612. * @param {Object} params - 参数。
  66613. * @param {function} callback - 回调函数。
  66614. */
  66615. }, {
  66616. key: "exists",
  66617. value: function exists(params, callback) {
  66618. return this.client.exists(params, this._handleCallback(callback));
  66619. }
  66620. /**
  66621. * @function ElasticSearch.prototype.existsSource
  66622. * @description 检查资源是否存在。</br>
  66623. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-existssource}</br>
  66624. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-get.html}</br>
  66625. * @param {Object} params - 参数。
  66626. * @param {function} callback - 回调函数。
  66627. */
  66628. }, {
  66629. key: "existsSource",
  66630. value: function existsSource(params, callback) {
  66631. return this.client.existsSource(params, this._handleCallback(callback));
  66632. }
  66633. /**
  66634. * @function ElasticSearch.prototype.explain
  66635. * @description 提供与特定查询相关的特定文档分数的详细信息。它还会告诉您文档是否与指定的查询匹配。</br>
  66636. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-explain}</br>
  66637. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-explain.html}</br>
  66638. * @param {Object} params - 参数。
  66639. * @param {function} callback - 回调函数。
  66640. */
  66641. }, {
  66642. key: "explain",
  66643. value: function explain(params, callback) {
  66644. return this.client.explain(params, this._handleCallback(callback));
  66645. }
  66646. /**
  66647. * @function ElasticSearch.prototype.fieldCaps
  66648. * @description 允许检索多个索引之间的字段的功能。(实验性API,可能会在未来版本中删除)</br>
  66649. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-fieldcaps}</br>
  66650. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-field-caps.html}</br>
  66651. * @param {Object} params - 参数。
  66652. * @param {function} callback - 回调函数。
  66653. */
  66654. }, {
  66655. key: "fieldCaps",
  66656. value: function fieldCaps(params, callback) {
  66657. return this.client.fieldCaps(params, this._handleCallback(callback));
  66658. }
  66659. /**
  66660. * @function ElasticSearch.prototype.get
  66661. * @description 从索引获取一个基于其ID的类型的JSON文档。</br>
  66662. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-get}</br>
  66663. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-get.html}</br>
  66664. * @param {Object} params - 参数。
  66665. * @param {function} callback - 回调函数。
  66666. */
  66667. }, {
  66668. key: "get",
  66669. value: function get(params, callback) {
  66670. return this.client.get(params, this._handleCallback(callback));
  66671. }
  66672. /**
  66673. * @function ElasticSearch.prototype.getScript
  66674. * @description 获取脚本。</br>
  66675. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-getscript}</br>
  66676. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-scripting.html}</br>
  66677. * @param {Object} params - 参数。
  66678. * @param {function} callback - 回调函数。
  66679. */
  66680. }, {
  66681. key: "getScript",
  66682. value: function getScript(params, callback) {
  66683. return this.client.getScript(params, this._handleCallback(callback));
  66684. }
  66685. /**
  66686. * @function ElasticSearch.prototype.getSource
  66687. * @description 通过索引,类型和ID获取文档的源。</br>
  66688. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-getsource}</br>
  66689. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-get.html}</br>
  66690. * @param {Object} params - 参数。
  66691. * @param {function} callback - 回调函数。
  66692. */
  66693. }, {
  66694. key: "getSource",
  66695. value: function getSource(params, callback) {
  66696. return this.client.getSource(params, this._handleCallback(callback));
  66697. }
  66698. /**
  66699. * @function ElasticSearch.prototype.getTemplate
  66700. * @description 获取模板。</br>
  66701. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-gettemplate}</br>
  66702. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html}</br>
  66703. * @param {Object} params - 参数。
  66704. * @param {function} callback - 回调函数。
  66705. */
  66706. }, {
  66707. key: "getTemplate",
  66708. value: function getTemplate(params, callback) {
  66709. return this.client.getTemplate(params, this._handleCallback(callback));
  66710. }
  66711. /**
  66712. * @function ElasticSearch.prototype.index
  66713. * @description 在索引中存储一个键入的JSON文档,使其可搜索。</br>
  66714. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-index}</br>
  66715. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-index_.html}</br>
  66716. * @param {Object} params - 参数。
  66717. * @param {function} callback - 回调函数。
  66718. */
  66719. }, {
  66720. key: "index",
  66721. value: function index(params, callback) {
  66722. return this.client.index(params, this._handleCallback(callback));
  66723. }
  66724. /**
  66725. * @function ElasticSearch.prototype.info
  66726. * @description 从当前集群获取基本信息。</br>
  66727. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-info}</br>
  66728. * 更多信息参考 {@link https://www.elastic.co/guide/index.html}</br>
  66729. * @param {Object} params - 参数。
  66730. * @param {function} callback - 回调函数。
  66731. */
  66732. }, {
  66733. key: "info",
  66734. value: function info(params, callback) {
  66735. return this.client.info(params, this._handleCallback(callback));
  66736. }
  66737. /**
  66738. * @function ElasticSearch.prototype.mget
  66739. * @description 根据索引,类型(可选)和ids来获取多个文档。mget所需的主体可以采用两种形式:文档位置数组或文档ID数组。</br>
  66740. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-mget}</br>
  66741. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-multi-get.html}</br>
  66742. * @param {Object} params - 参数。
  66743. * @param {function} callback - 回调函数。
  66744. */
  66745. }, {
  66746. key: "mget",
  66747. value: function mget(params, callback) {
  66748. return this.client.mget(params, this._handleCallback(callback));
  66749. }
  66750. /**
  66751. * @function ElasticSearch.prototype.msearch
  66752. * @description 在同一请求中执行多个搜索请求。</br>
  66753. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-msearch}</br>
  66754. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-multi-search.html}</br>
  66755. * @param {Object} params - 参数。
  66756. * @param {function} callback - 请求返回的回调函数。也可以使用then表达式获取返回结果。
  66757. * 回调参数:error,response,结果存储在response.responses中。
  66758. */
  66759. }, {
  66760. key: "msearch",
  66761. value: function msearch(params, callback) {
  66762. var me = this;
  66763. return me.client.msearch(params).then(function (resp) {
  66764. resp = resp.body || resp;
  66765. me._update(resp.responses, callback);
  66766. return resp;
  66767. }, function (err) {
  66768. callback(err);
  66769. me.events.triggerEvent('error', {
  66770. error: err
  66771. });
  66772. return err;
  66773. });
  66774. }
  66775. /**
  66776. * @function ElasticSearch.prototype.msearchTemplate
  66777. * @description 在同一请求中执行多个搜索模板请求。</br>
  66778. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-msearchtemplate}</br>
  66779. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html}</br>
  66780. * @param {Object} params - 参数。
  66781. * @param {function} callback - 回调函数。
  66782. */
  66783. }, {
  66784. key: "msearchTemplate",
  66785. value: function msearchTemplate(params, callback) {
  66786. return this.client.msearchTemplate(params, this._handleCallback(callback));
  66787. }
  66788. /**
  66789. * @function ElasticSearch.prototype.mtermvectors
  66790. * @description 多termvectors API允许一次获得多个termvectors。</br>
  66791. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-mtermvectors}</br>
  66792. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-multi-termvectors.html}</br>
  66793. * @param {Object} params - 参数。
  66794. * @param {function} callback - 回调函数。
  66795. */
  66796. }, {
  66797. key: "mtermvectors",
  66798. value: function mtermvectors(params, callback) {
  66799. return this.client.mtermvectors(params, this._handleCallback(callback));
  66800. }
  66801. /**
  66802. * @function ElasticSearch.prototype.ping
  66803. * @description 测试连接。</br>
  66804. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-ping}</br>
  66805. * 更多信息参考 {@link https://www.elastic.co/guide/index.html}</br>
  66806. * @param {Object} params - 参数。
  66807. * @param {function} callback - 回调函数。
  66808. */
  66809. }, {
  66810. key: "ping",
  66811. value: function ping(params, callback) {
  66812. return this.client.ping(params, this._handleCallback(callback));
  66813. }
  66814. /**
  66815. * @function ElasticSearch.prototype.putScript
  66816. * @description 添加脚本。</br>
  66817. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-putscript}</br>
  66818. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-scripting.html}</br>
  66819. * @param {Object} params - 参数。
  66820. * @param {function} callback - 回调函数。
  66821. */
  66822. }, {
  66823. key: "putScript",
  66824. value: function putScript(params, callback) {
  66825. return this.client.putScript(params, this._handleCallback(callback));
  66826. }
  66827. /**
  66828. * @function ElasticSearch.prototype.putTemplate
  66829. * @description 添加模板。</br>
  66830. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-puttemplate}</br>
  66831. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html}</br>
  66832. * @param {Object} params - 参数。
  66833. * @param {function} callback - 回调函数。
  66834. */
  66835. }, {
  66836. key: "putTemplate",
  66837. value: function putTemplate(params, callback) {
  66838. return this.client.putTemplate(params, this._handleCallback(callback));
  66839. }
  66840. /**
  66841. * @function ElasticSearch.prototype.reindex
  66842. * @description 重新索引。</br>
  66843. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-reindex}</br>
  66844. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html}</br>
  66845. * @param {Object} params - 参数。
  66846. * @param {function} callback - 回调函数。
  66847. */
  66848. }, {
  66849. key: "reindex",
  66850. value: function reindex(params, callback) {
  66851. return this.client.reindex(params, this._handleCallback(callback));
  66852. }
  66853. /**
  66854. * @function ElasticSearch.prototype.reindexRessrottle
  66855. * @description 重新索引。</br>
  66856. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-reindexrethrottle}</br>
  66857. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html}</br>
  66858. * @param {Object} params - 参数。
  66859. * @param {function} callback - 回调函数。
  66860. */
  66861. }, {
  66862. key: "reindexRessrottle",
  66863. value: function reindexRessrottle(params, callback) {
  66864. return this.client.reindexRessrottle(params, this._handleCallback(callback));
  66865. }
  66866. /**
  66867. * @function ElasticSearch.prototype.renderSearchTemplate
  66868. * @description 搜索模板。</br>
  66869. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-rendersearchtemplate}</br>
  66870. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html}</br>
  66871. * @param {Object} params - 参数。
  66872. * @param {function} callback - 回调函数。
  66873. */
  66874. }, {
  66875. key: "renderSearchTemplate",
  66876. value: function renderSearchTemplate(params, callback) {
  66877. return this.client.renderSearchTemplate(params, this._handleCallback(callback));
  66878. }
  66879. /**
  66880. * @function ElasticSearch.prototype.scroll
  66881. * @description 在search()调用中指定滚动参数之后,滚动搜索请求(检索下一组结果)。</br>
  66882. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-scroll}</br>
  66883. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-scroll.html}</br>
  66884. * @param {Object} params - 参数。
  66885. * @param {function} callback - 回调函数。
  66886. */
  66887. }, {
  66888. key: "scroll",
  66889. value: function scroll(params, callback) {
  66890. return this.client.scroll(params, this._handleCallback(callback));
  66891. }
  66892. /**
  66893. * @function ElasticSearch.prototype.search
  66894. * @description 在search()调用中指定滚动参数之后,滚动搜索请求(检索下一组结果)。
  66895. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-search}</br>
  66896. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-search.html}</br>
  66897. * @param {Object} params - 参数。
  66898. * @param {function} callback - 请求返回的回调函数。也可以使用then表达式获取返回结果。
  66899. * 回调参数:error,response,结果存储在response.responses中。
  66900. */
  66901. }, {
  66902. key: "search",
  66903. value: function search(params, callback) {
  66904. var me = this;
  66905. return me.client.search(params).then(function (resp) {
  66906. resp = resp.body || resp;
  66907. me._update(resp, callback);
  66908. return resp;
  66909. }, function (err) {
  66910. callback && callback(err);
  66911. me.events.triggerEvent('error', {
  66912. error: err
  66913. });
  66914. return err;
  66915. });
  66916. }
  66917. /**
  66918. * @function ElasticSearch.prototype.searchShards
  66919. * @description 返回要执行搜索请求的索引和分片。
  66920. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-searchshards}</br>
  66921. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-shards.html}</br>
  66922. * @param {Object} params - 参数。
  66923. * @param {function} callback - 回调函数。
  66924. */
  66925. }, {
  66926. key: "searchShards",
  66927. value: function searchShards(params, callback) {
  66928. return this.client.searchShards(params, this._handleCallback(callback));
  66929. }
  66930. /**
  66931. * @function ElasticSearch.prototype.searchTemplate
  66932. * @description 搜索模板。
  66933. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-searchtemplate}</br>
  66934. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-suggesters.html}</br>
  66935. * @param {Object} params - 参数。
  66936. * @param {function} callback - 回调函数。
  66937. */
  66938. }, {
  66939. key: "searchTemplate",
  66940. value: function searchTemplate(params, callback) {
  66941. return this.client.searchTemplate(params, this._handleCallback(callback));
  66942. }
  66943. /**
  66944. * @function ElasticSearch.prototype.suggest
  66945. * @description 该建议功能通过使用特定的建议者,基于所提供的文本来建议类似的术语。
  66946. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-suggest}</br>
  66947. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-suggesters.html}</br>
  66948. * @param {Object} params - 参数。
  66949. * @param {function} callback - 回调函数。
  66950. */
  66951. }, {
  66952. key: "suggest",
  66953. value: function suggest(params, callback) {
  66954. return this.client.suggest(params, this._handleCallback(callback));
  66955. }
  66956. /**
  66957. * @function ElasticSearch.prototype.termvectors
  66958. * @description 返回有关特定文档字段中的术语的信息和统计信息。
  66959. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-termvectors}</br>
  66960. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-termvectors.html}</br>
  66961. * @param {Object} params - 参数。
  66962. * @param {function} callback - 回调函数。
  66963. */
  66964. }, {
  66965. key: "termvectors",
  66966. value: function termvectors(params, callback) {
  66967. return this.client.termvectors(params, this._handleCallback(callback));
  66968. }
  66969. /**
  66970. * @function ElasticSearch.prototype.update
  66971. * @description 更新文档的部分。
  66972. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-update}</br>
  66973. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-update.html}</br>
  66974. * @param {Object} params - 参数。
  66975. * @param {function} callback - 回调函数。
  66976. */
  66977. }, {
  66978. key: "update",
  66979. value: function update(params, callback) {
  66980. return this.client.update(params, this._handleCallback(callback));
  66981. }
  66982. /**
  66983. * @function ElasticSearch.prototype.updateByQuery
  66984. * @description 通过查询API来更新文档。
  66985. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-updatebyquery}</br>
  66986. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-update-by-query.html}</br>
  66987. * @param {Object} params - 参数。
  66988. * @param {function} callback - 回调函数。
  66989. */
  66990. }, {
  66991. key: "updateByQuery",
  66992. value: function updateByQuery(params, callback) {
  66993. return this.client.updateByQuery(params, this._handleCallback(callback));
  66994. }
  66995. /**
  66996. * @function ElasticSearch.prototype._handleCallback
  66997. * @description 处理ElasticSearch 16.x和5.x的callback兼容。 5.x的回调参数多包了一层body
  66998. * @param {function} callback - 回调函数。
  66999. * @private
  67000. */
  67001. }, {
  67002. key: "_handleCallback",
  67003. value: function _handleCallback(callback) {
  67004. return function () {
  67005. var args = Array.from(arguments);
  67006. var error = args.shift();
  67007. var resp = args.shift();
  67008. var body = resp && resp.body;
  67009. if (body) {
  67010. var _resp2 = resp,
  67011. statusCode = _resp2.statusCode,
  67012. headers = _resp2.headers;
  67013. args = [statusCode, headers];
  67014. resp = body;
  67015. }
  67016. callback.call.apply(callback, [this, error, resp].concat(ElasticSearch_toConsumableArray(args)));
  67017. };
  67018. }
  67019. }, {
  67020. key: "_update",
  67021. value: function _update(data, callback) {
  67022. var me = this;
  67023. if (!data) {
  67024. return;
  67025. }
  67026. me.data = data;
  67027. if (me.openGeoFence && me.geoFence) {
  67028. me._validateDatas(data);
  67029. }
  67030. me.events.triggerEvent('change', {
  67031. data: me.data
  67032. });
  67033. //change方法已废弃,不建议使用。建议使用search方法的第二个参数传入请求成功的回调
  67034. if (me.change) {
  67035. me.change && me.change(data);
  67036. } else {
  67037. //加responses是为了保持跟原来es自身的数据结构一致
  67038. callback && callback(undefined, {
  67039. responses: data
  67040. });
  67041. }
  67042. }
  67043. }, {
  67044. key: "_validateDatas",
  67045. value: function _validateDatas(datas) {
  67046. if (!datas) {
  67047. return;
  67048. }
  67049. if (!(datas instanceof Array)) {
  67050. datas = [datas];
  67051. }
  67052. var i,
  67053. len = datas.length;
  67054. for (i = 0; i < len; i++) {
  67055. this._validateData(datas[i]);
  67056. }
  67057. }
  67058. }, {
  67059. key: "_validateData",
  67060. value: function _validateData(data) {
  67061. var me = this;
  67062. data.hits.hits.map(function (source) {
  67063. var content = source._source;
  67064. var meterUnit = me._getMeterPerMapUnit(me.geoFence.unit);
  67065. var geoFenceCX = me.geoFence.center[0] * meterUnit;
  67066. var geoFenceCY = me.geoFence.center[1] * meterUnit;
  67067. var contentX = content.x * meterUnit;
  67068. var contentY = content.y * meterUnit;
  67069. var distance = me._distance(contentX, contentY, geoFenceCX, geoFenceCY);
  67070. var radius = me.geoFence.radius;
  67071. if (distance > radius) {
  67072. me.outOfGeoFence && me.outOfGeoFence(data);
  67073. me.events.triggerEvent('outOfGeoFence', {
  67074. data: data
  67075. });
  67076. }
  67077. return source;
  67078. });
  67079. }
  67080. }, {
  67081. key: "_distance",
  67082. value: function _distance(x1, y1, x2, y2) {
  67083. return Math.sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
  67084. }
  67085. }, {
  67086. key: "_getMeterPerMapUnit",
  67087. value: function _getMeterPerMapUnit(mapUnit) {
  67088. var earchRadiusInMeters = 6378137;
  67089. var meterPerMapUnit;
  67090. if (mapUnit === 'meter') {
  67091. meterPerMapUnit = 1;
  67092. } else if (mapUnit === 'degree') {
  67093. // 每度表示多少米。
  67094. meterPerMapUnit = Math.PI * 2 * earchRadiusInMeters / 360;
  67095. }
  67096. return meterPerMapUnit;
  67097. }
  67098. }]);
  67099. return ElasticSearch;
  67100. }();
  67101. ;// CONCATENATED MODULE: ./src/common/thirdparty/elasticsearch/index.js
  67102. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  67103. * This program are made available under the terms of the Apache License, Version 2.0
  67104. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  67105. ;// CONCATENATED MODULE: ./src/common/thirdparty/index.js
  67106. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  67107. * This program are made available under the terms of the Apache License, Version 2.0
  67108. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  67109. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Util.js
  67110. function Util_typeof(obj) { "@babel/helpers - typeof"; return Util_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, Util_typeof(obj); }
  67111. function Util_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  67112. function Util_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  67113. function Util_createClass(Constructor, protoProps, staticProps) { if (protoProps) Util_defineProperties(Constructor.prototype, protoProps); if (staticProps) Util_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  67114. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  67115. * This program are made available under the terms of the Apache License, Version 2.0
  67116. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  67117. /**
  67118. * @private
  67119. * @class LevelRenderer.Tool.Util
  67120. * @category Visualization Theme
  67121. * LevelRenderer 基础工具类
  67122. *
  67123. */
  67124. var levelRenderer_Util_Util = /*#__PURE__*/function () {
  67125. function Util() {
  67126. Util_classCallCheck(this, Util);
  67127. /**
  67128. * @member {Object} LevelRenderer.Tool.Util.prototype.BUILTIN_OBJECT
  67129. * @description 用于处理merge时无法遍历Date等对象的问题
  67130. */
  67131. this.BUILTIN_OBJECT = {
  67132. '[object Function]': 1,
  67133. '[object RegExp]': 1,
  67134. '[object Date]': 1,
  67135. '[object Error]': 1,
  67136. '[object CanvasGradient]': 1
  67137. };
  67138. /**
  67139. * @member {Object} LevelRenderer.Tool.Util.prototype._ctx
  67140. */
  67141. this._ctx = null;
  67142. /**
  67143. * Property: _canvas
  67144. * {Object}
  67145. */
  67146. this._canvas = null;
  67147. /**
  67148. * Property: _pixelCtx
  67149. * {Object}
  67150. */
  67151. this._pixelCtx = null;
  67152. /**
  67153. * Property: _width
  67154. * {Object}
  67155. */
  67156. this._width = null;
  67157. /**
  67158. * Property: _height
  67159. * {Object}
  67160. */
  67161. this._height = null;
  67162. /**
  67163. * Property: _offsetX
  67164. * {Object}
  67165. */
  67166. this._offsetX = 0;
  67167. /**
  67168. * Property: _offsetY
  67169. * {Object}
  67170. */
  67171. this._offsetY = 0;
  67172. this.CLASS_NAME = "SuperMap.LevelRenderer.Tool.Util";
  67173. }
  67174. /**
  67175. * @function LevelRenderer.Tool.Util.prototype.clone
  67176. * @description 对一个object进行深度拷贝。
  67177. *
  67178. * @param {Object} source - 需要进行拷贝的对象。
  67179. * @return {Object} 拷贝后的新对象。
  67180. */
  67181. Util_createClass(Util, [{
  67182. key: "clone",
  67183. value: function clone(source) {
  67184. var BUILTIN_OBJECT = this.BUILTIN_OBJECT;
  67185. if (Util_typeof(source) == 'object' && source !== null) {
  67186. var result = source;
  67187. if (source instanceof Array) {
  67188. result = [];
  67189. for (var i = 0, len = source.length; i < len; i++) {
  67190. result[i] = this.clone(source[i]);
  67191. }
  67192. } else if (!BUILTIN_OBJECT[Object.prototype.toString.call(source)]) {
  67193. result = {};
  67194. for (var key in source) {
  67195. if (source.hasOwnProperty(key)) {
  67196. result[key] = this.clone(source[key]);
  67197. }
  67198. }
  67199. }
  67200. return result;
  67201. }
  67202. return source;
  67203. }
  67204. /**
  67205. * @function LevelRenderer.Tool.Util.prototype.mergeItem
  67206. * @description 合并源对象的单个属性到目标对象。
  67207. *
  67208. * @param {Object} target - 目标对象。
  67209. * @param {Object} source - 源对象。
  67210. * @param {string} key - 键。
  67211. * @param {boolean} overwrite - 是否覆盖。
  67212. * @return {Object} 目标对象
  67213. */
  67214. }, {
  67215. key: "mergeItem",
  67216. value: function mergeItem(target, source, key, overwrite) {
  67217. var BUILTIN_OBJECT = this.BUILTIN_OBJECT;
  67218. if (source.hasOwnProperty(key)) {
  67219. if (Util_typeof(target[key]) == 'object' && !BUILTIN_OBJECT[Object.prototype.toString.call(target[key])]) {
  67220. // 如果需要递归覆盖,就递归调用merge
  67221. this.merge(target[key], source[key], overwrite);
  67222. } else if (overwrite || !(key in target)) {
  67223. // 否则只处理overwrite为true,或者在目标对象中没有此属性的情况
  67224. target[key] = source[key];
  67225. }
  67226. }
  67227. }
  67228. /**
  67229. * @function LevelRenderer.Tool.Util.prototype.merge
  67230. * @description 合并源对象的属性到目标对象。
  67231. *
  67232. * @param {Object} target - 目标对象。
  67233. * @param {Object} source - 源对象。
  67234. * @param {boolean} overwrite - 是否覆盖。
  67235. * @return {Object} 目标对象。
  67236. */
  67237. }, {
  67238. key: "merge",
  67239. value: function merge(target, source, overwrite) {
  67240. for (var i in source) {
  67241. this.mergeItem(target, source, i, overwrite);
  67242. }
  67243. return target;
  67244. }
  67245. /**
  67246. * @function LevelRenderer.Tool.Util.prototype.getContext
  67247. * @description 获取 Canvas 上下文。
  67248. * @return {Object} 上下文。
  67249. */
  67250. }, {
  67251. key: "getContext",
  67252. value: function getContext() {
  67253. if (!this._ctx) {
  67254. this._ctx = document.createElement('canvas').getContext('2d');
  67255. }
  67256. return this._ctx;
  67257. }
  67258. /**
  67259. * @function LevelRenderer.Tool.Util.prototype.getPixelContext
  67260. * @description 获取像素拾取专用的上下文。
  67261. * @return {Object} 像素拾取专用的上下文。
  67262. */
  67263. }, {
  67264. key: "getPixelContext",
  67265. value: function getPixelContext() {
  67266. if (!this._pixelCtx) {
  67267. this._canvas = document.createElement('canvas');
  67268. this._width = this._canvas.width;
  67269. this._height = this._canvas.height;
  67270. this._pixelCtx = this._canvas.getContext('2d');
  67271. }
  67272. return this._pixelCtx;
  67273. }
  67274. /**
  67275. * @function LevelRenderer.Tool.Util.prototype.adjustCanvasSize
  67276. * @description 如果坐标处在_canvas外部,改变_canvas的大小,修改canvas的大小 需要重新设置translate
  67277. *
  67278. * @param {number} x - 横坐标。
  67279. * @param {number} y - 纵坐标。
  67280. *
  67281. */
  67282. }, {
  67283. key: "adjustCanvasSize",
  67284. value: function adjustCanvasSize(x, y) {
  67285. var _canvas = this._canvas;
  67286. var _pixelCtx = this._pixelCtx;
  67287. var _width = this._width;
  67288. var _height = this._height;
  67289. var _offsetX = this._offsetX;
  67290. var _offsetY = this._offsetY;
  67291. // 每次加的长度
  67292. var _v = 100;
  67293. var _flag;
  67294. if (x + _offsetX > _width) {
  67295. _width = x + _offsetX + _v;
  67296. _canvas.width = _width;
  67297. _flag = true;
  67298. }
  67299. if (y + _offsetY > _height) {
  67300. _height = y + _offsetY + _v;
  67301. _canvas.height = _height;
  67302. _flag = true;
  67303. }
  67304. if (x < -_offsetX) {
  67305. _offsetX = Math.ceil(-x / _v) * _v;
  67306. _width += _offsetX;
  67307. _canvas.width = _width;
  67308. _flag = true;
  67309. }
  67310. if (y < -_offsetY) {
  67311. _offsetY = Math.ceil(-y / _v) * _v;
  67312. _height += _offsetY;
  67313. _canvas.height = _height;
  67314. _flag = true;
  67315. }
  67316. if (_flag) {
  67317. _pixelCtx.translate(_offsetX, _offsetY);
  67318. }
  67319. }
  67320. /**
  67321. * @function LevelRenderer.Tool.Util.prototype.getPixelOffset
  67322. * @description 获取像素canvas的偏移量。
  67323. * @return {Object} 偏移量。
  67324. */
  67325. }, {
  67326. key: "getPixelOffset",
  67327. value: function getPixelOffset() {
  67328. return {
  67329. x: this._offsetX,
  67330. y: this._offsetY
  67331. };
  67332. }
  67333. /**
  67334. * @function LevelRenderer.Tool.Util.prototype.indexOf
  67335. * @description 查询数组中元素的index
  67336. * @return {Object} 偏移量。
  67337. */
  67338. }, {
  67339. key: "indexOf",
  67340. value: function indexOf(array, value) {
  67341. if (array.indexOf) {
  67342. return array.indexOf(value);
  67343. }
  67344. for (var i = 0, len = array.length; i < len; i++) {
  67345. if (array[i] === value) {
  67346. return i;
  67347. }
  67348. }
  67349. return -1;
  67350. }
  67351. /**
  67352. * @function LevelRenderer.Tool.Util.prototype.inherits
  67353. * @description 构造类继承关系
  67354. *
  67355. * @param {function} clazz - 源类。
  67356. * @param {function} baseClazz - 基类。
  67357. * @return {Object} 偏移量。
  67358. */
  67359. }, {
  67360. key: "inherits",
  67361. value: function inherits(clazz, baseClazz) {
  67362. var clazzPrototype = clazz.prototype;
  67363. function F() {}
  67364. F.prototype = baseClazz.prototype;
  67365. clazz.prototype = new F();
  67366. for (var prop in clazzPrototype) {
  67367. clazz.prototype[prop] = clazzPrototype[prop];
  67368. }
  67369. clazz.constructor = clazz;
  67370. }
  67371. }]);
  67372. return Util;
  67373. }();
  67374. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Color.js
  67375. function Color_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  67376. function Color_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  67377. function Color_createClass(Constructor, protoProps, staticProps) { if (protoProps) Color_defineProperties(Constructor.prototype, protoProps); if (staticProps) Color_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  67378. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  67379. * This program are made available under the terms of the Apache License, Version 2.0
  67380. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  67381. /**
  67382. * @class LevelRenderer.Tool.Color
  67383. * @category Visualization Theme
  67384. * @classdesc LevelRenderer 工具-颜色辅助类
  67385. * @private
  67386. */
  67387. var Color_Color = /*#__PURE__*/function () {
  67388. function Color() {
  67389. Color_classCallCheck(this, Color);
  67390. /**
  67391. * @member {LevelRenderer.Tool.Util} LevelRenderer.Tool.Color.prototype.util
  67392. * @description LevelRenderer 基础工具对象。
  67393. */
  67394. this.util = new levelRenderer_Util_Util();
  67395. /**
  67396. * @member {Object} LevelRenderer.Tool.Color.prototype._ctx
  67397. * @description _ctx。
  67398. */
  67399. this._ctx = null;
  67400. /**
  67401. * @member {Array.<string>} LevelRenderer.Tool.Color.prototype.palette
  67402. * @description 默认色板。色板是一个包含图表默认颜色系列的数组,当色板中所有颜色被使用过后,又将从新回到色板中的第一个颜色。
  67403. */
  67404. this.palette = ['#ff9277', ' #dddd00', ' #ffc877', ' #bbe3ff', ' #d5ffbb', '#bbbbff', ' #ddb000', ' #b0dd00', ' #e2bbff', ' #ffbbe3', '#ff7777', ' #ff9900', ' #83dd00', ' #77e3ff', ' #778fff', '#c877ff', ' #ff77ab', ' #ff6600', ' #aa8800', ' #77c7ff', '#ad77ff', ' #ff77ff', ' #dd0083', ' #777700', ' #00aa00', '#0088aa', ' #8400dd', ' #aa0088', ' #dd0000', ' #772e00'];
  67405. /**
  67406. * @member {Array.<string>} LevelRenderer.Tool.Color.prototype._palette
  67407. * @description 复位色板,用于复位 palette
  67408. */
  67409. this._palette = this.palette;
  67410. /**
  67411. * @member {string} LevelRenderer.Tool.Color.prototype.highlightColor
  67412. * @description 高亮色
  67413. */
  67414. this.highlightColor = 'rgba(0,0,255,1)';
  67415. /**
  67416. * @member {string} LevelRenderer.Tool.Color.prototype._highlightColor
  67417. * @description 复位高亮色
  67418. */
  67419. this._highlightColor = this.highlightColor;
  67420. /**
  67421. * @member {string} LevelRenderer.Tool.Color.prototype.colorRegExp
  67422. * @description 颜色格式,正则表达式。
  67423. */
  67424. this.colorRegExp = /^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+%?)?)\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\))\s*$/i;
  67425. /**
  67426. * @member {string} LevelRenderer.Tool.Color.prototype._nameColors
  67427. * @description 颜色名。
  67428. */
  67429. this._nameColors = {
  67430. aliceblue: '#f0f8ff',
  67431. antiquewhite: '#faebd7',
  67432. aqua: '#0ff',
  67433. aquamarine: '#7fffd4',
  67434. azure: '#f0ffff',
  67435. beige: '#f5f5dc',
  67436. bisque: '#ffe4c4',
  67437. black: '#000',
  67438. blanchedalmond: '#ffebcd',
  67439. blue: '#00f',
  67440. blueviolet: '#8a2be2',
  67441. brown: '#a52a2a',
  67442. burlywood: '#deb887',
  67443. cadetblue: '#5f9ea0',
  67444. chartreuse: '#7fff00',
  67445. chocolate: '#d2691e',
  67446. coral: '#ff7f50',
  67447. cornflowerblue: '#6495ed',
  67448. cornsilk: '#fff8dc',
  67449. crimson: '#dc143c',
  67450. cyan: '#0ff',
  67451. darkblue: '#00008b',
  67452. darkcyan: '#008b8b',
  67453. darkgoldenrod: '#b8860b',
  67454. darkgray: '#a9a9a9',
  67455. darkgrey: '#a9a9a9',
  67456. darkgreen: '#006400',
  67457. darkkhaki: '#bdb76b',
  67458. darkmagenta: '#8b008b',
  67459. darkolivegreen: '#556b2f',
  67460. darkorange: '#ff8c00',
  67461. darkorchid: '#9932cc',
  67462. darkred: '#8b0000',
  67463. darksalmon: '#e9967a',
  67464. darkseagreen: '#8fbc8f',
  67465. darkslateblue: '#483d8b',
  67466. darkslategray: '#2f4f4f',
  67467. darkslategrey: '#2f4f4f',
  67468. darkturquoise: '#00ced1',
  67469. darkviolet: '#9400d3',
  67470. deeppink: '#ff1493',
  67471. deepskyblue: '#00bfff',
  67472. dimgray: '#696969',
  67473. dimgrey: '#696969',
  67474. dodgerblue: '#1e90ff',
  67475. firebrick: '#b22222',
  67476. floralwhite: '#fffaf0',
  67477. forestgreen: '#228b22',
  67478. fuchsia: '#f0f',
  67479. gainsboro: '#dcdcdc',
  67480. ghostwhite: '#f8f8ff',
  67481. gold: '#ffd700',
  67482. goldenrod: '#daa520',
  67483. gray: '#808080',
  67484. grey: '#808080',
  67485. green: '#008000',
  67486. greenyellow: '#adff2f',
  67487. honeydew: '#f0fff0',
  67488. hotpink: '#ff69b4',
  67489. indianred: '#cd5c5c',
  67490. indigo: '#4b0082',
  67491. ivory: '#fffff0',
  67492. khaki: '#f0e68c',
  67493. lavender: '#e6e6fa',
  67494. lavenderblush: '#fff0f5',
  67495. lawngreen: '#7cfc00',
  67496. lemonchiffon: '#fffacd',
  67497. lightblue: '#add8e6',
  67498. lightcoral: '#f08080',
  67499. lightcyan: '#e0ffff',
  67500. lightgoldenrodyellow: '#fafad2',
  67501. lightgray: '#d3d3d3',
  67502. lightgrey: '#d3d3d3',
  67503. lightgreen: '#90ee90',
  67504. lightpink: '#ffb6c1',
  67505. lightsalmon: '#ffa07a',
  67506. lightseagreen: '#20b2aa',
  67507. lightskyblue: '#87cefa',
  67508. lightslategray: '#789',
  67509. lightslategrey: '#789',
  67510. lightsteelblue: '#b0c4de',
  67511. lightyellow: '#ffffe0',
  67512. lime: '#0f0',
  67513. limegreen: '#32cd32',
  67514. linen: '#faf0e6',
  67515. magenta: '#f0f',
  67516. maroon: '#800000',
  67517. mediumaquamarine: '#66cdaa',
  67518. mediumblue: '#0000cd',
  67519. mediumorchid: '#ba55d3',
  67520. mediumpurple: '#9370d8',
  67521. mediumseagreen: '#3cb371',
  67522. mediumslateblue: '#7b68ee',
  67523. mediumspringgreen: '#00fa9a',
  67524. mediumturquoise: '#48d1cc',
  67525. mediumvioletred: '#c71585',
  67526. midnightblue: '#191970',
  67527. mintcream: '#f5fffa',
  67528. mistyrose: '#ffe4e1',
  67529. moccasin: '#ffe4b5',
  67530. navajowhite: '#ffdead',
  67531. navy: '#000080',
  67532. oldlace: '#fdf5e6',
  67533. olive: '#808000',
  67534. olivedrab: '#6b8e23',
  67535. orange: '#ffa500',
  67536. orangered: '#ff4500',
  67537. orchid: '#da70d6',
  67538. palegoldenrod: '#eee8aa',
  67539. palegreen: '#98fb98',
  67540. paleturquoise: '#afeeee',
  67541. palevioletred: '#d87093',
  67542. papayawhip: '#ffefd5',
  67543. peachpuff: '#ffdab9',
  67544. peru: '#cd853f',
  67545. pink: '#ffc0cb',
  67546. plum: '#dda0dd',
  67547. powderblue: '#b0e0e6',
  67548. purple: '#800080',
  67549. red: '#f00',
  67550. rosybrown: '#bc8f8f',
  67551. royalblue: '#4169e1',
  67552. saddlebrown: '#8b4513',
  67553. salmon: '#fa8072',
  67554. sandybrown: '#f4a460',
  67555. seagreen: '#2e8b57',
  67556. seashell: '#fff5ee',
  67557. sienna: '#a0522d',
  67558. silver: '#c0c0c0',
  67559. skyblue: '#87ceeb',
  67560. slateblue: '#6a5acd',
  67561. slategray: '#708090',
  67562. slategrey: '#708090',
  67563. snow: '#fffafa',
  67564. springgreen: '#00ff7f',
  67565. steelblue: '#4682b4',
  67566. tan: '#d2b48c',
  67567. teal: '#008080',
  67568. thistle: '#d8bfd8',
  67569. tomato: '#ff6347',
  67570. turquoise: '#40e0d0',
  67571. violet: '#ee82ee',
  67572. wheat: '#f5deb3',
  67573. white: '#fff',
  67574. whitesmoke: '#f5f5f5',
  67575. yellow: '#ff0',
  67576. yellowgreen: '#9acd32'
  67577. };
  67578. this.CLASS_NAME = "SuperMap.LevelRenderer.Tool.Color";
  67579. }
  67580. /**
  67581. * @function LevelRenderer.Tool.Color.prototype.customPalette
  67582. * @description 自定义调色板。
  67583. * @param {Array.<string>} userPalete - 颜色板。
  67584. */
  67585. Color_createClass(Color, [{
  67586. key: "customPalette",
  67587. value: function customPalette(userPalete) {
  67588. this.palette = userPalete;
  67589. }
  67590. /**
  67591. * @function LevelRenderer.Tool.Color.prototype.resetPalette
  67592. * @description 复位默认色板。
  67593. */
  67594. }, {
  67595. key: "resetPalette",
  67596. value: function resetPalette() {
  67597. this.palette = this._palette;
  67598. }
  67599. /**
  67600. * @function LevelRenderer.Tool.Color.prototype.getColor
  67601. * @description 获取色板颜色。
  67602. * @param {number} idx - 色板位置。
  67603. * @param {Array.<string>} userPalete - 色板。
  67604. * @returns {string} 颜色值。
  67605. */
  67606. }, {
  67607. key: "getColor",
  67608. value: function getColor(idx, userPalete) {
  67609. idx = idx | 0;
  67610. userPalete = userPalete || this.palette;
  67611. return userPalete[idx % userPalete.length];
  67612. }
  67613. /**
  67614. * @function LevelRenderer.Tool.Color.prototype.customHighlight
  67615. * @description 自定义默认高亮颜色。
  67616. * @param {string} userHighlightColor - 自定义高亮色。
  67617. */
  67618. }, {
  67619. key: "customHighlight",
  67620. value: function customHighlight(userHighlightColor) {
  67621. this.highlightColor = userHighlightColor;
  67622. }
  67623. /**
  67624. * @function LevelRenderer.Tool.Color.prototype.resetHighlight
  67625. * @description 重置默认高亮颜色。将当前的高亮色作为默认高亮颜色
  67626. */
  67627. }, {
  67628. key: "resetHighlight",
  67629. value: function resetHighlight() {
  67630. this.highlightColor = this._highlightColor;
  67631. }
  67632. /**
  67633. * @function LevelRenderer.Tool.Color.prototype.getHighlightColor
  67634. * @description 获取默认高亮颜色
  67635. * @returns {string} 颜色值。
  67636. */
  67637. }, {
  67638. key: "getHighlightColor",
  67639. value: function getHighlightColor() {
  67640. return this.highlightColor;
  67641. }
  67642. /**
  67643. * @function LevelRenderer.Tool.Color.prototype.getRadialGradient
  67644. * @description 径向渐变。
  67645. * @param {number} x0 - 渐变起点横坐标。
  67646. * @param {number} y0 - 渐变起点纵坐标。
  67647. * @param {number} r0 - 半径
  67648. * @param {number} x1 - 渐变终点横坐标。
  67649. * @param {number} y1 - 渐变终点纵坐标。
  67650. * @param {number} r1 - 半径
  67651. * @param {Array} colorList - 颜色列表。
  67652. * @returns {CanvasGradient} Cavans 渐变颜色。
  67653. */
  67654. }, {
  67655. key: "getRadialGradient",
  67656. value: function getRadialGradient(x0, y0, r0, x1, y1, r1, colorList) {
  67657. var util = this.util;
  67658. if (!this._ctx) {
  67659. this._ctx = util.getContext();
  67660. }
  67661. var gradient = this._ctx.createRadialGradient(x0, y0, r0, x1, y1, r1);
  67662. for (var i = 0, l = colorList.length; i < l; i++) {
  67663. gradient.addColorStop(colorList[i][0], colorList[i][1]);
  67664. }
  67665. gradient.__nonRecursion = true;
  67666. return gradient;
  67667. }
  67668. /**
  67669. * @function LevelRenderer.Tool.Color.prototype.getLinearGradient
  67670. * @description 线性渐变。
  67671. * @param {number} x0 - 渐变起点横坐标。
  67672. * @param {number} y0 - 渐变起点纵坐标。
  67673. * @param {number} x1 - 渐变终点横坐标。
  67674. * @param {number} y1 - 渐变终点纵坐标。
  67675. * @param {Array} colorList - 颜色列表。
  67676. * @returns {CanvasGradient} Cavans 渐变颜色。
  67677. */
  67678. }, {
  67679. key: "getLinearGradient",
  67680. value: function getLinearGradient(x0, y0, x1, y1, colorList) {
  67681. var util = this.util;
  67682. if (!this._ctx) {
  67683. this._ctx = util.getContext();
  67684. }
  67685. var gradient = this._ctx.createLinearGradient(x0, y0, x1, y1);
  67686. for (var i = 0, l = colorList.length; i < l; i++) {
  67687. gradient.addColorStop(colorList[i][0], colorList[i][1]);
  67688. }
  67689. gradient.__nonRecursion = true;
  67690. return gradient;
  67691. }
  67692. /**
  67693. * @function LevelRenderer.Tool.Color.prototype.getStepColors
  67694. * @description 获取两种颜色之间渐变颜色数组。
  67695. * @param {Object} start - 起始颜色对象。
  67696. * @param {Object} end - 结束颜色对象。
  67697. * @param {number} step - 渐变级数。
  67698. * @returns {Array} 颜色数组。
  67699. */
  67700. }, {
  67701. key: "getStepColors",
  67702. value: function getStepColors(start, end, step) {
  67703. start = this.toRGBA(start);
  67704. end = this.toRGBA(end);
  67705. start = this.getData(start);
  67706. end = this.getData(end);
  67707. var colors = [];
  67708. var stepR = (end[0] - start[0]) / step;
  67709. var stepG = (end[1] - start[1]) / step;
  67710. var stepB = (end[2] - start[2]) / step;
  67711. var stepA = (end[3] - start[3]) / step;
  67712. // 生成颜色集合
  67713. // fix by linfeng 颜色堆积
  67714. for (var i = 0, r = start[0], g = start[1], b = start[2], a = start[3]; i < step; i++) {
  67715. colors[i] = this.toColor([this.adjust(Math.floor(r), [0, 255]), this.adjust(Math.floor(g), [0, 255]), this.adjust(Math.floor(b), [0, 255]), a.toFixed(4) - 0], 'rgba');
  67716. r += stepR;
  67717. g += stepG;
  67718. b += stepB;
  67719. a += stepA;
  67720. }
  67721. r = end[0];
  67722. g = end[1];
  67723. b = end[2];
  67724. a = end[3];
  67725. colors[i] = this.toColor([r, g, b, a], 'rgba');
  67726. return colors;
  67727. }
  67728. /**
  67729. * @function LevelRenderer.Tool.Color.prototype.getGradientColors
  67730. * @description 获取指定级数的渐变颜色数组。
  67731. * @param {Array.<string>} colors - 颜色数组。
  67732. * @param {number} [step=20] - 渐变级数。
  67733. * @returns {Array.<string>} 颜色数组。
  67734. */
  67735. }, {
  67736. key: "getGradientColors",
  67737. value: function getGradientColors(colors, step) {
  67738. var ret = [];
  67739. var len = colors.length;
  67740. if (step === undefined) {
  67741. step = 20;
  67742. }
  67743. if (len === 1) {
  67744. ret = this.getStepColors(colors[0], colors[0], step);
  67745. } else if (len > 1) {
  67746. for (var i = 0, n = len - 1; i < n; i++) {
  67747. var steps = this.getStepColors(colors[i], colors[i + 1], step);
  67748. if (i < n - 1) {
  67749. steps.pop();
  67750. }
  67751. ret = ret.concat(steps);
  67752. }
  67753. }
  67754. return ret;
  67755. }
  67756. /**
  67757. * @function LevelRenderer.Tool.Color.prototype.toColor
  67758. * @description 颜色值数组转为指定格式颜色。
  67759. * @param {Array} data - 颜色值数组。
  67760. * @param {string} format - 格式,默认'rgb'
  67761. * @returns {string} 颜色。
  67762. */
  67763. }, {
  67764. key: "toColor",
  67765. value: function toColor(data, format) {
  67766. format = format || 'rgb';
  67767. if (data && (data.length === 3 || data.length === 4)) {
  67768. data = this.map(data, function (c) {
  67769. return c > 1 ? Math.ceil(c) : c;
  67770. });
  67771. if (format.indexOf('hex') > -1) {
  67772. return '#' + ((1 << 24) + (data[0] << 16) + (data[1] << 8) + +data[2]).toString(16).slice(1);
  67773. } else if (format.indexOf('hs') > -1) {
  67774. var sx = this.map(data.slice(1, 3), function (c) {
  67775. return c + '%';
  67776. });
  67777. data[1] = sx[0];
  67778. data[2] = sx[1];
  67779. }
  67780. if (format.indexOf('a') > -1) {
  67781. if (data.length === 3) {
  67782. data.push(1);
  67783. }
  67784. data[3] = this.adjust(data[3], [0, 1]);
  67785. return format + '(' + data.slice(0, 4).join(',') + ')';
  67786. }
  67787. return format + '(' + data.slice(0, 3).join(',') + ')';
  67788. }
  67789. }
  67790. /**
  67791. * @function LevelRenderer.Tool.Color.prototype.toArray
  67792. * @description 颜色字符串转换为rgba数组。
  67793. * @param {string} color - 颜色。
  67794. * @returns {Array.<number>} 颜色值数组。
  67795. */
  67796. }, {
  67797. key: "toArray",
  67798. value: function toArray(color) {
  67799. color = this.trim(color);
  67800. if (color.indexOf('rgba') < 0) {
  67801. color = this.toRGBA(color);
  67802. }
  67803. var data = [];
  67804. var i = 0;
  67805. color.replace(/[\d.]+/g, function (n) {
  67806. if (i < 3) {
  67807. n = n | 0;
  67808. } else {
  67809. // Alpha
  67810. n = +n;
  67811. }
  67812. data[i++] = n;
  67813. });
  67814. return data;
  67815. }
  67816. /**
  67817. * @function LevelRenderer.Tool.Color.prototype.convert
  67818. * @description 颜色格式转化。
  67819. * @param {Array} data - 颜色值数组。
  67820. * @param {string} format - 格式,默认'rgb'
  67821. * @returns {string} 颜色。
  67822. */
  67823. }, {
  67824. key: "convert",
  67825. value: function convert(color, format) {
  67826. if (!this.isCalculableColor(color)) {
  67827. return color;
  67828. }
  67829. var data = this.getData(color);
  67830. var alpha = data[3];
  67831. if (typeof alpha === 'undefined') {
  67832. alpha = 1;
  67833. }
  67834. if (color.indexOf('hsb') > -1) {
  67835. data = this._HSV_2_RGB(data);
  67836. } else if (color.indexOf('hsl') > -1) {
  67837. data = this._HSL_2_RGB(data);
  67838. }
  67839. if (format.indexOf('hsb') > -1 || format.indexOf('hsv') > -1) {
  67840. data = this._RGB_2_HSB(data);
  67841. } else if (format.indexOf('hsl') > -1) {
  67842. data = this._RGB_2_HSL(data);
  67843. }
  67844. data[3] = alpha;
  67845. return this.toColor(data, format);
  67846. }
  67847. /**
  67848. * @function LevelRenderer.Tool.Color.prototype.toRGBA
  67849. * @description 转换为rgba格式的颜色。
  67850. * @param {string} color - 颜色。
  67851. * @returns {string} 颜色。
  67852. */
  67853. }, {
  67854. key: "toRGBA",
  67855. value: function toRGBA(color) {
  67856. return this.convert(color, 'rgba');
  67857. }
  67858. /**
  67859. * @function LevelRenderer.Tool.Color.prototype.toRGB
  67860. * @description 转换为rgb数字格式的颜色。
  67861. * @param {string} color - 颜色。
  67862. * @returns {string} 颜色。
  67863. */
  67864. }, {
  67865. key: "toRGB",
  67866. value: function toRGB(color) {
  67867. return this.convert(color, 'rgb');
  67868. }
  67869. /**
  67870. * @function LevelRenderer.Tool.Color.prototype.toHex
  67871. * @description 转换为16进制颜色。
  67872. * @param {string} color - 颜色。
  67873. * @returns {string} 16进制颜色,#rrggbb格式
  67874. */
  67875. }, {
  67876. key: "toHex",
  67877. value: function toHex(color) {
  67878. return this.convert(color, 'hex');
  67879. }
  67880. /**
  67881. * @function LevelRenderer.Tool.Color.prototype.toHSVA
  67882. * @description 转换为HSV颜色。
  67883. * @param {string} color - 颜色。
  67884. * @returns {string} HSVA颜色,hsva(h,s,v,a)
  67885. */
  67886. }, {
  67887. key: "toHSVA",
  67888. value: function toHSVA(color) {
  67889. return this.convert(color, 'hsva');
  67890. }
  67891. /**
  67892. * @function LevelRenderer.Tool.Color.prototype.toHSV
  67893. * @description 转换为HSV颜色。
  67894. * @param {string} color - 颜色。
  67895. * @returns {string} HSV颜色,hsv(h,s,v)
  67896. */
  67897. }, {
  67898. key: "toHSV",
  67899. value: function toHSV(color) {
  67900. return this.convert(color, 'hsv');
  67901. }
  67902. /**
  67903. * @function LevelRenderer.Tool.Color.prototype.toHSBA
  67904. * @description 转换为HSBA颜色。
  67905. * @param {string} color - 颜色。
  67906. * @returns {string} HSBA颜色,hsba(h,s,b,a)
  67907. */
  67908. }, {
  67909. key: "toHSBA",
  67910. value: function toHSBA(color) {
  67911. return this.convert(color, 'hsba');
  67912. }
  67913. /**
  67914. * @function LevelRenderer.Tool.Color.prototype.toHSB
  67915. * @description 转换为HSB颜色。
  67916. * @param {string} color - 颜色。
  67917. * @returns {string} HSB颜色,hsb(h,s,b)
  67918. */
  67919. }, {
  67920. key: "toHSB",
  67921. value: function toHSB(color) {
  67922. return this.convert(color, 'hsb');
  67923. }
  67924. /**
  67925. * @function LevelRenderer.Tool.Color.prototype.toHSLA
  67926. * @description 转换为HSLA颜色。
  67927. * @param {string} color - 颜色。
  67928. * @returns {string} HSLA颜色,hsla(h,s,l,a)
  67929. */
  67930. }, {
  67931. key: "toHSLA",
  67932. value: function toHSLA(color) {
  67933. return this.convert(color, 'hsla');
  67934. }
  67935. /**
  67936. * @function LevelRenderer.Tool.Color.prototype.toHSL
  67937. * @description 转换为HSL颜色。
  67938. * @param {string} color - 颜色。
  67939. * @returns {string} HSL颜色,hsl(h,s,l)
  67940. */
  67941. }, {
  67942. key: "toHSL",
  67943. value: function toHSL(color) {
  67944. return this.convert(color, 'hsl');
  67945. }
  67946. /**
  67947. * @function LevelRenderer.Tool.Color.prototype.toName
  67948. * @description 转换颜色名。
  67949. * @param {string} color - 颜色。
  67950. * @returns {string} 颜色名
  67951. */
  67952. }, {
  67953. key: "toName",
  67954. value: function toName(color) {
  67955. for (var key in this._nameColors) {
  67956. if (this.toHex(this._nameColors[key]) === this.toHex(color)) {
  67957. return key;
  67958. }
  67959. }
  67960. return null;
  67961. }
  67962. /**
  67963. * @function LevelRenderer.Tool.Color.prototype.trim
  67964. * @description 移除颜色中多余空格。
  67965. * @param {string} color - 颜色。
  67966. * @returns {string} 无空格颜色
  67967. */
  67968. }, {
  67969. key: "trim",
  67970. value: function trim(color) {
  67971. return String(color).replace(/\s+/g, '');
  67972. }
  67973. /**
  67974. * @function LevelRenderer.Tool.Color.prototype.normalize
  67975. * @description 颜色规范化。
  67976. * @param {string} color - 颜色。
  67977. * @returns {string} 规范化后的颜色
  67978. */
  67979. }, {
  67980. key: "normalize",
  67981. value: function normalize(color) {
  67982. // 颜色名
  67983. if (this._nameColors[color]) {
  67984. color = this._nameColors[color];
  67985. }
  67986. // 去掉空格
  67987. color = this.trim(color);
  67988. // hsv与hsb等价
  67989. color = color.replace(/hsv/i, 'hsb');
  67990. // rgb转为rrggbb
  67991. if (/^#[\da-f]{3}$/i.test(color)) {
  67992. color = parseInt(color.slice(1), 16);
  67993. var r = (color & 0xf00) << 8;
  67994. var g = (color & 0xf0) << 4;
  67995. var b = color & 0xf;
  67996. color = '#' + ((1 << 24) + (r << 4) + r + (g << 4) + g + (b << 4) + b).toString(16).slice(1);
  67997. }
  67998. // 或者使用以下正则替换,不过 chrome 下性能相对差点
  67999. // color = color.replace(/^#([\da-f])([\da-f])([\da-f])$/i, '#$1$1$2$2$3$3');
  68000. return color;
  68001. }
  68002. /**
  68003. * @function LevelRenderer.Tool.Color.prototype.lift
  68004. * @description 颜色加深或减淡,当level>0加深,当level<0减淡。
  68005. * @param {string} color - 颜色。
  68006. * @param {number} level - 升降程度,取值区间[-1,1]。
  68007. * @returns {string} 加深或减淡后颜色值
  68008. */
  68009. }, {
  68010. key: "lift",
  68011. value: function lift(color, level) {
  68012. if (!this.isCalculableColor(color)) {
  68013. return color;
  68014. }
  68015. var direct = level > 0 ? 1 : -1;
  68016. if (typeof level === 'undefined') {
  68017. level = 0;
  68018. }
  68019. level = Math.abs(level) > 1 ? 1 : Math.abs(level);
  68020. color = this.toRGB(color);
  68021. var data = this.getData(color);
  68022. for (var i = 0; i < 3; i++) {
  68023. if (direct === 1) {
  68024. data[i] = data[i] * (1 - level) | 0;
  68025. } else {
  68026. data[i] = (255 - data[i]) * level + data[i] | 0;
  68027. }
  68028. }
  68029. return 'rgb(' + data.join(',') + ')';
  68030. }
  68031. /**
  68032. * @function LevelRenderer.Tool.Color.prototype.reverse
  68033. * @description 颜色翻转。[255-r,255-g,255-b,1-a]
  68034. * @param {string} color - 颜色。
  68035. * @returns {string} 翻转颜色
  68036. */
  68037. }, {
  68038. key: "reverse",
  68039. value: function reverse(color) {
  68040. if (!this.isCalculableColor(color)) {
  68041. return color;
  68042. }
  68043. var data = this.getData(this.toRGBA(color));
  68044. data = this.map(data, function (c) {
  68045. return 255 - c;
  68046. });
  68047. return this.toColor(data, 'rgb');
  68048. }
  68049. /**
  68050. * @function LevelRenderer.Tool.Color.prototype.mix
  68051. * @description 简单两种颜色混合
  68052. * @param {string} color1 - 第一种颜色。
  68053. * @param {string} color2 - 第二种颜色。
  68054. * @param {number} weight - 混合权重[0-1]。
  68055. * @returns {string} 结果色。rgb(r,g,b)或rgba(r,g,b,a)
  68056. */
  68057. }, {
  68058. key: "mix",
  68059. value: function mix(color1, color2, weight) {
  68060. if (!this.isCalculableColor(color1) || !this.isCalculableColor(color2)) {
  68061. return color1;
  68062. }
  68063. if (typeof weight === 'undefined') {
  68064. weight = 0.5;
  68065. }
  68066. weight = 1 - this.adjust(weight, [0, 1]);
  68067. var w = weight * 2 - 1;
  68068. var data1 = this.getData(this.toRGBA(color1));
  68069. var data2 = this.getData(this.toRGBA(color2));
  68070. var d = data1[3] - data2[3];
  68071. var weight1 = ((w * d === -1 ? w : (w + d) / (1 + w * d)) + 1) / 2;
  68072. var weight2 = 1 - weight1;
  68073. var data = [];
  68074. for (var i = 0; i < 3; i++) {
  68075. data[i] = data1[i] * weight1 + data2[i] * weight2;
  68076. }
  68077. var alpha = data1[3] * weight + data2[3] * (1 - weight);
  68078. alpha = Math.max(0, Math.min(1, alpha));
  68079. if (data1[3] === 1 && data2[3] === 1) {
  68080. // 不考虑透明度
  68081. return this.toColor(data, 'rgb');
  68082. }
  68083. data[3] = alpha;
  68084. return this.toColor(data, 'rgba');
  68085. }
  68086. /**
  68087. * @function LevelRenderer.Tool.Color.prototype.random
  68088. * @description 随机颜色
  68089. * @returns {string} 颜色值,#rrggbb格式
  68090. */
  68091. }, {
  68092. key: "random",
  68093. value: function random() {
  68094. return '#' + Math.random().toString(16).slice(2, 8);
  68095. }
  68096. /**
  68097. * @function LevelRenderer.Tool.Color.prototype.getData
  68098. * @description 获取颜色值数组,返回值范围。
  68099. * RGB 范围[0-255]
  68100. * HSL/HSV/HSB 范围[0-1]
  68101. * A透明度范围[0-1]
  68102. * 支持格式:
  68103. * #rgb
  68104. * #rrggbb
  68105. * rgb(r,g,b)
  68106. * rgb(r%,g%,b%)
  68107. * rgba(r,g,b,a)
  68108. * hsb(h,s,b) // hsv与hsb等价
  68109. * hsb(h%,s%,b%)
  68110. * hsba(h,s,b,a)
  68111. * hsl(h,s,l)
  68112. * hsl(h%,s%,l%)
  68113. * hsla(h,s,l,a)
  68114. * @param {string} color - 颜色。
  68115. * @returns {Array.<number>} 颜色值数组或null
  68116. */
  68117. }, {
  68118. key: "getData",
  68119. value: function getData(color) {
  68120. color = this.normalize(color);
  68121. var r = color.match(this.colorRegExp);
  68122. if (r === null) {
  68123. throw new Error('The color format error'); // 颜色格式错误
  68124. }
  68125. var d;
  68126. var a;
  68127. var data = [];
  68128. var rgb;
  68129. if (r[2]) {
  68130. // #rrggbb
  68131. d = r[2].replace('#', '').split('');
  68132. rgb = [d[0] + d[1], d[2] + d[3], d[4] + d[5]];
  68133. data = this.map(rgb, function (c) {
  68134. return Color.prototype.adjust.call(this, parseInt(c, 16), [0, 255]);
  68135. });
  68136. } else if (r[4]) {
  68137. // rgb rgba
  68138. var rgba = r[4].split(',');
  68139. a = rgba[3];
  68140. rgb = rgba.slice(0, 3);
  68141. data = this.map(rgb, function (c) {
  68142. c = Math.floor(c.indexOf('%') > 0 ? parseInt(c, 0) * 2.55 : c);
  68143. return Color.prototype.adjust.call(this, c, [0, 255]);
  68144. });
  68145. if (typeof a !== 'undefined') {
  68146. data.push(this.adjust(parseFloat(a), [0, 1]));
  68147. }
  68148. } else if (r[5] || r[6]) {
  68149. // hsb hsba hsl hsla
  68150. var hsxa = (r[5] || r[6]).split(',');
  68151. var h = parseInt(hsxa[0], 0) / 360;
  68152. var s = hsxa[1];
  68153. var x = hsxa[2];
  68154. a = hsxa[3];
  68155. data = this.map([s, x], function (c) {
  68156. return Color.prototype.adjust.call(this, parseFloat(c) / 100, [0, 1]);
  68157. });
  68158. data.unshift(h);
  68159. if (typeof a !== 'undefined') {
  68160. data.push(this.adjust(parseFloat(a), [0, 1]));
  68161. }
  68162. }
  68163. return data;
  68164. }
  68165. /**
  68166. * @function LevelRenderer.Tool.Color.prototype.alpha
  68167. * @description 设置颜色透明度
  68168. * @param {string} color - 颜色。
  68169. * @param {number} a - 透明度,区间[0,1]。
  68170. * @returns {string} rgba颜色值
  68171. */
  68172. }, {
  68173. key: "alpha",
  68174. value: function alpha(color, a) {
  68175. if (!this.isCalculableColor(color)) {
  68176. return color;
  68177. }
  68178. if (a === null) {
  68179. a = 1;
  68180. }
  68181. var data = this.getData(this.toRGBA(color));
  68182. data[3] = this.adjust(Number(a).toFixed(4), [0, 1]);
  68183. return this.toColor(data, 'rgba');
  68184. }
  68185. /**
  68186. * @function LevelRenderer.Tool.Color.prototype.map
  68187. * @description 数组映射
  68188. * @param {Array} array - 数组。
  68189. * @param {function} fun - 函数。
  68190. * @returns {string} 数组映射结果
  68191. */
  68192. }, {
  68193. key: "map",
  68194. value: function map(array, fun) {
  68195. if (typeof fun !== 'function') {
  68196. throw new TypeError();
  68197. }
  68198. var len = array ? array.length : 0;
  68199. for (var i = 0; i < len; i++) {
  68200. array[i] = fun(array[i]);
  68201. }
  68202. return array;
  68203. }
  68204. /**
  68205. * @function LevelRenderer.Tool.Color.prototype.adjust
  68206. * @description 调整值区间
  68207. * @param {Array.<number>} value - 数组。
  68208. * @param {Array.<number>} region - 区间。
  68209. * @returns {number} 调整后的值
  68210. */
  68211. }, {
  68212. key: "adjust",
  68213. value: function adjust(value, region) {
  68214. // < to <= & > to >=
  68215. // modify by linzhifeng 2014-05-25 because -0 == 0
  68216. if (value <= region[0]) {
  68217. value = region[0];
  68218. } else if (value >= region[1]) {
  68219. value = region[1];
  68220. }
  68221. return value;
  68222. }
  68223. /**
  68224. * @function LevelRenderer.Tool.Color.prototype.isCalculableColor
  68225. * @description 判断是否是可计算的颜色
  68226. * @param {string} color - 颜色。
  68227. * @returns {boolean} 是否是可计算的颜色
  68228. */
  68229. }, {
  68230. key: "isCalculableColor",
  68231. value: function isCalculableColor(color) {
  68232. return color instanceof Array || typeof color === 'string';
  68233. }
  68234. /**
  68235. * @function LevelRenderer.Tool.Color.prototype._HSV_2_RGB。参见{@link http://www.easyrgb.com/index.php?X=MATH}
  68236. */
  68237. }, {
  68238. key: "_HSV_2_RGB",
  68239. value: function _HSV_2_RGB(data) {
  68240. var H = data[0];
  68241. var S = data[1];
  68242. var V = data[2];
  68243. // HSV from 0 to 1
  68244. var R;
  68245. var G;
  68246. var B;
  68247. if (S === 0) {
  68248. R = V * 255;
  68249. G = V * 255;
  68250. B = V * 255;
  68251. } else {
  68252. var h = H * 6;
  68253. if (h === 6) {
  68254. h = 0;
  68255. }
  68256. var i = h | 0;
  68257. var v1 = V * (1 - S);
  68258. var v2 = V * (1 - S * (h - i));
  68259. var v3 = V * (1 - S * (1 - (h - i)));
  68260. var r = 0;
  68261. var g = 0;
  68262. var b = 0;
  68263. if (i === 0) {
  68264. r = V;
  68265. g = v3;
  68266. b = v1;
  68267. } else if (i === 1) {
  68268. r = v2;
  68269. g = V;
  68270. b = v1;
  68271. } else if (i === 2) {
  68272. r = v1;
  68273. g = V;
  68274. b = v3;
  68275. } else if (i === 3) {
  68276. r = v1;
  68277. g = v2;
  68278. b = V;
  68279. } else if (i === 4) {
  68280. r = v3;
  68281. g = v1;
  68282. b = V;
  68283. } else {
  68284. r = V;
  68285. g = v1;
  68286. b = v2;
  68287. }
  68288. // RGB results from 0 to 255
  68289. R = r * 255;
  68290. G = g * 255;
  68291. B = b * 255;
  68292. }
  68293. return [R, G, B];
  68294. }
  68295. /**
  68296. * @function LevelRenderer.Tool.Color.prototype._HSL_2_RGB。参见{@link http://www.easyrgb.com/index.php?X=MATH}
  68297. */
  68298. }, {
  68299. key: "_HSL_2_RGB",
  68300. value: function _HSL_2_RGB(data) {
  68301. var H = data[0];
  68302. var S = data[1];
  68303. var L = data[2];
  68304. // HSL from 0 to 1
  68305. var R;
  68306. var G;
  68307. var B;
  68308. if (S === 0) {
  68309. R = L * 255;
  68310. G = L * 255;
  68311. B = L * 255;
  68312. } else {
  68313. var v2;
  68314. if (L < 0.5) {
  68315. v2 = L * (1 + S);
  68316. } else {
  68317. v2 = L + S - S * L;
  68318. }
  68319. var v1 = 2 * L - v2;
  68320. R = 255 * this._HUE_2_RGB(v1, v2, H + 1 / 3);
  68321. G = 255 * this._HUE_2_RGB(v1, v2, H);
  68322. B = 255 * this._HUE_2_RGB(v1, v2, H - 1 / 3);
  68323. }
  68324. return [R, G, B];
  68325. }
  68326. /**
  68327. * @function LevelRenderer.Tool.Color.prototype._HUE_2_RGB。参见{@link http://www.easyrgb.com/index.php?X=MATH}
  68328. */
  68329. }, {
  68330. key: "_HUE_2_RGB",
  68331. value: function _HUE_2_RGB(v1, v2, vH) {
  68332. if (vH < 0) {
  68333. vH += 1;
  68334. }
  68335. if (vH > 1) {
  68336. vH -= 1;
  68337. }
  68338. if (6 * vH < 1) {
  68339. return v1 + (v2 - v1) * 6 * vH;
  68340. }
  68341. if (2 * vH < 1) {
  68342. return v2;
  68343. }
  68344. if (3 * vH < 2) {
  68345. return v1 + (v2 - v1) * (2 / 3 - vH) * 6;
  68346. }
  68347. return v1;
  68348. }
  68349. /**
  68350. * @function LevelRenderer.Tool.Color.prototype._RGB_2_HSB。参见{@link http://www.easyrgb.com/index.php?X=MATH}
  68351. */
  68352. }, {
  68353. key: "_RGB_2_HSB",
  68354. value: function _RGB_2_HSB(data) {
  68355. // RGB from 0 to 255
  68356. var R = data[0] / 255;
  68357. var G = data[1] / 255;
  68358. var B = data[2] / 255;
  68359. var vMin = Math.min(R, G, B); // Min. value of RGB
  68360. var vMax = Math.max(R, G, B); // Max. value of RGB
  68361. var delta = vMax - vMin; // Delta RGB value
  68362. var V = vMax;
  68363. var H;
  68364. var S;
  68365. // HSV results from 0 to 1
  68366. if (delta === 0) {
  68367. H = 0;
  68368. S = 0;
  68369. } else {
  68370. S = delta / vMax;
  68371. var deltaR = ((vMax - R) / 6 + delta / 2) / delta;
  68372. var deltaG = ((vMax - G) / 6 + delta / 2) / delta;
  68373. var deltaB = ((vMax - B) / 6 + delta / 2) / delta;
  68374. if (R === vMax) {
  68375. H = deltaB - deltaG;
  68376. } else if (G === vMax) {
  68377. H = 1 / 3 + deltaR - deltaB;
  68378. } else if (B === vMax) {
  68379. H = 2 / 3 + deltaG - deltaR;
  68380. }
  68381. if (H < 0) {
  68382. H += 1;
  68383. }
  68384. if (H > 1) {
  68385. H -= 1;
  68386. }
  68387. }
  68388. H = H * 360;
  68389. S = S * 100;
  68390. V = V * 100;
  68391. return [H, S, V];
  68392. }
  68393. /**
  68394. * @function LevelRenderer.Tool.Color.prototype._RGB_2_HSL。参见{@link http://www.easyrgb.com/index.php?X=MATH}
  68395. */
  68396. }, {
  68397. key: "_RGB_2_HSL",
  68398. value: function _RGB_2_HSL(data) {
  68399. // RGB from 0 to 255
  68400. var R = data[0] / 255;
  68401. var G = data[1] / 255;
  68402. var B = data[2] / 255;
  68403. var vMin = Math.min(R, G, B); // Min. value of RGB
  68404. var vMax = Math.max(R, G, B); // Max. value of RGB
  68405. var delta = vMax - vMin; // Delta RGB value
  68406. var L = (vMax + vMin) / 2;
  68407. var H;
  68408. var S;
  68409. // HSL results from 0 to 1
  68410. if (delta === 0) {
  68411. H = 0;
  68412. S = 0;
  68413. } else {
  68414. if (L < 0.5) {
  68415. S = delta / (vMax + vMin);
  68416. } else {
  68417. S = delta / (2 - vMax - vMin);
  68418. }
  68419. var deltaR = ((vMax - R) / 6 + delta / 2) / delta;
  68420. var deltaG = ((vMax - G) / 6 + delta / 2) / delta;
  68421. var deltaB = ((vMax - B) / 6 + delta / 2) / delta;
  68422. if (R === vMax) {
  68423. H = deltaB - deltaG;
  68424. } else if (G === vMax) {
  68425. H = 1 / 3 + deltaR - deltaB;
  68426. } else if (B === vMax) {
  68427. H = 2 / 3 + deltaG - deltaR;
  68428. }
  68429. if (H < 0) {
  68430. H += 1;
  68431. }
  68432. if (H > 1) {
  68433. H -= 1;
  68434. }
  68435. }
  68436. H = H * 360;
  68437. S = S * 100;
  68438. L = L * 100;
  68439. return [H, S, L];
  68440. }
  68441. }]);
  68442. return Color;
  68443. }();
  68444. ;// CONCATENATED MODULE: ./src/common/util/ColorsPickerUtil.js
  68445. function ColorsPickerUtil_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  68446. function ColorsPickerUtil_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  68447. function ColorsPickerUtil_createClass(Constructor, protoProps, staticProps) { if (protoProps) ColorsPickerUtil_defineProperties(Constructor.prototype, protoProps); if (staticProps) ColorsPickerUtil_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  68448. var ColorRender = new Color_Color();
  68449. // let "http://www.qzu.zj.cn": "#bd10e0"
  68450. // "www.qzct.net": "#7ed321" = new LevelRenderer.Tool.Color();
  68451. /**
  68452. * @name ColorsPickerUtil
  68453. * @namespace
  68454. * @category BaseTypes Util
  68455. * @classdesc 色带选择器工具类。用于1、创建canvas对象,2、从几种颜色中获取一定数量的渐变色。
  68456. * @usage
  68457. * ```
  68458. * // 浏览器
  68459. * <script type="text/javascript" src="{cdn}"></script>
  68460. * <script>
  68461. * const result = {namespace}.ColorsPickerUtil.createCanvas();
  68462. *
  68463. * // 弃用的写法
  68464. * const result = SuperMap.ColorsPickerUtil.createCanvas();
  68465. *
  68466. * </script>
  68467. *
  68468. * // ES6 Import
  68469. * import { ColorsPickerUtil } from '{npm}';
  68470. *
  68471. * const result = ColorsPickerUtil.createCanvas();
  68472. * ```
  68473. */
  68474. var ColorsPickerUtil = /*#__PURE__*/function () {
  68475. function ColorsPickerUtil() {
  68476. ColorsPickerUtil_classCallCheck(this, ColorsPickerUtil);
  68477. }
  68478. ColorsPickerUtil_createClass(ColorsPickerUtil, null, [{
  68479. key: "createCanvas",
  68480. value:
  68481. /**
  68482. * @function ColorsPickerUtil.createCanvas
  68483. * @description 创建DOM canvas。
  68484. * @param {number} height - canvas 高度。
  68485. * @param {number} width - canvas 宽度。
  68486. */
  68487. function createCanvas(height, width) {
  68488. var canvas = document.createElement("canvas");
  68489. canvas.height = height;
  68490. canvas.width = width;
  68491. return canvas.getContext("2d");
  68492. }
  68493. /**
  68494. * @function ColorsPickerUtil.getLinearGradient
  68495. * @description 线性渐变。
  68496. * @param {number} x0 - 渐变起点 x 坐标。
  68497. * @param {number} y0 - 渐变起点 y 坐标。
  68498. * @param {number} x1 - 渐变终点 x 坐标。
  68499. * @param {number} y1 - 渐变终点 y 坐标。
  68500. * @param {Array} colorList 颜色列表。
  68501. * @returns {CanvasGradient} Cavans 渐变颜色。
  68502. */
  68503. }, {
  68504. key: "getLinearGradient",
  68505. value: function getLinearGradient(x0, y0, x1, y1, colorList) {
  68506. if (!this._ctx) {
  68507. this._ctx = this.getContext();
  68508. }
  68509. var gradient = this._ctx.createLinearGradient(x0, y0, x1, y1);
  68510. var leng = colorList.length;
  68511. var add = 1 / (leng - 1);
  68512. var offset = 0;
  68513. for (var i = 0; i < leng; i++) {
  68514. gradient.addColorStop(offset, colorList[i]);
  68515. offset += add;
  68516. }
  68517. gradient.__nonRecursion = true;
  68518. return gradient;
  68519. }
  68520. /**
  68521. * @function ColorsPickerUtil.getContext
  68522. * @description 获取 Cavans 上下文。
  68523. * @returns {Object} Cavans 上下文。
  68524. */
  68525. }, {
  68526. key: "getContext",
  68527. value: function getContext() {
  68528. if (!this._ctx) {
  68529. this._ctx = document.createElement('canvas').getContext('2d');
  68530. }
  68531. return this._ctx;
  68532. }
  68533. /**
  68534. * @function ColorsPickerUtil.getStepColors
  68535. * @description 获取两种颜色之间渐变颜色数组。
  68536. * @param {string} start - 起始颜色。
  68537. * @param {string} end - 结束颜色。
  68538. * @param {number} step - 渐变级数。
  68539. * @returns {Array} 颜色数组。
  68540. */
  68541. }, {
  68542. key: "getStepColors",
  68543. value: function getStepColors(start, end, step) {
  68544. start = ColorRender.toRGBA(start);
  68545. end = ColorRender.toRGBA(end);
  68546. start = ColorRender.getData(start);
  68547. end = ColorRender.getData(end);
  68548. var colors = [];
  68549. var stepR = (end[0] - start[0]) / step;
  68550. var stepG = (end[1] - start[1]) / step;
  68551. var stepB = (end[2] - start[2]) / step;
  68552. var stepA = (end[3] - start[3]) / step;
  68553. // 生成颜色集合
  68554. // fix by linfeng 颜色堆积
  68555. for (var i = 0, r = start[0], g = start[1], b = start[2], a = start[3]; i < step; i++) {
  68556. colors[i] = ColorRender.toColor([ColorRender.adjust(Math.floor(r), [0, 255]), ColorRender.adjust(Math.floor(g), [0, 255]), ColorRender.adjust(Math.floor(b), [0, 255]), a.toFixed(4) - 0], 'hex');
  68557. r += stepR;
  68558. g += stepG;
  68559. b += stepB;
  68560. a += stepA;
  68561. }
  68562. r = end[0];
  68563. g = end[1];
  68564. b = end[2];
  68565. a = end[3];
  68566. colors[i] = ColorRender.toColor([r, g, b, a], 'hex');
  68567. return colors;
  68568. }
  68569. /**
  68570. * @function ColorsPickerUtil.getGradientColors
  68571. * @description 获取指定级数的渐变颜色数组。
  68572. * @param {Array.<string>} colors - 颜色组。
  68573. * @param {number} total - 颜色总数。
  68574. * @param {string} themeType - 专题类型。
  68575. * @returns {Array.<string>} 颜色数组。
  68576. */
  68577. }, {
  68578. key: "getGradientColors",
  68579. value: function getGradientColors(colors, total, themeType) {
  68580. var ret = [],
  68581. step;
  68582. var i,
  68583. n,
  68584. len = colors.length;
  68585. if (total === undefined) {
  68586. return;
  68587. }
  68588. if (len >= total) {
  68589. if (themeType === 'RANGE') {
  68590. for (i = 0; i < total; i++) {
  68591. ret.push(colors[i]);
  68592. }
  68593. } else {
  68594. //1/2前后取色
  68595. for (i = 0; i < total; i++) {
  68596. var ii = Math.floor(i / 2);
  68597. if (i % 2 === 0) {
  68598. ret.push(colors[ii]);
  68599. } else {
  68600. var _index = colors.length - 1 - ii;
  68601. ret.push(colors[_index]);
  68602. }
  68603. }
  68604. }
  68605. } else {
  68606. step = Math.ceil(total / (len - 1));
  68607. for (i = 0, n = len - 1; i < n; i++) {
  68608. var steps = this.getStepColors(colors[i], colors[i + 1], step);
  68609. if (i < n - 1) {
  68610. steps.pop();
  68611. }
  68612. ret = ret.concat(steps);
  68613. }
  68614. //删除多余元素
  68615. var nouse = ret.length - total;
  68616. for (var j = 0, index = 0; j < nouse; j++) {
  68617. ret.splice(index + 2, 1);
  68618. }
  68619. }
  68620. return ret;
  68621. }
  68622. }]);
  68623. return ColorsPickerUtil;
  68624. }();
  68625. ;// CONCATENATED MODULE: ./src/common/util/ArrayStatistic.js
  68626. function ArrayStatistic_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  68627. function ArrayStatistic_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  68628. function ArrayStatistic_createClass(Constructor, protoProps, staticProps) { if (protoProps) ArrayStatistic_defineProperties(Constructor.prototype, protoProps); if (staticProps) ArrayStatistic_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  68629. /**
  68630. * @name ArrayStatistic
  68631. * @namespace
  68632. * @category BaseTypes Util
  68633. * @classdesc 处理数组。
  68634. * @usage
  68635. * ```
  68636. * // 浏览器
  68637. * <script type="text/javascript" src="{cdn}"></script>
  68638. * <script>
  68639. * const result = {namespace}.ArrayStatistic.newInstance();
  68640. *
  68641. * // 弃用的写法
  68642. * const result = SuperMap.ArrayStatistic.newInstance();
  68643. *
  68644. * </script>
  68645. *
  68646. * // ES6 Import
  68647. * import { ArrayStatistic } from '{npm}';
  68648. *
  68649. * const result = ArrayStatistic.newInstance();
  68650. * ```
  68651. */
  68652. var ArrayStatistic = /*#__PURE__*/function () {
  68653. function ArrayStatistic() {
  68654. ArrayStatistic_classCallCheck(this, ArrayStatistic);
  68655. }
  68656. ArrayStatistic_createClass(ArrayStatistic, null, [{
  68657. key: "newInstance",
  68658. value:
  68659. // geostatsInstance: null,
  68660. /**
  68661. * @function ArrayStatistic.newInstance
  68662. * @description 初始化插件实例。
  68663. */
  68664. function newInstance() {
  68665. // if(!this.geostatsInstance) {
  68666. // // this.geostatsInstance = new geostats();
  68667. // // }
  68668. // window.dataList = [];
  68669. if (!this.geostatsInstance) {
  68670. this.geostatsInstance = new window.geostats();
  68671. }
  68672. return this.geostatsInstance;
  68673. }
  68674. /**
  68675. * @function ArrayStatistic.getInstance
  68676. * @description 设置需要被处理的数组。
  68677. * @param {Array} array - 数组。
  68678. */
  68679. }, {
  68680. key: "getInstance",
  68681. value: function getInstance(array) {
  68682. var instance = this.newInstance();
  68683. instance.setSerie(array);
  68684. return instance;
  68685. }
  68686. /**
  68687. * @function ArrayStatistic.getArrayStatistic
  68688. * @description 获取数组统计的值。
  68689. * @param {Array.<number>} array - 需要统计的数组。
  68690. * @param {string} type - 统计方法。
  68691. */
  68692. }, {
  68693. key: "getArrayStatistic",
  68694. value: function getArrayStatistic(array, type) {
  68695. if (!array.length) {
  68696. return 0;
  68697. }
  68698. if (type === "Sum" || type === "求和") {
  68699. return this.getSum(array);
  68700. } else if (type === "Maximum" || type === "最大值") {
  68701. return this.getMax(array);
  68702. } else if (type === "Minimum" || type === "最小值") {
  68703. return this.getMin(array);
  68704. } else if (type === "Average" || type === "平均值") {
  68705. return this.getMean(array);
  68706. } else if (type === "Median" || type === "中位数") {
  68707. return this.getMedian(array);
  68708. } else if (type === "times" || type === "计数") {
  68709. return this.getTimes(array);
  68710. }
  68711. }
  68712. /**
  68713. * @function ArrayStatistic.getArraySegments
  68714. * @description 获取数组分段后的数值。
  68715. * @param {Array.<number>} array - 需要分段的数组。
  68716. * @param {string} type - 分段方法。
  68717. * @param {number} segNum - 分段个数。
  68718. */
  68719. }, {
  68720. key: "getArraySegments",
  68721. value: function getArraySegments(array, type, segNum) {
  68722. if (type === "offset") {
  68723. return this.getEqInterval(array, segNum);
  68724. } else if (type === "jenks") {
  68725. return this.getJenks(array, segNum);
  68726. } else if (type === "square") {
  68727. // 数据都必须 >= 0
  68728. var minValue = this.getMin(array);
  68729. if (minValue >= 0) {
  68730. return this.getSqrtInterval(array, segNum);
  68731. } else {
  68732. //console.log('数据都必须 >= 0');
  68733. // Util.showMessage(Language.hasNegValue + Language.noSupportRange, 'ERROR');
  68734. return false;
  68735. }
  68736. } else if (type === "logarithm") {
  68737. // 数据都必须 > 0
  68738. var _minValue = this.getMin(array);
  68739. if (_minValue > 0) {
  68740. return this.getGeometricProgression(array, segNum);
  68741. } else {
  68742. //console.log('数据都必须 > 0');
  68743. // Util.showMessage(Language.hasZeroNegValue + Language.noSupportRange, 'ERROR');
  68744. return false;
  68745. }
  68746. }
  68747. }
  68748. /**
  68749. * @function ArrayStatistic.getSum
  68750. * @description 求和。
  68751. * @param {Array.<number>} array 需要求和的参数。
  68752. * @returns {number} 返回求和结果。
  68753. */
  68754. }, {
  68755. key: "getSum",
  68756. value: function getSum(array) {
  68757. return this.getInstance(array).sum();
  68758. }
  68759. /**
  68760. * @function ArrayStatistic.getMax
  68761. * @description 最大值。
  68762. * @param {Array.<number>} array 需要求最大值的参数。
  68763. * @returns {number} 返回最大值。
  68764. */
  68765. }, {
  68766. key: "getMax",
  68767. value: function getMax(array) {
  68768. return this.getInstance(array).max();
  68769. }
  68770. /**
  68771. * @function ArrayStatistic.getMin
  68772. * @description 最小值。
  68773. * @param {Array.<number>} array 需要求最小值的参数。
  68774. * @returns {number} 返回最小值。
  68775. */
  68776. }, {
  68777. key: "getMin",
  68778. value: function getMin(array) {
  68779. return this.getInstance(array).min();
  68780. }
  68781. /**
  68782. * @function ArrayStatistic.getMean
  68783. * @description 求平均数。
  68784. * @param {Array.<number>} array 需要求平均数的参数。
  68785. * @returns {number} 返回平均数。
  68786. */
  68787. }, {
  68788. key: "getMean",
  68789. value: function getMean(array) {
  68790. return this.getInstance(array).mean();
  68791. }
  68792. /**
  68793. * @function ArrayStatistic.getMedian
  68794. * @description 求中位数。
  68795. * @param {Array.<number>} array 需要求中位数的参数。
  68796. * @returns {number} 返回中位数。
  68797. */
  68798. }, {
  68799. key: "getMedian",
  68800. value: function getMedian(array) {
  68801. return this.getInstance(array).median();
  68802. }
  68803. /**
  68804. * @function ArrayStatistic.getTimes
  68805. * @description 计数。
  68806. * @param {Array.<number>} array 需要计数的参数。
  68807. * @returns {number} 返回计数结果。
  68808. */
  68809. }, {
  68810. key: "getTimes",
  68811. value: function getTimes(array) {
  68812. return array.length;
  68813. }
  68814. /**
  68815. * @function ArrayStatistic.getEqInterval
  68816. * @description 等距分段法。
  68817. * @param {Array} array 需要进行等距分段的数组。
  68818. * @param {number} segNum 分段个数。
  68819. */
  68820. }, {
  68821. key: "getEqInterval",
  68822. value: function getEqInterval(array, segNum) {
  68823. return this.getInstance(array).getClassEqInterval(segNum);
  68824. }
  68825. /**
  68826. * @function ArrayStatistic.getJenks
  68827. * @description 自然断裂法。
  68828. * @param {Array} array 需要进行自然断裂的参数。
  68829. * @param {number} segNum 分段个数。
  68830. */
  68831. }, {
  68832. key: "getJenks",
  68833. value: function getJenks(array, segNum) {
  68834. return this.getInstance(array).getClassJenks(segNum);
  68835. }
  68836. /**
  68837. * @function ArrayStatistic.getSqrtInterval
  68838. * @description 平方根分段法。
  68839. * @param {Array} array 需要进行平方根分段的参数。
  68840. * @param {number} segNum 分段个数。
  68841. */
  68842. }, {
  68843. key: "getSqrtInterval",
  68844. value: function getSqrtInterval(array, segNum) {
  68845. array = array.map(function (value) {
  68846. return Math.sqrt(value);
  68847. });
  68848. var breaks = this.getInstance(array).getClassEqInterval(segNum);
  68849. return breaks.map(function (value) {
  68850. return value * value;
  68851. });
  68852. }
  68853. /**
  68854. * @function ArrayStatistic.getGeometricProgression
  68855. * @description 对数分段法。
  68856. * @param {Array} array 需要进行对数分段的参数。
  68857. * @param {number} segNum 分段个数。
  68858. */
  68859. }, {
  68860. key: "getGeometricProgression",
  68861. value: function getGeometricProgression(array, segNum) {
  68862. return this.getInstance(array).getClassGeometricProgression(segNum);
  68863. }
  68864. }]);
  68865. return ArrayStatistic;
  68866. }();
  68867. ;// CONCATENATED MODULE: ./src/common/util/index.js
  68868. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  68869. * This program are made available under the terms of the Apache License, Version 2.0
  68870. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  68871. function toSuperMapGeometry(geoJSON) {
  68872. if (geoJSON && geoJSON.type) {
  68873. var format = new GeoJSONFormat();
  68874. var result = format.read(geoJSON, "FeatureCollection");
  68875. return result[0].geometry;
  68876. }
  68877. }
  68878. function toSuperMapPolygon(lnglatBounds) {
  68879. var west = lnglatBounds.getWest();
  68880. var east = lnglatBounds.getEast();
  68881. var sourth = lnglatBounds.getSouth();
  68882. var north = lnglatBounds.getNorth();
  68883. return new Polygon([new LinearRing([new GeometryPoint(west, sourth), new GeometryPoint(east, sourth), new GeometryPoint(east, north), new GeometryPoint(west, north)])]);
  68884. }
  68885. /**
  68886. * @function Util.extend
  68887. * @description 对象拷贝赋值。
  68888. * @param {Object} dest - 目标对象。
  68889. * @param {Object} arguments - 待拷贝的对象。
  68890. * @returns {Object} 赋值后的目标对象。
  68891. */
  68892. function extend(dest) {
  68893. for (var index = 0; index < Object.getOwnPropertyNames(arguments).length; index++) {
  68894. var arg = Object.getOwnPropertyNames(arguments)[index];
  68895. if (arg == "caller" || arg == "callee" || arg == "length" || arg == "arguments") {
  68896. continue;
  68897. }
  68898. var obj = arguments[arg];
  68899. if (obj) {
  68900. for (var j = 0; j < Object.getOwnPropertyNames(obj).length; j++) {
  68901. var key = Object.getOwnPropertyNames(obj)[j];
  68902. if (arg == "caller" || arg == "callee" || arg == "length" || arg == "arguments") {
  68903. continue;
  68904. }
  68905. dest[key] = obj[key];
  68906. }
  68907. }
  68908. }
  68909. return dest;
  68910. }
  68911. // EXTERNAL MODULE: ./node_modules/lodash.topairs/index.js
  68912. var lodash_topairs = __webpack_require__(7820);
  68913. var lodash_topairs_default = /*#__PURE__*/__webpack_require__.n(lodash_topairs);
  68914. ;// CONCATENATED MODULE: ./src/common/style/CartoCSS.js
  68915. function CartoCSS_typeof(obj) { "@babel/helpers - typeof"; return CartoCSS_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, CartoCSS_typeof(obj); }
  68916. function CartoCSS_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  68917. function CartoCSS_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  68918. function CartoCSS_createClass(Constructor, protoProps, staticProps) { if (protoProps) CartoCSS_defineProperties(Constructor.prototype, protoProps); if (staticProps) CartoCSS_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  68919. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  68920. * This program are made available under the terms of the Apache License, Version 2.0
  68921. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  68922. /**
  68923. * @class CartoCSS
  68924. * @deprecatedclass SuperMap.CartoCSS
  68925. * @classdesc CartoCSS 解析类,其主要功能为将 CartoCSS 字符串解析为 CartoCSS 的 shader 属性风格对象。
  68926. * @category BaseTypes Style
  68927. * @param {string} cartoStr - 样式表字符串。
  68928. * @example
  68929. * var cartocss = "@provinceLineColor:#ddd;
  68930. * #China_Provinces_L___China400{
  68931. * line-dasharray:10,10;
  68932. * line-color:@provinceLineColor;
  68933. * line-width:1;
  68934. * }";
  68935. * new CartoCSS(cartocss);
  68936. * @usage
  68937. */
  68938. /*eslint no-useless-escape: "off"*/
  68939. var CartoCSS = /*#__PURE__*/function () {
  68940. function CartoCSS(cartoStr) {
  68941. CartoCSS_classCallCheck(this, CartoCSS);
  68942. this.env = null;
  68943. /**
  68944. * @member CartoCSS.prototype.parser
  68945. * @description 解析器。
  68946. */
  68947. this.parser = null;
  68948. /**
  68949. * @member CartoCSS.prototype.ruleSet
  68950. * @description CartoCSS 规则对象。
  68951. */
  68952. this.ruleSet = null;
  68953. /**
  68954. * @member CartoCSS.prototype.cartoStr
  68955. * @description CartoCSS 样式表字符串。
  68956. */
  68957. this.cartoStr = "";
  68958. /**
  68959. * @member CartoCSS.prototype.shaders
  68960. * @description Carto 着色器集。
  68961. */
  68962. this.shaders = null;
  68963. if (typeof cartoStr === "string") {
  68964. this.cartoStr = cartoStr;
  68965. this.env = {
  68966. frames: [],
  68967. errors: [],
  68968. error: function error(obj) {
  68969. this.errors.push(obj);
  68970. }
  68971. };
  68972. this.parser = this.getParser(this.env);
  68973. this.parse(cartoStr);
  68974. this.shaders = this.toShaders();
  68975. }
  68976. }
  68977. /**
  68978. * @function CartoCSS.prototype.getParser
  68979. * @description 获取 CartoCSS 解析器。
  68980. */
  68981. CartoCSS_createClass(CartoCSS, [{
  68982. key: "getParser",
  68983. value: function getParser(env) {
  68984. var input,
  68985. // LeSS input string
  68986. i,
  68987. // current index in `input`
  68988. j,
  68989. // current chunk
  68990. temp,
  68991. // temporarily holds a chunk's state, for backtracking
  68992. memo,
  68993. // temporarily holds `i`, when backtracking
  68994. furthest,
  68995. // furthest index the parser has gone to
  68996. chunks,
  68997. // chunkified input
  68998. current,
  68999. // index of current chunk, in `input`
  69000. parser;
  69001. var that = this;
  69002. // This function is called after all files
  69003. // have been imported through `@import`.
  69004. var finish = function finish() {//NOSONAR
  69005. //所有文件导入完成之后调用
  69006. };
  69007. function save() {
  69008. temp = chunks[j];
  69009. memo = i;
  69010. current = i;
  69011. }
  69012. function restore() {
  69013. chunks[j] = temp;
  69014. i = memo;
  69015. current = i;
  69016. }
  69017. function sync() {
  69018. if (i > current) {
  69019. chunks[j] = chunks[j].slice(i - current);
  69020. current = i;
  69021. }
  69022. }
  69023. //
  69024. // Parse from a token, regexp or string, and move forward if match
  69025. //
  69026. function _match(tok) {
  69027. var match, length, c, endIndex;
  69028. // Non-terminal
  69029. if (tok instanceof Function) {
  69030. return tok.call(parser.parsers);
  69031. // Terminal
  69032. // Either match a single character in the input,
  69033. // or match a regexp in the current chunk (chunk[j]).
  69034. } else if (typeof tok === 'string') {
  69035. match = input.charAt(i) === tok ? tok : null;
  69036. length = 1;
  69037. sync();
  69038. } else {
  69039. sync();
  69040. match = tok.exec(chunks[j]);
  69041. if (match) {
  69042. length = match[0].length;
  69043. } else {
  69044. return null;
  69045. }
  69046. }
  69047. // The match is confirmed, add the match length to `i`,
  69048. // and consume any extra white-space characters (' ' || '\n')
  69049. // which come after that. The reason for this is that LeSS's
  69050. // grammar is mostly white-space insensitive.
  69051. if (match) {
  69052. var mem = i += length;
  69053. endIndex = i + chunks[j].length - length;
  69054. while (i < endIndex) {
  69055. c = input.charCodeAt(i);
  69056. if (!(c === 32 || c === 10 || c === 9)) {
  69057. break;
  69058. }
  69059. i++;
  69060. }
  69061. chunks[j] = chunks[j].slice(length + (i - mem));
  69062. current = i;
  69063. if (chunks[j].length === 0 && j < chunks.length - 1) {
  69064. j++;
  69065. }
  69066. if (typeof match === 'string') {
  69067. return match;
  69068. } else {
  69069. return match.length === 1 ? match[0] : match;
  69070. }
  69071. }
  69072. }
  69073. // Same as _match(), but don't change the state of the parser,
  69074. // just return the match.
  69075. function peek(tok) {
  69076. if (typeof tok === 'string') {
  69077. return input.charAt(i) === tok;
  69078. } else {
  69079. return !!tok.test(chunks[j]);
  69080. }
  69081. }
  69082. // Make an error object from a passed set of properties.
  69083. // Accepted properties:
  69084. // - `message`: Text of the error message.
  69085. // - `filename`: Filename where the error occurred.
  69086. // - `index`: Char. index where the error occurred.
  69087. function makeError(err) {
  69088. var einput;
  69089. var defautls = {
  69090. index: furthest,
  69091. filename: env.filename,
  69092. message: 'Parse error.',
  69093. line: 0,
  69094. column: -1
  69095. };
  69096. for (var prop in defautls) {
  69097. if (err[prop] === 0) {
  69098. err[prop] = defautls[prop];
  69099. }
  69100. }
  69101. if (err.filename && that.env.inputs && that.env.inputs[err.filename]) {
  69102. einput = that.env.inputs[err.filename];
  69103. } else {
  69104. einput = input;
  69105. }
  69106. err.line = (einput.slice(0, err.index).match(/\n/g) || '').length + 1;
  69107. for (var n = err.index; n >= 0 && einput.charAt(n) !== '\n'; n--) {
  69108. err.column++;
  69109. }
  69110. return new Error([err.filename, err.line, err.column, err.message].join(";"));
  69111. }
  69112. this.env = env = env || {};
  69113. this.env.filename = this.env.filename || null;
  69114. this.env.inputs = this.env.inputs || {};
  69115. // The Parser
  69116. parser = {
  69117. // Parse an input string into an abstract syntax tree.
  69118. // Throws an error on parse errors.
  69119. parse: function parse(str) {
  69120. var root,
  69121. error = null;
  69122. i = j = current = furthest = 0;
  69123. chunks = [];
  69124. input = str.replace(/\r\n/g, '\n');
  69125. if (env.filename) {
  69126. that.env.inputs[env.filename] = input;
  69127. }
  69128. // Split the input into chunks.
  69129. chunks = function (chunks) {
  69130. var j = 0,
  69131. skip = /(?:@\{[\w-]+\}|[^"'`\{\}\/\(\)\\])+/g,
  69132. comment = /\/\*(?:[^*]|\*+[^\/*])*\*+\/|\/\/.*/g,
  69133. string = /"((?:[^"\\\r\n]|\\.)*)"|'((?:[^'\\\r\n]|\\.)*)'|`((?:[^`]|\\.)*)`/g,
  69134. level = 0,
  69135. match,
  69136. chunk = chunks[0],
  69137. inParam;
  69138. for (var i = 0, c, cc; i < input.length;) {
  69139. skip.lastIndex = i;
  69140. if (match = skip.exec(input)) {
  69141. if (match.index === i) {
  69142. i += match[0].length;
  69143. chunk.push(match[0]);
  69144. }
  69145. }
  69146. c = input.charAt(i);
  69147. comment.lastIndex = string.lastIndex = i;
  69148. if (match = string.exec(input)) {
  69149. if (match.index === i) {
  69150. i += match[0].length;
  69151. chunk.push(match[0]);
  69152. continue;
  69153. }
  69154. }
  69155. if (!inParam && c === '/') {
  69156. cc = input.charAt(i + 1);
  69157. if (cc === '/' || cc === '*') {
  69158. if (match = comment.exec(input)) {
  69159. if (match.index === i) {
  69160. i += match[0].length;
  69161. chunk.push(match[0]);
  69162. continue;
  69163. }
  69164. }
  69165. }
  69166. }
  69167. switch (c) {
  69168. case '{':
  69169. //NOSONAR
  69170. if (!inParam) {
  69171. level++;
  69172. chunk.push(c);
  69173. break;
  69174. }
  69175. case '}':
  69176. //NOSONAR
  69177. if (!inParam) {
  69178. level--;
  69179. chunk.push(c);
  69180. chunks[++j] = chunk = [];
  69181. break;
  69182. }
  69183. case '(':
  69184. //NOSONAR
  69185. if (!inParam) {
  69186. inParam = true;
  69187. chunk.push(c);
  69188. break;
  69189. }
  69190. case ')':
  69191. //NOSONAR
  69192. if (inParam) {
  69193. inParam = false;
  69194. chunk.push(c);
  69195. break;
  69196. }
  69197. default:
  69198. chunk.push(c);
  69199. break;
  69200. }
  69201. i++;
  69202. }
  69203. if (level !== 0) {
  69204. error = {
  69205. index: i - 1,
  69206. type: 'Parse',
  69207. message: level > 0 ? "missing closing `}`" : "missing opening `{`"
  69208. };
  69209. }
  69210. return chunks.map(function (c) {
  69211. return c.join('');
  69212. });
  69213. }([[]]);
  69214. if (error) {
  69215. throw makeError(error);
  69216. }
  69217. // Sort rules by specificity: this function expects selectors to be
  69218. // split already.
  69219. //
  69220. // Written to be used as a .sort(Function);
  69221. // argument.
  69222. //
  69223. // [1, 0, 0, 467] > [0, 0, 1, 520]
  69224. var specificitySort = function specificitySort(a, b) {
  69225. var as = a.specificity;
  69226. var bs = b.specificity;
  69227. if (as[0] != bs[0]) {
  69228. return bs[0] - as[0];
  69229. }
  69230. if (as[1] != bs[1]) {
  69231. return bs[1] - as[1];
  69232. }
  69233. if (as[2] != bs[2]) {
  69234. return bs[2] - as[2];
  69235. }
  69236. return bs[3] - as[3];
  69237. };
  69238. // Start with the primary rule.
  69239. // The whole syntax tree is held under a Ruleset node,
  69240. // with the `root` property set to true, so no `{}` are
  69241. // output.
  69242. root = new CartoCSS.Tree.Ruleset([], _match(this.parsers.primary));
  69243. root.root = true;
  69244. // Get an array of Ruleset objects, flattened
  69245. // and sorted according to specificitySort
  69246. root.toList = function () {
  69247. return function (env) {
  69248. env.error = function (e) {
  69249. if (!env.errors) {
  69250. env.errors = new Error('');
  69251. }
  69252. if (env.errors.message) {
  69253. env.errors.message += '\n' + makeError(e).message;
  69254. } else {
  69255. env.errors.message = makeError(e).message;
  69256. }
  69257. };
  69258. env.frames = env.frames || [];
  69259. // call populates Invalid-caused errors
  69260. var definitions = this.flatten([], [], env);
  69261. definitions.sort(specificitySort);
  69262. return definitions;
  69263. };
  69264. }();
  69265. return root;
  69266. },
  69267. // Here in, the parsing rules/functions
  69268. //
  69269. // The basic structure of the syntax tree generated is as follows:
  69270. //
  69271. // Ruleset -> Rule -> Value -> Expression -> Entity
  69272. //
  69273. // In general, most rules will try to parse a token with the `_match()` function, and if the return
  69274. // value is truly, will return a new node, of the relevant type. Sometimes, we need to check
  69275. // first, before parsing, that's when we use `peek()`.
  69276. parsers: {
  69277. // The `primary` rule is the *entry* and *exit* point of the parser.
  69278. // The rules here can appear at any level of the parse tree.
  69279. //
  69280. // The recursive nature of the grammar is an interplay between the `block`
  69281. // rule, which represents `{ ... }`, the `ruleset` rule, and this `primary` rule,
  69282. // as represented by this simplified grammar:
  69283. //
  69284. // primary → (ruleset | rule)+
  69285. // ruleset → selector+ block
  69286. // block → '{' primary '}'
  69287. //
  69288. // Only at one point is the primary rule not called from the
  69289. // block rule: at the root level.
  69290. primary: function primary() {
  69291. var node,
  69292. root = [];
  69293. while ((node = _match(this.rule) || _match(this.ruleset) || _match(this.comment)) || _match(/^[\s\n]+/) || (node = _match(this.invalid))) {
  69294. if (node) {
  69295. root.push(node);
  69296. }
  69297. }
  69298. return root;
  69299. },
  69300. invalid: function invalid() {
  69301. var chunk = _match(/^[^;\n]*[;\n]/);
  69302. // To fail gracefully, match everything until a semicolon or linebreak.
  69303. if (chunk) {
  69304. return new CartoCSS.Tree.Invalid(chunk, memo);
  69305. }
  69306. },
  69307. // We create a Comment node for CSS comments `/* */`,
  69308. // but keep the LeSS comments `//` silent, by just skipping
  69309. // over them.
  69310. comment: function comment() {
  69311. var comment;
  69312. if (input.charAt(i) !== '/') {
  69313. return;
  69314. }
  69315. if (input.charAt(i + 1) === '/') {
  69316. return new CartoCSS.Tree.Comment(_match(/^\/\/.*/), true);
  69317. } else if (comment = _match(/^\/\*(?:[^*]|\*+[^\/*])*\*+\/\n?/)) {
  69318. return new CartoCSS.Tree.Comment(comment);
  69319. }
  69320. },
  69321. // Entities are tokens which can be found inside an Expression
  69322. entities: {
  69323. // A string, which supports escaping " and ' "milky way" 'he\'s the one!'
  69324. quoted: function quoted() {
  69325. if (input.charAt(i) !== '"' && input.charAt(i) !== "'") {
  69326. return;
  69327. }
  69328. var str = _match(/^"((?:[^"\\\r\n]|\\.)*)"|'((?:[^'\\\r\n]|\\.)*)'/);
  69329. if (str) {
  69330. return new CartoCSS.Tree.Quoted(str[1] || str[2]);
  69331. }
  69332. },
  69333. // A reference to a Mapnik field, like [NAME]
  69334. // Behind the scenes, this has the same representation, but Carto
  69335. // needs to be careful to warn when unsupported operations are used.
  69336. field: function field() {
  69337. var l = '[',
  69338. r = ']';
  69339. if (!_match(l)) {
  69340. return;
  69341. }
  69342. var field_name = _match(/(^[^\]]+)/);
  69343. if (!_match(r)) {
  69344. return;
  69345. }
  69346. if (field_name) {
  69347. return new CartoCSS.Tree.Field(field_name[1]);
  69348. }
  69349. },
  69350. // This is a comparison operator
  69351. comparison: function comparison() {
  69352. var str = _match(/^=~|=|!=|<=|>=|<|>/);
  69353. if (str) {
  69354. return str;
  69355. }
  69356. },
  69357. // A catch-all word, such as: hard-light
  69358. // These can start with either a letter or a dash (-),
  69359. // and then contain numbers, underscores, and letters.
  69360. keyword: function keyword() {
  69361. var k = _match(/^[A-Za-z\u4e00-\u9fa5-]+[A-Za-z-0-9\u4e00-\u9fa5_]*/);
  69362. if (k) {
  69363. return new CartoCSS.Tree.Keyword(k);
  69364. }
  69365. },
  69366. // A function call like rgb(255, 0, 255)
  69367. // The arguments are parsed with the `entities.arguments` parser.
  69368. call: function call() {
  69369. var name, args;
  69370. if (!(name = /^([\w\-]+|%)\(/.exec(chunks[j]))) {
  69371. return;
  69372. }
  69373. name = name[1];
  69374. if (name === 'url') {
  69375. // url() is handled by the url parser instead
  69376. return null;
  69377. } else {
  69378. i += name.length;
  69379. }
  69380. var l = '(',
  69381. r = ')';
  69382. _match(l); // Parse the '(' and consume whitespace.
  69383. args = _match(this.entities['arguments']);
  69384. if (!_match(r)) {
  69385. return;
  69386. }
  69387. if (name) {
  69388. return new CartoCSS.Tree.Call(name, args, i);
  69389. }
  69390. },
  69391. // Arguments are comma-separated expressions
  69392. 'arguments': function _arguments() {
  69393. var args = [],
  69394. arg;
  69395. while (arg = _match(this.expression)) {
  69396. args.push(arg);
  69397. var q = ',';
  69398. if (!_match(q)) {
  69399. break;
  69400. }
  69401. }
  69402. return args;
  69403. },
  69404. literal: function literal() {
  69405. return _match(this.entities.dimension) || _match(this.entities.keywordcolor) || _match(this.entities.hexcolor) || _match(this.entities.quoted);
  69406. },
  69407. // Parse url() tokens
  69408. //
  69409. // We use a specific rule for urls, because they don't really behave like
  69410. // standard function calls. The difference is that the argument doesn't have
  69411. // to be enclosed within a string, so it can't be parsed as an Expression.
  69412. url: function url() {
  69413. var value;
  69414. if (input.charAt(i) !== 'u' || !_match(/^url\(/)) {
  69415. return;
  69416. }
  69417. value = _match(this.entities.quoted) || _match(this.entities.variable) || _match(/^[\-\w%@_match\/.&=:;#+?~]+/) || '';
  69418. var r = ')';
  69419. if (!_match(r)) {
  69420. return new CartoCSS.Tree.Invalid(value, memo, 'Missing closing ) in URL.');
  69421. } else {
  69422. return new CartoCSS.Tree.URL(typeof value.value !== 'undefined' || value instanceof CartoCSS.Tree.Variable ? value : new CartoCSS.Tree.Quoted(value));
  69423. }
  69424. },
  69425. // A Variable entity, such as `@fink`, in
  69426. //
  69427. // width: @fink + 2px
  69428. //
  69429. // We use a different parser for variable definitions,
  69430. // see `parsers.variable`.
  69431. variable: function variable() {
  69432. var name,
  69433. index = i;
  69434. if (input.charAt(i) === '@' && (name = _match(/^@[\w-]+/))) {
  69435. return new CartoCSS.Tree.Variable(name, index, env.filename);
  69436. }
  69437. },
  69438. hexcolor: function hexcolor() {
  69439. var rgb;
  69440. if (input.charAt(i) === '#' && (rgb = _match(/^#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})/))) {
  69441. return new CartoCSS.Tree.Color(rgb[1]);
  69442. }
  69443. },
  69444. keywordcolor: function keywordcolor() {
  69445. var rgb = chunks[j].match(/^[a-z]+/);
  69446. if (rgb && rgb[0] in CartoCSS.Tree.Reference.data.colors) {
  69447. return new CartoCSS.Tree.Color(CartoCSS.Tree.Reference.data.colors[_match(/^[a-z]+/)]);
  69448. }
  69449. },
  69450. // A Dimension, that is, a number and a unit. The only
  69451. // unit that has an effect is %
  69452. dimension: function dimension() {
  69453. var c = input.charCodeAt(i);
  69454. if (c > 57 || c < 45 || c === 47) {
  69455. return;
  69456. }
  69457. var value = _match(/^(-?\d*\.?\d+(?:[eE][-+]?\d+)?)(\%|\w+)?/);
  69458. if (value) {
  69459. return new CartoCSS.Tree.Dimension(value[1], value[2], memo);
  69460. }
  69461. }
  69462. },
  69463. // The variable part of a variable definition.
  69464. // Used in the `rule` parser. Like @fink:
  69465. variable: function variable() {
  69466. var name;
  69467. if (input.charAt(i) === '@' && (name = _match(/^(@[\w-]+)\s*:/))) {
  69468. return name[1];
  69469. }
  69470. },
  69471. // Entities are the smallest recognized token,
  69472. // and can be found inside a rule's value.
  69473. entity: function entity() {
  69474. var property1 = _match(this.entities.call) || _match(this.entities.literal);
  69475. var property2 = _match(this.entities.field) || _match(this.entities.variable);
  69476. var property3 = _match(this.entities.url) || _match(this.entities.keyword);
  69477. return property1 || property2 || property3;
  69478. },
  69479. // A Rule terminator. Note that we use `peek()` to check for '}',
  69480. // because the `block` rule will be expecting it, but we still need to make sure
  69481. // it's there, if ';' was ommitted.
  69482. end: function end() {
  69483. var q = ';';
  69484. return _match(q) || peek('}');
  69485. },
  69486. // Elements are the building blocks for Selectors. They consist of
  69487. // an element name, such as a tag a class, or `*`.
  69488. //增加对中文的支持,[\u4e00-\u9fa5]
  69489. element: function element() {
  69490. var e = _match(/^(?:[.#][\w\u4e00-\u9fa5\-]+|\*|Map)/);
  69491. if (e) {
  69492. return new CartoCSS.Tree.Element(e);
  69493. }
  69494. },
  69495. // Attachments allow adding multiple lines, polygons etc. to an
  69496. // object. There can only be one attachment per selector.
  69497. attachment: function attachment() {
  69498. var s = _match(/^::([\w\-]+(?:\/[\w\-]+)*)/);
  69499. if (s) {
  69500. return s[1];
  69501. }
  69502. },
  69503. // Selectors are made out of one or more Elements, see above.
  69504. selector: function selector() {
  69505. var a,
  69506. attachment,
  69507. e,
  69508. elements = [],
  69509. f,
  69510. filters = new CartoCSS.Tree.Filterset(),
  69511. z,
  69512. zooms = [],
  69513. segments = 0,
  69514. conditions = 0;
  69515. while ((e = _match(this.element)) || (z = _match(this.zoom)) || (f = _match(this.filter)) || (a = _match(this.attachment))) {
  69516. segments++;
  69517. if (e) {
  69518. elements.push(e);
  69519. } else if (z) {
  69520. zooms.push(z);
  69521. conditions++;
  69522. } else if (f) {
  69523. var err = filters.add(f);
  69524. if (err) {
  69525. throw makeError({
  69526. message: err,
  69527. index: i - 1
  69528. });
  69529. }
  69530. conditions++;
  69531. } else if (attachment) {
  69532. throw makeError({
  69533. message: 'Encountered second attachment name.',
  69534. index: i - 1
  69535. });
  69536. } else {
  69537. attachment = a;
  69538. }
  69539. var c = input.charAt(i);
  69540. if (c === '{' || c === '}' || c === ';' || c === ',') {
  69541. break;
  69542. }
  69543. }
  69544. if (segments) {
  69545. return new CartoCSS.Tree.Selector(filters, zooms, elements, attachment, conditions, memo);
  69546. }
  69547. },
  69548. filter: function filter() {
  69549. save();
  69550. var key,
  69551. op,
  69552. val,
  69553. l = '[',
  69554. r = ']';
  69555. if (!_match(l)) {
  69556. return;
  69557. }
  69558. if (key = _match(/^[a-zA-Z0-9\-_]+/) || _match(this.entities.quoted) || _match(this.entities.variable) || _match(this.entities.keyword) || _match(this.entities.field)) {
  69559. if (key instanceof CartoCSS.Tree.Quoted) {
  69560. key = new CartoCSS.Tree.Field(key.toString());
  69561. }
  69562. if ((op = _match(this.entities.comparison)) && (val = _match(this.entities.quoted) || _match(this.entities.variable) || _match(this.entities.dimension) || _match(this.entities.keyword) || _match(this.entities.field))) {
  69563. if (!_match(r)) {
  69564. throw makeError({
  69565. message: 'Missing closing ] of filter.',
  69566. index: memo - 1
  69567. });
  69568. }
  69569. if (!key.is) {
  69570. key = new CartoCSS.Tree.Field(key);
  69571. }
  69572. return new CartoCSS.Tree.Filter(key, op, val, memo, env.filename);
  69573. }
  69574. }
  69575. },
  69576. zoom: function zoom() {
  69577. save();
  69578. var op,
  69579. val,
  69580. r = ']';
  69581. if (_match(/^\[\s*zoom/g) && (op = _match(this.entities.comparison)) && (val = _match(this.entities.variable) || _match(this.entities.dimension)) && _match(r)) {
  69582. return new CartoCSS.Tree.Zoom(op, val, memo);
  69583. } else {
  69584. // backtrack
  69585. restore();
  69586. }
  69587. },
  69588. // The `block` rule is used by `ruleset`
  69589. // It's a wrapper around the `primary` rule, with added `{}`.
  69590. block: function block() {
  69591. var content,
  69592. l = '{',
  69593. r = '}';
  69594. if (_match(l) && (content = _match(this.primary)) && _match(r)) {
  69595. return content;
  69596. }
  69597. },
  69598. // div, .class, body > p {...}
  69599. ruleset: function ruleset() {
  69600. var selectors = [],
  69601. s,
  69602. rules,
  69603. q = ',';
  69604. save();
  69605. while (s = _match(this.selector)) {
  69606. selectors.push(s);
  69607. while (_match(this.comment)) {//NOSONAR
  69608. }
  69609. if (!_match(q)) {
  69610. break;
  69611. }
  69612. while (_match(this.comment)) {//NOSONAR
  69613. }
  69614. }
  69615. if (s) {
  69616. while (_match(this.comment)) {//NOSONAR
  69617. }
  69618. }
  69619. if (selectors.length > 0 && (rules = _match(this.block))) {
  69620. if (selectors.length === 1 && selectors[0].elements.length && selectors[0].elements[0].value === 'Map') {
  69621. var rs = new CartoCSS.Tree.Ruleset(selectors, rules);
  69622. rs.isMap = true;
  69623. return rs;
  69624. }
  69625. return new CartoCSS.Tree.Ruleset(selectors, rules);
  69626. } else {
  69627. // Backtrack
  69628. restore();
  69629. }
  69630. },
  69631. rule: function rule() {
  69632. var name,
  69633. value,
  69634. c = input.charAt(i);
  69635. save();
  69636. if (c === '.' || c === '#') {
  69637. return;
  69638. }
  69639. if (name = _match(this.variable) || _match(this.property)) {
  69640. value = _match(this.value);
  69641. if (value && _match(this.end)) {
  69642. return new CartoCSS.Tree.Rule(name, value, memo, env.filename);
  69643. } else {
  69644. furthest = i;
  69645. restore();
  69646. }
  69647. }
  69648. },
  69649. font: function font() {
  69650. var value = [],
  69651. expression = [],
  69652. e,
  69653. q = ',';
  69654. while (e = _match(this.entity)) {
  69655. expression.push(e);
  69656. }
  69657. value.push(new CartoCSS.Tree.Expression(expression));
  69658. if (_match(q)) {
  69659. while (e = _match(this.expression)) {
  69660. value.push(e);
  69661. if (!_match(q)) {
  69662. break;
  69663. }
  69664. }
  69665. }
  69666. return new CartoCSS.Tree.Value(value);
  69667. },
  69668. // A Value is a comma-delimited list of Expressions
  69669. // In a Rule, a Value represents everything after the `:`,
  69670. // and before the `;`.
  69671. value: function value() {
  69672. var e,
  69673. expressions = [],
  69674. q = ',';
  69675. while (e = _match(this.expression)) {
  69676. expressions.push(e);
  69677. if (!_match(q)) {
  69678. break;
  69679. }
  69680. }
  69681. if (expressions.length > 1) {
  69682. return new CartoCSS.Tree.Value(expressions.map(function (e) {
  69683. return e.value[0];
  69684. }));
  69685. } else if (expressions.length === 1) {
  69686. return new CartoCSS.Tree.Value(expressions);
  69687. }
  69688. },
  69689. // A sub-expression, contained by parenthensis
  69690. sub: function sub() {
  69691. var e,
  69692. l = '(',
  69693. r = ")";
  69694. if (_match(l) && (e = _match(this.expression)) && _match(r)) {
  69695. return e;
  69696. }
  69697. },
  69698. // This is a misnomer because it actually handles multiplication
  69699. // and division.
  69700. multiplication: function multiplication() {
  69701. var m,
  69702. a,
  69703. op,
  69704. operation,
  69705. q = '/';
  69706. if (m = _match(this.operand)) {
  69707. while ((op = _match(q) || _match('*') || _match('%')) && (a = _match(this.operand))) {
  69708. operation = new CartoCSS.Tree.Operation(op, [operation || m, a], memo);
  69709. }
  69710. return operation || m;
  69711. }
  69712. },
  69713. addition: function addition() {
  69714. var m,
  69715. a,
  69716. op,
  69717. operation,
  69718. plus = '+';
  69719. if (m = _match(this.multiplication)) {
  69720. while ((op = _match(/^[-+]\s+/) || input.charAt(i - 1) != ' ' && (_match(plus) || _match('-'))) && (a = _match(this.multiplication))) {
  69721. operation = new CartoCSS.Tree.Operation(op, [operation || m, a], memo);
  69722. }
  69723. return operation || m;
  69724. }
  69725. },
  69726. // An operand is anything that can be part of an operation,
  69727. // such as a Color, or a Variable
  69728. operand: function operand() {
  69729. return _match(this.sub) || _match(this.entity);
  69730. },
  69731. // Expressions either represent mathematical operations,
  69732. // or white-space delimited Entities. @var * 2
  69733. expression: function expression() {
  69734. var e,
  69735. entities = [];
  69736. while (e = _match(this.addition) || _match(this.entity)) {
  69737. entities.push(e);
  69738. }
  69739. if (entities.length > 0) {
  69740. return new CartoCSS.Tree.Expression(entities);
  69741. }
  69742. },
  69743. property: function property() {
  69744. var name = _match(/^(([a-z][-a-z_0-9]*\/)?\*?-?[-a-z_0-9]+)\s*:/);
  69745. if (name) {
  69746. return name[1];
  69747. }
  69748. }
  69749. }
  69750. };
  69751. return parser;
  69752. }
  69753. /**
  69754. * @function CartoCSS.prototype.parse
  69755. * @description 利用CartoCSS解析器里面的parse方法,将CartoCSS样式表字符串转化为CartoCSS规则集。
  69756. * @returns {Object} CartoCSS规则集。
  69757. */
  69758. }, {
  69759. key: "parse",
  69760. value: function parse(str) {
  69761. var parser = this.parser;
  69762. var ruleSet = this.ruleSet = parser.parse(str);
  69763. return ruleSet;
  69764. }
  69765. /**
  69766. * @function CartoCSS.prototype.toShaders
  69767. * @description 将CartoCSS规则集转化为着色器。
  69768. * @returns {Array} CartoCSS着色器集。
  69769. */
  69770. }, {
  69771. key: "toShaders",
  69772. value: function toShaders() {
  69773. if (this.ruleSet) {
  69774. var ruleset = this.ruleSet;
  69775. if (ruleset) {
  69776. var defs = ruleset.toList(this.env);
  69777. defs.reverse();
  69778. var shaders = {};
  69779. var keys = [];
  69780. this._toShaders(shaders, keys, defs);
  69781. var ordered_shaders = [];
  69782. var done = {};
  69783. for (var i = 0, len0 = defs.length; i < len0; ++i) {
  69784. var def = defs[i];
  69785. var k = def.attachment;
  69786. var shader = shaders[keys[i]];
  69787. var shaderArray = [];
  69788. if (!done[k]) {
  69789. var j = 0;
  69790. for (var prop in shader) {
  69791. if (prop !== 'zoom' && prop !== 'frames' && prop !== "attachment" && prop != "elements") {
  69792. //对layer-index作特殊处理以实现图层的控制
  69793. if (prop === "layer-index") {
  69794. /*var getLayerIndex = Function("attributes", "zoom", "var _value = null;" + shader[prop].join('\n') + "; return _value; ");*/
  69795. var getLayerIndex = function getLayerIndex(attributes, zoom) {
  69796. //NOSONAR
  69797. var _value = null;
  69798. shader[prop].join('\n');
  69799. return _value;
  69800. };
  69801. var layerIndex = getLayerIndex();
  69802. Object.defineProperty(shaderArray, "layerIndex", {
  69803. configurable: true,
  69804. enumerable: false,
  69805. value: layerIndex
  69806. });
  69807. } else {
  69808. shaderArray[j++] = function (ops, shaderArray) {
  69809. //NOSONAR
  69810. if (!Array.isArray(ops)) {
  69811. return ops;
  69812. }
  69813. var body = ops.join('\n');
  69814. var myKeyword = 'attributes["FEATUREID"]&&attributes["FEATUREID"]';
  69815. var index = body.indexOf(myKeyword);
  69816. if (index >= 0) {
  69817. //对featureID作一些特殊处理,以将featureID提取出来
  69818. if (!shaderArray.featureFilter) {
  69819. var featureFilterStart = index + myKeyword.length;
  69820. var featureFilterEnd = body.indexOf(")", featureFilterStart + 1);
  69821. var featureFilterStr = "featureId&&(featureId" + body.substring(featureFilterStart, featureFilterEnd) + ")";
  69822. /*var featureFilter = Function("featureId", "if(" + featureFilterStr + "){return true;}return false;");*/
  69823. var featureFilter = function featureFilter(featureId) {
  69824. if (featureFilterStr) {
  69825. return true;
  69826. }
  69827. return false;
  69828. };
  69829. Object.defineProperty(shaderArray, "featureFilter", {
  69830. configurable: true,
  69831. enumerable: false,
  69832. value: featureFilter
  69833. });
  69834. }
  69835. return {
  69836. "property": prop,
  69837. "getValue": Function("attributes", "zoom", "seftFilter", "var _value = null; var isExcute=typeof seftFilter=='function'?sefgFilter():seftFilter;if(isExcute){" + body + ";} return _value; ") //NOSONAR
  69838. };
  69839. } else {
  69840. return {
  69841. "property": prop,
  69842. "getValue": Function("attributes", "zoom", "var _value = null;" + body + "; return _value; ") //NOSONAR
  69843. };
  69844. }
  69845. }(shader[prop], shaderArray);
  69846. }
  69847. }
  69848. }
  69849. Object.defineProperty(shaderArray, "attachment", {
  69850. configurable: true,
  69851. enumerable: false,
  69852. value: k
  69853. });
  69854. Object.defineProperty(shaderArray, "elements", {
  69855. configurable: true,
  69856. enumerable: false,
  69857. value: def.elements
  69858. });
  69859. ordered_shaders.push(shaderArray);
  69860. done[keys[i]] = true;
  69861. }
  69862. Object.defineProperty(shaderArray, "zoom", {
  69863. configurable: true,
  69864. enumerable: false,
  69865. value: def.zoom
  69866. });
  69867. //shader.frames.push(def.frame_offset);
  69868. }
  69869. return ordered_shaders;
  69870. }
  69871. }
  69872. return null;
  69873. }
  69874. }, {
  69875. key: "_toShaders",
  69876. value: function _toShaders(shaders, keys, defs) {
  69877. for (var i = 0, len0 = defs.length; i < len0; ++i) {
  69878. var def = defs[i];
  69879. var element_str = [];
  69880. for (var j = 0, len1 = def.elements.length; j < len1; j++) {
  69881. element_str.push(def.elements[j]);
  69882. }
  69883. var filters = def.filters.filters;
  69884. var filterStr = [];
  69885. for (var attr in filters) {
  69886. filterStr.push(filters[attr].id);
  69887. }
  69888. var key = element_str.join("/") + "::" + def.attachment + "_" + filterStr.join("_");
  69889. keys.push(key);
  69890. var shader = shaders[key] = shaders[key] || {};
  69891. //shader.frames = [];
  69892. shader.zoom = CartoCSS.Tree.Zoom.all;
  69893. var props = def.toJS(this.env);
  69894. for (var v in props) {
  69895. (shader[v] = shader[v] || []).push(props[v].join('\n'));
  69896. }
  69897. }
  69898. }
  69899. /**
  69900. * @function CartoCSS.prototype.getShaders
  69901. * @description 获取CartoCSS着色器。
  69902. * @returns {Array} 着色器集。
  69903. * @example
  69904. * //shaders的结构大概如下:
  69905. * var shaders=[
  69906. * {
  69907. * attachment:"one",
  69908. * elements:[],
  69909. * zoom:23,
  69910. * length:2,
  69911. * 0:{property:"line-color",value:function(attribute,zoom){var _value=null;if(zoom){_value="#123456"}return _vlaue;}},
  69912. * 1:{preoperty:"line-width",value:function(attribute,zoom){var _value=null;if(zoom){_value=3}return _vlaue;}}
  69913. * },
  69914. * {
  69915. * attachment:"two",
  69916. * elements:[],
  69917. * zoom:23,
  69918. * length:2,
  69919. * 0:{property:"polygon-color",value:function(attribute,zoom){var _value=null;if(zoom){_value="#123456"}return _vlaue;}},
  69920. * 1:{property:"line-width",value:function(attribute,zoom){var _value=null;if(zoom){_value=3}return _vlaue;}}
  69921. * }
  69922. * ];
  69923. */
  69924. }, {
  69925. key: "getShaders",
  69926. value: function getShaders() {
  69927. return this.shaders;
  69928. }
  69929. /**
  69930. * @function CartoCSS.prototype.destroy
  69931. * @description CartoCSS解析对象的析构函数,用于销毁CartoCSS解析对象。
  69932. */
  69933. }, {
  69934. key: "destroy",
  69935. value: function destroy() {
  69936. this.cartoStr = null;
  69937. this.env = null;
  69938. this.ruleSet = null;
  69939. this.parser = null;
  69940. this.shaders = null;
  69941. }
  69942. }]);
  69943. return CartoCSS;
  69944. }();
  69945. var _mapnik_reference_latest = {
  69946. "version": "2.1.1",
  69947. "style": {
  69948. "filter-mode": {
  69949. "type": ["all", "first"],
  69950. "doc": "Control the processing behavior of Rule filters within a Style. If 'all' is used then all Rules are processed sequentially independent of whether any previous filters matched. If 'first' is used then it means processing ends after the first match (a positive filter evaluation) and no further Rules in the Style are processed ('first' is usually the default for CSS implementations on top of Mapnik to simplify translation from CSS to Mapnik XML)",
  69951. "default-value": "all",
  69952. "default-meaning": "All Rules in a Style are processed whether they have filters or not and whether or not the filter conditions evaluate to true."
  69953. },
  69954. "image-filters": {
  69955. "css": "image-filters",
  69956. "default-value": "none",
  69957. "default-meaning": "no filters",
  69958. "type": "functions",
  69959. "functions": [["agg-stack-blur", 2], ["emboss", 0], ["blur", 0], ["gray", 0], ["sobel", 0], ["edge-detect", 0], ["x-gradient", 0], ["y-gradient", 0], ["invert", 0], ["sharpen", 0]],
  69960. "doc": "A list of image filters."
  69961. },
  69962. "comp-op": {
  69963. "css": "comp-op",
  69964. "default-value": "src-over",
  69965. "default-meaning": "add the current layer on top of other layers",
  69966. "doc": "Composite operation. This defines how this layer should behave relative to layers atop or below it.",
  69967. "type": ["clear", "src", "dst", "src-over", "dst-over", "src-in", "dst-in", "src-out", "dst-out", "src-atop", "dst-atop", "xor", "plus", "minus", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "contrast", "invert", "invert-rgb", "grain-merge", "grain-extract", "hue", "saturation", "color", "value"]
  69968. },
  69969. "opacity": {
  69970. "css": "opacity",
  69971. "type": "float",
  69972. "doc": "An alpha value for the style (which means an alpha applied to all features in separate buffer and then composited back to main buffer)",
  69973. "default-value": 1,
  69974. "default-meaning": "no separate buffer will be used and no alpha will be applied to the style after rendering"
  69975. }
  69976. },
  69977. "layer": {
  69978. "name": {
  69979. "default-value": "",
  69980. "type": "string",
  69981. "required": true,
  69982. "default-meaning": "No layer name has been provided",
  69983. "doc": "The name of a layer. Can be anything you wish and is not strictly validated, but ideally unique in the map"
  69984. },
  69985. "srs": {
  69986. "default-value": "",
  69987. "type": "string",
  69988. "default-meaning": "No srs value is provided and the value will be inherited from the Map's srs",
  69989. "doc": "The spatial reference system definition for the layer, aka the projection. Can either be a proj4 literal string like '+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs' or, if the proper proj4 epsg/nad/etc identifier files are installed, a string that uses an id like: '+init=epsg:4326'"
  69990. },
  69991. "status": {
  69992. "default-value": true,
  69993. "type": "boolean",
  69994. "default-meaning": "This layer will be marked as active and available for processing",
  69995. "doc": "A property that can be set to false to disable this layer from being processed"
  69996. },
  69997. "minzoom": {
  69998. "default-value": "0",
  69999. "type": "float",
  70000. "default-meaning": "The layer will be visible at the minimum possible scale",
  70001. "doc": "The minimum scale denominator that this layer will be visible at. A layer's visibility is determined by whether its status is true and if the Map scale >= minzoom - 1e-6 and scale < maxzoom + 1e-6"
  70002. },
  70003. "maxzoom": {
  70004. "default-value": "1.79769e+308",
  70005. "type": "float",
  70006. "default-meaning": "The layer will be visible at the maximum possible scale",
  70007. "doc": "The maximum scale denominator that this layer will be visible at. The default is the numeric limit of the C++ double type, which may vary slightly by system, but is likely a massive number like 1.79769e+308 and ensures that this layer will always be visible unless the value is reduced. A layer's visibility is determined by whether its status is true and if the Map scale >= minzoom - 1e-6 and scale < maxzoom + 1e-6"
  70008. },
  70009. "queryable": {
  70010. "default-value": false,
  70011. "type": "boolean",
  70012. "default-meaning": "The layer will not be available for the direct querying of data values",
  70013. "doc": "This property was added for GetFeatureInfo/WMS compatibility and is rarely used. It is off by default meaning that in a WMS context the layer will not be able to be queried unless the property is explicitly set to true"
  70014. },
  70015. "clear-label-cache": {
  70016. "default-value": false,
  70017. "type": "boolean",
  70018. "default-meaning": "The renderer's collision detector cache (used for avoiding duplicate labels and overlapping markers) will not be cleared immediately before processing this layer",
  70019. "doc": "This property, by default off, can be enabled to allow a user to clear the collision detector cache before a given layer is processed. This may be desirable to ensure that a given layers data shows up on the map even if it normally would not because of collisions with previously rendered labels or markers"
  70020. },
  70021. "group-by": {
  70022. "default-value": "",
  70023. "type": "string",
  70024. "default-meaning": "No special layer grouping will be used during rendering",
  70025. "doc": "https://github.com/mapnik/mapnik/wiki/Grouped-rendering"
  70026. },
  70027. "buffer-size": {
  70028. "default-value": "0",
  70029. "type": "float",
  70030. "default-meaning": "No buffer will be used",
  70031. "doc": "Extra tolerance around the Layer extent (in pixels) used to when querying and (potentially) clipping the layer data during rendering"
  70032. },
  70033. "maximum-extent": {
  70034. "default-value": "none",
  70035. "type": "bbox",
  70036. "default-meaning": "No clipping extent will be used",
  70037. "doc": "An extent to be used to limit the bounds used to query this specific layer data during rendering. Should be minx, miny, maxx, maxy in the coordinates of the Layer."
  70038. }
  70039. },
  70040. "symbolizers": {
  70041. "*": {
  70042. "image-filters": {
  70043. "css": "image-filters",
  70044. "default-value": "none",
  70045. "default-meaning": "no filters",
  70046. "type": "functions",
  70047. "functions": [["agg-stack-blur", 2], ["emboss", 0], ["blur", 0], ["gray", 0], ["sobel", 0], ["edge-detect", 0], ["x-gradient", 0], ["y-gradient", 0], ["invert", 0], ["sharpen", 0]],
  70048. "doc": "A list of image filters."
  70049. },
  70050. "comp-op": {
  70051. "css": "comp-op",
  70052. "default-value": "src-over",
  70053. "default-meaning": "add the current layer on top of other layers",
  70054. "doc": "Composite operation. This defines how this layer should behave relative to layers atop or below it.",
  70055. "type": ["clear", "src", "dst", "src-over", "dst-over", "src-in", "dst-in", "src-out", "dst-out", "src-atop", "dst-atop", "xor", "plus", "minus", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "contrast", "invert", "invert-rgb", "grain-merge", "grain-extract", "hue", "saturation", "color", "value"]
  70056. },
  70057. "opacity": {
  70058. "css": "opacity",
  70059. "type": "float",
  70060. "doc": "An alpha value for the style (which means an alpha applied to all features in separate buffer and then composited back to main buffer)",
  70061. "default-value": 1,
  70062. "default-meaning": "no separate buffer will be used and no alpha will be applied to the style after rendering"
  70063. }
  70064. },
  70065. "map": {
  70066. "background-color": {
  70067. "css": "background-color",
  70068. "default-value": "none",
  70069. "default-meaning": "transparent",
  70070. "type": "color",
  70071. "doc": "Map Background color"
  70072. },
  70073. "background-image": {
  70074. "css": "background-image",
  70075. "type": "uri",
  70076. "default-value": "",
  70077. "default-meaning": "transparent",
  70078. "doc": "An image that is repeated below all features on a map as a background.",
  70079. "description": "Map Background image"
  70080. },
  70081. "srs": {
  70082. "css": "srs",
  70083. "type": "string",
  70084. "default-value": "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs",
  70085. "default-meaning": "The proj4 literal of EPSG:4326 is assumed to be the Map's spatial reference and all data from layers within this map will be plotted using this coordinate system. If any layers do not declare an srs value then they will be assumed to be in the same srs as the Map and not transformations will be needed to plot them in the Map's coordinate space",
  70086. "doc": "Map spatial reference (proj4 string)"
  70087. },
  70088. "buffer-size": {
  70089. "css": "buffer-size",
  70090. "default-value": "0",
  70091. "type": "float",
  70092. "default-meaning": "No buffer will be used",
  70093. "doc": "Extra tolerance around the map (in pixels) used to ensure labels crossing tile boundaries are equally rendered in each tile (e.g. cut in each tile). Not intended to be used in combination with \"avoid-edges\"."
  70094. },
  70095. "maximum-extent": {
  70096. "css": "",
  70097. "default-value": "none",
  70098. "type": "bbox",
  70099. "default-meaning": "No clipping extent will be used",
  70100. "doc": "An extent to be used to limit the bounds used to query all layers during rendering. Should be minx, miny, maxx, maxy in the coordinates of the Map."
  70101. },
  70102. "base": {
  70103. "css": "base",
  70104. "default-value": "",
  70105. "default-meaning": "This base path defaults to an empty string meaning that any relative paths to files referenced in styles or layers will be interpreted relative to the application process.",
  70106. "type": "string",
  70107. "doc": "Any relative paths used to reference files will be understood as relative to this directory path if the map is loaded from an in memory object rather than from the filesystem. If the map is loaded from the filesystem and this option is not provided it will be set to the directory of the stylesheet."
  70108. },
  70109. "paths-from-xml": {
  70110. "css": "",
  70111. "default-value": true,
  70112. "default-meaning": "Paths read from XML will be interpreted from the location of the XML",
  70113. "type": "boolean",
  70114. "doc": "value to control whether paths in the XML will be interpreted from the location of the XML or from the working directory of the program that calls load_map()"
  70115. },
  70116. "minimum-version": {
  70117. "css": "",
  70118. "default-value": "none",
  70119. "default-meaning": "Mapnik version will not be detected and no error will be thrown about compatibility",
  70120. "type": "string",
  70121. "doc": "The minumum Mapnik version (e.g. 0.7.2) needed to use certain functionality in the stylesheet"
  70122. },
  70123. "font-directory": {
  70124. "css": "font-directory",
  70125. "type": "uri",
  70126. "default-value": "none",
  70127. "default-meaning": "No map-specific fonts will be registered",
  70128. "doc": "Path to a directory which holds fonts which should be registered when the Map is loaded (in addition to any fonts that may be automatically registered)."
  70129. }
  70130. },
  70131. "polygon": {
  70132. "fill": {
  70133. "css": "polygon-fill",
  70134. "type": "color",
  70135. "default-value": "rgba(128,128,128,1)",
  70136. "default-meaning": "gray and fully opaque (alpha = 1), same as rgb(128,128,128)",
  70137. "doc": "Fill color to assign to a polygon"
  70138. },
  70139. "fill-opacity": {
  70140. "css": "polygon-opacity",
  70141. "type": "float",
  70142. "doc": "The opacity of the polygon",
  70143. "default-value": 1,
  70144. "default-meaning": "opaque"
  70145. },
  70146. "gamma": {
  70147. "css": "polygon-gamma",
  70148. "type": "float",
  70149. "default-value": 1,
  70150. "default-meaning": "fully antialiased",
  70151. "range": "0-1",
  70152. "doc": "Level of antialiasing of polygon edges"
  70153. },
  70154. "gamma-method": {
  70155. "css": "polygon-gamma-method",
  70156. "type": ["power", "linear", "none", "threshold", "multiply"],
  70157. "default-value": "power",
  70158. "default-meaning": "pow(x,gamma) is used to calculate pixel gamma, which produces slightly smoother line and polygon antialiasing than the 'linear' method, while other methods are usually only used to disable AA",
  70159. "doc": "An Antigrain Geometry specific rendering hint to control the quality of antialiasing. Under the hood in Mapnik this method is used in combination with the 'gamma' value (which defaults to 1). The methods are in the AGG source at https://github.com/mapnik/mapnik/blob/master/deps/agg/include/agg_gamma_functions.h"
  70160. },
  70161. "clip": {
  70162. "css": "polygon-clip",
  70163. "type": "boolean",
  70164. "default-value": true,
  70165. "default-meaning": "geometry will be clipped to map bounds before rendering",
  70166. "doc": "geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts."
  70167. },
  70168. "smooth": {
  70169. "css": "polygon-smooth",
  70170. "type": "float",
  70171. "default-value": 0,
  70172. "default-meaning": "no smoothing",
  70173. "range": "0-1",
  70174. "doc": "Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries."
  70175. },
  70176. "geometry-transform": {
  70177. "css": "polygon-geometry-transform",
  70178. "type": "functions",
  70179. "default-value": "none",
  70180. "default-meaning": "geometry will not be transformed",
  70181. "doc": "Allows transformation functions to be applied to the geometry.",
  70182. "functions": [["matrix", 6], ["translate", 2], ["scale", 2], ["rotate", 3], ["skewX", 1], ["skewY", 1]]
  70183. },
  70184. "comp-op": {
  70185. "css": "polygon-comp-op",
  70186. "default-value": "src-over",
  70187. "default-meaning": "add the current symbolizer on top of other symbolizer",
  70188. "doc": "Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",
  70189. "type": ["clear", "src", "dst", "src-over", "dst-over", "src-in", "dst-in", "src-out", "dst-out", "src-atop", "dst-atop", "xor", "plus", "minus", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "contrast", "invert", "invert-rgb", "grain-merge", "grain-extract", "hue", "saturation", "color", "value"]
  70190. }
  70191. },
  70192. "line": {
  70193. "stroke": {
  70194. "css": "line-color",
  70195. "default-value": "rgba(0,0,0,1)",
  70196. "type": "color",
  70197. "default-meaning": "black and fully opaque (alpha = 1), same as rgb(0,0,0)",
  70198. "doc": "The color of a drawn line"
  70199. },
  70200. "stroke-width": {
  70201. "css": "line-width",
  70202. "default-value": 1,
  70203. "type": "float",
  70204. "doc": "The width of a line in pixels"
  70205. },
  70206. "stroke-opacity": {
  70207. "css": "line-opacity",
  70208. "default-value": 1,
  70209. "type": "float",
  70210. "default-meaning": "opaque",
  70211. "doc": "The opacity of a line"
  70212. },
  70213. "stroke-linejoin": {
  70214. "css": "line-join",
  70215. "default-value": "miter",
  70216. "type": ["miter", "round", "bevel"],
  70217. "doc": "The behavior of lines when joining"
  70218. },
  70219. "stroke-linecap": {
  70220. "css": "line-cap",
  70221. "default-value": "butt",
  70222. "type": ["butt", "round", "square"],
  70223. "doc": "The display of line endings"
  70224. },
  70225. "stroke-gamma": {
  70226. "css": "line-gamma",
  70227. "type": "float",
  70228. "default-value": 1,
  70229. "default-meaning": "fully antialiased",
  70230. "range": "0-1",
  70231. "doc": "Level of antialiasing of stroke line"
  70232. },
  70233. "stroke-gamma-method": {
  70234. "css": "line-gamma-method",
  70235. "type": ["power", "linear", "none", "threshold", "multiply"],
  70236. "default-value": "power",
  70237. "default-meaning": "pow(x,gamma) is used to calculate pixel gamma, which produces slightly smoother line and polygon antialiasing than the 'linear' method, while other methods are usually only used to disable AA",
  70238. "doc": "An Antigrain Geometry specific rendering hint to control the quality of antialiasing. Under the hood in Mapnik this method is used in combination with the 'gamma' value (which defaults to 1). The methods are in the AGG source at https://github.com/mapnik/mapnik/blob/master/deps/agg/include/agg_gamma_functions.h"
  70239. },
  70240. "stroke-dasharray": {
  70241. "css": "line-dasharray",
  70242. "type": "numbers",
  70243. "doc": "A pair of length values [a,b], where (a) is the dash length and (b) is the gap length respectively. More than two values are supported for more complex patterns.",
  70244. "default-value": "none",
  70245. "default-meaning": "solid line"
  70246. },
  70247. "stroke-dashoffset": {
  70248. "css": "line-dash-offset",
  70249. "type": "numbers",
  70250. "doc": "valid parameter but not currently used in renderers (only exists for experimental svg support in Mapnik which is not yet enabled)",
  70251. "default-value": "none",
  70252. "default-meaning": "solid line"
  70253. },
  70254. "stroke-miterlimit": {
  70255. "css": "line-miterlimit",
  70256. "type": "float",
  70257. "doc": "The limit on the ratio of the miter length to the stroke-width. Used to automatically convert miter joins to bevel joins for sharp angles to avoid the miter extending beyond the thickness of the stroking path. Normally will not need to be set, but a larger value can sometimes help avoid jaggy artifacts.",
  70258. "default-value": 4.0,
  70259. "default-meaning": "Will auto-convert miters to bevel line joins when theta is less than 29 degrees as per the SVG spec: 'miterLength / stroke-width = 1 / sin ( theta / 2 )'"
  70260. },
  70261. "clip": {
  70262. "css": "line-clip",
  70263. "type": "boolean",
  70264. "default-value": true,
  70265. "default-meaning": "geometry will be clipped to map bounds before rendering",
  70266. "doc": "geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts."
  70267. },
  70268. "smooth": {
  70269. "css": "line-smooth",
  70270. "type": "float",
  70271. "default-value": 0,
  70272. "default-meaning": "no smoothing",
  70273. "range": "0-1",
  70274. "doc": "Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries."
  70275. },
  70276. "offset": {
  70277. "css": "line-offset",
  70278. "type": "float",
  70279. "default-value": 0,
  70280. "default-meaning": "no offset",
  70281. "doc": "Offsets a line a number of pixels parallel to its actual path. Postive values move the line left, negative values move it right (relative to the directionality of the line)."
  70282. },
  70283. "rasterizer": {
  70284. "css": "line-rasterizer",
  70285. "type": ["full", "fast"],
  70286. "default-value": "full",
  70287. "doc": "Exposes an alternate AGG rendering method that sacrifices some accuracy for speed."
  70288. },
  70289. "geometry-transform": {
  70290. "css": "line-geometry-transform",
  70291. "type": "functions",
  70292. "default-value": "none",
  70293. "default-meaning": "geometry will not be transformed",
  70294. "doc": "Allows transformation functions to be applied to the geometry.",
  70295. "functions": [["matrix", 6], ["translate", 2], ["scale", 2], ["rotate", 3], ["skewX", 1], ["skewY", 1]]
  70296. },
  70297. "comp-op": {
  70298. "css": "line-comp-op",
  70299. "default-value": "src-over",
  70300. "default-meaning": "add the current symbolizer on top of other symbolizer",
  70301. "doc": "Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",
  70302. "type": ["clear", "src", "dst", "src-over", "dst-over", "src-in", "dst-in", "src-out", "dst-out", "src-atop", "dst-atop", "xor", "plus", "minus", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "contrast", "invert", "invert-rgb", "grain-merge", "grain-extract", "hue", "saturation", "color", "value"]
  70303. }
  70304. },
  70305. "markers": {
  70306. "file": {
  70307. "css": "marker-file",
  70308. "doc": "An SVG file that this marker shows at each placement. If no file is given, the marker will show an ellipse.",
  70309. "default-value": "",
  70310. "default-meaning": "An ellipse or circle, if width equals height",
  70311. "type": "uri"
  70312. },
  70313. "opacity": {
  70314. "css": "marker-opacity",
  70315. "doc": "The overall opacity of the marker, if set, overrides both the opacity of both the fill and stroke",
  70316. "default-value": 1,
  70317. "default-meaning": "The stroke-opacity and fill-opacity will be used",
  70318. "type": "float"
  70319. },
  70320. "fill-opacity": {
  70321. "css": "marker-fill-opacity",
  70322. "doc": "The fill opacity of the marker",
  70323. "default-value": 1,
  70324. "default-meaning": "opaque",
  70325. "type": "float"
  70326. },
  70327. "stroke": {
  70328. "css": "marker-line-color",
  70329. "doc": "The color of the stroke around a marker shape.",
  70330. "default-value": "black",
  70331. "type": "color"
  70332. },
  70333. "stroke-width": {
  70334. "css": "marker-line-width",
  70335. "doc": "The width of the stroke around a marker shape, in pixels. This is positioned on the boundary, so high values can cover the area itself.",
  70336. "type": "float"
  70337. },
  70338. "stroke-opacity": {
  70339. "css": "marker-line-opacity",
  70340. "default-value": 1,
  70341. "default-meaning": "opaque",
  70342. "doc": "The opacity of a line",
  70343. "type": "float"
  70344. },
  70345. "placement": {
  70346. "css": "marker-placement",
  70347. "type": ["point", "line", "interior"],
  70348. "default-value": "point",
  70349. "default-meaning": "Place markers at the center point (centroid) of the geometry",
  70350. "doc": "Attempt to place markers on a point, in the center of a polygon, or if markers-placement:line, then multiple times along a line. 'interior' placement can be used to ensure that points placed on polygons are forced to be inside the polygon interior"
  70351. },
  70352. "multi-policy": {
  70353. "css": "marker-multi-policy",
  70354. "type": ["each", "whole", "largest"],
  70355. "default-value": "each",
  70356. "default-meaning": "If a feature contains multiple geometries and the placement type is either point or interior then a marker will be rendered for each",
  70357. "doc": "A special setting to allow the user to control rendering behavior for 'multi-geometries' (when a feature contains multiple geometries). This setting does not apply to markers placed along lines. The 'each' policy is default and means all geometries will get a marker. The 'whole' policy means that the aggregate centroid between all geometries will be used. The 'largest' policy means that only the largest (by bounding box areas) feature will get a rendered marker (this is how text labeling behaves by default)."
  70358. },
  70359. "marker-type": {
  70360. "css": "marker-type",
  70361. "type": ["arrow", "ellipse"],
  70362. "default-value": "ellipse",
  70363. "doc": "The default marker-type. If a SVG file is not given as the marker-file parameter, the renderer provides either an arrow or an ellipse (a circle if height is equal to width)"
  70364. },
  70365. "width": {
  70366. "css": "marker-width",
  70367. "default-value": 10,
  70368. "doc": "The width of the marker, if using one of the default types.",
  70369. "type": "expression"
  70370. },
  70371. "height": {
  70372. "css": "marker-height",
  70373. "default-value": 10,
  70374. "doc": "The height of the marker, if using one of the default types.",
  70375. "type": "expression"
  70376. },
  70377. "fill": {
  70378. "css": "marker-fill",
  70379. "default-value": "blue",
  70380. "doc": "The color of the area of the marker.",
  70381. "type": "color"
  70382. },
  70383. "allow-overlap": {
  70384. "css": "marker-allow-overlap",
  70385. "type": "boolean",
  70386. "default-value": false,
  70387. "doc": "Control whether overlapping markers are shown or hidden.",
  70388. "default-meaning": "Do not allow makers to overlap with each other - overlapping markers will not be shown."
  70389. },
  70390. "ignore-placement": {
  70391. "css": "marker-ignore-placement",
  70392. "type": "boolean",
  70393. "default-value": false,
  70394. "default-meaning": "do not store the bbox of this geometry in the collision detector cache",
  70395. "doc": "value to control whether the placement of the feature will prevent the placement of other features"
  70396. },
  70397. "spacing": {
  70398. "css": "marker-spacing",
  70399. "doc": "Space between repeated labels",
  70400. "default-value": 100,
  70401. "type": "float"
  70402. },
  70403. "max-error": {
  70404. "css": "marker-max-error",
  70405. "type": "float",
  70406. "default-value": 0.2,
  70407. "doc": "The maximum difference between actual marker placement and the marker-spacing parameter. Setting a high value can allow the renderer to try to resolve placement conflicts with other symbolizers."
  70408. },
  70409. "transform": {
  70410. "css": "marker-transform",
  70411. "type": "functions",
  70412. "functions": [["matrix", 6], ["translate", 2], ["scale", 2], ["rotate", 3], ["skewX", 1], ["skewY", 1]],
  70413. "default-value": "",
  70414. "default-meaning": "No transformation",
  70415. "doc": "SVG transformation definition"
  70416. },
  70417. "clip": {
  70418. "css": "marker-clip",
  70419. "type": "boolean",
  70420. "default-value": true,
  70421. "default-meaning": "geometry will be clipped to map bounds before rendering",
  70422. "doc": "geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts."
  70423. },
  70424. "smooth": {
  70425. "css": "marker-smooth",
  70426. "type": "float",
  70427. "default-value": 0,
  70428. "default-meaning": "no smoothing",
  70429. "range": "0-1",
  70430. "doc": "Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries."
  70431. },
  70432. "geometry-transform": {
  70433. "css": "marker-geometry-transform",
  70434. "type": "functions",
  70435. "default-value": "none",
  70436. "default-meaning": "geometry will not be transformed",
  70437. "doc": "Allows transformation functions to be applied to the geometry.",
  70438. "functions": [["matrix", 6], ["translate", 2], ["scale", 2], ["rotate", 3], ["skewX", 1], ["skewY", 1]]
  70439. },
  70440. "comp-op": {
  70441. "css": "marker-comp-op",
  70442. "default-value": "src-over",
  70443. "default-meaning": "add the current symbolizer on top of other symbolizer",
  70444. "doc": "Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",
  70445. "type": ["clear", "src", "dst", "src-over", "dst-over", "src-in", "dst-in", "src-out", "dst-out", "src-atop", "dst-atop", "xor", "plus", "minus", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "contrast", "invert", "invert-rgb", "grain-merge", "grain-extract", "hue", "saturation", "color", "value"]
  70446. }
  70447. },
  70448. "shield": {
  70449. "name": {
  70450. "css": "shield-name",
  70451. "type": "expression",
  70452. "serialization": "content",
  70453. "doc": "Value to use for a shield\"s text label. Data columns are specified using brackets like [column_name]"
  70454. },
  70455. "file": {
  70456. "css": "shield-file",
  70457. "required": true,
  70458. "type": "uri",
  70459. "default-value": "none",
  70460. "doc": "Image file to render behind the shield text"
  70461. },
  70462. "face-name": {
  70463. "css": "shield-face-name",
  70464. "type": "string",
  70465. "validate": "font",
  70466. "doc": "Font name and style to use for the shield text",
  70467. "default-value": "",
  70468. "required": true
  70469. },
  70470. "unlock-image": {
  70471. "css": "shield-unlock-image",
  70472. "type": "boolean",
  70473. "doc": "This parameter should be set to true if you are trying to position text beside rather than on top of the shield image",
  70474. "default-value": false,
  70475. "default-meaning": "text alignment relative to the shield image uses the center of the image as the anchor for text positioning."
  70476. },
  70477. "size": {
  70478. "css": "shield-size",
  70479. "type": "float",
  70480. "doc": "The size of the shield text in pixels"
  70481. },
  70482. "fill": {
  70483. "css": "shield-fill",
  70484. "type": "color",
  70485. "doc": "The color of the shield text"
  70486. },
  70487. "placement": {
  70488. "css": "shield-placement",
  70489. "type": ["point", "line", "vertex", "interior"],
  70490. "default-value": "point",
  70491. "doc": "How this shield should be placed. Point placement attempts to place it on top of points, line places along lines multiple times per feature, vertex places on the vertexes of polygons, and interior attempts to place inside of polygons."
  70492. },
  70493. "avoid-edges": {
  70494. "css": "shield-avoid-edges",
  70495. "doc": "Tell positioning algorithm to avoid labeling near intersection edges.",
  70496. "type": "boolean",
  70497. "default-value": false
  70498. },
  70499. "allow-overlap": {
  70500. "css": "shield-allow-overlap",
  70501. "type": "boolean",
  70502. "default-value": false,
  70503. "doc": "Control whether overlapping shields are shown or hidden.",
  70504. "default-meaning": "Do not allow shields to overlap with other map elements already placed."
  70505. },
  70506. "minimum-distance": {
  70507. "css": "shield-min-distance",
  70508. "type": "float",
  70509. "default-value": 0,
  70510. "doc": "Minimum distance to the next shield symbol, not necessarily the same shield."
  70511. },
  70512. "spacing": {
  70513. "css": "shield-spacing",
  70514. "type": "float",
  70515. "default-value": 0,
  70516. "doc": "The spacing between repeated occurrences of the same shield on a line"
  70517. },
  70518. "minimum-padding": {
  70519. "css": "shield-min-padding",
  70520. "default-value": 0,
  70521. "doc": "Determines the minimum amount of padding that a shield gets relative to other shields",
  70522. "type": "float"
  70523. },
  70524. "wrap-width": {
  70525. "css": "shield-wrap-width",
  70526. "type": "unsigned",
  70527. "default-value": 0,
  70528. "doc": "Length of a chunk of text in characters before wrapping text"
  70529. },
  70530. "wrap-before": {
  70531. "css": "shield-wrap-before",
  70532. "type": "boolean",
  70533. "default-value": false,
  70534. "doc": "Wrap text before wrap-width is reached. If false, wrapped lines will be a bit longer than wrap-width."
  70535. },
  70536. "wrap-character": {
  70537. "css": "shield-wrap-character",
  70538. "type": "string",
  70539. "default-value": " ",
  70540. "doc": "Use this character instead of a space to wrap long names."
  70541. },
  70542. "halo-fill": {
  70543. "css": "shield-halo-fill",
  70544. "type": "color",
  70545. "default-value": "#FFFFFF",
  70546. "default-meaning": "white",
  70547. "doc": "Specifies the color of the halo around the text."
  70548. },
  70549. "halo-radius": {
  70550. "css": "shield-halo-radius",
  70551. "doc": "Specify the radius of the halo in pixels",
  70552. "default-value": 0,
  70553. "default-meaning": "no halo",
  70554. "type": "float"
  70555. },
  70556. "character-spacing": {
  70557. "css": "shield-character-spacing",
  70558. "type": "unsigned",
  70559. "default-value": 0,
  70560. "doc": "Horizontal spacing between characters (in pixels). Currently works for point placement only, not line placement."
  70561. },
  70562. "line-spacing": {
  70563. "css": "shield-line-spacing",
  70564. "doc": "Vertical spacing between lines of multiline labels (in pixels)",
  70565. "type": "unsigned"
  70566. },
  70567. "dx": {
  70568. "css": "shield-text-dx",
  70569. "type": "float",
  70570. "doc": "Displace text within shield by fixed amount, in pixels, +/- along the X axis. A positive value will shift the text right",
  70571. "default-value": 0
  70572. },
  70573. "dy": {
  70574. "css": "shield-text-dy",
  70575. "type": "float",
  70576. "doc": "Displace text within shield by fixed amount, in pixels, +/- along the Y axis. A positive value will shift the text down",
  70577. "default-value": 0
  70578. },
  70579. "shield-dx": {
  70580. "css": "shield-dx",
  70581. "type": "float",
  70582. "doc": "Displace shield by fixed amount, in pixels, +/- along the X axis. A positive value will shift the text right",
  70583. "default-value": 0
  70584. },
  70585. "shield-dy": {
  70586. "css": "shield-dy",
  70587. "type": "float",
  70588. "doc": "Displace shield by fixed amount, in pixels, +/- along the Y axis. A positive value will shift the text down",
  70589. "default-value": 0
  70590. },
  70591. "opacity": {
  70592. "css": "shield-opacity",
  70593. "type": "float",
  70594. "doc": "(Default 1.0) - opacity of the image used for the shield",
  70595. "default-value": 1
  70596. },
  70597. "text-opacity": {
  70598. "css": "shield-text-opacity",
  70599. "type": "float",
  70600. "doc": "(Default 1.0) - opacity of the text placed on top of the shield",
  70601. "default-value": 1
  70602. },
  70603. "horizontal-alignment": {
  70604. "css": "shield-horizontal-alignment",
  70605. "type": ["left", "middle", "right", "auto"],
  70606. "doc": "The shield's horizontal alignment from its centerpoint",
  70607. "default-value": "auto"
  70608. },
  70609. "vertical-alignment": {
  70610. "css": "shield-vertical-alignment",
  70611. "type": ["top", "middle", "bottom", "auto"],
  70612. "doc": "The shield's vertical alignment from its centerpoint",
  70613. "default-value": "middle"
  70614. },
  70615. "text-transform": {
  70616. "css": "shield-text-transform",
  70617. "type": ["none", "uppercase", "lowercase", "capitalize"],
  70618. "doc": "Transform the case of the characters",
  70619. "default-value": "none"
  70620. },
  70621. "justify-alignment": {
  70622. "css": "shield-justify-alignment",
  70623. "type": ["left", "center", "right", "auto"],
  70624. "doc": "Define how text in a shield's label is justified",
  70625. "default-value": "auto"
  70626. },
  70627. "clip": {
  70628. "css": "shield-clip",
  70629. "type": "boolean",
  70630. "default-value": true,
  70631. "default-meaning": "geometry will be clipped to map bounds before rendering",
  70632. "doc": "geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts."
  70633. },
  70634. "comp-op": {
  70635. "css": "shield-comp-op",
  70636. "default-value": "src-over",
  70637. "default-meaning": "add the current symbolizer on top of other symbolizer",
  70638. "doc": "Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",
  70639. "type": ["clear", "src", "dst", "src-over", "dst-over", "src-in", "dst-in", "src-out", "dst-out", "src-atop", "dst-atop", "xor", "plus", "minus", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "contrast", "invert", "invert-rgb", "grain-merge", "grain-extract", "hue", "saturation", "color", "value"]
  70640. }
  70641. },
  70642. "line-pattern": {
  70643. "file": {
  70644. "css": "line-pattern-file",
  70645. "type": "uri",
  70646. "default-value": "none",
  70647. "required": true,
  70648. "doc": "An image file to be repeated and warped along a line"
  70649. },
  70650. "clip": {
  70651. "css": "line-pattern-clip",
  70652. "type": "boolean",
  70653. "default-value": true,
  70654. "default-meaning": "geometry will be clipped to map bounds before rendering",
  70655. "doc": "geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts."
  70656. },
  70657. "smooth": {
  70658. "css": "line-pattern-smooth",
  70659. "type": "float",
  70660. "default-value": 0,
  70661. "default-meaning": "no smoothing",
  70662. "range": "0-1",
  70663. "doc": "Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries."
  70664. },
  70665. "geometry-transform": {
  70666. "css": "line-pattern-geometry-transform",
  70667. "type": "functions",
  70668. "default-value": "none",
  70669. "default-meaning": "geometry will not be transformed",
  70670. "doc": "Allows transformation functions to be applied to the geometry.",
  70671. "functions": [["matrix", 6], ["translate", 2], ["scale", 2], ["rotate", 3], ["skewX", 1], ["skewY", 1]]
  70672. },
  70673. "comp-op": {
  70674. "css": "line-pattern-comp-op",
  70675. "default-value": "src-over",
  70676. "default-meaning": "add the current symbolizer on top of other symbolizer",
  70677. "doc": "Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",
  70678. "type": ["clear", "src", "dst", "src-over", "dst-over", "src-in", "dst-in", "src-out", "dst-out", "src-atop", "dst-atop", "xor", "plus", "minus", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "contrast", "invert", "invert-rgb", "grain-merge", "grain-extract", "hue", "saturation", "color", "value"]
  70679. }
  70680. },
  70681. "polygon-pattern": {
  70682. "file": {
  70683. "css": "polygon-pattern-file",
  70684. "type": "uri",
  70685. "default-value": "none",
  70686. "required": true,
  70687. "doc": "Image to use as a repeated pattern fill within a polygon"
  70688. },
  70689. "alignment": {
  70690. "css": "polygon-pattern-alignment",
  70691. "type": ["local", "global"],
  70692. "default-value": "local",
  70693. "doc": "Specify whether to align pattern fills to the layer or to the map."
  70694. },
  70695. "gamma": {
  70696. "css": "polygon-pattern-gamma",
  70697. "type": "float",
  70698. "default-value": 1,
  70699. "default-meaning": "fully antialiased",
  70700. "range": "0-1",
  70701. "doc": "Level of antialiasing of polygon pattern edges"
  70702. },
  70703. "opacity": {
  70704. "css": "polygon-pattern-opacity",
  70705. "type": "float",
  70706. "doc": "(Default 1.0) - Apply an opacity level to the image used for the pattern",
  70707. "default-value": 1,
  70708. "default-meaning": "The image is rendered without modifications"
  70709. },
  70710. "clip": {
  70711. "css": "polygon-pattern-clip",
  70712. "type": "boolean",
  70713. "default-value": true,
  70714. "default-meaning": "geometry will be clipped to map bounds before rendering",
  70715. "doc": "geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts."
  70716. },
  70717. "smooth": {
  70718. "css": "polygon-pattern-smooth",
  70719. "type": "float",
  70720. "default-value": 0,
  70721. "default-meaning": "no smoothing",
  70722. "range": "0-1",
  70723. "doc": "Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries."
  70724. },
  70725. "geometry-transform": {
  70726. "css": "polygon-pattern-geometry-transform",
  70727. "type": "functions",
  70728. "default-value": "none",
  70729. "default-meaning": "geometry will not be transformed",
  70730. "doc": "Allows transformation functions to be applied to the geometry.",
  70731. "functions": [["matrix", 6], ["translate", 2], ["scale", 2], ["rotate", 3], ["skewX", 1], ["skewY", 1]]
  70732. },
  70733. "comp-op": {
  70734. "css": "polygon-pattern-comp-op",
  70735. "default-value": "src-over",
  70736. "default-meaning": "add the current symbolizer on top of other symbolizer",
  70737. "doc": "Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",
  70738. "type": ["clear", "src", "dst", "src-over", "dst-over", "src-in", "dst-in", "src-out", "dst-out", "src-atop", "dst-atop", "xor", "plus", "minus", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "contrast", "invert", "invert-rgb", "grain-merge", "grain-extract", "hue", "saturation", "color", "value"]
  70739. }
  70740. },
  70741. "raster": {
  70742. "opacity": {
  70743. "css": "raster-opacity",
  70744. "default-value": 1,
  70745. "default-meaning": "opaque",
  70746. "type": "float",
  70747. "doc": "The opacity of the raster symbolizer on top of other symbolizers."
  70748. },
  70749. "filter-factor": {
  70750. "css": "raster-filter-factor",
  70751. "default-value": -1,
  70752. "default-meaning": "Allow the datasource to choose appropriate downscaling.",
  70753. "type": "float",
  70754. "doc": "This is used by the Raster or Gdal datasources to pre-downscale images using overviews. Higher numbers can sometimes cause much better scaled image output, at the cost of speed."
  70755. },
  70756. "scaling": {
  70757. "css": "raster-scaling",
  70758. "type": ["near", "fast", "bilinear", "bilinear8", "bicubic", "spline16", "spline36", "hanning", "hamming", "hermite", "kaiser", "quadric", "catrom", "gaussian", "bessel", "mitchell", "sinc", "lanczos", "blackman"],
  70759. "default-value": "near",
  70760. "doc": "The scaling algorithm used to making different resolution versions of this raster layer. Bilinear is a good compromise between speed and accuracy, while lanczos gives the highest quality."
  70761. },
  70762. "mesh-size": {
  70763. "css": "raster-mesh-size",
  70764. "default-value": 16,
  70765. "default-meaning": "Reprojection mesh will be 1/16 of the resolution of the source image",
  70766. "type": "unsigned",
  70767. "doc": "A reduced resolution mesh is used for raster reprojection, and the total image size is divided by the mesh-size to determine the quality of that mesh. Values for mesh-size larger than the default will result in faster reprojection but might lead to distortion."
  70768. },
  70769. "comp-op": {
  70770. "css": "raster-comp-op",
  70771. "default-value": "src-over",
  70772. "default-meaning": "add the current symbolizer on top of other symbolizer",
  70773. "doc": "Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",
  70774. "type": ["clear", "src", "dst", "src-over", "dst-over", "src-in", "dst-in", "src-out", "dst-out", "src-atop", "dst-atop", "xor", "plus", "minus", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "contrast", "invert", "invert-rgb", "grain-merge", "grain-extract", "hue", "saturation", "color", "value"]
  70775. }
  70776. },
  70777. "point": {
  70778. "file": {
  70779. "css": "point-file",
  70780. "type": "uri",
  70781. "required": false,
  70782. "default-value": "none",
  70783. "doc": "Image file to represent a point"
  70784. },
  70785. "allow-overlap": {
  70786. "css": "point-allow-overlap",
  70787. "type": "boolean",
  70788. "default-value": false,
  70789. "doc": "Control whether overlapping points are shown or hidden.",
  70790. "default-meaning": "Do not allow points to overlap with each other - overlapping markers will not be shown."
  70791. },
  70792. "ignore-placement": {
  70793. "css": "point-ignore-placement",
  70794. "type": "boolean",
  70795. "default-value": false,
  70796. "default-meaning": "do not store the bbox of this geometry in the collision detector cache",
  70797. "doc": "value to control whether the placement of the feature will prevent the placement of other features"
  70798. },
  70799. "opacity": {
  70800. "css": "point-opacity",
  70801. "type": "float",
  70802. "default-value": 1.0,
  70803. "default-meaning": "Fully opaque",
  70804. "doc": "A value from 0 to 1 to control the opacity of the point"
  70805. },
  70806. "placement": {
  70807. "css": "point-placement",
  70808. "type": ["centroid", "interior"],
  70809. "doc": "How this point should be placed. Centroid calculates the geometric center of a polygon, which can be outside of it, while interior always places inside of a polygon.",
  70810. "default-value": "centroid"
  70811. },
  70812. "transform": {
  70813. "css": "point-transform",
  70814. "type": "functions",
  70815. "functions": [["matrix", 6], ["translate", 2], ["scale", 2], ["rotate", 3], ["skewX", 1], ["skewY", 1]],
  70816. "default-value": "",
  70817. "default-meaning": "No transformation",
  70818. "doc": "SVG transformation definition"
  70819. },
  70820. "comp-op": {
  70821. "css": "point-comp-op",
  70822. "default-value": "src-over",
  70823. "default-meaning": "add the current symbolizer on top of other symbolizer",
  70824. "doc": "Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",
  70825. "type": ["clear", "src", "dst", "src-over", "dst-over", "src-in", "dst-in", "src-out", "dst-out", "src-atop", "dst-atop", "xor", "plus", "minus", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "contrast", "invert", "invert-rgb", "grain-merge", "grain-extract", "hue", "saturation", "color", "value"]
  70826. }
  70827. },
  70828. "text": {
  70829. "name": {
  70830. "css": "text-name",
  70831. "type": "expression",
  70832. "required": true,
  70833. "default-value": "",
  70834. "serialization": "content",
  70835. "doc": "Value to use for a text label. Data columns are specified using brackets like [column_name]"
  70836. },
  70837. "face-name": {
  70838. "css": "text-face-name",
  70839. "type": "string",
  70840. "validate": "font",
  70841. "doc": "Font name and style to render a label in",
  70842. "required": true
  70843. },
  70844. "size": {
  70845. "css": "text-size",
  70846. "type": "float",
  70847. "default-value": 10,
  70848. "doc": "Text size in pixels"
  70849. },
  70850. "text-ratio": {
  70851. "css": "text-ratio",
  70852. "doc": "Define the amount of text (of the total) present on successive lines when wrapping occurs",
  70853. "default-value": 0,
  70854. "type": "unsigned"
  70855. },
  70856. "wrap-width": {
  70857. "css": "text-wrap-width",
  70858. "doc": "Length of a chunk of text in characters before wrapping text",
  70859. "default-value": 0,
  70860. "type": "unsigned"
  70861. },
  70862. "wrap-before": {
  70863. "css": "text-wrap-before",
  70864. "type": "boolean",
  70865. "default-value": false,
  70866. "doc": "Wrap text before wrap-width is reached. If false, wrapped lines will be a bit longer than wrap-width."
  70867. },
  70868. "wrap-character": {
  70869. "css": "text-wrap-character",
  70870. "type": "string",
  70871. "default-value": " ",
  70872. "doc": "Use this character instead of a space to wrap long text."
  70873. },
  70874. "spacing": {
  70875. "css": "text-spacing",
  70876. "type": "unsigned",
  70877. "doc": "Distance between repeated text labels on a line (aka. label-spacing)"
  70878. },
  70879. "character-spacing": {
  70880. "css": "text-character-spacing",
  70881. "type": "float",
  70882. "default-value": 0,
  70883. "doc": "Horizontal spacing adjustment between characters in pixels"
  70884. },
  70885. "line-spacing": {
  70886. "css": "text-line-spacing",
  70887. "default-value": 0,
  70888. "type": "unsigned",
  70889. "doc": "Vertical spacing adjustment between lines in pixels"
  70890. },
  70891. "label-position-tolerance": {
  70892. "css": "text-label-position-tolerance",
  70893. "default-value": 0,
  70894. "type": "unsigned",
  70895. "doc": "Allows the label to be displaced from its ideal position by a number of pixels (only works with placement:line)"
  70896. },
  70897. "max-char-angle-delta": {
  70898. "css": "text-max-char-angle-delta",
  70899. "type": "float",
  70900. "default-value": "22.5",
  70901. "doc": "The maximum angle change, in degrees, allowed between adjacent characters in a label. This value internally is converted to radians to the default is 22.5*math.pi/180.0. The higher the value the fewer labels will be placed around around sharp corners."
  70902. },
  70903. "fill": {
  70904. "css": "text-fill",
  70905. "doc": "Specifies the color for the text",
  70906. "default-value": "#000000",
  70907. "type": "color"
  70908. },
  70909. "opacity": {
  70910. "css": "text-opacity",
  70911. "doc": "A number from 0 to 1 specifying the opacity for the text",
  70912. "default-value": 1.0,
  70913. "default-meaning": "Fully opaque",
  70914. "type": "float"
  70915. },
  70916. "halo-fill": {
  70917. "css": "text-halo-fill",
  70918. "type": "color",
  70919. "default-value": "#FFFFFF",
  70920. "default-meaning": "white",
  70921. "doc": "Specifies the color of the halo around the text."
  70922. },
  70923. "halo-radius": {
  70924. "css": "text-halo-radius",
  70925. "doc": "Specify the radius of the halo in pixels",
  70926. "default-value": 0,
  70927. "default-meaning": "no halo",
  70928. "type": "float"
  70929. },
  70930. "dx": {
  70931. "css": "text-dx",
  70932. "type": "float",
  70933. "doc": "Displace text by fixed amount, in pixels, +/- along the X axis. A positive value will shift the text right",
  70934. "default-value": 0
  70935. },
  70936. "dy": {
  70937. "css": "text-dy",
  70938. "type": "float",
  70939. "doc": "Displace text by fixed amount, in pixels, +/- along the Y axis. A positive value will shift the text down",
  70940. "default-value": 0
  70941. },
  70942. "vertical-alignment": {
  70943. "css": "text-vertical-alignment",
  70944. "type": ["top", "middle", "bottom", "auto"],
  70945. "doc": "Position of label relative to point position.",
  70946. "default-value": "auto",
  70947. "default-meaning": "Default affected by value of dy; \"bottom\" for dy>0, \"top\" for dy<0."
  70948. },
  70949. "avoid-edges": {
  70950. "css": "text-avoid-edges",
  70951. "doc": "Tell positioning algorithm to avoid labeling near intersection edges.",
  70952. "default-value": false,
  70953. "type": "boolean"
  70954. },
  70955. "minimum-distance": {
  70956. "css": "text-min-distance",
  70957. "doc": "Minimum permitted distance to the next text symbolizer.",
  70958. "type": "float"
  70959. },
  70960. "minimum-padding": {
  70961. "css": "text-min-padding",
  70962. "doc": "Determines the minimum amount of padding that a text symbolizer gets relative to other text",
  70963. "type": "float"
  70964. },
  70965. "minimum-path-length": {
  70966. "css": "text-min-path-length",
  70967. "type": "float",
  70968. "default-value": 0,
  70969. "default-meaning": "place labels on all paths",
  70970. "doc": "Place labels only on paths longer than this value."
  70971. },
  70972. "allow-overlap": {
  70973. "css": "text-allow-overlap",
  70974. "type": "boolean",
  70975. "default-value": false,
  70976. "doc": "Control whether overlapping text is shown or hidden.",
  70977. "default-meaning": "Do not allow text to overlap with other text - overlapping markers will not be shown."
  70978. },
  70979. "orientation": {
  70980. "css": "text-orientation",
  70981. "type": "expression",
  70982. "doc": "Rotate the text."
  70983. },
  70984. "placement": {
  70985. "css": "text-placement",
  70986. "type": ["point", "line", "vertex", "interior"],
  70987. "default-value": "point",
  70988. "doc": "Control the style of placement of a point versus the geometry it is attached to."
  70989. },
  70990. "placement-type": {
  70991. "css": "text-placement-type",
  70992. "doc": "Re-position and/or re-size text to avoid overlaps. \"simple\" for basic algorithm (using text-placements string,) \"dummy\" to turn this feature off.",
  70993. "type": ["dummy", "simple"],
  70994. "default-value": "dummy"
  70995. },
  70996. "placements": {
  70997. "css": "text-placements",
  70998. "type": "string",
  70999. "default-value": "",
  71000. "doc": "If \"placement-type\" is set to \"simple\", use this \"POSITIONS,[SIZES]\" string. An example is `text-placements: \"E,NE,SE,W,NW,SW\";` "
  71001. },
  71002. "text-transform": {
  71003. "css": "text-transform",
  71004. "type": ["none", "uppercase", "lowercase", "capitalize"],
  71005. "doc": "Transform the case of the characters",
  71006. "default-value": "none"
  71007. },
  71008. "horizontal-alignment": {
  71009. "css": "text-horizontal-alignment",
  71010. "type": ["left", "middle", "right", "auto"],
  71011. "doc": "The text's horizontal alignment from its centerpoint",
  71012. "default-value": "auto"
  71013. },
  71014. "justify-alignment": {
  71015. "css": "text-align",
  71016. "type": ["left", "right", "center", "auto"],
  71017. "doc": "Define how text is justified",
  71018. "default-value": "auto",
  71019. "default-meaning": "Auto alignment means that text will be centered by default except when using the `placement-type` parameter - in that case either right or left justification will be used automatically depending on where the text could be fit given the `text-placements` directives"
  71020. },
  71021. "clip": {
  71022. "css": "text-clip",
  71023. "type": "boolean",
  71024. "default-value": true,
  71025. "default-meaning": "geometry will be clipped to map bounds before rendering",
  71026. "doc": "geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts."
  71027. },
  71028. "comp-op": {
  71029. "css": "text-comp-op",
  71030. "default-value": "src-over",
  71031. "default-meaning": "add the current symbolizer on top of other symbolizer",
  71032. "doc": "Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",
  71033. "type": ["clear", "src", "dst", "src-over", "dst-over", "src-in", "dst-in", "src-out", "dst-out", "src-atop", "dst-atop", "xor", "plus", "minus", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "contrast", "invert", "invert-rgb", "grain-merge", "grain-extract", "hue", "saturation", "color", "value"]
  71034. }
  71035. },
  71036. "building": {
  71037. "fill": {
  71038. "css": "building-fill",
  71039. "default-value": "#FFFFFF",
  71040. "doc": "The color of the buildings walls.",
  71041. "type": "color"
  71042. },
  71043. "fill-opacity": {
  71044. "css": "building-fill-opacity",
  71045. "type": "float",
  71046. "doc": "The opacity of the building as a whole, including all walls.",
  71047. "default-value": 1
  71048. },
  71049. "height": {
  71050. "css": "building-height",
  71051. "doc": "The height of the building in pixels.",
  71052. "type": "expression",
  71053. "default-value": "0"
  71054. }
  71055. }
  71056. },
  71057. "colors": {
  71058. "aliceblue": [240, 248, 255],
  71059. "antiquewhite": [250, 235, 215],
  71060. "aqua": [0, 255, 255],
  71061. "aquamarine": [127, 255, 212],
  71062. "azure": [240, 255, 255],
  71063. "beige": [245, 245, 220],
  71064. "bisque": [255, 228, 196],
  71065. "black": [0, 0, 0],
  71066. "blanchedalmond": [255, 235, 205],
  71067. "blue": [0, 0, 255],
  71068. "blueviolet": [138, 43, 226],
  71069. "brown": [165, 42, 42],
  71070. "burlywood": [222, 184, 135],
  71071. "cadetblue": [95, 158, 160],
  71072. "chartreuse": [127, 255, 0],
  71073. "chocolate": [210, 105, 30],
  71074. "coral": [255, 127, 80],
  71075. "cornflowerblue": [100, 149, 237],
  71076. "cornsilk": [255, 248, 220],
  71077. "crimson": [220, 20, 60],
  71078. "cyan": [0, 255, 255],
  71079. "darkblue": [0, 0, 139],
  71080. "darkcyan": [0, 139, 139],
  71081. "darkgoldenrod": [184, 134, 11],
  71082. "darkgray": [169, 169, 169],
  71083. "darkgreen": [0, 100, 0],
  71084. "darkgrey": [169, 169, 169],
  71085. "darkkhaki": [189, 183, 107],
  71086. "darkmagenta": [139, 0, 139],
  71087. "darkolivegreen": [85, 107, 47],
  71088. "darkorange": [255, 140, 0],
  71089. "darkorchid": [153, 50, 204],
  71090. "darkred": [139, 0, 0],
  71091. "darksalmon": [233, 150, 122],
  71092. "darkseagreen": [143, 188, 143],
  71093. "darkslateblue": [72, 61, 139],
  71094. "darkslategrey": [47, 79, 79],
  71095. "darkturquoise": [0, 206, 209],
  71096. "darkviolet": [148, 0, 211],
  71097. "deeppink": [255, 20, 147],
  71098. "deepskyblue": [0, 191, 255],
  71099. "dimgray": [105, 105, 105],
  71100. "dimgrey": [105, 105, 105],
  71101. "dodgerblue": [30, 144, 255],
  71102. "firebrick": [178, 34, 34],
  71103. "floralwhite": [255, 250, 240],
  71104. "forestgreen": [34, 139, 34],
  71105. "fuchsia": [255, 0, 255],
  71106. "gainsboro": [220, 220, 220],
  71107. "ghostwhite": [248, 248, 255],
  71108. "gold": [255, 215, 0],
  71109. "goldenrod": [218, 165, 32],
  71110. "gray": [128, 128, 128],
  71111. "grey": [128, 128, 128],
  71112. "green": [0, 128, 0],
  71113. "greenyellow": [173, 255, 47],
  71114. "honeydew": [240, 255, 240],
  71115. "hotpink": [255, 105, 180],
  71116. "indianred": [205, 92, 92],
  71117. "indigo": [75, 0, 130],
  71118. "ivory": [255, 255, 240],
  71119. "khaki": [240, 230, 140],
  71120. "lavender": [230, 230, 250],
  71121. "lavenderblush": [255, 240, 245],
  71122. "lawngreen": [124, 252, 0],
  71123. "lemonchiffon": [255, 250, 205],
  71124. "lightblue": [173, 216, 230],
  71125. "lightcoral": [240, 128, 128],
  71126. "lightcyan": [224, 255, 255],
  71127. "lightgoldenrodyellow": [250, 250, 210],
  71128. "lightgray": [211, 211, 211],
  71129. "lightgreen": [144, 238, 144],
  71130. "lightgrey": [211, 211, 211],
  71131. "lightpink": [255, 182, 193],
  71132. "lightsalmon": [255, 160, 122],
  71133. "lightseagreen": [32, 178, 170],
  71134. "lightskyblue": [135, 206, 250],
  71135. "lightslategray": [119, 136, 153],
  71136. "lightslategrey": [119, 136, 153],
  71137. "lightsteelblue": [176, 196, 222],
  71138. "lightyellow": [255, 255, 224],
  71139. "lime": [0, 255, 0],
  71140. "limegreen": [50, 205, 50],
  71141. "linen": [250, 240, 230],
  71142. "magenta": [255, 0, 255],
  71143. "maroon": [128, 0, 0],
  71144. "mediumaquamarine": [102, 205, 170],
  71145. "mediumblue": [0, 0, 205],
  71146. "mediumorchid": [186, 85, 211],
  71147. "mediumpurple": [147, 112, 219],
  71148. "mediumseagreen": [60, 179, 113],
  71149. "mediumslateblue": [123, 104, 238],
  71150. "mediumspringgreen": [0, 250, 154],
  71151. "mediumturquoise": [72, 209, 204],
  71152. "mediumvioletred": [199, 21, 133],
  71153. "midnightblue": [25, 25, 112],
  71154. "mintcream": [245, 255, 250],
  71155. "mistyrose": [255, 228, 225],
  71156. "moccasin": [255, 228, 181],
  71157. "navajowhite": [255, 222, 173],
  71158. "navy": [0, 0, 128],
  71159. "oldlace": [253, 245, 230],
  71160. "olive": [128, 128, 0],
  71161. "olivedrab": [107, 142, 35],
  71162. "orange": [255, 165, 0],
  71163. "orangered": [255, 69, 0],
  71164. "orchid": [218, 112, 214],
  71165. "palegoldenrod": [238, 232, 170],
  71166. "palegreen": [152, 251, 152],
  71167. "paleturquoise": [175, 238, 238],
  71168. "palevioletred": [219, 112, 147],
  71169. "papayawhip": [255, 239, 213],
  71170. "peachpuff": [255, 218, 185],
  71171. "peru": [205, 133, 63],
  71172. "pink": [255, 192, 203],
  71173. "plum": [221, 160, 221],
  71174. "powderblue": [176, 224, 230],
  71175. "purple": [128, 0, 128],
  71176. "red": [255, 0, 0],
  71177. "rosybrown": [188, 143, 143],
  71178. "royalblue": [65, 105, 225],
  71179. "saddlebrown": [139, 69, 19],
  71180. "salmon": [250, 128, 114],
  71181. "sandybrown": [244, 164, 96],
  71182. "seagreen": [46, 139, 87],
  71183. "seashell": [255, 245, 238],
  71184. "sienna": [160, 82, 45],
  71185. "silver": [192, 192, 192],
  71186. "skyblue": [135, 206, 235],
  71187. "slateblue": [106, 90, 205],
  71188. "slategray": [112, 128, 144],
  71189. "slategrey": [112, 128, 144],
  71190. "snow": [255, 250, 250],
  71191. "springgreen": [0, 255, 127],
  71192. "steelblue": [70, 130, 180],
  71193. "tan": [210, 180, 140],
  71194. "teal": [0, 128, 128],
  71195. "thistle": [216, 191, 216],
  71196. "tomato": [255, 99, 71],
  71197. "turquoise": [64, 224, 208],
  71198. "violet": [238, 130, 238],
  71199. "wheat": [245, 222, 179],
  71200. "white": [255, 255, 255],
  71201. "whitesmoke": [245, 245, 245],
  71202. "yellow": [255, 255, 0],
  71203. "yellowgreen": [154, 205, 50],
  71204. "transparent": [0, 0, 0, 0]
  71205. },
  71206. "filter": {
  71207. "value": ["true", "false", "null", "point", "linestring", "polygon", "collection"]
  71208. }
  71209. };
  71210. CartoCSS['mapnik_reference'] = {
  71211. version: {
  71212. latest: _mapnik_reference_latest,
  71213. '2.1.1': _mapnik_reference_latest
  71214. }
  71215. };
  71216. CartoCSS.Tree = {};
  71217. CartoCSS.Tree.operate = function (op, a, b) {
  71218. switch (op) {
  71219. case '+':
  71220. return a + b;
  71221. case '-':
  71222. return a - b;
  71223. case '*':
  71224. return a * b;
  71225. case '%':
  71226. return a % b;
  71227. case '/':
  71228. return a / b;
  71229. }
  71230. };
  71231. CartoCSS.Tree.functions = {
  71232. rgb: function rgb(r, g, b) {
  71233. return this.rgba(r, g, b, 1.0);
  71234. },
  71235. rgba: function rgba(r, g, b, a) {
  71236. var me = this;
  71237. var rgb = [r, g, b].map(function (c) {
  71238. return me.number(c);
  71239. });
  71240. a = me.number(a);
  71241. if (rgb.some(isNaN) || isNaN(a)) {
  71242. return null;
  71243. }
  71244. return new CartoCSS.Tree.Color(rgb, a);
  71245. },
  71246. // Only require val
  71247. stop: function stop(val) {
  71248. var color, mode;
  71249. if (arguments.length > 1) {
  71250. color = arguments[1];
  71251. }
  71252. if (arguments.length > 2) {
  71253. mode = arguments[2];
  71254. }
  71255. return {
  71256. is: 'tag',
  71257. val: val,
  71258. color: color,
  71259. mode: mode,
  71260. toString: function toString(env) {
  71261. return '\n\t<stop value="' + val.ev(env) + '"' + (color ? ' color="' + color.ev(env) + '" ' : '') + (mode ? ' mode="' + mode.ev(env) + '" ' : '') + '/>';
  71262. }
  71263. };
  71264. },
  71265. hsl: function hsl(h, s, l) {
  71266. return this.hsla(h, s, l, 1.0);
  71267. },
  71268. hsla: function hsla(h, s, l, a) {
  71269. h = this.number(h) % 360 / 360;
  71270. s = this.number(s);
  71271. l = this.number(l);
  71272. a = this.number(a);
  71273. if ([h, s, l, a].some(isNaN)) {
  71274. return null;
  71275. }
  71276. var m2 = l <= 0.5 ? l * (s + 1) : l + s - l * s,
  71277. m1 = l * 2 - m2;
  71278. return this.rgba(hue(h + 1 / 3) * 255, hue(h) * 255, hue(h - 1 / 3) * 255, a);
  71279. function hue(h) {
  71280. h = h < 0 ? h + 1 : h > 1 ? h - 1 : h;
  71281. if (h * 6 < 1) {
  71282. return m1 + (m2 - m1) * h * 6;
  71283. } else if (h * 2 < 1) {
  71284. return m2;
  71285. } else if (h * 3 < 2) {
  71286. return m1 + (m2 - m1) * (2 / 3 - h) * 6;
  71287. } else {
  71288. return m1;
  71289. }
  71290. }
  71291. },
  71292. hue: function hue(color) {
  71293. if (!('toHSL' in color)) {
  71294. return null;
  71295. }
  71296. return new CartoCSS.Tree.Dimension(Math.round(color.toHSL().h));
  71297. },
  71298. saturation: function saturation(color) {
  71299. if (!('toHSL' in color)) {
  71300. return null;
  71301. }
  71302. return new CartoCSS.Tree.Dimension(Math.round(color.toHSL().s * 100), '%');
  71303. },
  71304. lightness: function lightness(color) {
  71305. if (!('toHSL' in color)) {
  71306. return null;
  71307. }
  71308. return new CartoCSS.Tree.Dimension(Math.round(color.toHSL().l * 100), '%');
  71309. },
  71310. alpha: function alpha(color) {
  71311. if (!('toHSL' in color)) {
  71312. return null;
  71313. }
  71314. return new CartoCSS.Tree.Dimension(color.toHSL().a);
  71315. },
  71316. saturate: function saturate(color, amount) {
  71317. if (!('toHSL' in color)) {
  71318. return null;
  71319. }
  71320. var hsl = color.toHSL();
  71321. hsl.s += amount.value / 100;
  71322. hsl.s = this.clamp(hsl.s);
  71323. return this.hsla_simple(hsl);
  71324. },
  71325. desaturate: function desaturate(color, amount) {
  71326. if (!('toHSL' in color)) {
  71327. return null;
  71328. }
  71329. var hsl = color.toHSL();
  71330. hsl.s -= amount.value / 100;
  71331. hsl.s = this.clamp(hsl.s);
  71332. return this.hsla_simple(hsl);
  71333. },
  71334. lighten: function lighten(color, amount) {
  71335. if (!('toHSL' in color)) {
  71336. return null;
  71337. }
  71338. var hsl = color.toHSL();
  71339. hsl.l += amount.value / 100;
  71340. hsl.l = this.clamp(hsl.l);
  71341. return this.hsla_simple(hsl);
  71342. },
  71343. darken: function darken(color, amount) {
  71344. if (!('toHSL' in color)) {
  71345. return null;
  71346. }
  71347. var hsl = color.toHSL();
  71348. hsl.l -= amount.value / 100;
  71349. hsl.l = this.clamp(hsl.l);
  71350. return this.hsla_simple(hsl);
  71351. },
  71352. fadein: function fadein(color, amount) {
  71353. if (!('toHSL' in color)) {
  71354. return null;
  71355. }
  71356. var hsl = color.toHSL();
  71357. hsl.a += amount.value / 100;
  71358. hsl.a = this.clamp(hsl.a);
  71359. return this.hsla_simple(hsl);
  71360. },
  71361. fadeout: function fadeout(color, amount) {
  71362. if (!('toHSL' in color)) {
  71363. return null;
  71364. }
  71365. var hsl = color.toHSL();
  71366. hsl.a -= amount.value / 100;
  71367. hsl.a = this.clamp(hsl.a);
  71368. return this.hsla_simple(hsl);
  71369. },
  71370. spin: function spin(color, amount) {
  71371. if (!('toHSL' in color)) {
  71372. return null;
  71373. }
  71374. var hsl = color.toHSL();
  71375. var hue = (hsl.h + amount.value) % 360;
  71376. hsl.h = hue < 0 ? 360 + hue : hue;
  71377. return this.hsla_simple(hsl);
  71378. },
  71379. replace: function replace(entity, a, b) {
  71380. if (entity.is === 'field') {
  71381. return entity.toString + '.replace(' + a.toString() + ', ' + b.toString() + ')';
  71382. } else {
  71383. return entity.replace(a, b);
  71384. }
  71385. },
  71386. //
  71387. // Copyright (c) 2006-2009 Hampton Catlin, Nathan Weizenbaum, and Chris Eppstein
  71388. // http://sass-lang.com
  71389. //
  71390. mix: function mix(color1, color2, weight) {
  71391. var p = weight.value / 100.0;
  71392. var w = p * 2 - 1;
  71393. var a = color1.toHSL().a - color2.toHSL().a;
  71394. var w1 = ((w * a == -1 ? w : (w + a) / (1 + w * a)) + 1) / 2.0;
  71395. var w2 = 1 - w1;
  71396. var rgb = [color1.rgb[0] * w1 + color2.rgb[0] * w2, color1.rgb[1] * w1 + color2.rgb[1] * w2, color1.rgb[2] * w1 + color2.rgb[2] * w2];
  71397. var alpha = color1.alpha * p + color2.alpha * (1 - p);
  71398. return new CartoCSS.Tree.Color(rgb, alpha);
  71399. },
  71400. greyscale: function greyscale(color) {
  71401. return this.desaturate(color, new CartoCSS.Tree.Dimension(100));
  71402. },
  71403. '%': function _(quoted /* arg, arg, ...*/) {
  71404. var args = Array.prototype.slice.call(arguments, 1),
  71405. str = quoted.value;
  71406. for (var i = 0; i < args.length; i++) {
  71407. str = str.replace(/%s/, args[i].value).replace(/%[da]/, args[i].toString());
  71408. }
  71409. str = str.replace(/%%/g, '%');
  71410. return new CartoCSS.Tree.Quoted(str);
  71411. },
  71412. hsla_simple: function hsla_simple(h) {
  71413. return this.hsla(h.h, h.s, h.l, h.a);
  71414. },
  71415. number: function number(n) {
  71416. if (n instanceof CartoCSS.Tree.Dimension) {
  71417. return parseFloat(n.unit === '%' ? n.value / 100 : n.value);
  71418. } else if (typeof n === 'number') {
  71419. return n;
  71420. } else {
  71421. return NaN;
  71422. }
  71423. },
  71424. clamp: function clamp(val) {
  71425. return Math.min(1, Math.max(0, val));
  71426. }
  71427. };
  71428. CartoCSS.Tree.Call = /*#__PURE__*/function () {
  71429. function Call(name, args, index) {
  71430. CartoCSS_classCallCheck(this, Call);
  71431. this.is = 'call';
  71432. this.name = name;
  71433. this.args = args;
  71434. this.index = index;
  71435. }
  71436. // When evuating a function call,
  71437. // we either find the function in `tree.functions` [1],
  71438. // in which case we call it, passing the evaluated arguments,
  71439. // or we simply print it out as it appeared originally [2].
  71440. // The *functions.js* file contains the built-in functions.
  71441. // The reason why we evaluate the arguments, is in the case where
  71442. // we try to pass a variable to a function, like: `saturate(@color)`.
  71443. // The function should receive the value, not the variable.
  71444. CartoCSS_createClass(Call, [{
  71445. key: 'ev',
  71446. value: function ev(env) {
  71447. var args = this.args.map(function (a) {
  71448. return a.ev(env);
  71449. });
  71450. for (var i = 0; i < args.length; i++) {
  71451. if (args[i].is === 'undefined') {
  71452. return {
  71453. is: 'undefined',
  71454. value: 'undefined'
  71455. };
  71456. }
  71457. }
  71458. if (this.name in CartoCSS.Tree.functions) {
  71459. if (CartoCSS.Tree.functions[this.name].length <= args.length) {
  71460. var val = CartoCSS.Tree.functions[this.name].apply(CartoCSS.Tree.functions, args);
  71461. if (val === null) {
  71462. env.error({
  71463. message: 'incorrect arguments given to ' + this.name + '()',
  71464. index: this.index,
  71465. type: 'runtime',
  71466. filename: this.filename
  71467. });
  71468. return {
  71469. is: 'undefined',
  71470. value: 'undefined'
  71471. };
  71472. }
  71473. return val;
  71474. } else {
  71475. env.error({
  71476. message: 'incorrect number of arguments for ' + this.name + '(). ' + CartoCSS.Tree.functions[this.name].length + ' expected.',
  71477. index: this.index,
  71478. type: 'runtime',
  71479. filename: this.filename
  71480. });
  71481. return {
  71482. is: 'undefined',
  71483. value: 'undefined'
  71484. };
  71485. }
  71486. } else {
  71487. var fn = CartoCSS.Tree.Reference.mapnikFunctions[this.name];
  71488. if (fn === undefined) {
  71489. var functions = lodash_topairs_default()(CartoCSS.Tree.Reference.mapnikFunctions);
  71490. // cheap closest, needs improvement.
  71491. var name = this.name;
  71492. var mean = functions.map(function (f) {
  71493. return [f[0], CartoCSS.Tree.Reference.editDistance(name, f[0]), f[1]];
  71494. }).sort(function (a, b) {
  71495. return a[1] - b[1];
  71496. });
  71497. env.error({
  71498. message: 'unknown function ' + this.name + '(), did you mean ' + mean[0][0] + '(' + mean[0][2] + ')',
  71499. index: this.index,
  71500. type: 'runtime',
  71501. filename: this.filename
  71502. });
  71503. return {
  71504. is: 'undefined',
  71505. value: 'undefined'
  71506. };
  71507. }
  71508. if (fn !== args.length &&
  71509. // support variable-arg functions like `colorize-alpha`
  71510. fn !== -1) {
  71511. env.error({
  71512. message: 'function ' + this.name + '() takes ' + fn + ' arguments and was given ' + args.length,
  71513. index: this.index,
  71514. type: 'runtime',
  71515. filename: this.filename
  71516. });
  71517. return {
  71518. is: 'undefined',
  71519. value: 'undefined'
  71520. };
  71521. } else {
  71522. // Save the evaluated versions of arguments
  71523. this.args = args;
  71524. return this;
  71525. }
  71526. }
  71527. }
  71528. }, {
  71529. key: "toString",
  71530. value: function toString(env, format) {
  71531. if (this.args.length) {
  71532. return this.name + '(' + this.args.join(',') + ')';
  71533. } else {
  71534. return this.name;
  71535. }
  71536. }
  71537. }]);
  71538. return Call;
  71539. }();
  71540. CartoCSS.Tree.Color = /*#__PURE__*/function () {
  71541. function Color(rgb, a) {
  71542. CartoCSS_classCallCheck(this, Color);
  71543. this.is = 'color';
  71544. // The end goal here, is to parse the arguments
  71545. // into an integer triplet, such as `128, 255, 0`
  71546. //
  71547. // This facilitates operations and conversions.
  71548. if (Array.isArray(rgb)) {
  71549. this.rgb = rgb.slice(0, 3);
  71550. } else if (rgb.length == 6) {
  71551. this.rgb = rgb.match(/.{2}/g).map(function (c) {
  71552. return parseInt(c, 16);
  71553. });
  71554. } else {
  71555. this.rgb = rgb.split('').map(function (c) {
  71556. return parseInt(c + c, 16);
  71557. });
  71558. }
  71559. if (typeof a === 'number') {
  71560. this.alpha = a;
  71561. } else if (rgb.length === 4) {
  71562. this.alpha = rgb[3];
  71563. } else {
  71564. this.alpha = 1;
  71565. }
  71566. }
  71567. CartoCSS_createClass(Color, [{
  71568. key: 'ev',
  71569. value: function ev() {
  71570. return this;
  71571. }
  71572. // If we have some transparency, the only way to represent it
  71573. // is via `rgba`. Otherwise, we use the hex representation,
  71574. // which has better compatibility with older browsers.
  71575. // Values are capped between `0` and `255`, rounded and zero-padded.
  71576. }, {
  71577. key: "toString",
  71578. value: function toString() {
  71579. /* if (this.alpha < 1.0) {*/
  71580. return 'rgba(' + this.rgb.map(function (c) {
  71581. return Math.round(c);
  71582. }).concat(this.alpha).join(', ') + ')';
  71583. /*} else {
  71584. return '#' + this.rgb.map(function(i) {
  71585. i = Math.round(i);
  71586. i = (i > 255 ? 255 : (i < 0 ? 0 : i)).toString(16);
  71587. return i.length === 1 ? '0' + i : i;
  71588. }).join('');
  71589. }*/
  71590. }
  71591. // Operations have to be done per-channel, if not,
  71592. // channels will spill onto each other. Once we have
  71593. // our result, in the form of an integer triplet,
  71594. // we create a new Color node to hold the result.
  71595. }, {
  71596. key: "operate",
  71597. value: function operate(env, op, other) {
  71598. var result = [];
  71599. if (!(other instanceof CartoCSS.Tree.Color)) {
  71600. other = other.toColor();
  71601. }
  71602. for (var c = 0; c < 3; c++) {
  71603. result[c] = CartoCSS.Tree.operate(op, this.rgb[c], other.rgb[c]);
  71604. }
  71605. return new CartoCSS.Tree.Color(result);
  71606. }
  71607. }, {
  71608. key: "toHSL",
  71609. value: function toHSL() {
  71610. var r = this.rgb[0] / 255,
  71611. g = this.rgb[1] / 255,
  71612. b = this.rgb[2] / 255,
  71613. a = this.alpha;
  71614. var max = Math.max(r, g, b),
  71615. min = Math.min(r, g, b);
  71616. var h,
  71617. s,
  71618. l = (max + min) / 2,
  71619. d = max - min;
  71620. if (max === min) {
  71621. h = s = 0;
  71622. } else {
  71623. s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
  71624. switch (max) {
  71625. case r:
  71626. h = (g - b) / d + (g < b ? 6 : 0);
  71627. break;
  71628. case g:
  71629. h = (b - r) / d + 2;
  71630. break;
  71631. case b:
  71632. h = (r - g) / d + 4;
  71633. break;
  71634. default:
  71635. break;
  71636. }
  71637. h /= 6;
  71638. }
  71639. return {
  71640. h: h * 360,
  71641. s: s,
  71642. l: l,
  71643. a: a
  71644. };
  71645. }
  71646. }]);
  71647. return Color;
  71648. }();
  71649. CartoCSS.Tree.Comment = /*#__PURE__*/function () {
  71650. function Comment(value, silent) {
  71651. CartoCSS_classCallCheck(this, Comment);
  71652. this.value = value;
  71653. this.silent = !!silent;
  71654. }
  71655. CartoCSS_createClass(Comment, [{
  71656. key: "toString",
  71657. value: function toString(env) {
  71658. return '<!--' + this.value + '-->';
  71659. }
  71660. }, {
  71661. key: 'ev',
  71662. value: function ev() {
  71663. return this;
  71664. }
  71665. }]);
  71666. return Comment;
  71667. }();
  71668. CartoCSS.Tree.Definition = /*#__PURE__*/function () {
  71669. function Definition(selector, rules) {
  71670. CartoCSS_classCallCheck(this, Definition);
  71671. this.elements = selector.elements;
  71672. //assert.ok(selector.filters instanceof CartoCSS.Tree.Filterset);
  71673. this.rules = rules;
  71674. this.ruleIndex = {};
  71675. for (var i = 0; i < this.rules.length; i++) {
  71676. if ('zoom' in this.rules[i]) {
  71677. this.rules[i] = this.rules[i].clone();
  71678. }
  71679. this.rules[i].zoom = selector.zoom;
  71680. this.ruleIndex[this.rules[i].updateID()] = true;
  71681. }
  71682. this.filters = selector.filters;
  71683. this.zoom = selector.zoom;
  71684. this.attachment = selector.attachment || '__default__';
  71685. this.specificity = selector.specificity();
  71686. }
  71687. CartoCSS_createClass(Definition, [{
  71688. key: "toString",
  71689. value: function toString() {
  71690. var str = this.filters.toString();
  71691. for (var i = 0; i < this.rules.length; i++) {
  71692. str += '\n ' + this.rules[i];
  71693. }
  71694. return str;
  71695. }
  71696. }, {
  71697. key: "toJS",
  71698. value: function toJS(env) {
  71699. var shaderAttrs = {};
  71700. // merge conditions from filters with zoom condition of the
  71701. // definition
  71702. var zoom = this.zoom;
  71703. //var frame_offset = this.frame_offset;
  71704. var _if = this.filters.toJS(env);
  71705. var filters = [zoom];
  71706. if (_if) {
  71707. filters.push(_if);
  71708. }
  71709. //if(frame_offset) filters.push('ctx["frame-offset"] === ' + frame_offset);
  71710. _if = filters.join(" && ");
  71711. function eachRule(rule) {
  71712. if (rule instanceof CartoCSS.Tree.Rule) {
  71713. shaderAttrs[rule.name] = shaderAttrs[rule.name] || [];
  71714. if (_if) {
  71715. shaderAttrs[rule.name].push("if(" + _if + "){" + rule.value.toJS(env) + "}");
  71716. } else {
  71717. shaderAttrs[rule.name].push(rule.value.toJS(env));
  71718. }
  71719. } else {
  71720. if (rule instanceof CartoCSS.Tree.Ruleset) {
  71721. var sh = rule.toJS(env);
  71722. for (var v in sh) {
  71723. shaderAttrs[v] = shaderAttrs[v] || [];
  71724. for (var attr in sh[v]) {
  71725. shaderAttrs[v].push(sh[v][attr]);
  71726. }
  71727. }
  71728. }
  71729. }
  71730. }
  71731. for (var id in this.rules) {
  71732. eachRule(this.rules[id]);
  71733. }
  71734. return shaderAttrs;
  71735. }
  71736. }]);
  71737. return Definition;
  71738. }();
  71739. CartoCSS.Tree.Dimension = /*#__PURE__*/function () {
  71740. function Dimension(value, unit, index) {
  71741. CartoCSS_classCallCheck(this, Dimension);
  71742. this.is = 'float';
  71743. this.physical_units = ['m', 'cm', 'in', 'mm', 'pt', 'pc'];
  71744. this.screen_units = ['px', '%'];
  71745. this.all_units = ['m', 'cm', 'in', 'mm', 'pt', 'pc', 'px', '%'];
  71746. this.densities = {
  71747. m: 0.0254,
  71748. mm: 25.4,
  71749. cm: 2.54,
  71750. pt: 72,
  71751. pc: 6
  71752. };
  71753. this.value = parseFloat(value);
  71754. this.unit = unit || null;
  71755. this.index = index;
  71756. }
  71757. CartoCSS_createClass(Dimension, [{
  71758. key: "ev",
  71759. value: function ev(env) {
  71760. if (this.unit && this.all_units.indexOf(this.unit) < 0) {
  71761. env.error({
  71762. message: "Invalid unit: '" + this.unit + "'",
  71763. index: this.index
  71764. });
  71765. return {
  71766. is: 'undefined',
  71767. value: 'undefined'
  71768. };
  71769. }
  71770. // normalize units which are not px or %
  71771. if (this.unit && this.physical_units.indexOf(this.unit) >= 0) {
  71772. if (!env.ppi) {
  71773. env.error({
  71774. message: "ppi is not set, so metric units can't be used",
  71775. index: this.index
  71776. });
  71777. return {
  71778. is: 'undefined',
  71779. value: 'undefined'
  71780. };
  71781. }
  71782. // convert all units to inch
  71783. // convert inch to px using ppi
  71784. this.value = this.value / this.densities[this.unit] * env.ppi;
  71785. this.unit = 'px';
  71786. }
  71787. return this;
  71788. }
  71789. }, {
  71790. key: "toColor",
  71791. value: function toColor() {
  71792. return new CartoCSS.Tree.Color([this.value, this.value, this.value]);
  71793. }
  71794. }, {
  71795. key: "round",
  71796. value: function round() {
  71797. this.value = Math.round(this.value);
  71798. return this;
  71799. }
  71800. }, {
  71801. key: "toString",
  71802. value: function toString() {
  71803. return this.value.toString();
  71804. }
  71805. }, {
  71806. key: "operate",
  71807. value: function operate(env, op, other) {
  71808. if (this.unit === '%' && other.unit !== '%') {
  71809. env.error({
  71810. message: 'If two operands differ, the first must not be %',
  71811. index: this.index
  71812. });
  71813. return {
  71814. is: 'undefined',
  71815. value: 'undefined'
  71816. };
  71817. }
  71818. if (this.unit !== '%' && other.unit === '%') {
  71819. if (op === '*' || op === '/' || op === '%') {
  71820. env.error({
  71821. message: 'Percent values can only be added or subtracted from other values',
  71822. index: this.index
  71823. });
  71824. return {
  71825. is: 'undefined',
  71826. value: 'undefined'
  71827. };
  71828. }
  71829. return new CartoCSS.Tree.Dimension(CartoCSS.Tree.operate(op, this.value, this.value * other.value * 0.01), this.unit);
  71830. }
  71831. //here the operands are either the same (% or undefined or px), or one is undefined and the other is px
  71832. return new CartoCSS.Tree.Dimension(CartoCSS.Tree.operate(op, this.value, other.value), this.unit || other.unit);
  71833. }
  71834. }]);
  71835. return Dimension;
  71836. }();
  71837. CartoCSS.Tree.Element = /*#__PURE__*/function () {
  71838. function Element(value) {
  71839. CartoCSS_classCallCheck(this, Element);
  71840. this.value = value.trim();
  71841. if (this.value[0] === '#') {
  71842. this.type = 'id';
  71843. this.clean = this.value.replace(/^#/, '');
  71844. }
  71845. if (this.value[0] === '.') {
  71846. this.type = 'class';
  71847. this.clean = this.value.replace(/^\./, '');
  71848. }
  71849. if (this.value.indexOf('*') !== -1) {
  71850. this.type = 'wildcard';
  71851. }
  71852. }
  71853. CartoCSS_createClass(Element, [{
  71854. key: "specificity",
  71855. value: function specificity() {
  71856. return [this.type === 'id' ? 1 : 0,
  71857. // a
  71858. this.type === 'class' ? 1 : 0 // b
  71859. ];
  71860. }
  71861. }, {
  71862. key: "toString",
  71863. value: function toString() {
  71864. return this.value;
  71865. }
  71866. }]);
  71867. return Element;
  71868. }();
  71869. CartoCSS.Tree.Expression = /*#__PURE__*/function () {
  71870. function Expression(value) {
  71871. CartoCSS_classCallCheck(this, Expression);
  71872. this.is = 'expression';
  71873. this.value = value;
  71874. }
  71875. CartoCSS_createClass(Expression, [{
  71876. key: "ev",
  71877. value: function ev(env) {
  71878. if (this.value.length > 1) {
  71879. return new CartoCSS.Tree.Expression(this.value.map(function (e) {
  71880. return e.ev(env);
  71881. }));
  71882. } else {
  71883. return this.value[0].ev(env);
  71884. }
  71885. }
  71886. }, {
  71887. key: "toString",
  71888. value: function toString(env) {
  71889. return this.value.map(function (e) {
  71890. return e.toString(env);
  71891. }).join(' ');
  71892. }
  71893. }]);
  71894. return Expression;
  71895. }();
  71896. CartoCSS.Tree.Field = /*#__PURE__*/function () {
  71897. function Field(content) {
  71898. CartoCSS_classCallCheck(this, Field);
  71899. this.is = 'field';
  71900. this.value = content || '';
  71901. }
  71902. CartoCSS_createClass(Field, [{
  71903. key: "toString",
  71904. value: function toString() {
  71905. return '["' + this.value.toUpperCase() + '"]';
  71906. }
  71907. }, {
  71908. key: 'ev',
  71909. value: function ev() {
  71910. return this;
  71911. }
  71912. }]);
  71913. return Field;
  71914. }();
  71915. CartoCSS.Tree.Filter = /*#__PURE__*/function () {
  71916. function Filter(key, op, val, index, filename) {
  71917. CartoCSS_classCallCheck(this, Filter);
  71918. this.ops = {
  71919. '<': [' &lt; ', 'numeric'],
  71920. '>': [' &gt; ', 'numeric'],
  71921. '=': [' = ', 'both'],
  71922. '!=': [' != ', 'both'],
  71923. '<=': [' &lt;= ', 'numeric'],
  71924. '>=': [' &gt;= ', 'numeric'],
  71925. '=~': ['.match(', 'string', ')']
  71926. };
  71927. this.key = key;
  71928. this.op = op;
  71929. this.val = val;
  71930. this.index = index;
  71931. this.filename = filename;
  71932. this.id = this.key + this.op + this.val;
  71933. }
  71934. CartoCSS_createClass(Filter, [{
  71935. key: "ev",
  71936. value: function ev(env) {
  71937. this.key = this.key.ev(env);
  71938. this.val = this.val.ev(env);
  71939. return this;
  71940. }
  71941. }, {
  71942. key: "toString",
  71943. value: function toString() {
  71944. return '[' + this.id + ']';
  71945. }
  71946. }]);
  71947. return Filter;
  71948. }();
  71949. CartoCSS.Tree.Filterset = /*#__PURE__*/function () {
  71950. function Filterset() {
  71951. CartoCSS_classCallCheck(this, Filterset);
  71952. this.filters = {};
  71953. }
  71954. CartoCSS_createClass(Filterset, [{
  71955. key: "toJS",
  71956. value: function toJS(env) {
  71957. function eachFilter(filter) {
  71958. var op = filter.op;
  71959. if (op === "=") {
  71960. op = "==";
  71961. }
  71962. var val = filter.val;
  71963. if (filter._val !== undefined) {
  71964. val = filter._val.toString(true);
  71965. }
  71966. //对scale进行特殊处理,将值转换成数值
  71967. if (filter.key && filter.key.value === 'scale') {
  71968. val = +val;
  71969. } else if (typeof val === 'string' || CartoCSS_typeof(val) === 'object') {
  71970. val = "'" + val + "'";
  71971. }
  71972. var attrs = "attributes";
  71973. return attrs + "&&" + attrs + filter.key + "&&" + attrs + filter.key + " " + op + val;
  71974. }
  71975. var results = [];
  71976. for (var id in this.filters) {
  71977. results.push(eachFilter(this.filters[id]));
  71978. }
  71979. return results.join(' && ');
  71980. }
  71981. }, {
  71982. key: "toString",
  71983. value: function toString() {
  71984. var arr = [];
  71985. for (var id in this.filters) {
  71986. arr.push(this.filters[id].id);
  71987. }
  71988. return arr.sort().join('\t');
  71989. }
  71990. }, {
  71991. key: "ev",
  71992. value: function ev(env) {
  71993. for (var i in this.filters) {
  71994. this.filters[i].ev(env);
  71995. }
  71996. return this;
  71997. }
  71998. }, {
  71999. key: "clone",
  72000. value: function clone() {
  72001. var clone = new CartoCSS.Tree.Filterset();
  72002. for (var id in this.filters) {
  72003. clone.filters[id] = this.filters[id];
  72004. }
  72005. return clone;
  72006. }
  72007. }, {
  72008. key: "cloneWith",
  72009. value: function cloneWith(other) {
  72010. var additions = [];
  72011. for (var id in other.filters) {
  72012. var status = this.addable(other.filters[id]);
  72013. // status is true, false or null. if it's null we don't fail this
  72014. // clone nor do we add the filter.
  72015. if (status === false) {
  72016. return false;
  72017. }
  72018. if (status === true) {
  72019. // Adding the filter will override another value.
  72020. additions.push(other.filters[id]);
  72021. }
  72022. }
  72023. // Adding the other filters doesn't make this filterset invalid, but it
  72024. // doesn't add anything to it either.
  72025. if (!additions.length) {
  72026. return null;
  72027. }
  72028. // We can successfully add all filters. Now clone the filterset and add the
  72029. // new rules.
  72030. var clone = new CartoCSS.Tree.Filterset();
  72031. // We can add the rules that are already present without going through the
  72032. // add function as a Filterset is always in it's simplest canonical form.
  72033. for (id in this.filters) {
  72034. clone.filters[id] = this.filters[id];
  72035. }
  72036. // Only add new filters that actually change the filter.
  72037. while (id = additions.shift()) {
  72038. clone.add(id);
  72039. }
  72040. return clone;
  72041. }
  72042. }, {
  72043. key: "addable",
  72044. value: function addable(filter) {
  72045. var key = filter.key.toString(),
  72046. value = filter.val.toString();
  72047. if (value.match(/^[0-9]+(\.[0-9]*)?_match/)) {
  72048. value = parseFloat(value);
  72049. }
  72050. switch (filter.op) {
  72051. case '=':
  72052. // if there is already foo= and we're adding foo=
  72053. if (this.filters[key + '='] !== undefined) {
  72054. if (this.filters[key + '='].val.toString() != value) {
  72055. return false;
  72056. } else {
  72057. return null;
  72058. }
  72059. }
  72060. if (this.filters[key + '!=' + value] !== undefined) {
  72061. return false;
  72062. }
  72063. if (this.filters[key + '>'] !== undefined && this.filters[key + '>'].val >= value) {
  72064. return false;
  72065. }
  72066. if (this.filters[key + '<'] !== undefined && this.filters[key + '<'].val <= value) {
  72067. return false;
  72068. }
  72069. if (this.filters[key + '>='] !== undefined && this.filters[key + '>='].val > value) {
  72070. return false;
  72071. }
  72072. if (this.filters[key + '<='] !== undefined && this.filters[key + '<='].val < value) {
  72073. return false;
  72074. }
  72075. return true;
  72076. case '=~':
  72077. return true;
  72078. case '!=':
  72079. if (this.filters[key + '='] !== undefined) {
  72080. return this.filters[key + '='].val === value ? false : null;
  72081. }
  72082. if (this.filters[key + '!=' + value] !== undefined) {
  72083. return null;
  72084. }
  72085. if (this.filters[key + '>'] !== undefined && this.filters[key + '>'].val >= value) {
  72086. return null;
  72087. }
  72088. if (this.filters[key + '<'] !== undefined && this.filters[key + '<'].val <= value) {
  72089. return null;
  72090. }
  72091. if (this.filters[key + '>='] !== undefined && this.filters[key + '>='].val > value) {
  72092. return null;
  72093. }
  72094. if (this.filters[key + '<='] !== undefined && this.filters[key + '<='].val < value) {
  72095. return null;
  72096. }
  72097. return true;
  72098. case '>':
  72099. if (key + '=' in this.filters) {
  72100. if (this.filters[key + '='].val <= value) {
  72101. return false;
  72102. } else {
  72103. return null;
  72104. }
  72105. }
  72106. if (this.filters[key + '<'] !== undefined && this.filters[key + '<'].val <= value) {
  72107. return false;
  72108. }
  72109. if (this.filters[key + '<='] !== undefined && this.filters[key + '<='].val <= value) {
  72110. return false;
  72111. }
  72112. if (this.filters[key + '>'] !== undefined && this.filters[key + '>'].val >= value) {
  72113. return null;
  72114. }
  72115. if (this.filters[key + '>='] !== undefined && this.filters[key + '>='].val > value) {
  72116. return null;
  72117. }
  72118. return true;
  72119. case '>=':
  72120. if (this.filters[key + '='] !== undefined) {
  72121. return this.filters[key + '='].val < value ? false : null;
  72122. }
  72123. if (this.filters[key + '<'] !== undefined && this.filters[key + '<'].val <= value) {
  72124. return false;
  72125. }
  72126. if (this.filters[key + '<='] !== undefined && this.filters[key + '<='].val < value) {
  72127. return false;
  72128. }
  72129. if (this.filters[key + '>'] !== undefined && this.filters[key + '>'].val >= value) {
  72130. return null;
  72131. }
  72132. if (this.filters[key + '>='] !== undefined && this.filters[key + '>='].val >= value) {
  72133. return null;
  72134. }
  72135. return true;
  72136. case '<':
  72137. if (this.filters[key + '='] !== undefined) {
  72138. return this.filters[key + '='].val >= value ? false : null;
  72139. }
  72140. if (this.filters[key + '>'] !== undefined && this.filters[key + '>'].val >= value) {
  72141. return false;
  72142. }
  72143. if (this.filters[key + '>='] !== undefined && this.filters[key + '>='].val >= value) {
  72144. return false;
  72145. }
  72146. if (this.filters[key + '<'] !== undefined && this.filters[key + '<'].val <= value) {
  72147. return null;
  72148. }
  72149. if (this.filters[key + '<='] !== undefined && this.filters[key + '<='].val < value) {
  72150. return null;
  72151. }
  72152. return true;
  72153. case '<=':
  72154. if (this.filters[key + '='] !== undefined) {
  72155. return this.filters[key + '='].val > value ? false : null;
  72156. }
  72157. if (this.filters[key + '>'] !== undefined && this.filters[key + '>'].val >= value) {
  72158. return false;
  72159. }
  72160. if (this.filters[key + '>='] !== undefined && this.filters[key + '>='].val > value) {
  72161. return false;
  72162. }
  72163. if (this.filters[key + '<'] !== undefined && this.filters[key + '<'].val <= value) {
  72164. return null;
  72165. }
  72166. if (this.filters[key + '<='] !== undefined && this.filters[key + '<='].val <= value) {
  72167. return null;
  72168. }
  72169. return true;
  72170. default:
  72171. break;
  72172. }
  72173. }
  72174. }, {
  72175. key: "conflict",
  72176. value: function conflict(filter) {
  72177. var key = filter.key.toString(),
  72178. value = filter.val.toString();
  72179. if (!isNaN(parseFloat(value))) {
  72180. value = parseFloat(value);
  72181. }
  72182. // if (a=b) && (a=c)
  72183. // if (a=b) && (a!=b)
  72184. // or (a!=b) && (a=b)
  72185. if (filter.op === '=' && this.filters[key + '='] !== undefined && value != this.filters[key + '='].val.toString() || filter.op === '!=' && this.filters[key + '='] !== undefined && value == this.filters[key + '='].val.toString() || filter.op === '=' && this.filters[key + '!='] !== undefined && value === this.filters[key + '!='].val.toString()) {
  72186. return filter.toString() + ' added to ' + this.toString() + ' produces an invalid filter';
  72187. }
  72188. return false;
  72189. }
  72190. }, {
  72191. key: "add",
  72192. value: function add(filter, env) {
  72193. var key = filter.key.toString(),
  72194. op = filter.op,
  72195. conflict = this.conflict(filter),
  72196. numval;
  72197. if (conflict) {
  72198. return conflict;
  72199. }
  72200. if (op === '=') {
  72201. for (var i in this.filters) {
  72202. if (this.filters[i].key === key) {
  72203. delete this.filters[i];
  72204. }
  72205. }
  72206. this.filters[key + '='] = filter;
  72207. } else if (op === '!=') {
  72208. this.filters[key + '!=' + filter.val] = filter;
  72209. } else if (op === '=~') {
  72210. this.filters[key + '=~' + filter.val] = filter;
  72211. } else if (op === '>') {
  72212. // If there are other filters that are also >
  72213. // but are less than this one, they don't matter, so
  72214. // remove them.
  72215. for (var j in this.filters) {
  72216. if (this.filters[j].key === key && this.filters[j].val <= filter.val) {
  72217. delete this.filters[j];
  72218. }
  72219. }
  72220. this.filters[key + '>'] = filter;
  72221. } else if (op === '>=') {
  72222. for (var k in this.filters) {
  72223. numval = +this.filters[k].val.toString();
  72224. if (this.filters[k].key === key && numval < filter.val) {
  72225. delete this.filters[k];
  72226. }
  72227. }
  72228. if (this.filters[key + '!=' + filter.val] !== undefined) {
  72229. delete this.filters[key + '!=' + filter.val];
  72230. filter.op = '>';
  72231. this.filters[key + '>'] = filter;
  72232. } else {
  72233. this.filters[key + '>='] = filter;
  72234. }
  72235. } else if (op === '<') {
  72236. for (var l in this.filters) {
  72237. numval = +this.filters[l].val.toString();
  72238. if (this.filters[l].key === key && numval >= filter.val) {
  72239. delete this.filters[l];
  72240. }
  72241. }
  72242. this.filters[key + '<'] = filter;
  72243. } else if (op === '<=') {
  72244. for (var m in this.filters) {
  72245. numval = +this.filters[m].val.toString();
  72246. if (this.filters[m].key === key && numval > filter.val) {
  72247. delete this.filters[m];
  72248. }
  72249. }
  72250. if (this.filters[key + '!=' + filter.val] !== undefined) {
  72251. delete this.filters[key + '!=' + filter.val];
  72252. filter.op = '<';
  72253. this.filters[key + '<'] = filter;
  72254. } else {
  72255. this.filters[key + '<='] = filter;
  72256. }
  72257. }
  72258. }
  72259. }]);
  72260. return Filterset;
  72261. }();
  72262. CartoCSS.Tree.Fontset = /*#__PURE__*/CartoCSS_createClass(function Fontset(env, fonts) {
  72263. CartoCSS_classCallCheck(this, Fontset);
  72264. this.fonts = fonts;
  72265. this.name = 'fontset-' + env.effects.length;
  72266. });
  72267. CartoCSS.Tree.Invalid = /*#__PURE__*/function () {
  72268. function Invalid(chunk, index, message) {
  72269. CartoCSS_classCallCheck(this, Invalid);
  72270. this.is = 'invalid';
  72271. this.chunk = chunk;
  72272. this.index = index;
  72273. this.type = 'syntax';
  72274. this.message = message || "Invalid code: " + this.chunk;
  72275. }
  72276. CartoCSS_createClass(Invalid, [{
  72277. key: "ev",
  72278. value: function ev(env) {
  72279. env.error({
  72280. chunk: this.chunk,
  72281. index: this.index,
  72282. type: 'syntax',
  72283. message: this.message || "Invalid code: " + this.chunk
  72284. });
  72285. return {
  72286. is: 'undefined'
  72287. };
  72288. }
  72289. }]);
  72290. return Invalid;
  72291. }();
  72292. CartoCSS.Tree.Keyword = /*#__PURE__*/function () {
  72293. function Keyword(value) {
  72294. CartoCSS_classCallCheck(this, Keyword);
  72295. this.value = value;
  72296. var special = {
  72297. 'transparent': 'color',
  72298. 'true': 'boolean',
  72299. 'false': 'boolean'
  72300. };
  72301. this.is = special[value] ? special[value] : 'keyword';
  72302. }
  72303. CartoCSS_createClass(Keyword, [{
  72304. key: "ev",
  72305. value: function ev() {
  72306. return this;
  72307. }
  72308. }, {
  72309. key: "toString",
  72310. value: function toString() {
  72311. return this.value;
  72312. }
  72313. }]);
  72314. return Keyword;
  72315. }();
  72316. /*Layer:class Invalid ),*/
  72317. CartoCSS.Tree.Literal = /*#__PURE__*/function () {
  72318. function Literal(content) {
  72319. CartoCSS_classCallCheck(this, Literal);
  72320. this.value = content || '';
  72321. this.is = 'field';
  72322. }
  72323. CartoCSS_createClass(Literal, [{
  72324. key: "toString",
  72325. value: function toString() {
  72326. return this.value;
  72327. }
  72328. }, {
  72329. key: 'ev',
  72330. value: function ev() {
  72331. return this;
  72332. }
  72333. }]);
  72334. return Literal;
  72335. }();
  72336. CartoCSS.Tree.Operation = /*#__PURE__*/function () {
  72337. function Operation(op, operands, index) {
  72338. CartoCSS_classCallCheck(this, Operation);
  72339. this.is = 'operation';
  72340. this.op = op.trim();
  72341. this.operands = operands;
  72342. this.index = index;
  72343. }
  72344. CartoCSS_createClass(Operation, [{
  72345. key: "ev",
  72346. value: function ev(env) {
  72347. var a = this.operands[0].ev(env),
  72348. b = this.operands[1].ev(env),
  72349. temp;
  72350. if (a.is === 'undefined' || b.is === 'undefined') {
  72351. return {
  72352. is: 'undefined',
  72353. value: 'undefined'
  72354. };
  72355. }
  72356. if (a instanceof CartoCSS.Tree.Dimension && b instanceof CartoCSS.Tree.Color) {
  72357. if (this.op === '*' || this.op === '+') {
  72358. temp = b;
  72359. b = a;
  72360. a = temp;
  72361. } else {
  72362. env.error({
  72363. name: "OperationError",
  72364. message: "Can't substract or divide a color from a number",
  72365. index: this.index
  72366. });
  72367. }
  72368. }
  72369. // Only concatenate plain strings, because this is easily
  72370. // pre-processed
  72371. if (a instanceof CartoCSS.Tree.Quoted && b instanceof CartoCSS.Tree.Quoted && this.op !== '+') {
  72372. env.error({
  72373. message: "Can't subtract, divide, or multiply strings.",
  72374. index: this.index,
  72375. type: 'runtime',
  72376. filename: this.filename
  72377. });
  72378. return {
  72379. is: 'undefined',
  72380. value: 'undefined'
  72381. };
  72382. }
  72383. // Fields, literals, dimensions, and quoted strings can be combined.
  72384. if (a instanceof CartoCSS.Tree.Field || b instanceof CartoCSS.Tree.Field || a instanceof CartoCSS.Tree.Literal || b instanceof CartoCSS.Tree.Literal) {
  72385. if (a.is === 'color' || b.is === 'color') {
  72386. env.error({
  72387. message: "Can't subtract, divide, or multiply colors in expressions.",
  72388. index: this.index,
  72389. type: 'runtime',
  72390. filename: this.filename
  72391. });
  72392. return {
  72393. is: 'undefined',
  72394. value: 'undefined'
  72395. };
  72396. } else {
  72397. return new CartoCSS.Tree.Literal(a.ev(env).toString(true) + this.op + b.ev(env).toString(true));
  72398. }
  72399. }
  72400. if (a.operate === undefined) {
  72401. env.error({
  72402. message: 'Cannot do math with type ' + a.is + '.',
  72403. index: this.index,
  72404. type: 'runtime',
  72405. filename: this.filename
  72406. });
  72407. return {
  72408. is: 'undefined',
  72409. value: 'undefined'
  72410. };
  72411. }
  72412. return a.operate(env, this.op, b);
  72413. }
  72414. }]);
  72415. return Operation;
  72416. }();
  72417. CartoCSS.Tree.Quoted = /*#__PURE__*/function () {
  72418. function Quoted(content) {
  72419. CartoCSS_classCallCheck(this, Quoted);
  72420. this.is = 'string';
  72421. this.value = content || '';
  72422. }
  72423. CartoCSS_createClass(Quoted, [{
  72424. key: "toString",
  72425. value: function toString(quotes) {
  72426. var escapedValue = this.value.replace(/&/g, '&amp;');
  72427. var xmlvalue = escapedValue.replace(/\'/g, '\\\'').replace(/\"/g, '&quot;').replace(/</g, '&lt;').replace(/\>/g, '&gt;');
  72428. return quotes === true ? "'" + xmlvalue + "'" : escapedValue;
  72429. }
  72430. }, {
  72431. key: "ev",
  72432. value: function ev() {
  72433. return this;
  72434. }
  72435. }, {
  72436. key: "operate",
  72437. value: function operate(env, op, other) {
  72438. return new CartoCSS.Tree.Quoted(CartoCSS.Tree.operate(op, this.toString(), other.toString(this.contains_field)));
  72439. }
  72440. }]);
  72441. return Quoted;
  72442. }();
  72443. CartoCSS.Tree.Reference = {
  72444. _validateValue: {
  72445. 'font': function font(env, value) {
  72446. if (env.validation_data && env.validation_data.fonts) {
  72447. return env.validation_data.fonts.indexOf(value) != -1;
  72448. } else {
  72449. return true;
  72450. }
  72451. }
  72452. },
  72453. setData: function setData(data) {
  72454. this.data = data;
  72455. this.selector_cache = generateSelectorCache(data);
  72456. this.mapnikFunctions = generateMapnikFunctions(data);
  72457. this.required_cache = generateRequiredProperties(data);
  72458. function generateSelectorCache(data) {
  72459. var index = {};
  72460. for (var i in data.symbolizers) {
  72461. for (var j in data.symbolizers[i]) {
  72462. if (data.symbolizers[i][j].hasOwnProperty('css')) {
  72463. index[data.symbolizers[i][j].css] = [data.symbolizers[i][j], i, j];
  72464. }
  72465. }
  72466. }
  72467. return index;
  72468. }
  72469. function generateMapnikFunctions(data) {
  72470. var functions = {};
  72471. for (var i in data.symbolizers) {
  72472. for (var j in data.symbolizers[i]) {
  72473. if (data.symbolizers[i][j].type === 'functions') {
  72474. for (var k = 0; k < data.symbolizers[i][j].functions.length; k++) {
  72475. var fn = data.symbolizers[i][j].functions[k];
  72476. functions[fn[0]] = fn[1];
  72477. }
  72478. }
  72479. }
  72480. }
  72481. return functions;
  72482. }
  72483. function generateRequiredProperties(data) {
  72484. var cache = {};
  72485. for (var symbolizer_name in data.symbolizers) {
  72486. cache[symbolizer_name] = [];
  72487. for (var j in data.symbolizers[symbolizer_name]) {
  72488. if (data.symbolizers[symbolizer_name][j].required) {
  72489. cache[symbolizer_name].push(data.symbolizers[symbolizer_name][j].css);
  72490. }
  72491. }
  72492. }
  72493. return cache;
  72494. }
  72495. },
  72496. setVersion: function setVersion(version) {
  72497. if (CartoCSS.mapnik_reference.version.hasOwnProperty(version)) {
  72498. this.setData(CartoCSS.mapnik_reference.version[version]);
  72499. return true;
  72500. }
  72501. return false;
  72502. },
  72503. selectorData: function selectorData(selector, i) {
  72504. if (this.selector_cache && this.selector_cache[selector]) {
  72505. return this.selector_cache[selector][i];
  72506. }
  72507. },
  72508. validSelector: function validSelector(selector) {
  72509. return !!this.selector_cache[selector];
  72510. },
  72511. selectorName: function selectorName(selector) {
  72512. return this.selectorData(selector, 2);
  72513. },
  72514. selector: function selector(_selector) {
  72515. return this.selectorData(_selector, 0);
  72516. },
  72517. symbolizer: function symbolizer(selector) {
  72518. return this.selectorData(selector, 1);
  72519. },
  72520. requiredProperties: function requiredProperties(symbolizer_name, rules) {
  72521. var req = this.required_cache[symbolizer_name];
  72522. for (var i in req) {
  72523. if (!(req[i] in rules)) {
  72524. return 'Property ' + req[i] + ' required for defining ' + symbolizer_name + ' styles.';
  72525. }
  72526. }
  72527. },
  72528. isFont: function isFont(selector) {
  72529. return this.selector(selector).validate === 'font';
  72530. },
  72531. editDistance: function editDistance(a, b) {
  72532. if (a.length === 0) {
  72533. return b.length;
  72534. }
  72535. if (b.length === 0) {
  72536. return a.length;
  72537. }
  72538. var matrix = [];
  72539. for (var i = 0; i <= b.length; i++) {
  72540. matrix[i] = [i];
  72541. }
  72542. for (var j = 0; j <= a.length; j++) {
  72543. matrix[0][j] = j;
  72544. }
  72545. for (i = 1; i <= b.length; i++) {
  72546. for (j = 1; j <= a.length; j++) {
  72547. if (b.charAt(i - 1) === a.charAt(j - 1)) {
  72548. matrix[i][j] = matrix[i - 1][j - 1];
  72549. } else {
  72550. matrix[i][j] = Math.min(matrix[i - 1][j - 1] + 1,
  72551. // substitution
  72552. Math.min(matrix[i][j - 1] + 1,
  72553. // insertion
  72554. matrix[i - 1][j] + 1)); // deletion
  72555. }
  72556. }
  72557. }
  72558. return matrix[b.length][a.length];
  72559. },
  72560. validValue: function validValue(env, selector, value) {
  72561. function validateFunctions(value, selector) {
  72562. if (value.value[0].is === 'string') {
  72563. return true;
  72564. }
  72565. for (var i in value.value) {
  72566. for (var j in value.value[i].value) {
  72567. if (value.value[i].value[j].is !== 'call') {
  72568. return false;
  72569. }
  72570. var f = find(this.selector(selector).functions, function (x) {
  72571. //NOSONAR
  72572. return x[0] === value.value[i].value[j].name;
  72573. });
  72574. if (!(f && f[1] === -1)) {
  72575. // This filter is unknown or given an incorrect number of arguments
  72576. if (!f || f[1] !== value.value[i].value[j].args.length) {
  72577. return false;
  72578. }
  72579. }
  72580. }
  72581. }
  72582. return true;
  72583. }
  72584. function validateKeyword(value, selector) {
  72585. if (CartoCSS_typeof(this.selector(selector).type) === 'object') {
  72586. return this.selector(selector).type.indexOf(value.value[0].value) !== -1;
  72587. } else {
  72588. // allow unquoted keywords as strings
  72589. return this.selector(selector).type === 'string';
  72590. }
  72591. }
  72592. var i;
  72593. if (!this.selector(selector)) {
  72594. return false;
  72595. } else if (value.value[0].is === 'keyword') {
  72596. return validateKeyword(value, selector);
  72597. } else if (value.value[0].is === 'undefined') {
  72598. // caught earlier in the chain - ignore here so that
  72599. // error is not overridden
  72600. return true;
  72601. } else if (this.selector(selector).type === 'numbers') {
  72602. for (i in value.value) {
  72603. if (value.value[i].is !== 'float') {
  72604. return false;
  72605. }
  72606. }
  72607. return true;
  72608. } else if (this.selector(selector).type === 'tags') {
  72609. if (!value.value) {
  72610. return false;
  72611. }
  72612. if (!value.value[0].value) {
  72613. return value.value[0].is === 'tag';
  72614. }
  72615. for (i = 0; i < value.value[0].value.length; i++) {
  72616. if (value.value[0].value[i].is !== 'tag') {
  72617. return false;
  72618. }
  72619. }
  72620. return true;
  72621. } else if (this.selector(selector).type == 'functions') {
  72622. // For backwards compatibility, you can specify a string for `functions`-compatible
  72623. // values, though they will not be validated.
  72624. return validateFunctions(value, selector);
  72625. } else if (this.selector(selector).type === 'expression') {
  72626. return true;
  72627. } else if (this.selector(selector).type === 'unsigned') {
  72628. if (value.value[0].is === 'float') {
  72629. value.value[0].round();
  72630. return true;
  72631. } else {
  72632. return false;
  72633. }
  72634. } else {
  72635. if (this.selector(selector).validate) {
  72636. var valid = false;
  72637. for (i = 0; i < value.value.length; i++) {
  72638. if (this.selector(selector).type === value.value[i].is && this._validateValue[this.selector(selector).validate](env, value.value[i].value)) {
  72639. return true;
  72640. }
  72641. }
  72642. return valid;
  72643. } else {
  72644. return this.selector(selector).type === value.value[0].is;
  72645. }
  72646. }
  72647. }
  72648. };
  72649. CartoCSS.Tree.Reference.setVersion("latest");
  72650. CartoCSS.Tree.Rule = /*#__PURE__*/function () {
  72651. function Rule(name, value, index, filename) {
  72652. CartoCSS_classCallCheck(this, Rule);
  72653. this.is = 'rule';
  72654. var parts = name.split('/');
  72655. this.name = parts.pop();
  72656. this.instance = parts.length ? parts[0] : '__default__';
  72657. this.value = value instanceof CartoCSS.Tree.Value ? value : new CartoCSS.Tree.Value([value]);
  72658. this.index = index;
  72659. this.symbolizer = CartoCSS.Tree.Reference.symbolizer(this.name);
  72660. this.filename = filename;
  72661. this.variable = name.charAt(0) === '@';
  72662. }
  72663. CartoCSS_createClass(Rule, [{
  72664. key: "clone",
  72665. value: function clone() {
  72666. var clone = Object.create(CartoCSS.Tree.Rule.prototype);
  72667. clone.name = this.name;
  72668. clone.value = this.value;
  72669. clone.index = this.index;
  72670. clone.instance = this.instance;
  72671. clone.symbolizer = this.symbolizer;
  72672. clone.filename = this.filename;
  72673. clone.variable = this.variable;
  72674. return clone;
  72675. }
  72676. }, {
  72677. key: "updateID",
  72678. value: function updateID() {
  72679. return this.id = this.zoom + '#' + this.instance + '#' + this.name;
  72680. }
  72681. }, {
  72682. key: "toString",
  72683. value: function toString() {
  72684. return '[' + CartoCSS.Tree.Zoom.toString(this.zoom) + '] ' + this.name + ': ' + this.value;
  72685. }
  72686. }, {
  72687. key: "ev",
  72688. value: function ev(context) {
  72689. return new CartoCSS.Tree.Rule(this.name, this.value.ev(context), this.index, this.filename);
  72690. }
  72691. }]);
  72692. return Rule;
  72693. }();
  72694. CartoCSS.Tree.Ruleset = /*#__PURE__*/function () {
  72695. function Ruleset(selectors, rules) {
  72696. CartoCSS_classCallCheck(this, Ruleset);
  72697. this.is = 'ruleset';
  72698. this.selectors = selectors;
  72699. this.rules = rules;
  72700. // static cache of find() function
  72701. this._lookups = {};
  72702. }
  72703. CartoCSS_createClass(Ruleset, [{
  72704. key: "ev",
  72705. value: function ev(env) {
  72706. var i,
  72707. rule,
  72708. ruleset = new CartoCSS.Tree.Ruleset(this.selectors, this.rules.slice(0));
  72709. ruleset.root = this.root;
  72710. // push the current ruleset to the frames stack
  72711. env.frames.unshift(ruleset);
  72712. // Evaluate everything else
  72713. for (i = 0, rule; i < ruleset.rules.length; i++) {
  72714. rule = ruleset.rules[i];
  72715. ruleset.rules[i] = rule.ev ? rule.ev(env) : rule;
  72716. }
  72717. // Pop the stack
  72718. env.frames.shift();
  72719. return ruleset;
  72720. }
  72721. }, {
  72722. key: "match",
  72723. value: function match(args) {
  72724. return !args || args.length === 0;
  72725. }
  72726. }, {
  72727. key: "variables",
  72728. value: function variables() {
  72729. if (this._variables) {
  72730. return this._variables;
  72731. } else {
  72732. return this._variables = this.rules.reduce(function (hash, r) {
  72733. if (r instanceof CartoCSS.Tree.Rule && r.variable === true) {
  72734. hash[r.name] = r;
  72735. }
  72736. return hash;
  72737. }, {});
  72738. }
  72739. }
  72740. }, {
  72741. key: "variable",
  72742. value: function variable(name) {
  72743. return this.variables()[name];
  72744. }
  72745. }, {
  72746. key: "rulesets",
  72747. value: function rulesets() {
  72748. if (this._rulesets) {
  72749. return this._rulesets;
  72750. } else {
  72751. return this._rulesets = this.rules.filter(function (r) {
  72752. return r instanceof CartoCSS.Tree.Ruleset;
  72753. });
  72754. }
  72755. }
  72756. }, {
  72757. key: "find",
  72758. value: function find(selector, self) {
  72759. self = self || this;
  72760. var rules = [],
  72761. match,
  72762. key = selector.toString();
  72763. if (key in this._lookups) {
  72764. return this._lookups[key];
  72765. }
  72766. this.rulesets().forEach(function (rule) {
  72767. if (rule !== self) {
  72768. for (var j = 0; j < rule.selectors.length; j++) {
  72769. match = selector.match(rule.selectors[j]);
  72770. if (match) {
  72771. if (selector.elements.length > 1) {
  72772. Array.prototype.push.apply(rules, rule.find(new CartoCSS.Tree.Selector(null, null, selector.elements.slice(1)), self));
  72773. } else {
  72774. rules.push(rule);
  72775. }
  72776. break;
  72777. }
  72778. }
  72779. }
  72780. });
  72781. return this._lookups[key] = rules;
  72782. }
  72783. // Zooms can use variables. This replaces CartoCSS.Tree.Zoom objects on selectors
  72784. // with simple bit-arrays that we can compare easily.
  72785. }, {
  72786. key: "evZooms",
  72787. value: function evZooms(env) {
  72788. for (var i = 0; i < this.selectors.length; i++) {
  72789. var zval = CartoCSS.Tree.Zoom.all;
  72790. for (var z = 0; z < this.selectors[i].zoom.length; z++) {
  72791. zval = this.selectors[i].zoom[z].ev(env).zoom;
  72792. }
  72793. this.selectors[i].zoom = zval;
  72794. }
  72795. }
  72796. }, {
  72797. key: "flatten",
  72798. value: function flatten(result, parents, env) {
  72799. var selectors = [],
  72800. i,
  72801. j;
  72802. if (this.selectors.length === 0) {
  72803. env.frames = env.frames.concat(this.rules);
  72804. }
  72805. // evaluate zoom variables on this object.
  72806. this.evZooms(env);
  72807. for (i = 0; i < this.selectors.length; i++) {
  72808. var child = this.selectors[i];
  72809. if (!child.filters) {
  72810. // This is an invalid filterset.
  72811. continue;
  72812. }
  72813. if (parents.length) {
  72814. for (j = 0; j < parents.length; j++) {
  72815. var parent = parents[j];
  72816. var mergedFilters = parent.filters.cloneWith(child.filters);
  72817. if (mergedFilters === null) {
  72818. // Filters could be added, but they didn't change the
  72819. // filters. This means that we only have to clone when
  72820. // the zoom levels or the attachment is different too.
  72821. if (parent.zoom === child.zoom && parent.attachment === child.attachment && parent.elements.join() === child.elements.join()) {
  72822. selectors.push(parent);
  72823. continue;
  72824. } else {
  72825. mergedFilters = parent.filters;
  72826. }
  72827. } else if (!mergedFilters) {
  72828. // The merged filters are invalid, that means we don't
  72829. // have to clone.
  72830. continue;
  72831. }
  72832. var clone = Object.create(CartoCSS.Tree.Selector.prototype);
  72833. clone.filters = mergedFilters;
  72834. clone.zoom = child.zoom;
  72835. clone.elements = parent.elements.concat(child.elements);
  72836. if (parent.attachment && child.attachment) {
  72837. clone.attachment = parent.attachment + '/' + child.attachment;
  72838. } else {
  72839. clone.attachment = child.attachment || parent.attachment;
  72840. }
  72841. clone.conditions = parent.conditions + child.conditions;
  72842. clone.index = child.index;
  72843. selectors.push(clone);
  72844. }
  72845. } else {
  72846. selectors.push(child);
  72847. }
  72848. }
  72849. var rules = [];
  72850. for (i = 0; i < this.rules.length; i++) {
  72851. var rule = this.rules[i];
  72852. // Recursively flatten any nested rulesets
  72853. if (rule instanceof CartoCSS.Tree.Ruleset) {
  72854. rule.flatten(result, selectors, env);
  72855. } else if (rule instanceof CartoCSS.Tree.Rule) {
  72856. rules.push(rule);
  72857. } else if (rule instanceof CartoCSS.Tree.Invalid) {
  72858. env.error(rule);
  72859. }
  72860. }
  72861. var index = rules.length ? rules[0].index : false;
  72862. for (i = 0; i < selectors.length; i++) {
  72863. // For specificity sort, use the position of the first rule to allow
  72864. // defining attachments that are under current element as a descendant
  72865. // selector.
  72866. if (index !== false) {
  72867. selectors[i].index = index;
  72868. }
  72869. result.push(new CartoCSS.Tree.Definition(selectors[i], rules.slice()));
  72870. }
  72871. return result;
  72872. }
  72873. }]);
  72874. return Ruleset;
  72875. }();
  72876. CartoCSS.Tree.Selector = /*#__PURE__*/function () {
  72877. function Selector(filters, zoom, elements, attachment, conditions, index) {
  72878. CartoCSS_classCallCheck(this, Selector);
  72879. this.elements = elements || [];
  72880. this.attachment = attachment;
  72881. this.filters = filters || {};
  72882. this.zoom = typeof zoom !== 'undefined' ? zoom : CartoCSS.Tree.Zoom.all;
  72883. this.conditions = conditions;
  72884. this.index = index;
  72885. }
  72886. CartoCSS_createClass(Selector, [{
  72887. key: "specificity",
  72888. value: function specificity() {
  72889. return this.elements.reduce(function (memo, e) {
  72890. var spec = e.specificity();
  72891. memo[0] += spec[0];
  72892. memo[1] += spec[1];
  72893. return memo;
  72894. }, [0, 0, this.conditions, this.index]);
  72895. }
  72896. }]);
  72897. return Selector;
  72898. }();
  72899. /*style:class Invalid ),*/
  72900. CartoCSS.Tree.URL = /*#__PURE__*/function () {
  72901. function URL(val, paths) {
  72902. CartoCSS_classCallCheck(this, URL);
  72903. this.is = 'uri';
  72904. this.value = val;
  72905. this.paths = paths;
  72906. }
  72907. CartoCSS_createClass(URL, [{
  72908. key: "toString",
  72909. value: function toString() {
  72910. return this.value.toString();
  72911. }
  72912. }, {
  72913. key: "ev",
  72914. value: function ev(ctx) {
  72915. return new CartoCSS.Tree.URL(this.value.ev(ctx), this.paths);
  72916. }
  72917. }]);
  72918. return URL;
  72919. }();
  72920. CartoCSS.Tree.Value = /*#__PURE__*/function () {
  72921. function Value(value) {
  72922. CartoCSS_classCallCheck(this, Value);
  72923. this.is = 'value';
  72924. this.value = value;
  72925. }
  72926. CartoCSS_createClass(Value, [{
  72927. key: "ev",
  72928. value: function ev(env) {
  72929. if (this.value.length === 1) {
  72930. return this.value[0].ev(env);
  72931. } else {
  72932. return new CartoCSS.Tree.Value(this.value.map(function (v) {
  72933. return v.ev(env);
  72934. }));
  72935. }
  72936. }
  72937. }, {
  72938. key: "toJS",
  72939. value: function toJS(env) {
  72940. //var v = this.value[0].value[0];
  72941. var val = this.ev(env);
  72942. var v = val.toString();
  72943. if (val.is === "color" || val.is === 'uri' || val.is === 'string' || val.is === 'keyword') {
  72944. v = "'" + v + "'";
  72945. } else if (val.is === 'field') {
  72946. // replace [varuable] by ctx['variable']
  72947. v = v.replace(/\[(.*)\]/g, "attributes['\_match1']");
  72948. } else if (val.value && CartoCSS_typeof(val.value) === "object") {
  72949. v = "[" + v + "]";
  72950. }
  72951. return "_value = " + v + ";";
  72952. }
  72953. }, {
  72954. key: "toString",
  72955. value: function toString(env, selector, sep, format) {
  72956. return this.value.map(function (e) {
  72957. return e.toString(env, format);
  72958. }).join(sep || ', ');
  72959. }
  72960. }, {
  72961. key: "clone",
  72962. value: function clone() {
  72963. var obj = Object.create(CartoCSS.Tree.Value.prototype);
  72964. if (Array.isArray(obj)) {
  72965. obj.value = this.value.slice();
  72966. } else {
  72967. obj.value = this.value;
  72968. }
  72969. obj.is = this.is;
  72970. return obj;
  72971. }
  72972. }]);
  72973. return Value;
  72974. }();
  72975. CartoCSS.Tree.Variable = /*#__PURE__*/function () {
  72976. function Variable(name, index, filename) {
  72977. CartoCSS_classCallCheck(this, Variable);
  72978. this.is = 'variable';
  72979. this.name = name;
  72980. this.index = index;
  72981. this.filename = filename;
  72982. }
  72983. CartoCSS_createClass(Variable, [{
  72984. key: "toString",
  72985. value: function toString() {
  72986. return this.name;
  72987. }
  72988. }, {
  72989. key: "ev",
  72990. value: function ev(env) {
  72991. if (this._css) {
  72992. return this._css;
  72993. }
  72994. var thisframe = env.frames.filter(function (f) {
  72995. return f.name === this.name;
  72996. }.bind(this));
  72997. if (thisframe.length) {
  72998. return thisframe[0].value.ev(env);
  72999. } else {
  73000. env.error({
  73001. message: 'variable ' + this.name + ' is undefined',
  73002. index: this.index,
  73003. type: 'runtime',
  73004. filename: this.filename
  73005. });
  73006. return {
  73007. is: 'undefined',
  73008. value: 'undefined'
  73009. };
  73010. }
  73011. }
  73012. }]);
  73013. return Variable;
  73014. }();
  73015. CartoCSS.Tree.Zoom = /*#__PURE__*/function () {
  73016. function Zoom(op, value, index) {
  73017. CartoCSS_classCallCheck(this, Zoom);
  73018. this.op = op;
  73019. this.value = value;
  73020. this.index = index;
  73021. }
  73022. CartoCSS_createClass(Zoom, [{
  73023. key: "setZoom",
  73024. value: function setZoom(zoom) {
  73025. this.zoom = zoom;
  73026. return this;
  73027. }
  73028. }, {
  73029. key: "ev",
  73030. value: function ev(env) {
  73031. var value = parseInt(this.value.ev(env).toString(), 10);
  73032. if (value > CartoCSS.Tree.Zoom.maxZoom || value < 0) {
  73033. env.error({
  73034. message: 'Only zoom levels between 0 and ' + CartoCSS.Tree.Zoom.maxZoom + ' supported.',
  73035. index: this.index
  73036. });
  73037. }
  73038. switch (this.op) {
  73039. case '=':
  73040. this.zoom = "zoom && zoom === " + value;
  73041. return this;
  73042. case '>':
  73043. this.zoom = "zoom && zoom > " + value;
  73044. break;
  73045. case '>=':
  73046. this.zoom = "zoom && zoom >= " + value;
  73047. break;
  73048. case '<':
  73049. this.zoom = "zoom && zoom < " + value;
  73050. break;
  73051. case '<=':
  73052. this.zoom = "zoom && zoom <= " + value;
  73053. break;
  73054. default:
  73055. break;
  73056. }
  73057. /*
  73058. for (var i = 0; i <= CartoCSS.Tree.Zoom.maxZoom; i++) {
  73059. if (i >= start && i <= end) {
  73060. zoom |= (1 << i);
  73061. }
  73062. }
  73063. this.zoom = zoom;
  73064. this.zoom=value+this.op+"zoom";*/
  73065. return this;
  73066. }
  73067. }, {
  73068. key: "toString",
  73069. value: function toString() {
  73070. var str = '';
  73071. for (var i = 0; i <= CartoCSS.Tree.Zoom.maxZoom; i++) {
  73072. str += this.zoom & 1 << i ? 'X' : '.';
  73073. }
  73074. return str;
  73075. }
  73076. }]);
  73077. return Zoom;
  73078. }();
  73079. // Covers all zoomlevels from 0 to 22
  73080. CartoCSS.Tree.Zoom.all = 23;
  73081. CartoCSS.Tree.Zoom.maxZoom = 22;
  73082. CartoCSS.Tree.Zoom.ranges = {
  73083. 0: 1000000000,
  73084. 1: 500000000,
  73085. 2: 200000000,
  73086. 3: 100000000,
  73087. 4: 50000000,
  73088. 5: 25000000,
  73089. 6: 12500000,
  73090. 7: 6500000,
  73091. 8: 3000000,
  73092. 9: 1500000,
  73093. 10: 750000,
  73094. 11: 400000,
  73095. 12: 200000,
  73096. 13: 100000,
  73097. 14: 50000,
  73098. 15: 25000,
  73099. 16: 12500,
  73100. 17: 5000,
  73101. 18: 2500,
  73102. 19: 1500,
  73103. 20: 750,
  73104. 21: 500,
  73105. 22: 250,
  73106. 23: 100
  73107. };
  73108. ;// CONCATENATED MODULE: ./src/common/style/ThemeStyle.js
  73109. function ThemeStyle_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  73110. function ThemeStyle_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeStyle_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeStyle_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  73111. function ThemeStyle_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  73112. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  73113. * This program are made available under the terms of the Apache License, Version 2.0
  73114. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  73115. /**
  73116. * @class ThemeStyle
  73117. * @deprecatedclass SuperMap.ThemeStyle
  73118. * @classdesc 客户端专题图风格类。
  73119. * @modulecategory Overlay
  73120. * @category Visualization Theme
  73121. * @param {Object} options - 可选参数。
  73122. * @param {boolean} [options.fill=true] - 是否填充,不需要填充则设置为 false。如果 fill 与 stroke 同时为 false,将按 fill 与 stroke 的默认值渲染图层。
  73123. * @param {string} [options.fillColor='#000000'] - 十六进制填充颜色。
  73124. * @param {number} [options.fillOpacity=1] - 填充不透明度。取值范围[0, 1]。
  73125. * @param {boolean} [options.stroke=false] - 是否描边,不需要描边则设置为false。如果 fill 与 stroke 同时为 false,将按 fill 与 stroke 的默认值渲染图层。
  73126. * @param {string} [options.strokeColor='#000000'] - 十六进制描边颜色。
  73127. * @param {number} [options.strokeOpacity=1] - 描边的不透明度。取值范围[0, 1]。
  73128. * @param {number} [options.strokeWidth=1] - 线宽度/描边宽度。
  73129. * @param {string} [options.strokeLinecap='butt'] - 线帽样式。strokeLinecap 有三种类型 “butt", "round", "square"。
  73130. * @param {string} [options.strokeLineJoin='iter'] - 线段连接样式。strokeLineJoin 有三种类型 “miter", "round", "bevel"。
  73131. * @param {string} [options.strokeDashstyle='solid'] - 虚线类型。strokeDashstyle 有八种类型 “dot",“dash",“dashdot",“longdash",“longdashdot",“solid", "dashed", "dotted"。solid 表示实线。
  73132. * @param {number} [options.pointRadius=6] - 点半径,单位为像素。
  73133. * @param {number} [options.shadowBlur=0] - 阴影模糊度,(大于 0 有效)。注:请将 shadowColor 属性与 shadowBlur 属性一起使用,来创建阴影。
  73134. * @param {string} [options.shadowColor='#000000'] - 阴影颜色。注:请将 shadowColor 属性与 shadowBlur 属性一起使用,来创建阴影。
  73135. * @param {number} [options.shadowOffsetX=0] - 阴影 X 方向偏移值。
  73136. * @param {number} [options.shadowOffsetY=0] - 阴影 Y 方向偏移值。
  73137. * @param {string} options.label - 专题要素附加文本标签内容。
  73138. * @param {string} [options.fontColor] - 附加文本字体颜色。
  73139. * @param {number} [options.fontSize=12] - 附加文本字体大小,单位是像素。
  73140. * @param {string} [options.fontStyle='normal'] - 附加文本字体样式。可设值:"normal", "italic", "oblique"。
  73141. * @param {string} [options.fontVariant='normal'] - 附加文本字体变体。可设值:"normal", "small-caps"。
  73142. * @param {string} [options.fontWeight='normal'] - 附加文本字体粗细。可设值:"normal", "bold", "bolder", "lighter"。
  73143. * @param {string} [options.fontFamily='arial,sans-serif'] - 附加文本字体系列。fontFamily 值是字体族名称或/及类族名称的一个优先表,每个值逗号分割,
  73144. * 浏览器会使用它可识别的第一个可以使用具体的字体名称("times"、"courier"、"arial")或字体系列名称
  73145. * ("serif"、"sans-serif"、"cursive"、"fantasy"、"monospace")。
  73146. * @param {string} [options.labelPosition='top'] - 附加文本位置,可以是 'inside', 'left', 'right', 'top', 'bottom'。
  73147. * @param {string} [options.labelAlign='center'] - 附加文本水平对齐。可以是 'left', 'right', 'center'。
  73148. * @param {string} [options.labelBaseline='middle'] - 附加文本垂直对齐。可以是 'top', 'bottom', 'middle' 。
  73149. * @param {number} [options.labelXOffset=0] - 附加文本在x轴方向的偏移量。
  73150. * @param {number} [options.labelYOffset=0] - 附加文本在y轴方向的偏移量。
  73151. * @usage
  73152. */
  73153. var ThemeStyle = /*#__PURE__*/ThemeStyle_createClass(function ThemeStyle(options) {
  73154. ThemeStyle_classCallCheck(this, ThemeStyle);
  73155. options = options || {};
  73156. /**
  73157. * @member {boolean} [ThemeStyle.prototype.fill=true]
  73158. * @description 是否填充,不需要填充则设置为 false。如果 fill 与 stroke 同时为 false,将按 fill 与 stroke 的默认值渲染图层。
  73159. */
  73160. this.fill = true;
  73161. /**
  73162. * @member {string} [ThemeStyle.prototype.fillColor="#000000"]
  73163. * @description 十六进制填充颜色。
  73164. */
  73165. this.fillColor = "#000000";
  73166. /**
  73167. * @member {number} [ThemeStyle.prototype.fillOpacity=1]
  73168. * @description 填充不透明度。取值范围[0, 1]。
  73169. */
  73170. this.fillOpacity = 1;
  73171. /**
  73172. * @member {boolean} [ThemeStyle.prototype.stroke=false]
  73173. * @description 是否描边,不需要描边则设置为false。如果 fill 与 stroke 同时为 false,将按 fill 与 stroke 的默认值渲染图层。
  73174. */
  73175. this.stroke = false;
  73176. /**
  73177. * @member {string} [ThemeStyle.prototype.strokeColor="#000000"]
  73178. * @description 十六进制描边颜色。
  73179. */
  73180. this.strokeColor = "#000000";
  73181. /**
  73182. * @member {number} [ThemeStyle.prototype.strokeOpacity=1]
  73183. * @description 描边的不透明度。取值范围[0, 1]。
  73184. */
  73185. this.strokeOpacity = 1;
  73186. /**
  73187. * @member {number} [ThemeStyle.prototype.strokeWidth=1]
  73188. * @description 线宽度/描边宽度。
  73189. */
  73190. this.strokeWidth = 1;
  73191. /**
  73192. * @member {string} [ThemeStyle.prototype.strokeLinecap="butt"]
  73193. * @description 线帽样式;strokeLinecap 有三种类型 “butt", "round", "square" 。
  73194. */
  73195. this.strokeLinecap = "butt";
  73196. /**
  73197. * @member {string} [ThemeStyle.prototype.strokeLineJoin="miter"]
  73198. * @description 线段连接样式;strokeLineJoin 有三种类型 “miter", "round", "bevel"。
  73199. */
  73200. this.strokeLineJoin = "miter";
  73201. /**
  73202. * @member {string} [ThemeStyle.prototype.strokeDashstyle="solid"]
  73203. * @description 虚线类型;strokeDashstyle 有八种类型 “dot",“dash",“dashdot",“longdash",“longdashdot",“solid", "dashed", "dotted";
  73204. * solid 表示实线。
  73205. */
  73206. this.strokeDashstyle = "solid";
  73207. /**
  73208. * @member {number} [ThemeStyle.prototype.pointRadius=6]
  73209. * @description 点半径。单位为像素。
  73210. */
  73211. this.pointRadius = 6;
  73212. /**
  73213. * @member {number} [ThemeStyle.prototype.shadowBlur=0]
  73214. * @description 阴影模糊度,(大于 0 有效)。注:请将 shadowColor 属性与 shadowBlur 属性一起使用,来创建阴影。
  73215. */
  73216. this.shadowBlur = 0;
  73217. /**
  73218. * @member {string} [ThemeStyle.prototype.shadowColor='#000000']
  73219. * @description 阴影颜色。注:请将 shadowColor 属性与 shadowBlur 属性一起使用,来创建阴影。
  73220. */
  73221. this.shadowColor = "#000000";
  73222. /**
  73223. * @member {number} [ThemeStyle.prototype.shadowOffsetX=0]
  73224. * @description 阴影 X 方向偏移值。
  73225. */
  73226. this.shadowOffsetX = 0;
  73227. /**
  73228. * @member {number} ThemeStyle.prototype.shadowOffsetY
  73229. * @description Y 方向偏移值。
  73230. */
  73231. this.shadowOffsetY = 0;
  73232. /**
  73233. * @member {string} [ThemeStyle.prototype.label]
  73234. * @description 专题要素附加文本标签内容。
  73235. */
  73236. this.label = "";
  73237. /**
  73238. * @member {boolean} [ThemeStyle.prototype.labelRect=false]
  73239. * @description 是否显示文本标签矩形背景。
  73240. */
  73241. this.labelRect = false;
  73242. /**
  73243. * @member {string} [ThemeStyle.prototype.fontColor]
  73244. * @description 附加文本字体颜色。
  73245. */
  73246. this.fontColor = "";
  73247. /**
  73248. * @member {number} [ThemeStyle.prototype.fontSize=12]
  73249. * @description 附加文本字体大小,单位是像素。
  73250. */
  73251. this.fontSize = 12;
  73252. /**
  73253. * @member {string} [ThemeStyle.prototype.fontStyle="normal"]
  73254. * @description 附加文本字体样式。可设值:"normal", "italic", "oblique"。
  73255. */
  73256. this.fontStyle = "normal";
  73257. /**
  73258. * @member {string} [ThemeStyle.prototype.fontVariant="normal"]
  73259. * @description 附加文本字体变体。可设值:"normal", "small-caps"。
  73260. */
  73261. this.fontVariant = "normal";
  73262. /**
  73263. * @member {string} [ThemeStyle.prototype.fontWeight="normal"]
  73264. * @description 附加文本字体粗细。可设值:"normal", "bold", "bolder", "lighter"。
  73265. */
  73266. this.fontWeight = "normal";
  73267. /**
  73268. * @member {string} [ThemeStyle.prototype.fontFamily="arial,sans-serif"]
  73269. * @description 附加文本字体系列。fontFamily 值是字体族名称或/及类族名称的一个优先表,每个值逗号分割,浏览器会使用它可识别的第一个
  73270. * 可以使用具体的字体名称("times"、"courier"、"arial")或字体系列名称("serif"、"sans-serif"、"cursive"、"fantasy"、"monospace")。
  73271. */
  73272. this.fontFamily = "arial,sans-serif";
  73273. /**
  73274. * @member {string} [ThemeStyle.prototype.labelPosition='top']
  73275. * @description 附加文本位置,可以是 'inside', 'left', 'right', 'top', 'bottom'。
  73276. */
  73277. this.labelPosition = "top";
  73278. /**
  73279. * @member {string} [ThemeStyle.prototype.labelAlign='center']
  73280. * @description 附加文本水平对齐。可以是 'left', 'right', 'center'。
  73281. */
  73282. this.labelAlign = "center";
  73283. /**
  73284. * @member {string} [ThemeStyle.prototype.labelBaseline='middle']
  73285. * @description 附加文本垂直对齐。可以是 'top', 'bottom', 'middle'。
  73286. */
  73287. this.labelBaseline = "middle";
  73288. /**
  73289. * @member {number} [ThemeStyle.prototype.labelXOffset=0]
  73290. * @description 附加文本在 X 轴方向的偏移量。
  73291. */
  73292. this.labelXOffset = 0;
  73293. /**
  73294. * @member {number} [ThemeStyle.prototype.labelYOffset=0]
  73295. * @description 附加文本在 Y 轴方向的偏移量。
  73296. */
  73297. this.labelYOffset = 0;
  73298. Util_Util.extend(this, options);
  73299. });
  73300. ;// CONCATENATED MODULE: ./src/common/style/index.js
  73301. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  73302. * This program are made available under the terms of the Apache License, Version 2.0
  73303. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  73304. ;// CONCATENATED MODULE: ./src/common/overlay/feature/ShapeParameters.js
  73305. function ShapeParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  73306. function ShapeParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  73307. function ShapeParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) ShapeParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) ShapeParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  73308. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  73309. * This program are made available under the terms of the Apache License, Version 2.0
  73310. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  73311. /**
  73312. * @class ShapeParameters
  73313. * @aliasclass Feature.ShapeParameters
  73314. * @deprecatedclass SuperMap.Feature.ShapeParameters
  73315. * @category Visualization Theme
  73316. * @classdesc 图形参数基类
  73317. * @usage
  73318. */
  73319. var ShapeParameters = /*#__PURE__*/function () {
  73320. function ShapeParameters() {
  73321. ShapeParameters_classCallCheck(this, ShapeParameters);
  73322. /**
  73323. * @member {Array.<number>} [ShapeParameters.prototype.refOriginalPosition=[0,0]]
  73324. * @description 图形参考原点位置,图形的参考中心位置。
  73325. * refOriginalPosition 是长度为 2 的数组,第一个元素表示 x 坐标,第二个元素表示 y 坐标。
  73326. * refOriginalPosition 表示图形的参考中心,通常情况下,图形是使用 canvas 的原点位置作为位置参考,
  73327. * 但 refOriginalPosition 可以改变图形的参考位置,例如: refOriginalPosition = [80, 80],
  73328. * 图形圆的 style.x = 20, style.y = 20,那么圆在 canvas 中的实际位置是 [100, 100]。
  73329. * 图形(Shape)的所有位置相关属性都是以 refOriginalPosition 为参考中心,
  73330. * 也就是说图形的所有位置信息在 canvas 中都是以 refOriginalPosition 为参考的相对位置,只有
  73331. * refOriginalPosition 的值为 [0, 0] 时,图形的位置信息才是 canvas 绝对位置。
  73332. * 图形的位置信息通常有:style.pointList,style.x,style.y。
  73333. */
  73334. this.refOriginalPosition = [0, 0];
  73335. /**
  73336. * @member {string} ShapeParameters.prototype.refDataID
  73337. * @description 图形所关联数据的 ID(<{@link FeatureVector}> 的 ID)。
  73338. */
  73339. this.refDataID = null;
  73340. /**
  73341. * @member {boolean} ShapeParameters.prototype.isHoverByRefDataID
  73342. * @description 是否根据 refDataID 进行高亮。用于同时高亮所有 refDataID 相同的图形。
  73343. */
  73344. this.isHoverByRefDataID = false;
  73345. /**
  73346. * @member {string} ShapeParameters.prototype.refDataHoverGroup
  73347. * @description 高亮图形组的组名。此属性在 refDataID 有效且 isHoverByRefDataID 为 true 时生效。
  73348. * 一旦设置此属性,且属性值有效,只有关联同一个数据的图形且此属性相同的图形才会高亮。
  73349. */
  73350. this.refDataHoverGroup = null;
  73351. /**
  73352. * @member {Object} ShapeParameters.prototype.dataInfo
  73353. * @description 图形携带的附加数据。
  73354. */
  73355. this.dataInfo = null;
  73356. /**
  73357. * @member {boolean} ShapeParameters.prototype.clickable
  73358. * @description 是否可点击。
  73359. */
  73360. this.clickable = true;
  73361. /**
  73362. * @member {boolean} ShapeParameters.prototype.hoverable
  73363. * @description 是否可点击。
  73364. */
  73365. this.hoverable = true;
  73366. /**
  73367. * @member {Object} ShapeParameters.prototype.style
  73368. * @description 图形样式对象,可设样式属性在子类中确定。
  73369. */
  73370. this.style = null;
  73371. /**
  73372. * @member {Object} ShapeParameters.prototype.highlightStyle
  73373. * @description 高亮样式对象,可设样式属性与 style 的可设样式属性相同。
  73374. */
  73375. this.highlightStyle = {};
  73376. this.CLASS_NAME = "SuperMap.Feature.ShapeParameters";
  73377. }
  73378. /**
  73379. * @function ShapeParameters.prototype.destroy
  73380. * @description 销毁对象。
  73381. */
  73382. ShapeParameters_createClass(ShapeParameters, [{
  73383. key: "destroy",
  73384. value: function destroy() {
  73385. this.refOriginalPosition = null;
  73386. this.refDataID = null;
  73387. this.isHoverByRefDataID = null;
  73388. this.refDataHoverGroup = null;
  73389. this.dataInfo = null;
  73390. this.clickable = null;
  73391. this.hoverable = null;
  73392. this.style = null;
  73393. this.highlightStyle = null;
  73394. }
  73395. }]);
  73396. return ShapeParameters;
  73397. }();
  73398. ;// CONCATENATED MODULE: ./src/common/overlay/feature/Point.js
  73399. function feature_Point_typeof(obj) { "@babel/helpers - typeof"; return feature_Point_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, feature_Point_typeof(obj); }
  73400. function feature_Point_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  73401. function feature_Point_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  73402. function feature_Point_createClass(Constructor, protoProps, staticProps) { if (protoProps) feature_Point_defineProperties(Constructor.prototype, protoProps); if (staticProps) feature_Point_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  73403. function Point_get() { if (typeof Reflect !== "undefined" && Reflect.get) { Point_get = Reflect.get.bind(); } else { Point_get = function _get(target, property, receiver) { var base = Point_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return Point_get.apply(this, arguments); }
  73404. function Point_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Point_getPrototypeOf(object); if (object === null) break; } return object; }
  73405. function Point_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) Point_setPrototypeOf(subClass, superClass); }
  73406. function Point_setPrototypeOf(o, p) { Point_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Point_setPrototypeOf(o, p); }
  73407. function Point_createSuper(Derived) { var hasNativeReflectConstruct = Point_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Point_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Point_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Point_possibleConstructorReturn(this, result); }; }
  73408. function Point_possibleConstructorReturn(self, call) { if (call && (feature_Point_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return Point_assertThisInitialized(self); }
  73409. function Point_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  73410. function Point_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  73411. function Point_getPrototypeOf(o) { Point_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Point_getPrototypeOf(o); }
  73412. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  73413. * This program are made available under the terms of the Apache License, Version 2.0
  73414. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  73415. /**
  73416. * @class ShapeParametersPoint
  73417. * @aliasclass Feature.ShapeParameters.Point
  73418. * @deprecatedclass SuperMap.Feature.ShapeParameters.Point
  73419. * @category Visualization Theme
  73420. * @classdesc 点参数对象。
  73421. * @extends {ShapeParameters}
  73422. * @param {number} x - 点 x 坐标。
  73423. * @param {number} y - 点 y 坐标。
  73424. * @usage
  73425. */
  73426. var Point_Point = /*#__PURE__*/function (_ShapeParameters) {
  73427. Point_inherits(Point, _ShapeParameters);
  73428. var _super = Point_createSuper(Point);
  73429. function Point(x, y) {
  73430. var _this;
  73431. feature_Point_classCallCheck(this, Point);
  73432. _this = _super.call(this, x, y);
  73433. /**
  73434. * @member {number} ShapeParametersPoint.prototype.x
  73435. * @description 点 x 坐标。
  73436. */
  73437. _this.x = !isNaN(x) ? x : 0;
  73438. /**
  73439. * @member {number} ShapeParametersPoint.prototype.y
  73440. * @description 点 y 坐标。
  73441. */
  73442. _this.y = !isNaN(y) ? y : 0;
  73443. /**
  73444. * @member {number} ShapeParametersPoint.prototype.r
  73445. * @description 点的半径。
  73446. */
  73447. _this.r = 6;
  73448. _this.CLASS_NAME = "SuperMap.Feature.ShapeParameters.Point";
  73449. return _this;
  73450. }
  73451. /**
  73452. * @function ShapeParametersPoint.prototype.destroy
  73453. * @description 销毁对象。
  73454. */
  73455. feature_Point_createClass(Point, [{
  73456. key: "destroy",
  73457. value: function destroy() {
  73458. this.x = null;
  73459. this.y = null;
  73460. this.r = null;
  73461. Point_get(Point_getPrototypeOf(Point.prototype), "destroy", this).call(this);
  73462. }
  73463. }]);
  73464. return Point;
  73465. }(ShapeParameters);
  73466. ;// CONCATENATED MODULE: ./src/common/overlay/feature/Line.js
  73467. function Line_typeof(obj) { "@babel/helpers - typeof"; return Line_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, Line_typeof(obj); }
  73468. function Line_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  73469. function Line_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  73470. function Line_createClass(Constructor, protoProps, staticProps) { if (protoProps) Line_defineProperties(Constructor.prototype, protoProps); if (staticProps) Line_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  73471. function Line_get() { if (typeof Reflect !== "undefined" && Reflect.get) { Line_get = Reflect.get.bind(); } else { Line_get = function _get(target, property, receiver) { var base = Line_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return Line_get.apply(this, arguments); }
  73472. function Line_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Line_getPrototypeOf(object); if (object === null) break; } return object; }
  73473. function Line_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) Line_setPrototypeOf(subClass, superClass); }
  73474. function Line_setPrototypeOf(o, p) { Line_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Line_setPrototypeOf(o, p); }
  73475. function Line_createSuper(Derived) { var hasNativeReflectConstruct = Line_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Line_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Line_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Line_possibleConstructorReturn(this, result); }; }
  73476. function Line_possibleConstructorReturn(self, call) { if (call && (Line_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return Line_assertThisInitialized(self); }
  73477. function Line_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  73478. function Line_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  73479. function Line_getPrototypeOf(o) { Line_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Line_getPrototypeOf(o); }
  73480. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  73481. * This program are made available under the terms of the Apache License, Version 2.0
  73482. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  73483. /**
  73484. * @class ShapeParametersLine
  73485. * @aliasclass Feature.ShapeParameters.Line
  73486. * @deprecatedclass SuperMap.Feature.ShapeParameters.Line
  73487. * @category Visualization Theme
  73488. * @classdesc 线参数对象。
  73489. * @extends {ShapeParameters}
  73490. * @param {Array} pointList - 线要素节点数组,二维数组。
  73491. * @usage
  73492. */
  73493. var Line_Line = /*#__PURE__*/function (_ShapeParameters) {
  73494. Line_inherits(Line, _ShapeParameters);
  73495. var _super = Line_createSuper(Line);
  73496. function Line(pointList) {
  73497. var _this;
  73498. Line_classCallCheck(this, Line);
  73499. _this = _super.call(this, pointList);
  73500. /**
  73501. * @member {Array} ShapeParametersLine.prototype.pointList
  73502. * @description 线要素节点数组,二维数组。
  73503. * 数组形如:
  73504. * (start code)
  73505. * [
  73506. * [10, 20], //节点
  73507. * [30, 40],
  73508. * [25, 30] //最后一个节点和第一个节点不必相同,绘制时自动封闭
  73509. * ]
  73510. * (end)
  73511. */
  73512. _this.pointList = pointList;
  73513. _this.CLASS_NAME = "SuperMap.Feature.ShapeParameters.Line";
  73514. return _this;
  73515. }
  73516. /**
  73517. * @function ShapeParametersLine.prototype.destroy
  73518. * @description 销毁对象。
  73519. */
  73520. Line_createClass(Line, [{
  73521. key: "destroy",
  73522. value: function destroy() {
  73523. this.pointList = null;
  73524. Line_get(Line_getPrototypeOf(Line.prototype), "destroy", this).call(this);
  73525. }
  73526. }]);
  73527. return Line;
  73528. }(ShapeParameters);
  73529. ;// CONCATENATED MODULE: ./src/common/overlay/feature/Polygon.js
  73530. function feature_Polygon_typeof(obj) { "@babel/helpers - typeof"; return feature_Polygon_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, feature_Polygon_typeof(obj); }
  73531. function feature_Polygon_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  73532. function feature_Polygon_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  73533. function feature_Polygon_createClass(Constructor, protoProps, staticProps) { if (protoProps) feature_Polygon_defineProperties(Constructor.prototype, protoProps); if (staticProps) feature_Polygon_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  73534. function Polygon_get() { if (typeof Reflect !== "undefined" && Reflect.get) { Polygon_get = Reflect.get.bind(); } else { Polygon_get = function _get(target, property, receiver) { var base = Polygon_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return Polygon_get.apply(this, arguments); }
  73535. function Polygon_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = feature_Polygon_getPrototypeOf(object); if (object === null) break; } return object; }
  73536. function feature_Polygon_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) feature_Polygon_setPrototypeOf(subClass, superClass); }
  73537. function feature_Polygon_setPrototypeOf(o, p) { feature_Polygon_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return feature_Polygon_setPrototypeOf(o, p); }
  73538. function feature_Polygon_createSuper(Derived) { var hasNativeReflectConstruct = feature_Polygon_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = feature_Polygon_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = feature_Polygon_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return feature_Polygon_possibleConstructorReturn(this, result); }; }
  73539. function feature_Polygon_possibleConstructorReturn(self, call) { if (call && (feature_Polygon_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return feature_Polygon_assertThisInitialized(self); }
  73540. function feature_Polygon_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  73541. function feature_Polygon_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  73542. function feature_Polygon_getPrototypeOf(o) { feature_Polygon_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return feature_Polygon_getPrototypeOf(o); }
  73543. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  73544. * This program are made available under the terms of the Apache License, Version 2.0
  73545. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  73546. /**
  73547. * @class ShapeParametersPolygon
  73548. * @aliasclass Feature.ShapeParameters.Polygon
  73549. * @deprecatedclass SuperMap.Feature.ShapeParameters.Polygon
  73550. * @category Visualization Theme
  73551. * @classdesc 面参数对象。
  73552. * @extends {ShapeParameters}
  73553. * @param {Array} pointList - 横坐标。
  73554. * @usage
  73555. */
  73556. var feature_Polygon_Polygon = /*#__PURE__*/function (_ShapeParameters) {
  73557. feature_Polygon_inherits(Polygon, _ShapeParameters);
  73558. var _super = feature_Polygon_createSuper(Polygon);
  73559. function Polygon(pointList) {
  73560. var _this;
  73561. feature_Polygon_classCallCheck(this, Polygon);
  73562. _this = _super.call(this, pointList);
  73563. /**
  73564. * @member {Array} ShapeParametersPolygon.prototype.pointList
  73565. * @description 面要素节点数组,二维数组。
  73566. * 数组形如:
  73567. * (start code)
  73568. * [
  73569. * [10, 20], //节点
  73570. * [30, 40],
  73571. * [25, 30] //最后一个节点和第一个节点不必相同,绘制时自动封闭
  73572. * ]
  73573. * (end)
  73574. */
  73575. _this.pointList = pointList;
  73576. /**
  73577. * @member {Array} ShapeParametersPolygon.prototype.holePolygonPointLists
  73578. * @description 岛洞面多边形顶点数组(三维数组)
  73579. */
  73580. _this.holePolygonPointLists = null;
  73581. _this.CLASS_NAME = "SuperMap.Feature.ShapeParameters.Polygon";
  73582. return _this;
  73583. }
  73584. /**
  73585. * @function ShapeParametersPolygon.prototype.destroy
  73586. * @description 销毁对象。
  73587. */
  73588. feature_Polygon_createClass(Polygon, [{
  73589. key: "destroy",
  73590. value: function destroy() {
  73591. this.pointList = null;
  73592. this.holePolygonPointLists = null;
  73593. Polygon_get(feature_Polygon_getPrototypeOf(Polygon.prototype), "destroy", this).call(this);
  73594. }
  73595. }]);
  73596. return Polygon;
  73597. }(ShapeParameters);
  73598. ;// CONCATENATED MODULE: ./src/common/overlay/feature/Rectangle.js
  73599. function feature_Rectangle_typeof(obj) { "@babel/helpers - typeof"; return feature_Rectangle_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, feature_Rectangle_typeof(obj); }
  73600. function feature_Rectangle_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  73601. function feature_Rectangle_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  73602. function feature_Rectangle_createClass(Constructor, protoProps, staticProps) { if (protoProps) feature_Rectangle_defineProperties(Constructor.prototype, protoProps); if (staticProps) feature_Rectangle_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  73603. function Rectangle_get() { if (typeof Reflect !== "undefined" && Reflect.get) { Rectangle_get = Reflect.get.bind(); } else { Rectangle_get = function _get(target, property, receiver) { var base = Rectangle_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return Rectangle_get.apply(this, arguments); }
  73604. function Rectangle_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = feature_Rectangle_getPrototypeOf(object); if (object === null) break; } return object; }
  73605. function feature_Rectangle_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) feature_Rectangle_setPrototypeOf(subClass, superClass); }
  73606. function feature_Rectangle_setPrototypeOf(o, p) { feature_Rectangle_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return feature_Rectangle_setPrototypeOf(o, p); }
  73607. function feature_Rectangle_createSuper(Derived) { var hasNativeReflectConstruct = feature_Rectangle_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = feature_Rectangle_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = feature_Rectangle_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return feature_Rectangle_possibleConstructorReturn(this, result); }; }
  73608. function feature_Rectangle_possibleConstructorReturn(self, call) { if (call && (feature_Rectangle_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return feature_Rectangle_assertThisInitialized(self); }
  73609. function feature_Rectangle_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  73610. function feature_Rectangle_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  73611. function feature_Rectangle_getPrototypeOf(o) { feature_Rectangle_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return feature_Rectangle_getPrototypeOf(o); }
  73612. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  73613. * This program are made available under the terms of the Apache License, Version 2.0
  73614. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  73615. /**
  73616. * @class ShapeParametersRectangle
  73617. * @aliasclass Feature.ShapeParameters.Rectangle
  73618. * @deprecatedclass SuperMap.Feature.ShapeParameters.Rectangle
  73619. * @category Visualization Theme
  73620. * @classdesc 矩形参数对象。
  73621. * @extends {ShapeParameters}
  73622. * @param {number} x - 矩形 x 坐标。
  73623. * @param {number} y - 矩形 y 坐标。
  73624. * @param {number} width - 矩形 width 宽度。
  73625. * @param {number} height - 矩形 height 高度。
  73626. * @usage
  73627. */
  73628. var Rectangle_Rectangle = /*#__PURE__*/function (_ShapeParameters) {
  73629. feature_Rectangle_inherits(Rectangle, _ShapeParameters);
  73630. var _super = feature_Rectangle_createSuper(Rectangle);
  73631. function Rectangle(x, y, width, height) {
  73632. var _this;
  73633. feature_Rectangle_classCallCheck(this, Rectangle);
  73634. _this = _super.call(this, x, y, width, height);
  73635. /**
  73636. * @member {number} ShapeParametersRectangle.prototype.x
  73637. * @description 左上角 x 坐标。
  73638. */
  73639. _this.x = !isNaN(x) ? x : 0;
  73640. /**
  73641. * @member {number} ShapeParametersRectangle.prototype.y
  73642. * @description 左上角 y 坐标。
  73643. */
  73644. _this.y = !isNaN(x) ? y : 0;
  73645. /**
  73646. * @member {number} ShapeParametersRectangle.prototype.width
  73647. * @description 宽度。
  73648. */
  73649. _this.width = !isNaN(width) ? width : 0;
  73650. /**
  73651. * @member {number} ShapeParametersRectangle.prototype.height
  73652. * @description 高度。
  73653. */
  73654. _this.height = !isNaN(height) ? height : 0;
  73655. _this.CLASS_NAME = "SuperMap.Feature.ShapeParameters.Rectangle";
  73656. return _this;
  73657. }
  73658. /**
  73659. * @function ShapeParametersRectangle.prototype.destroy
  73660. * @description 销毁对象。
  73661. */
  73662. feature_Rectangle_createClass(Rectangle, [{
  73663. key: "destroy",
  73664. value: function destroy() {
  73665. this.x = null;
  73666. this.y = null;
  73667. this.width = null;
  73668. this.height = null;
  73669. Rectangle_get(feature_Rectangle_getPrototypeOf(Rectangle.prototype), "destroy", this).call(this);
  73670. }
  73671. }]);
  73672. return Rectangle;
  73673. }(ShapeParameters);
  73674. ;// CONCATENATED MODULE: ./src/common/overlay/feature/Sector.js
  73675. function Sector_typeof(obj) { "@babel/helpers - typeof"; return Sector_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, Sector_typeof(obj); }
  73676. function Sector_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  73677. function Sector_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  73678. function Sector_createClass(Constructor, protoProps, staticProps) { if (protoProps) Sector_defineProperties(Constructor.prototype, protoProps); if (staticProps) Sector_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  73679. function Sector_get() { if (typeof Reflect !== "undefined" && Reflect.get) { Sector_get = Reflect.get.bind(); } else { Sector_get = function _get(target, property, receiver) { var base = Sector_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return Sector_get.apply(this, arguments); }
  73680. function Sector_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Sector_getPrototypeOf(object); if (object === null) break; } return object; }
  73681. function Sector_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) Sector_setPrototypeOf(subClass, superClass); }
  73682. function Sector_setPrototypeOf(o, p) { Sector_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Sector_setPrototypeOf(o, p); }
  73683. function Sector_createSuper(Derived) { var hasNativeReflectConstruct = Sector_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Sector_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Sector_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Sector_possibleConstructorReturn(this, result); }; }
  73684. function Sector_possibleConstructorReturn(self, call) { if (call && (Sector_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return Sector_assertThisInitialized(self); }
  73685. function Sector_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  73686. function Sector_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  73687. function Sector_getPrototypeOf(o) { Sector_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Sector_getPrototypeOf(o); }
  73688. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  73689. * This program are made available under the terms of the Apache License, Version 2.0
  73690. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  73691. /**
  73692. * @class ShapeParametersSector
  73693. * @aliasclass Feature.ShapeParameters.Sector
  73694. * @deprecatedclass SuperMap.Feature.ShapeParameters.Sector
  73695. * @category Visualization Theme
  73696. * @classdesc 扇形参数对象。
  73697. * @extends {ShapeParameters}
  73698. * @param {number} x - 圆心 x 坐标。
  73699. * @param {number} y - 圆心 y 坐标。
  73700. * @param {number} r - 外圆半径。
  73701. * @param {number} startAngle - 起始角度。取值范围[0, 360)。
  73702. * @param {number} endAngle - 结束角度。取值范围(0, 360]。
  73703. * @param {number} [r0=0] - 内圆半径,指定后将出现内弧,同时扇边长度为'r - r0'。取值范围[0, r)。
  73704. * @usage
  73705. */
  73706. var Sector = /*#__PURE__*/function (_ShapeParameters) {
  73707. Sector_inherits(Sector, _ShapeParameters);
  73708. var _super = Sector_createSuper(Sector);
  73709. function Sector(x, y, r, startAngle, endAngle, r0, clockWise) {
  73710. var _this;
  73711. Sector_classCallCheck(this, Sector);
  73712. _this = _super.call(this, x, y, r, startAngle, endAngle, r0, clockWise);
  73713. /**
  73714. * @member {number} ShapeParametersSector.prototype.x
  73715. * @description 圆心 x 坐标。
  73716. */
  73717. _this.x = !isNaN(x) ? x : 0;
  73718. /**
  73719. * @member {number} ShapeParametersSector.prototype.Y
  73720. * @description 圆心 Y 坐标。
  73721. */
  73722. _this.y = !isNaN(y) ? y : 0;
  73723. /**
  73724. * @member {number} ShapeParametersSector.prototype.r
  73725. * @description 外圆半径。
  73726. */
  73727. _this.r = !isNaN(r) ? r : 0;
  73728. /**
  73729. * @member {number} ShapeParametersSector.prototype.startAngle
  73730. * @description 起始角度。取值范围[0, 360),默认值:null。
  73731. */
  73732. _this.startAngle = !isNaN(startAngle) ? startAngle : 0;
  73733. /**
  73734. * @member {number} ShapeParametersSector.prototype.endAngle
  73735. * @description 结束角度。取值范围(0, 360],默认值:null。
  73736. */
  73737. _this.endAngle = !isNaN(endAngle) ? endAngle : 0;
  73738. /**
  73739. * @member {number} [ShapeParametersSector.prototype.r0=0]
  73740. * @description 内圆半径,指定后将出现内弧,同时扇边长度为 r 减 r0。取值范围[0, r)。
  73741. */
  73742. _this.r0 = !isNaN(r0) ? r0 : 0;
  73743. /**
  73744. * @member {number} [ShapeParametersSector.prototype.clockWise=false]
  73745. * @description 是否是顺时针。默认值:false。
  73746. */
  73747. _this.clockWise = clockWise;
  73748. _this.CLASS_NAME = "SuperMap.Feature.ShapeParameters.Sector";
  73749. return _this;
  73750. }
  73751. /**
  73752. * @function ShapeParametersSector.prototype.destroy
  73753. * @description 销毁对象。
  73754. */
  73755. Sector_createClass(Sector, [{
  73756. key: "destroy",
  73757. value: function destroy() {
  73758. this.x = null;
  73759. this.y = null;
  73760. this.r = null;
  73761. this.startAngle = null;
  73762. this.endAngle = null;
  73763. this.r0 = null;
  73764. this.clockWise = null;
  73765. Sector_get(Sector_getPrototypeOf(Sector.prototype), "destroy", this).call(this);
  73766. }
  73767. }]);
  73768. return Sector;
  73769. }(ShapeParameters);
  73770. ;// CONCATENATED MODULE: ./src/common/overlay/feature/Label.js
  73771. function Label_typeof(obj) { "@babel/helpers - typeof"; return Label_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, Label_typeof(obj); }
  73772. function Label_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  73773. function Label_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  73774. function Label_createClass(Constructor, protoProps, staticProps) { if (protoProps) Label_defineProperties(Constructor.prototype, protoProps); if (staticProps) Label_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  73775. function Label_get() { if (typeof Reflect !== "undefined" && Reflect.get) { Label_get = Reflect.get.bind(); } else { Label_get = function _get(target, property, receiver) { var base = Label_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return Label_get.apply(this, arguments); }
  73776. function Label_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Label_getPrototypeOf(object); if (object === null) break; } return object; }
  73777. function Label_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) Label_setPrototypeOf(subClass, superClass); }
  73778. function Label_setPrototypeOf(o, p) { Label_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Label_setPrototypeOf(o, p); }
  73779. function Label_createSuper(Derived) { var hasNativeReflectConstruct = Label_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Label_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Label_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Label_possibleConstructorReturn(this, result); }; }
  73780. function Label_possibleConstructorReturn(self, call) { if (call && (Label_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return Label_assertThisInitialized(self); }
  73781. function Label_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  73782. function Label_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  73783. function Label_getPrototypeOf(o) { Label_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Label_getPrototypeOf(o); }
  73784. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  73785. * This program are made available under the terms of the Apache License, Version 2.0
  73786. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  73787. /**
  73788. * @class ShapeParametersLabel
  73789. * @aliasclass Feature.ShapeParameters.Label
  73790. * @deprecatedclass SuperMap.Feature.ShapeParameters.Label
  73791. * @category Visualization Theme
  73792. * @classdesc 标签参数对象。
  73793. * @extends {ShapeParameters}
  73794. * @param {number} x - 横坐标。
  73795. * @param {number} y - 纵坐标。
  73796. * @param {string} text - 图形中的附加文本。
  73797. * @usage
  73798. * ```
  73799. * // 浏览器
  73800. * <script type="text/javascript" src="{cdn}"></script>
  73801. * <script>
  73802. * new {namespace}.Feature.ShapeParameters.Label(x, y, text);
  73803. *
  73804. * // 弃用的写法
  73805. * new SuperMap.Feature.ShapeParameters.Label(x, y, text);
  73806. *
  73807. * </script>
  73808. * // ES6 Import
  73809. * import { ShapeParametersLabel } from '{npm}';
  73810. * new ShapeParametersLabel(x, y, text);
  73811. *
  73812. * // 弃用的写法
  73813. * import { Label } from '{npm}';
  73814. * new Label(x, y, text);
  73815. *
  73816. * ```
  73817. */
  73818. var Label = /*#__PURE__*/function (_ShapeParameters) {
  73819. Label_inherits(Label, _ShapeParameters);
  73820. var _super = Label_createSuper(Label);
  73821. function Label(x, y, text) {
  73822. var _this;
  73823. Label_classCallCheck(this, Label);
  73824. _this = _super.call(this, x, y, text);
  73825. /**
  73826. * @member {number} ShapeParametersLabel.prototype.x
  73827. * @description 标签 x 坐标。
  73828. */
  73829. _this.x = x;
  73830. /**
  73831. * @member {number} ShapeParametersLabel.prototype.y
  73832. * @description 标签 y 坐标。
  73833. */
  73834. _this.y = y;
  73835. /**
  73836. * @member {number} ShapeParametersLabel.prototype.text
  73837. * @description 标签的文本内容。
  73838. */
  73839. _this.text = text;
  73840. _this.CLASS_NAME = "SuperMap.Feature.ShapeParameters.Label";
  73841. return _this;
  73842. }
  73843. /**
  73844. * @function ShapeParametersLabel.prototype.destroy
  73845. * @description 销毁对象。
  73846. */
  73847. Label_createClass(Label, [{
  73848. key: "destroy",
  73849. value: function destroy() {
  73850. this.x = null;
  73851. this.y = null;
  73852. this.text = null;
  73853. Label_get(Label_getPrototypeOf(Label.prototype), "destroy", this).call(this);
  73854. }
  73855. }]);
  73856. return Label;
  73857. }(ShapeParameters);
  73858. ;// CONCATENATED MODULE: ./src/common/overlay/feature/Image.js
  73859. function feature_Image_typeof(obj) { "@babel/helpers - typeof"; return feature_Image_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, feature_Image_typeof(obj); }
  73860. function feature_Image_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  73861. function feature_Image_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  73862. function feature_Image_createClass(Constructor, protoProps, staticProps) { if (protoProps) feature_Image_defineProperties(Constructor.prototype, protoProps); if (staticProps) feature_Image_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  73863. function feature_Image_get() { if (typeof Reflect !== "undefined" && Reflect.get) { feature_Image_get = Reflect.get.bind(); } else { feature_Image_get = function _get(target, property, receiver) { var base = feature_Image_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return feature_Image_get.apply(this, arguments); }
  73864. function feature_Image_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = feature_Image_getPrototypeOf(object); if (object === null) break; } return object; }
  73865. function feature_Image_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) feature_Image_setPrototypeOf(subClass, superClass); }
  73866. function feature_Image_setPrototypeOf(o, p) { feature_Image_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return feature_Image_setPrototypeOf(o, p); }
  73867. function feature_Image_createSuper(Derived) { var hasNativeReflectConstruct = feature_Image_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = feature_Image_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = feature_Image_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return feature_Image_possibleConstructorReturn(this, result); }; }
  73868. function feature_Image_possibleConstructorReturn(self, call) { if (call && (feature_Image_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return feature_Image_assertThisInitialized(self); }
  73869. function feature_Image_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  73870. function feature_Image_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  73871. function feature_Image_getPrototypeOf(o) { feature_Image_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return feature_Image_getPrototypeOf(o); }
  73872. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  73873. * This program are made available under the terms of the Apache License, Version 2.0
  73874. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  73875. /**
  73876. * @class ShapeParametersImage
  73877. * @aliasclass Feature.ShapeParameters.Image
  73878. * @deprecatedclass SuperMap.Feature.ShapeParameters.Image
  73879. * @category Visualization Theme
  73880. * @classdesc 图片参数对象。
  73881. * @extends {ShapeParameters}
  73882. * @param {number} x - 左上角横坐标。
  73883. * @param {number} y - 左上角纵坐标。
  73884. * @param {(string|Object)} image - 图片地址或Cavans对象。
  73885. * @param {number} width - 绘制到画布上的宽度,默认为图片高度。
  73886. * @param {number} height - 绘制到画布上的高度,默认为图片高度。
  73887. * @param {number} sx - 从图片中裁剪的左上角横坐标。
  73888. * @param {number} sy - 从图片中裁剪的左上角纵坐标。
  73889. * @param {number} sWidth - 从图片中裁剪的宽度,默认为图片高度。
  73890. * @param {number} sHeight - 绘制到画布上的高度,默认为图片高度。
  73891. * @usage
  73892. */
  73893. var Image_Image = /*#__PURE__*/function (_ShapeParameters) {
  73894. feature_Image_inherits(Image, _ShapeParameters);
  73895. var _super = feature_Image_createSuper(Image);
  73896. function Image(x, y, image, width, height, sx, sy, sWidth, sHeight) {
  73897. var _this;
  73898. feature_Image_classCallCheck(this, Image);
  73899. _this = _super.call(this, x, y, image, width, height, sx, sy, sWidth, sHeight);
  73900. /**
  73901. * @member {number} ShapeParametersImage.prototype.x
  73902. * @description 左上角横坐标,必设参数。
  73903. */
  73904. _this.x = x;
  73905. /**
  73906. * @member {number} ShapeParametersImage.prototype.y
  73907. * @description 左上角纵坐标,必设参数。
  73908. */
  73909. _this.y = y;
  73910. /**
  73911. * @member {(string|Object)} ShapeParametersImage.prototype.image
  73912. * @description 图片地址。
  73913. */
  73914. _this.image = image;
  73915. /**
  73916. * @member {number} ShapeParametersImage.prototype.width
  73917. * @description 绘制到画布上的宽度,默认为图片高度。
  73918. */
  73919. _this.width = width;
  73920. /**
  73921. * @member {number} ShapeParametersImage.prototype.height
  73922. * @description 绘制到画布上的高度,默认为图片高度。
  73923. */
  73924. _this.height = height;
  73925. /**
  73926. * @member {number} ShapeParametersImage.prototype.sx
  73927. * @description 从图片中裁剪的左上角横坐标。
  73928. */
  73929. _this.sx = sx;
  73930. /**
  73931. * @member {number} ShapeParametersImage.prototype.sy
  73932. * @description 从图片中裁剪的左上角纵坐标。
  73933. */
  73934. _this.sy = sy;
  73935. /**
  73936. * @member {number} ShapeParametersImage.prototype.sWidth
  73937. * @description 从图片中裁剪的宽度,默认为图片高度。
  73938. */
  73939. _this.sWidth = sWidth;
  73940. /**
  73941. * @member {number} ShapeParametersImage.prototype.sHeight
  73942. * @description 绘制到画布上的高度,默认为图片高度。
  73943. */
  73944. _this.sHeight = sHeight;
  73945. _this.CLASS_NAME = "SuperMap.Feature.ShapeParameters.Image";
  73946. return _this;
  73947. }
  73948. /**
  73949. * @function ShapeParametersImage.prototype.destroy
  73950. * @description 销毁对象。
  73951. */
  73952. feature_Image_createClass(Image, [{
  73953. key: "destroy",
  73954. value: function destroy() {
  73955. this.x = null;
  73956. this.y = null;
  73957. this.image = null;
  73958. this.width = null;
  73959. this.height = null;
  73960. this.sx = null;
  73961. this.sy = null;
  73962. this.sWidth = null;
  73963. this.sHeight = null;
  73964. feature_Image_get(feature_Image_getPrototypeOf(Image.prototype), "destroy", this).call(this);
  73965. }
  73966. }]);
  73967. return Image;
  73968. }(ShapeParameters);
  73969. ;// CONCATENATED MODULE: ./src/common/overlay/feature/Circle.js
  73970. function Circle_typeof(obj) { "@babel/helpers - typeof"; return Circle_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, Circle_typeof(obj); }
  73971. function Circle_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  73972. function Circle_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  73973. function Circle_createClass(Constructor, protoProps, staticProps) { if (protoProps) Circle_defineProperties(Constructor.prototype, protoProps); if (staticProps) Circle_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  73974. function Circle_get() { if (typeof Reflect !== "undefined" && Reflect.get) { Circle_get = Reflect.get.bind(); } else { Circle_get = function _get(target, property, receiver) { var base = Circle_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return Circle_get.apply(this, arguments); }
  73975. function Circle_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Circle_getPrototypeOf(object); if (object === null) break; } return object; }
  73976. function Circle_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) Circle_setPrototypeOf(subClass, superClass); }
  73977. function Circle_setPrototypeOf(o, p) { Circle_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Circle_setPrototypeOf(o, p); }
  73978. function Circle_createSuper(Derived) { var hasNativeReflectConstruct = Circle_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Circle_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Circle_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Circle_possibleConstructorReturn(this, result); }; }
  73979. function Circle_possibleConstructorReturn(self, call) { if (call && (Circle_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return Circle_assertThisInitialized(self); }
  73980. function Circle_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  73981. function Circle_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  73982. function Circle_getPrototypeOf(o) { Circle_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Circle_getPrototypeOf(o); }
  73983. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  73984. * This program are made available under the terms of the Apache License, Version 2.0
  73985. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  73986. /**
  73987. * @class ShapeParametersCircle
  73988. * @aliasclass Feature.ShapeParameters.Circle
  73989. * @deprecatedclass SuperMap.Feature.ShapeParameters.Circle
  73990. * @classdesc 圆形参数对象。
  73991. * @category Visualization Theme
  73992. * @extends {ShapeParameters}
  73993. * @param {number} x - 圆心 x 坐标。
  73994. * @param {number} y - 圆心 y 坐标。
  73995. * @param {number} r - 圆半径。
  73996. * @usage
  73997. */
  73998. var Circle_Circle = /*#__PURE__*/function (_ShapeParameters) {
  73999. Circle_inherits(Circle, _ShapeParameters);
  74000. var _super = Circle_createSuper(Circle);
  74001. function Circle(x, y, r) {
  74002. var _this;
  74003. Circle_classCallCheck(this, Circle);
  74004. _this = _super.call(this, x, y, r);
  74005. /**
  74006. * @member {number} ShapeParametersCircle.prototype.x
  74007. * @description 圆心 x 坐标。
  74008. */
  74009. _this.x = !isNaN(x) ? x : 0;
  74010. /**
  74011. * @member {number} ShapeParametersCircle.prototype.y
  74012. * @description 圆心 y 坐标。
  74013. */
  74014. _this.y = !isNaN(y) ? y : 0;
  74015. /**
  74016. * @member {number} ShapeParametersCircle.prototype.r
  74017. * @description 圆半径。
  74018. */
  74019. _this.r = !isNaN(r) ? r : 0;
  74020. _this.CLASS_NAME = "SuperMap.Feature.ShapeParameters.Circle";
  74021. return _this;
  74022. }
  74023. /**
  74024. * @function ShapeParametersCircle.prototype.destroy
  74025. * @description 销毁对象。
  74026. */
  74027. Circle_createClass(Circle, [{
  74028. key: "destroy",
  74029. value: function destroy() {
  74030. this.x = null;
  74031. this.y = null;
  74032. this.r = null;
  74033. Circle_get(Circle_getPrototypeOf(Circle.prototype), "destroy", this).call(this);
  74034. }
  74035. }]);
  74036. return Circle;
  74037. }(ShapeParameters);
  74038. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Eventful.js
  74039. function Eventful_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  74040. function Eventful_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  74041. function Eventful_createClass(Constructor, protoProps, staticProps) { if (protoProps) Eventful_defineProperties(Constructor.prototype, protoProps); if (staticProps) Eventful_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  74042. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  74043. * This program are made available under the terms of the Apache License, Version 2.0
  74044. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  74045. /**
  74046. * @class LevelRenderer.Eventful
  74047. * @category Visualization Theme
  74048. * @classdesc 事件分发器超类,所有支持事件处理的类均是此类的子类。
  74049. * 此类不可实例化。
  74050. * 支持的事件:
  74051. * Symbolizer properties:
  74052. * onclick - {function} 默认值:null。
  74053. * onmouseover - {function} 默认值:null。
  74054. * onmouseout - {function} 默认值:null。
  74055. * onmousemove - {function} 默认值:null。
  74056. * onmousewheel - {function} 默认值:null。
  74057. * onmousedown - {function} 默认值:null。
  74058. * onmouseup - {function} 默认值:null。
  74059. * ondragstart - {function} 默认值:null。
  74060. * ondragend - {function} 默认值:null。
  74061. * ondragenter - {function} 默认值:null。
  74062. * ondragleave - {function} 默认值:null。
  74063. * ondragover - {function} 默认值:null。
  74064. * ondrop - {function} 默认值:null。
  74065. * @private
  74066. */
  74067. var Eventful = /*#__PURE__*/function () {
  74068. function Eventful() {
  74069. Eventful_classCallCheck(this, Eventful);
  74070. /**
  74071. * @member {Object} LevelRenderer.Eventful.prototype._handlers
  74072. * @description 事件处理对象(事件分发器)。
  74073. */
  74074. this._handlers = {};
  74075. this.CLASS_NAME = "SuperMap.LevelRenderer.Eventful";
  74076. }
  74077. /**
  74078. * @function {Object} LevelRenderer.Eventful.prototype.destroy
  74079. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  74080. */
  74081. Eventful_createClass(Eventful, [{
  74082. key: "destroy",
  74083. value: function destroy() {
  74084. this._handlers = null;
  74085. }
  74086. /**
  74087. * @function LevelRenderer.Eventful.prototype.one
  74088. * @description 单次触发绑定,dispatch后销毁。
  74089. * @param {string} event - 事件名。
  74090. * @param {boolean} handler - 响应函数。
  74091. * @param {Object} context - context。
  74092. * @returns {LevelRenderer.Eventful} this
  74093. */
  74094. }, {
  74095. key: "one",
  74096. value: function one(event, handler, context) {
  74097. var _h = this._handlers;
  74098. if (!handler || !event) {
  74099. return this;
  74100. }
  74101. if (!_h[event]) {
  74102. _h[event] = [];
  74103. }
  74104. _h[event].push({
  74105. h: handler,
  74106. one: true,
  74107. ctx: context || this
  74108. });
  74109. return this;
  74110. }
  74111. /**
  74112. * @function LevelRenderer.Eventful.prototype.bind
  74113. * @description 绑定事件。
  74114. * @param {string} event - 事件名。
  74115. * @param {boolean} handler - 响应函数。
  74116. * @param {Object} context - context。
  74117. * @returns {LevelRenderer.Eventful} this
  74118. */
  74119. }, {
  74120. key: "bind",
  74121. value: function bind(event, handler, context) {
  74122. var _h = this._handlers;
  74123. if (!handler || !event) {
  74124. return this;
  74125. }
  74126. if (!_h[event]) {
  74127. _h[event] = [];
  74128. }
  74129. _h[event].push({
  74130. h: handler,
  74131. one: false,
  74132. ctx: context || this
  74133. });
  74134. return this;
  74135. }
  74136. /**
  74137. * @function LevelRenderer.Eventful.prototype.unbind
  74138. * @description 解绑事件。
  74139. * @param {string} event - 事件名。
  74140. * @param {boolean} handler - 响应函数。
  74141. * @returns {LevelRenderer.Eventful} this
  74142. */
  74143. }, {
  74144. key: "unbind",
  74145. value: function unbind(event, handler) {
  74146. var _h = this._handlers;
  74147. if (!event) {
  74148. this._handlers = {};
  74149. return this;
  74150. }
  74151. if (handler) {
  74152. if (_h[event]) {
  74153. var newList = [];
  74154. for (var i = 0, l = _h[event].length; i < l; i++) {
  74155. if (_h[event][i]['h'] != handler) {
  74156. newList.push(_h[event][i]);
  74157. }
  74158. }
  74159. _h[event] = newList;
  74160. }
  74161. if (_h[event] && _h[event].length === 0) {
  74162. delete _h[event];
  74163. }
  74164. } else {
  74165. delete _h[event];
  74166. }
  74167. return this;
  74168. }
  74169. /**
  74170. * @function LevelRenderer.Eventful.prototype.dispatch
  74171. * @description 事件分发。
  74172. * @param {string} type - 事件类型。
  74173. * @returns {LevelRenderer.Eventful} this
  74174. */
  74175. }, {
  74176. key: "dispatch",
  74177. value: function dispatch(type) {
  74178. if (this._handlers[type]) {
  74179. var args = arguments;
  74180. var argLen = args.length;
  74181. if (argLen > 3) {
  74182. args = Array.prototype.slice.call(args, 1);
  74183. }
  74184. var _h = this._handlers[type];
  74185. var len = _h.length;
  74186. for (var i = 0; i < len;) {
  74187. // Optimize advise from backbone
  74188. switch (argLen) {
  74189. case 1:
  74190. _h[i]['h'].call(_h[i]['ctx']);
  74191. break;
  74192. case 2:
  74193. _h[i]['h'].call(_h[i]['ctx'], args[1]);
  74194. break;
  74195. case 3:
  74196. _h[i]['h'].call(_h[i]['ctx'], args[1], args[2]);
  74197. break;
  74198. default:
  74199. // have more than 2 given arguments
  74200. _h[i]['h'].apply(_h[i]['ctx'], args);
  74201. break;
  74202. }
  74203. if (_h[i]['one']) {
  74204. _h.splice(i, 1);
  74205. len--;
  74206. } else {
  74207. i++;
  74208. }
  74209. }
  74210. }
  74211. return this;
  74212. }
  74213. /**
  74214. * @function LevelRenderer.Eventful.prototype.dispatchWithContext
  74215. * @description 带有context的事件分发,最后一个参数是事件回调的 context。
  74216. * @param {string} type - 事件类型。
  74217. * @returns {LevelRenderer.Eventful} this
  74218. */
  74219. }, {
  74220. key: "dispatchWithContext",
  74221. value: function dispatchWithContext(type) {
  74222. if (this._handlers[type]) {
  74223. var args = arguments;
  74224. var argLen = args.length;
  74225. if (argLen > 4) {
  74226. args = Array.prototype.slice.call(args, 1, args.length - 1);
  74227. }
  74228. var ctx = args[args.length - 1];
  74229. var _h = this._handlers[type];
  74230. var len = _h.length;
  74231. for (var i = 0; i < len;) {
  74232. // Optimize advise from backbone
  74233. switch (argLen) {
  74234. case 1:
  74235. _h[i]['h'].call(ctx);
  74236. break;
  74237. case 2:
  74238. _h[i]['h'].call(ctx, args[1]);
  74239. break;
  74240. case 3:
  74241. _h[i]['h'].call(ctx, args[1], args[2]);
  74242. break;
  74243. default:
  74244. // have more than 2 given arguments
  74245. _h[i]['h'].apply(ctx, args);
  74246. break;
  74247. }
  74248. if (_h[i]['one']) {
  74249. _h.splice(i, 1);
  74250. len--;
  74251. } else {
  74252. i++;
  74253. }
  74254. }
  74255. }
  74256. return this;
  74257. }
  74258. }]);
  74259. return Eventful;
  74260. }();
  74261. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Vector.js
  74262. function levelRenderer_Vector_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  74263. function levelRenderer_Vector_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  74264. function levelRenderer_Vector_createClass(Constructor, protoProps, staticProps) { if (protoProps) levelRenderer_Vector_defineProperties(Constructor.prototype, protoProps); if (staticProps) levelRenderer_Vector_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  74265. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  74266. * This program are made available under the terms of the Apache License, Version 2.0
  74267. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  74268. /**
  74269. * @private
  74270. * @class LevelRenderer.Tool.Vector
  74271. * @category Visualization Theme
  74272. * @classdesc LevelRenderer 二维向量类
  74273. *
  74274. */
  74275. var levelRenderer_Vector_Vector = /*#__PURE__*/function () {
  74276. function Vector() {
  74277. levelRenderer_Vector_classCallCheck(this, Vector);
  74278. this.ArrayCtor = typeof Float32Array === 'undefined' ? Array : Float32Array;
  74279. this.CLASS_NAME = "SuperMap.LevelRenderer.Tool.Vector";
  74280. }
  74281. /**
  74282. * @function LevelRenderer.Tool.Vector.prototype.create
  74283. * @description 创建一个向量。
  74284. *
  74285. * @param {number} x - x坐标
  74286. * @param {number} y - Y坐标
  74287. * @return {Vector2} 向量。
  74288. */
  74289. levelRenderer_Vector_createClass(Vector, [{
  74290. key: "create",
  74291. value: function create(x, y) {
  74292. var ArrayCtor = this.ArrayCtor;
  74293. var out = new ArrayCtor(2);
  74294. out[0] = x || 0;
  74295. out[1] = y || 0;
  74296. return out;
  74297. }
  74298. /**
  74299. * @function LevelRenderer.Tool.Vector.prototype.copy
  74300. * @description 复制一个向量。
  74301. *
  74302. * @param {Vector2} out - 基础向量。
  74303. * @param {Vector2} v - 向量。
  74304. * @return {Vector2} 克隆向量。
  74305. */
  74306. }, {
  74307. key: "copy",
  74308. value: function copy(out, v) {
  74309. out[0] = v[0];
  74310. out[1] = v[1];
  74311. return out;
  74312. }
  74313. /**
  74314. * @function LevelRenderer.Tool.Vector.prototype.set
  74315. * @description 设置向量的两个项。
  74316. *
  74317. * @param {Vector2} out - 基础向量。
  74318. * @param {number} a - 项 a。
  74319. * @param {number} b - 项 b。
  74320. * @return {Vector2} 结果。
  74321. */
  74322. }, {
  74323. key: "set",
  74324. value: function set(out, a, b) {
  74325. out[0] = a;
  74326. out[1] = b;
  74327. return out;
  74328. }
  74329. /**
  74330. * @function LevelRenderer.Tool.Vector.prototype.add
  74331. * @description 向量相加。
  74332. *
  74333. * @param {Vector2} out - 基础向量。
  74334. * @param {Vector2} v1 - 向量 v1。
  74335. * @param {Vector2} v2 - 向量 v2。
  74336. * @return {Vector2} 结果。
  74337. */
  74338. }, {
  74339. key: "add",
  74340. value: function add(out, v1, v2) {
  74341. out[0] = v1[0] + v2[0];
  74342. out[1] = v1[1] + v2[1];
  74343. return out;
  74344. }
  74345. /**
  74346. * @function LevelRenderer.Tool.Vector.prototype.scaleAndAdd
  74347. * @description 向量缩放后相加。
  74348. * @param {Vector2} out - 基础向量。
  74349. * @param {Vector2} v1 - 向量 v1。
  74350. * @param {Vector2} v2 - 向量 v2(缩放向量)。
  74351. * @param {number} a - 缩放参数。
  74352. * @return {Vector2} 结果。
  74353. */
  74354. }, {
  74355. key: "scaleAndAdd",
  74356. value: function scaleAndAdd(out, v1, v2, a) {
  74357. out[0] = v1[0] + v2[0] * a;
  74358. out[1] = v1[1] + v2[1] * a;
  74359. return out;
  74360. }
  74361. /**
  74362. * @function LevelRenderer.Tool.Vector.prototype.sub
  74363. * @description 向量相减。
  74364. * @param {Vector2} out - 基础向量。
  74365. * @param {Vector2} v1 - 向量 v1。
  74366. * @param {Vector2} v2 - 向量 v2。
  74367. * @return {Vector2} 结果。
  74368. */
  74369. }, {
  74370. key: "sub",
  74371. value: function sub(out, v1, v2) {
  74372. out[0] = v1[0] - v2[0];
  74373. out[1] = v1[1] - v2[1];
  74374. return out;
  74375. }
  74376. /**
  74377. * @function LevelRenderer.Tool.Vector.prototype.len
  74378. * @description 向量长度。
  74379. * @param {Vector2} v - 向量。
  74380. * @return {number} 向量长度。
  74381. */
  74382. }, {
  74383. key: "len",
  74384. value: function len(v) {
  74385. return Math.sqrt(this.lenSquare(v));
  74386. }
  74387. /**
  74388. * @function LevelRenderer.Tool.Vector.prototype.lenSquare
  74389. * @description 向量长度平方。
  74390. * @param {Vector2} v - 向量。
  74391. * @return {number} 向量长度平方。
  74392. */
  74393. }, {
  74394. key: "lenSquare",
  74395. value: function lenSquare(v) {
  74396. return v[0] * v[0] + v[1] * v[1];
  74397. }
  74398. /**
  74399. * @function LevelRenderer.Tool.Vector.prototype.mul
  74400. * @description 向量乘法。
  74401. * @param {Vector2} out - 基础向量。
  74402. * @param {Vector2} v1 - 向量 v1。
  74403. * @param {Vector2} v2 - 向量 v2。
  74404. * @return {Vector2} 结果。
  74405. */
  74406. }, {
  74407. key: "mul",
  74408. value: function mul(out, v1, v2) {
  74409. out[0] = v1[0] * v2[0];
  74410. out[1] = v1[1] * v2[1];
  74411. return out;
  74412. }
  74413. /**
  74414. * @function LevelRenderer.Tool.Vector.prototype.div
  74415. * @description 向量除法。
  74416. *
  74417. * @param {Vector2} out - 基础向量。
  74418. * @param {Vector2} v1 - 向量 v1。
  74419. * @param {Vector2} v2 - 向量 v2。
  74420. * @return {Vector2} 结果。
  74421. */
  74422. }, {
  74423. key: "div",
  74424. value: function div(out, v1, v2) {
  74425. out[0] = v1[0] / v2[0];
  74426. out[1] = v1[1] / v2[1];
  74427. return out;
  74428. }
  74429. /**
  74430. * @function LevelRenderer.Tool.Vector.prototype.dot
  74431. * @description 向量点乘。
  74432. *
  74433. * @param {Vector2} v1 - 向量 v1。
  74434. * @param {Vector2} v2 - 向量 v2。
  74435. * @return {number} 向量点乘。
  74436. */
  74437. }, {
  74438. key: "dot",
  74439. value: function dot(v1, v2) {
  74440. return v1[0] * v2[0] + v1[1] * v2[1];
  74441. }
  74442. /**
  74443. * @function LevelRenderer.Tool.Vector.prototype.scale
  74444. * @description 向量缩放。
  74445. *
  74446. * @param {Vector2} out - 基础向量。
  74447. * @param {Vector2} v - 向量v。
  74448. * @param {number} s -缩放参数。
  74449. * @return {Vector2} 结果。
  74450. */
  74451. }, {
  74452. key: "scale",
  74453. value: function scale(out, v, s) {
  74454. out[0] = v[0] * s;
  74455. out[1] = v[1] * s;
  74456. return out;
  74457. }
  74458. /**
  74459. * @function LevelRenderer.Tool.Vector.prototype.normalize
  74460. * @description 向量归一化。
  74461. *
  74462. * @param {Vector2} out - 基础向量。
  74463. * @param {Vector2} v - 向量 v。
  74464. * @return {Vector2} 结果。
  74465. */
  74466. }, {
  74467. key: "normalize",
  74468. value: function normalize(out, v) {
  74469. var d = this.len(v);
  74470. if (d === 0) {
  74471. out[0] = 0;
  74472. out[1] = 0;
  74473. } else {
  74474. out[0] = v[0] / d;
  74475. out[1] = v[1] / d;
  74476. }
  74477. return out;
  74478. }
  74479. /**
  74480. * @function LevelRenderer.Tool.Vector.prototype.distance
  74481. * @description 计算向量间距离。
  74482. *
  74483. * @param {Vector2} v1 - 向量 v1。
  74484. * @param {Vector2} v2 - 向量 v2。
  74485. * @return {number} 向量间距离。
  74486. */
  74487. }, {
  74488. key: "distance",
  74489. value: function distance(v1, v2) {
  74490. return Math.sqrt((v1[0] - v2[0]) * (v1[0] - v2[0]) + (v1[1] - v2[1]) * (v1[1] - v2[1]));
  74491. }
  74492. /**
  74493. * @function LevelRenderer.Tool.Vector.prototype.distanceSquare
  74494. * @description 向量距离平方。
  74495. *
  74496. * @param {Vector2} v1 - 向量 v1。
  74497. * @param {Vector2} v2 - 向量 v2。
  74498. * @return {number} 向量距离平方。
  74499. */
  74500. }, {
  74501. key: "distanceSquare",
  74502. value: function distanceSquare(v1, v2) {
  74503. return (v1[0] - v2[0]) * (v1[0] - v2[0]) + (v1[1] - v2[1]) * (v1[1] - v2[1]);
  74504. }
  74505. /**
  74506. * @function LevelRenderer.Tool.Vector.prototype.negate
  74507. * @description 求负向量。
  74508. *
  74509. * @param {Vector2} out - 基础向量。
  74510. * @param {Vector2} v - 向量 v。
  74511. * @return {Vector2} 负向量。
  74512. */
  74513. }, {
  74514. key: "negate",
  74515. value: function negate(out, v) {
  74516. out[0] = -v[0];
  74517. out[1] = -v[1];
  74518. return out;
  74519. }
  74520. /**
  74521. * @function LevelRenderer.Tool.Vector.prototype.lerp
  74522. * @description 两点之间线性插值。
  74523. *
  74524. * @param {Vector2} out - 基础向量。
  74525. * @param {Vector2} v1 - 向量 v1。
  74526. * @param {Vector2} v2 - 向量 v2。
  74527. * @param {number} t
  74528. * @return {Vector2} 结果。
  74529. */
  74530. }, {
  74531. key: "lerp",
  74532. value: function lerp(out, v1, v2, t) {
  74533. out[0] = v1[0] + t * (v2[0] - v1[0]);
  74534. out[1] = v1[1] + t * (v2[1] - v1[1]);
  74535. return out;
  74536. }
  74537. /**
  74538. * @function LevelRenderer.Tool.Vector.prototype.applyTransform
  74539. * @description 矩阵左乘向量。
  74540. *
  74541. * @param {Vector2} out - 基础向量。
  74542. * @param {Vector2} v1 - 向量 v1。
  74543. * @param {Vector2} v2 - 向量 v2。
  74544. * @return {Vector2} 结果。
  74545. */
  74546. }, {
  74547. key: "applyTransform",
  74548. value: function applyTransform(out, v, m) {
  74549. var x = v[0];
  74550. var y = v[1];
  74551. out[0] = m[0] * x + m[2] * y + m[4];
  74552. out[1] = m[1] * x + m[3] * y + m[5];
  74553. return out;
  74554. }
  74555. /**
  74556. * @function LevelRenderer.Tool.Vector.prototype.min
  74557. * @description 求两个向量最小值。
  74558. * @param {Vector2} out - 基础向量。
  74559. * @param {Vector2} v1 - 向量 v1。
  74560. * @param {Vector2} v2 - 向量 v2。
  74561. * @return {Vector2} 结果。
  74562. */
  74563. }, {
  74564. key: "min",
  74565. value: function min(out, v1, v2) {
  74566. out[0] = Math.min(v1[0], v2[0]);
  74567. out[1] = Math.min(v1[1], v2[1]);
  74568. return out;
  74569. }
  74570. /**
  74571. * @function LevelRenderer.Tool.Vector.prototype.max
  74572. * @description 求两个向量最大值。
  74573. *
  74574. * @param {Vector2} out - 基础向量。
  74575. * @param {Vector2} v1 - 向量 v1。
  74576. * @param {Vector2} v2 - 向量 v2。
  74577. * @return {Vector2} 结果。
  74578. */
  74579. }, {
  74580. key: "max",
  74581. value: function max(out, v1, v2) {
  74582. out[0] = Math.max(v1[0], v2[0]);
  74583. out[1] = Math.max(v1[1], v2[1]);
  74584. return out;
  74585. }
  74586. /**
  74587. * @function LevelRenderer.Tool.Vector.prototype.length
  74588. * @description 向量长度。
  74589. *
  74590. * @param {Vector2} v - 向量。
  74591. * @return {number} 向量长度。
  74592. */
  74593. }, {
  74594. key: "length",
  74595. value: function length(v) {
  74596. return this.len(v);
  74597. }
  74598. /**
  74599. * @function LevelRenderer.Tool.Vector.prototype.lengthSquare
  74600. * @description 向量长度平方。
  74601. *
  74602. * @param {Vector2} v - 向量。
  74603. * @return {number} 向量长度平方。
  74604. */
  74605. }, {
  74606. key: "lengthSquare",
  74607. value: function lengthSquare(v) {
  74608. return this.lenSquare(v);
  74609. }
  74610. /**
  74611. * @function LevelRenderer.Tool.Vector.prototype.dist
  74612. * @description 计算向量间距离。
  74613. *
  74614. * @param {Vector2} v1 - 向量 v1。
  74615. * @param {Vector2} v2 - 向量 v2。
  74616. * @return {number} 向量间距离。
  74617. */
  74618. }, {
  74619. key: "dist",
  74620. value: function dist(v1, v2) {
  74621. return this.distance(v1, v2);
  74622. }
  74623. /**
  74624. * @function LevelRenderer.Tool.Vector.prototype.distSquare
  74625. * @description 向量距离平方。
  74626. *
  74627. * @param {Vector2} v1 - 向量 v1。
  74628. * @param {Vector2} v2 - 向量 v2。
  74629. * @return {number} 向量距离平方
  74630. */
  74631. }, {
  74632. key: "distSquare",
  74633. value: function distSquare(v1, v2) {
  74634. return this.distanceSquare(v1, v2);
  74635. }
  74636. }]);
  74637. return Vector;
  74638. }();
  74639. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Curve.js
  74640. function levelRenderer_Curve_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  74641. function levelRenderer_Curve_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  74642. function levelRenderer_Curve_createClass(Constructor, protoProps, staticProps) { if (protoProps) levelRenderer_Curve_defineProperties(Constructor.prototype, protoProps); if (staticProps) levelRenderer_Curve_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  74643. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  74644. * This program are made available under the terms of the Apache License, Version 2.0
  74645. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  74646. /**
  74647. * @class LevelRenderer.Tool.Curve
  74648. * @category Visualization Theme
  74649. * @classdesc LevelRenderer 工具-曲线
  74650. * @private
  74651. */
  74652. var Curve_Curve = /*#__PURE__*/function () {
  74653. function Curve() {
  74654. levelRenderer_Curve_classCallCheck(this, Curve);
  74655. /**
  74656. * @member {LevelRenderer.Tool.Vector} LevelRenderer.Tool.Curve.prototype.vector
  74657. * @description 矢量工具。
  74658. */
  74659. this.vector = new levelRenderer_Vector_Vector();
  74660. /**
  74661. * @member {number} LevelRenderer.Tool.Curve.prototype.EPSILON
  74662. * @description e。
  74663. */
  74664. this.EPSILON = 1e-4;
  74665. /**
  74666. * @member {number} LevelRenderer.Tool.Curve.prototype.THREE_SQRT
  74667. * @description 3 的平方根。
  74668. */
  74669. this.THREE_SQRT = Math.sqrt(3);
  74670. /**
  74671. * @member {number} LevelRenderer.Tool.Curve.prototype.ONE_THIRD
  74672. * @description 1/3。
  74673. */
  74674. this.ONE_THIRD = 1 / 3;
  74675. this.CLASS_NAME = "SuperMap.LevelRenderer.Tool.Curve";
  74676. }
  74677. /*
  74678. * Method: evalCubicCoeff
  74679. *
  74680. * Parameters:
  74681. * a - {number} 值。
  74682. * b - {number} 值。
  74683. * c - {number} 值。
  74684. * d - {number} 值。
  74685. * t - {number} 值。
  74686. *
  74687. * Returns:
  74688. * {number}
  74689. */
  74690. /*
  74691. evalCubicCoeff: function(a, b, c, d, t){
  74692. return ((a * t + b) * t + c) * t + d;
  74693. },
  74694. */
  74695. /**
  74696. * @function LevelRenderer.Tool.Curve.prototype.isAroundZero
  74697. * @description 判断一个值是否趋于0,判断参考值:1e-4。
  74698. * @param {number} val - 值。
  74699. * @returns {boolean} 值是否趋于0。
  74700. */
  74701. levelRenderer_Curve_createClass(Curve, [{
  74702. key: "isAroundZero",
  74703. value: function isAroundZero(val) {
  74704. return val > -this.EPSILON && val < this.EPSILON;
  74705. }
  74706. /**
  74707. * @function LevelRenderer.Tool.Curve.prototype.isNotAroundZero
  74708. * @description 判断一个值是否不趋于0,判断参考值:1e-4。
  74709. * @param {number} val - 值。
  74710. * @returns {boolean} 值是否不趋于0。
  74711. */
  74712. }, {
  74713. key: "isNotAroundZero",
  74714. value: function isNotAroundZero(val) {
  74715. return val > this.EPSILON || val < -this.EPSILON;
  74716. }
  74717. /**
  74718. * @function LevelRenderer.Tool.Curve.prototype.cubicAt
  74719. * @description 计算三次贝塞尔值
  74720. * @param {number} p0 - 点p0。
  74721. * @param {number} p1 - 点p1。
  74722. * @param {number} p2 - 点p2。
  74723. * @param {number} p3 - 点p3。
  74724. * @param {number} t - t值。
  74725. * @returns {number} 三次贝塞尔值。
  74726. */
  74727. }, {
  74728. key: "cubicAt",
  74729. value: function cubicAt(p0, p1, p2, p3, t) {
  74730. var onet = 1 - t;
  74731. return onet * onet * (onet * p0 + 3 * t * p1) + t * t * (t * p3 + 3 * onet * p2);
  74732. }
  74733. /**
  74734. * @function LevelRenderer.Tool.Curve.prototype.cubicDerivativeAt
  74735. * @description 计算三次贝塞尔导数值
  74736. * @param {number} p0 - 点p0。
  74737. * @param {number} p1 - 点p1。
  74738. * @param {number} p2 - 点p2。
  74739. * @param {number} p3 - 点p3。
  74740. * @param {number} t - t值。
  74741. * @returns {number} 三次贝塞尔导数值。
  74742. */
  74743. }, {
  74744. key: "cubicDerivativeAt",
  74745. value: function cubicDerivativeAt(p0, p1, p2, p3, t) {
  74746. var onet = 1 - t;
  74747. return 3 * (((p1 - p0) * onet + 2 * (p2 - p1) * t) * onet + (p3 - p2) * t * t);
  74748. }
  74749. /**
  74750. * @function LevelRenderer.Tool.Curve.prototype.cubicRootAt
  74751. * @description 计算三次贝塞尔方程根,使用盛金公式
  74752. * @param {number} p0 - 点p0。
  74753. * @param {number} p1 - 点p1。
  74754. * @param {number} p2 - 点p2。
  74755. * @param {number} p3 - 点p3。
  74756. * @param {number} val - 值。
  74757. * @param {Array.<number>} roots - 有效根数目。
  74758. * @returns {number} 有效根。
  74759. */
  74760. }, {
  74761. key: "cubicRootAt",
  74762. value: function cubicRootAt(p0, p1, p2, p3, val, roots) {
  74763. // Evaluate roots of cubic functions
  74764. var a = p3 + 3 * (p1 - p2) - p0;
  74765. var b = 3 * (p2 - p1 * 2 + p0);
  74766. var c = 3 * (p1 - p0);
  74767. var d = p0 - val;
  74768. var A = b * b - 3 * a * c;
  74769. var B = b * c - 9 * a * d;
  74770. var C = c * c - 3 * b * d;
  74771. var n = 0;
  74772. if (this.isAroundZero(A) && this.isAroundZero(B)) {
  74773. if (this.isAroundZero(b)) {
  74774. roots[0] = 0;
  74775. } else {
  74776. var t1 = -c / b; //t1, t2, t3, b is not zero
  74777. if (t1 >= 0 && t1 <= 1) {
  74778. roots[n++] = t1;
  74779. }
  74780. }
  74781. } else {
  74782. var disc = B * B - 4 * A * C;
  74783. if (this.isAroundZero(disc)) {
  74784. var K = B / A;
  74785. var _t2 = -b / a + K; // t1, a is not zero
  74786. var t2 = -K / 2; // t2, t3
  74787. if (_t2 >= 0 && _t2 <= 1) {
  74788. roots[n++] = _t2;
  74789. }
  74790. if (t2 >= 0 && t2 <= 1) {
  74791. roots[n++] = t2;
  74792. }
  74793. } else if (disc > 0) {
  74794. var discSqrt = Math.sqrt(disc);
  74795. var Y1 = A * b + 1.5 * a * (-B + discSqrt);
  74796. var Y2 = A * b + 1.5 * a * (-B - discSqrt);
  74797. if (Y1 < 0) {
  74798. Y1 = -Math.pow(-Y1, this.ONE_THIRD);
  74799. } else {
  74800. Y1 = Math.pow(Y1, this.ONE_THIRD);
  74801. }
  74802. if (Y2 < 0) {
  74803. Y2 = -Math.pow(-Y2, this.ONE_THIRD);
  74804. } else {
  74805. Y2 = Math.pow(Y2, this.ONE_THIRD);
  74806. }
  74807. var _t3 = (-b - (Y1 + Y2)) / (3 * a);
  74808. if (_t3 >= 0 && _t3 <= 1) {
  74809. roots[n++] = _t3;
  74810. }
  74811. } else {
  74812. var T = (2 * A * b - 3 * a * B) / (2 * Math.sqrt(A * A * A));
  74813. var theta = Math.acos(T) / 3;
  74814. var ASqrt = Math.sqrt(A);
  74815. var tmp = Math.cos(theta);
  74816. var _t4 = (-b - 2 * ASqrt * tmp) / (3 * a);
  74817. var _t5 = (-b + ASqrt * (tmp + this.THREE_SQRT * Math.sin(theta))) / (3 * a);
  74818. var t3 = (-b + ASqrt * (tmp - this.THREE_SQRT * Math.sin(theta))) / (3 * a);
  74819. if (_t4 >= 0 && _t4 <= 1) {
  74820. roots[n++] = _t4;
  74821. }
  74822. if (_t5 >= 0 && _t5 <= 1) {
  74823. roots[n++] = _t5;
  74824. }
  74825. if (t3 >= 0 && t3 <= 1) {
  74826. roots[n++] = t3;
  74827. }
  74828. }
  74829. }
  74830. return n;
  74831. }
  74832. /**
  74833. * @function LevelRenderer.Tool.Curve.prototype.cubicRootAt
  74834. * @description 计算三次贝塞尔方程极限值的位置
  74835. * @param {number} p0 - 点p0。
  74836. * @param {number} p1 - 点p1。
  74837. * @param {number} p2 - 点p2。
  74838. * @param {number} p3 - 点p3。
  74839. * @param {Array.<number>} extrema - 值。
  74840. * @returns {number} 有效数目。
  74841. */
  74842. }, {
  74843. key: "cubicExtrema",
  74844. value: function cubicExtrema(p0, p1, p2, p3, extrema) {
  74845. var b = 6 * p2 - 12 * p1 + 6 * p0;
  74846. var a = 9 * p1 + 3 * p3 - 3 * p0 - 9 * p2;
  74847. var c = 3 * p1 - 3 * p0;
  74848. var n = 0;
  74849. if (this.isAroundZero(a)) {
  74850. if (this.isNotAroundZero(b)) {
  74851. var t1 = -c / b;
  74852. if (t1 >= 0 && t1 <= 1) {
  74853. extrema[n++] = t1;
  74854. }
  74855. }
  74856. } else {
  74857. var disc = b * b - 4 * a * c;
  74858. if (this.isAroundZero(disc)) {
  74859. extrema[0] = -b / (2 * a);
  74860. } else if (disc > 0) {
  74861. var discSqrt = Math.sqrt(disc);
  74862. var _t6 = (-b + discSqrt) / (2 * a);
  74863. var t2 = (-b - discSqrt) / (2 * a);
  74864. if (_t6 >= 0 && _t6 <= 1) {
  74865. extrema[n++] = _t6;
  74866. }
  74867. if (t2 >= 0 && t2 <= 1) {
  74868. extrema[n++] = t2;
  74869. }
  74870. }
  74871. }
  74872. return n;
  74873. }
  74874. /**
  74875. * @function LevelRenderer.Tool.Curve.prototype.cubicSubdivide
  74876. * @description 细分三次贝塞尔曲线
  74877. * @param {number} p0 - 点p0。
  74878. * @param {number} p1 - 点p1。
  74879. * @param {number} p2 - 点p2。
  74880. * @param {number} p3 - 点p3。
  74881. * @param {number} t - t值。
  74882. * @param {Array.<number>} out - 投射点。
  74883. * @returns {number} 投射点。
  74884. */
  74885. }, {
  74886. key: "cubicSubdivide",
  74887. value: function cubicSubdivide(p0, p1, p2, p3, t, out) {
  74888. var p01 = (p1 - p0) * t + p0;
  74889. var p12 = (p2 - p1) * t + p1;
  74890. var p23 = (p3 - p2) * t + p2;
  74891. var p012 = (p12 - p01) * t + p01;
  74892. var p123 = (p23 - p12) * t + p12;
  74893. var p0123 = (p123 - p012) * t + p012;
  74894. // Seg0
  74895. out[0] = p0;
  74896. out[1] = p01;
  74897. out[2] = p012;
  74898. out[3] = p0123;
  74899. // Seg1
  74900. out[4] = p0123;
  74901. out[5] = p123;
  74902. out[6] = p23;
  74903. out[7] = p3;
  74904. }
  74905. /**
  74906. * @function LevelRenderer.Tool.Curve.prototype.cubicProjectPoint
  74907. * @description 投射点到三次贝塞尔曲线上,返回投射距离。投射点有可能会有一个或者多个,这里只返回其中距离最短的一个。
  74908. * @param {number} x0 - 点p0横坐标。
  74909. * @param {number} y0 - 点p0纵坐标。
  74910. * @param {number} x1 - 点p1横坐标。
  74911. * @param {number} y1 - 点p1纵坐标。
  74912. * @param {number} x2 - 点p2横坐标。
  74913. * @param {number} y2 - 点p2纵坐标。
  74914. * @param {number} x3 - 点p3横坐标。
  74915. * @param {number} y3 - 点p3纵坐标。
  74916. * @param {number} x - 点p横坐标。
  74917. * @param {number} y - 点p纵坐标。
  74918. * @param {Array.<number>} out - 投射点。
  74919. * @returns {number} 投射点。
  74920. */
  74921. }, {
  74922. key: "cubicProjectPoint",
  74923. value: function cubicProjectPoint(x0, y0, x1, y1, x2, y2, x3, y3, x, y, out) {
  74924. // 临时变量
  74925. var _v0 = this.vector.create();
  74926. var _v1 = this.vector.create();
  74927. var _v2 = this.vector.create();
  74928. // var _v3 = vector.create();
  74929. // http://pomax.github.io/bezierinfo/#projections
  74930. var t;
  74931. var interval = 0.005;
  74932. var d = Infinity;
  74933. _v0[0] = x;
  74934. _v0[1] = y;
  74935. // 先粗略估计一下可能的最小距离的 t 值
  74936. // PENDING
  74937. for (var _t = 0; _t < 1; _t += 0.05) {
  74938. _v1[0] = this.cubicAt(x0, x1, x2, x3, _t);
  74939. _v1[1] = this.cubicAt(y0, y1, y2, y3, _t);
  74940. var d1 = this.vector.distSquare(_v0, _v1);
  74941. if (d1 < d) {
  74942. t = _t;
  74943. d = d1;
  74944. }
  74945. }
  74946. d = Infinity;
  74947. // At most 32 iteration
  74948. for (var i = 0; i < 32; i++) {
  74949. if (interval < this.EPSILON) {
  74950. break;
  74951. }
  74952. var prev = t - interval;
  74953. var next = t + interval;
  74954. // t - interval
  74955. _v1[0] = this.cubicAt(x0, x1, x2, x3, prev);
  74956. _v1[1] = this.cubicAt(y0, y1, y2, y3, prev);
  74957. var _d = this.vector.distSquare(_v1, _v0);
  74958. if (prev >= 0 && _d < d) {
  74959. t = prev;
  74960. d = _d;
  74961. } else {
  74962. // t + interval
  74963. _v2[0] = this.cubicAt(x0, x1, x2, x3, next);
  74964. _v2[1] = this.cubicAt(y0, y1, y2, y3, next);
  74965. var d2 = this.vector.distSquare(_v2, _v0);
  74966. if (next <= 1 && d2 < d) {
  74967. t = next;
  74968. d = d2;
  74969. } else {
  74970. interval *= 0.5;
  74971. }
  74972. }
  74973. }
  74974. // t
  74975. if (out) {
  74976. out[0] = this.cubicAt(x0, x1, x2, x3, t);
  74977. out[1] = this.cubicAt(y0, y1, y2, y3, t);
  74978. }
  74979. // console.log(interval, i);
  74980. return Math.sqrt(d);
  74981. }
  74982. /**
  74983. * @function LevelRenderer.Tool.Curve.prototype.quadraticAt
  74984. * @description 计算二次方贝塞尔值。
  74985. * @param {number} p0 - 点p0。
  74986. * @param {number} p1 - 点p1。
  74987. * @param {number} p2 - 点p2。
  74988. * @param {number} t - t值。
  74989. * @returns {number} 二次方贝塞尔值。
  74990. */
  74991. }, {
  74992. key: "quadraticAt",
  74993. value: function quadraticAt(p0, p1, p2, t) {
  74994. var onet = 1 - t;
  74995. return onet * (onet * p0 + 2 * t * p1) + t * t * p2;
  74996. }
  74997. /**
  74998. * @function LevelRenderer.Tool.Curve.prototype.quadraticAt
  74999. * @description 计算二次方贝塞尔导数值。
  75000. * @param {number} p0 - 点p0。
  75001. * @param {number} p1 - 点p1。
  75002. * @param {number} p2 - 点p2。
  75003. * @param {number} t - t值。
  75004. * @returns {number} 二次方贝塞尔导数值。
  75005. */
  75006. }, {
  75007. key: "quadraticDerivativeAt",
  75008. value: function quadraticDerivativeAt(p0, p1, p2, t) {
  75009. return 2 * ((1 - t) * (p1 - p0) + t * (p2 - p1));
  75010. }
  75011. /**
  75012. * @function LevelRenderer.Tool.Curve.prototype.quadraticRootAt
  75013. * @description 计算二次方贝塞尔方程根
  75014. * @param {number} p0 - 点p0。
  75015. * @param {number} p1 - 点p1。
  75016. * @param {number} p2 - 点p2。
  75017. * @param {number} val - 值。
  75018. * @param {Array.<number>} roots - 有效根数目。
  75019. * @returns {number} 有效根数目。
  75020. */
  75021. }, {
  75022. key: "quadraticRootAt",
  75023. value: function quadraticRootAt(p0, p1, p2, val, roots) {
  75024. var a = p0 - 2 * p1 + p2;
  75025. var b = 2 * (p1 - p0);
  75026. var c = p0 - val;
  75027. var n = 0;
  75028. if (this.isAroundZero(a)) {
  75029. if (this.isNotAroundZero(b)) {
  75030. var t1 = -c / b;
  75031. if (t1 >= 0 && t1 <= 1) {
  75032. roots[n++] = t1;
  75033. }
  75034. }
  75035. } else {
  75036. var disc = b * b - 4 * a * c;
  75037. if (this.isAroundZero(disc)) {
  75038. var _t7 = -b / (2 * a);
  75039. if (_t7 >= 0 && _t7 <= 1) {
  75040. roots[n++] = _t7;
  75041. }
  75042. } else if (disc > 0) {
  75043. var discSqrt = Math.sqrt(disc);
  75044. var _t8 = (-b + discSqrt) / (2 * a);
  75045. var t2 = (-b - discSqrt) / (2 * a);
  75046. if (_t8 >= 0 && _t8 <= 1) {
  75047. roots[n++] = _t8;
  75048. }
  75049. if (t2 >= 0 && t2 <= 1) {
  75050. roots[n++] = t2;
  75051. }
  75052. }
  75053. }
  75054. return n;
  75055. }
  75056. /**
  75057. * @function LevelRenderer.Tool.Curve.prototype.quadraticExtremum
  75058. * @description 计算二次贝塞尔方程极限值
  75059. * @param {number} p0 - 点p0。
  75060. * @param {number} p1 - 点p1。
  75061. * @param {number} p2 - 点p2。
  75062. * @returns {number} 二次贝塞尔方程极限值。
  75063. */
  75064. }, {
  75065. key: "quadraticExtremum",
  75066. value: function quadraticExtremum(p0, p1, p2) {
  75067. var divider = p0 + p2 - 2 * p1;
  75068. if (divider === 0) {
  75069. // p1 is center of p0 and p2
  75070. return 0.5;
  75071. } else {
  75072. return (p0 - p1) / divider;
  75073. }
  75074. }
  75075. /**
  75076. * @function LevelRenderer.Tool.Curve.prototype.quadraticProjectPoint
  75077. * @description 投射点到二次贝塞尔曲线上,返回投射距离。投射点有可能会有一个或者多个,这里只返回其中距离最短的一个。
  75078. * @param {number} x0 - 点p0横坐标。
  75079. * @param {number} y0 - 点p0纵坐标。
  75080. * @param {number} x1 - 点p1横坐标。
  75081. * @param {number} y1 - 点p1纵坐标。
  75082. * @param {number} x2 - 点p2横坐标。
  75083. * @param {number} y2 - 点p2纵坐标。
  75084. * @param {number} x - 点p横坐标。
  75085. * @param {number} y - 点p纵坐标。
  75086. * @param {Array.<number>} out - 投射点。
  75087. * @returns {number} 投射距离。
  75088. */
  75089. }, {
  75090. key: "quadraticProjectPoint",
  75091. value: function quadraticProjectPoint(x0, y0, x1, y1, x2, y2, x, y, out) {
  75092. // 临时变量
  75093. var _v0 = this.vector.create();
  75094. var _v1 = this.vector.create();
  75095. var _v2 = this.vector.create();
  75096. // http://pomax.github.io/bezierinfo/#projections
  75097. var t;
  75098. var interval = 0.005;
  75099. var d = Infinity;
  75100. _v0[0] = x;
  75101. _v0[1] = y;
  75102. // 先粗略估计一下可能的最小距离的 t 值
  75103. // PENDING
  75104. for (var _t = 0; _t < 1; _t += 0.05) {
  75105. _v1[0] = this.quadraticAt(x0, x1, x2, _t);
  75106. _v1[1] = this.quadraticAt(y0, y1, y2, _t);
  75107. var d1 = this.vector.distSquare(_v0, _v1);
  75108. if (d1 < d) {
  75109. t = _t;
  75110. d = d1;
  75111. }
  75112. }
  75113. d = Infinity;
  75114. // At most 32 iteration
  75115. for (var i = 0; i < 32; i++) {
  75116. if (interval < this.EPSILON) {
  75117. break;
  75118. }
  75119. var prev = t - interval;
  75120. var next = t + interval;
  75121. // t - interval
  75122. _v1[0] = this.quadraticAt(x0, x1, x2, prev);
  75123. _v1[1] = this.quadraticAt(y0, y1, y2, prev);
  75124. var _d2 = this.vector.distSquare(_v1, _v0);
  75125. if (prev >= 0 && _d2 < d) {
  75126. t = prev;
  75127. d = _d2;
  75128. } else {
  75129. // t + interval
  75130. _v2[0] = this.quadraticAt(x0, x1, x2, next);
  75131. _v2[1] = this.quadraticAt(y0, y1, y2, next);
  75132. var d2 = this.vector.distSquare(_v2, _v0);
  75133. if (next <= 1 && d2 < d) {
  75134. t = next;
  75135. d = d2;
  75136. } else {
  75137. interval *= 0.5;
  75138. }
  75139. }
  75140. }
  75141. // t
  75142. if (out) {
  75143. out[0] = this.quadraticAt(x0, x1, x2, t);
  75144. out[1] = this.quadraticAt(y0, y1, y2, t);
  75145. }
  75146. // console.log(interval, i);
  75147. return Math.sqrt(d);
  75148. }
  75149. }]);
  75150. return Curve;
  75151. }();
  75152. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Area.js
  75153. function Area_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  75154. function Area_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  75155. function Area_createClass(Constructor, protoProps, staticProps) { if (protoProps) Area_defineProperties(Constructor.prototype, protoProps); if (staticProps) Area_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  75156. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  75157. * This program are made available under the terms of the Apache License, Version 2.0
  75158. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  75159. /**
  75160. * @class LevelRenderer.Tool.Area
  75161. * @category Visualization Theme
  75162. * @classdesc LevelRenderer 工具-图形范围判断
  75163. * @private
  75164. */
  75165. var Area = /*#__PURE__*/function () {
  75166. function Area() {
  75167. Area_classCallCheck(this, Area);
  75168. /**
  75169. * @member {LevelRenderer.Tool.Util} LevelRenderer.Tool.Areal.prototype.util
  75170. * @description 基础工具对象。
  75171. */
  75172. this.util = new levelRenderer_Util_Util();
  75173. /**
  75174. * @member {LevelRenderer.Tool.Curve} LevelRenderer.Tool.Areal.prototype.curve
  75175. * @description 曲线工具对象
  75176. */
  75177. this.curve = new Curve_Curve();
  75178. /**
  75179. * @member {Object} LevelRenderer.Tool.Areal.prototype._ctx
  75180. * @description Cavans2D 渲染上下文
  75181. */
  75182. this._ctx = null;
  75183. /**
  75184. * @member {Object} LevelRenderer.Tool.Areal.prototype._textWidthCache
  75185. * @description 文本宽度缓存
  75186. */
  75187. this._textWidthCache = {};
  75188. /**
  75189. * @member {Object} LevelRenderer.Tool.Areal.prototype._textHeightCache
  75190. * @description 文本高度缓存
  75191. */
  75192. this._textHeightCache = {};
  75193. /**
  75194. * @member {number} LevelRenderer.Tool.Areal.prototype._textWidthCacheCounter
  75195. * @description 文本宽度缓存数量
  75196. */
  75197. this._textWidthCacheCounter = 0;
  75198. /**
  75199. * @member {number} LevelRenderer.Tool.Areal.prototype._textHeightCacheCounter
  75200. * @description 文本高度缓存数量
  75201. */
  75202. this._textHeightCacheCounter = 0;
  75203. /**
  75204. * @member {number} LevelRenderer.Tool.Areal.prototype.TEXT_CACHE_MAX
  75205. * @description 文本最大缓存数量
  75206. */
  75207. this.TEXT_CACHE_MAX = 5000;
  75208. /**
  75209. * @member {number} LevelRenderer.Tool.Areal.prototype.PI2
  75210. * @description 2*PI 的值
  75211. */
  75212. this.PI2 = Math.PI * 2;
  75213. /**
  75214. * @member {Array.<number>} LevelRenderer.Tool.Areal.prototype.roots
  75215. * @description 临时数组
  75216. */
  75217. this.roots = [-1, -1, -1];
  75218. /**
  75219. * @member {Array.<number>} LevelRenderer.Tool.Areal.prototype.extrema
  75220. * @description 临时数组
  75221. */
  75222. this.extrema = [-1, -1];
  75223. this.CLASS_NAME = "SuperMap.LevelRenderer.Tool.Area";
  75224. }
  75225. /**
  75226. * @function LevelRenderer.Tool.Areal.prototype.normalizeRadian
  75227. * @description 弧度标准化函数。
  75228. * @param {number} angle - 弧度值。
  75229. * @returns {number} 标准化后的弧度值。
  75230. */
  75231. Area_createClass(Area, [{
  75232. key: "normalizeRadian",
  75233. value: function normalizeRadian(angle) {
  75234. angle %= this.PI2;
  75235. if (angle < 0) {
  75236. angle += this.PI2;
  75237. }
  75238. return angle;
  75239. }
  75240. /**
  75241. * @function LevelRenderer.Tool.Areal.prototype.isInside
  75242. * @description 包含判断。
  75243. * @param {Object} shape - 图形。
  75244. * @param {number} area - 目标区域。
  75245. * @param {number} x - 横坐标。
  75246. * @param {number} y - 纵坐标。
  75247. * @returns {boolean} 图形是否包含鼠标位置。
  75248. */
  75249. }, {
  75250. key: "isInside",
  75251. value: function isInside(shape, area, x, y) {
  75252. if (!area || !shape) {
  75253. // 无参数或不支持类型
  75254. return false;
  75255. }
  75256. var zoneType = shape.type;
  75257. this._ctx = this._ctx || this.util.getContext();
  75258. // 未实现或不可用时则数学运算,主要是line,brokenLine,ring
  75259. var _mathReturn = this._mathMethod(shape, area, x, y);
  75260. if (typeof _mathReturn != 'undefined') {
  75261. return _mathReturn;
  75262. }
  75263. if (shape.buildPath && this._ctx.isPointInPath) {
  75264. return this._buildPathMethod(shape, this._ctx, area, x, y);
  75265. }
  75266. // 上面的方法都行不通时
  75267. switch (zoneType) {
  75268. case 'ellipse': // Todo,不精确
  75269. case 'smicellipse':
  75270. // Todo,不精确
  75271. return true;
  75272. // 旋轮曲线 不准确
  75273. case 'trochoid':
  75274. var _r = area.location == 'out' ? area.r1 + area.r2 + area.d : area.r1 - area.r2 + area.d;
  75275. return this.isInsideCircle(area, x, y, _r);
  75276. // 玫瑰线 不准确
  75277. case 'rose':
  75278. return this.isInsideCircle(area, x, y, area.maxr);
  75279. // 路径,椭圆,曲线等-----------------13
  75280. default:
  75281. return false;
  75282. // Todo,暂不支持
  75283. }
  75284. }
  75285. /**
  75286. * @function LevelRenderer.Tool.Areal.prototype._mathMethod
  75287. * @description 包含判断。用数学方法判断,三个方法中最快,但是支持的shape少。
  75288. * @param {Object} shape - 图形。
  75289. * @param {number} area - 目标区域。
  75290. * @param {number} x - 横坐标。
  75291. * @param {number} y - 纵坐标。
  75292. * @returns {boolean} 图形是否包含鼠标位置,true表示坐标处在图形中。
  75293. */
  75294. }, {
  75295. key: "_mathMethod",
  75296. value: function _mathMethod(shape, area, x, y) {
  75297. var zoneType = shape.type;
  75298. // 在矩形内则部分图形需要进一步判断
  75299. switch (zoneType) {
  75300. // 贝塞尔曲线
  75301. case 'bezier-curve':
  75302. if (typeof area.cpX2 === 'undefined') {
  75303. return this.isInsideQuadraticStroke(area.xStart, area.yStart, area.cpX1, area.cpY1, area.xEnd, area.yEnd, area.lineWidth, x, y);
  75304. }
  75305. return this.isInsideCubicStroke(area.xStart, area.yStart, area.cpX1, area.cpY1, area.cpX2, area.cpY2, area.xEnd, area.yEnd, area.lineWidth, x, y);
  75306. // 线
  75307. case 'line':
  75308. return this.isInsideLine(area.xStart, area.yStart, area.xEnd, area.yEnd, area.lineWidth, x, y);
  75309. // 折线
  75310. case 'broken-line':
  75311. return this.isInsideBrokenLine(area.pointList, area.lineWidth, x, y);
  75312. // 扩展折线
  75313. case 'smicbroken-line':
  75314. {
  75315. // SMIC-修改 - start
  75316. var icX = x;
  75317. var icY = y;
  75318. if (shape.refOriginalPosition) {
  75319. icX = x - shape.refOriginalPosition[0];
  75320. icY = y - shape.refOriginalPosition[1];
  75321. }
  75322. return this.isInsideBrokenLine(area.pointList, area.lineWidth, icX, icY);
  75323. }
  75324. //初始代码:
  75325. // return isInsideBrokenLine(
  75326. // area.pointList, area.lineWidth, x, y
  75327. // );
  75328. // SMIC-修改 - end
  75329. // 圆环
  75330. case 'ring':
  75331. return this.isInsideRing(area.x, area.y, area.r0, area.r, x, y);
  75332. case 'smicring':
  75333. {
  75334. var areaX = area.x;
  75335. var areaY = area.y;
  75336. if (shape.refOriginalPosition) {
  75337. areaX = area.x + shape.refOriginalPosition[0];
  75338. areaY = area.y + shape.refOriginalPosition[1];
  75339. }
  75340. return this.isInsideRing(areaX, areaY, area.r0, area.r, x, y);
  75341. }
  75342. // 圆形
  75343. case 'circle':
  75344. return this.isInsideCircle(area.x, area.y, area.r, x, y);
  75345. // 扩展-点
  75346. case 'smicpoint':
  75347. {
  75348. // SMIC-修改 - start
  75349. var _icX = x;
  75350. var _icY = y;
  75351. if (shape.refOriginalPosition) {
  75352. _icX = x - shape.refOriginalPosition[0];
  75353. _icY = y - shape.refOriginalPosition[1];
  75354. }
  75355. return this.isInsideCircle(area.x, area.y, area.r, _icX, _icY);
  75356. }
  75357. //初始代码:
  75358. // 无
  75359. // SMIC-修改 - end
  75360. // 扇形
  75361. case 'sector':
  75362. {
  75363. var startAngle = area.startAngle * Math.PI / 180;
  75364. var endAngle = area.endAngle * Math.PI / 180;
  75365. if (!area.clockWise) {
  75366. startAngle = -startAngle;
  75367. endAngle = -endAngle;
  75368. }
  75369. return this.isInsideSector(area.x, area.y, area.r0, area.r, startAngle, endAngle, !area.clockWise, x, y);
  75370. }
  75371. //初始代码:
  75372. // 无
  75373. // SMIC-增加 - end
  75374. // 扇形
  75375. case 'smicsector':
  75376. {
  75377. var _startAngle = area.startAngle * Math.PI / 180;
  75378. var _endAngle = area.endAngle * Math.PI / 180;
  75379. if (!area.clockWise) {
  75380. _startAngle = -_startAngle;
  75381. _endAngle = -_endAngle;
  75382. }
  75383. var _areaX = area.x;
  75384. var _areaY = area.y;
  75385. if (shape.refOriginalPosition) {
  75386. _areaX = area.x + shape.refOriginalPosition[0];
  75387. _areaY = area.y + shape.refOriginalPosition[1];
  75388. }
  75389. return this.isInsideSector(_areaX, _areaY, area.r0, area.r, _startAngle, _endAngle, !area.clockWise, x, y);
  75390. }
  75391. // 多边形
  75392. case 'path':
  75393. return this.isInsidePath(area.pathArray, Math.max(area.lineWidth, 5), area.brushType, x, y);
  75394. case 'polygon':
  75395. case 'star':
  75396. case 'smicstar':
  75397. case 'isogon':
  75398. case 'smicisogon':
  75399. return this.isInsidePolygon(area.pointList, x, y);
  75400. // 扩展多边形
  75401. case 'smicpolygon':
  75402. {
  75403. // SMIC-修改 - start
  75404. var _icX2 = x;
  75405. var _icY2 = y;
  75406. if (shape.refOriginalPosition) {
  75407. _icX2 = x - shape.refOriginalPosition[0];
  75408. _icY2 = y - shape.refOriginalPosition[1];
  75409. }
  75410. //岛洞面
  75411. if (shape.holePolygonPointLists && shape.holePolygonPointLists.length > 0) {
  75412. var isOnBase = this.isInsidePolygon(area.pointList, _icX2, _icY2);
  75413. // 遍历岛洞子面
  75414. var holePLS = shape.holePolygonPointLists;
  75415. var isOnHole = false;
  75416. for (var i = 0, holePLSen = holePLS.length; i < holePLSen; i++) {
  75417. var holePL = holePLS[i];
  75418. var isOnSubHole = this.isInsidePolygon(holePL, _icX2, _icY2);
  75419. if (isOnSubHole === true) {
  75420. isOnHole = true;
  75421. }
  75422. }
  75423. // 捕获判断
  75424. return isOnBase === true && isOnHole === false;
  75425. } else {
  75426. return this.isInsidePolygon(area.pointList, _icX2, _icY2);
  75427. }
  75428. }
  75429. // 初始代码:
  75430. // 无
  75431. // SMIC-修改 - end
  75432. // 文本
  75433. case 'text':
  75434. var rect = area.__rect || shape.getRect(area);
  75435. return this.isInsideRect(rect.x, rect.y, rect.width, rect.height, x, y);
  75436. // 扩展文本
  75437. case 'smictext':
  75438. //用文本背景矩形判断
  75439. var textBg = shape.getTextBackground(area);
  75440. return this.isInsidePolygon(textBg, x, y);
  75441. //初始代码:
  75442. // 无
  75443. // SMIC-修改 - end
  75444. // 矩形
  75445. case 'rectangle':
  75446. case 'image':
  75447. // 图片
  75448. return this.isInsideRect(area.x, area.y, area.width, area.height, x, y);
  75449. case 'smicimage':
  75450. {
  75451. var _areaX2 = area.x;
  75452. var _areaY2 = area.y;
  75453. if (shape.refOriginalPosition) {
  75454. _areaX2 = area.x + shape.refOriginalPosition[0];
  75455. _areaY2 = area.y + shape.refOriginalPosition[1];
  75456. }
  75457. return this.isInsideRect(_areaX2, _areaY2, area.width, area.height, x, y);
  75458. }
  75459. //// 扩展矩形
  75460. //case 'smicpolygon':
  75461. // // SMIC-修改 - start
  75462. // var icX = x;
  75463. // var icY = y;
  75464. // if(shape.refOriginalPosition) {
  75465. // icX = x - shape.refOriginalPosition[0];
  75466. // icY = y - shape.refOriginalPosition[1];
  75467. // }
  75468. // return this.isInsideRect(
  75469. // area.x, area.y, area.width, area.height, icX, icY
  75470. // );
  75471. //初始代码:
  75472. // 无
  75473. // SMIC-修改 - end
  75474. }
  75475. }
  75476. /**
  75477. * @function LevelRenderer.Tool.Areal.prototype._buildPathMethod
  75478. * @description 包含判断。通过buildPath方法来判断,三个方法中较快,但是不支持线条类型的 shape。
  75479. * @param {Object} shape - 图形。
  75480. * @param {Object} context - 上下文。
  75481. * @param {number} area - 目标区域。
  75482. * @param {number} x - 横坐标。
  75483. * @param {number} y - 纵坐标。
  75484. * @returns {boolean} 图形是否包含鼠标位置,true表示坐标处在图形中。
  75485. */
  75486. }, {
  75487. key: "_buildPathMethod",
  75488. value: function _buildPathMethod(shape, context, area, x, y) {
  75489. // 图形类实现路径创建了则用类的path
  75490. context.beginPath();
  75491. shape.buildPath(context, area);
  75492. context.closePath();
  75493. return context.isPointInPath(x, y);
  75494. }
  75495. /**
  75496. * @function LevelRenderer.Tool.Areal.prototype.isOutside
  75497. * @description 图形是否不包含鼠标位置。
  75498. * @param {Object} shape - 图形。
  75499. * @param {number} area - 目标区域。
  75500. * @param {number} x - 横坐标。
  75501. * @param {number} y - 纵坐标。
  75502. * @returns {boolean} 图形是否不包含鼠标位置, true表示坐标处在图形外。
  75503. */
  75504. }, {
  75505. key: "isOutside",
  75506. value: function isOutside(shape, area, x, y) {
  75507. return !this.isInside(shape, area, x, y);
  75508. }
  75509. /**
  75510. * @function LevelRenderer.Tool.Areal.prototype.isInsideLine
  75511. * @description 线段包含判断。
  75512. * @param {number} x0 - 线起始点横坐标。
  75513. * @param {number} y0 - 线起始点纵坐标。
  75514. * @param {number} x1 - 线终点横坐标。
  75515. * @param {number} y1 - 线终点纵坐标。
  75516. * @param {number} lineWidth - 线宽。
  75517. * @param {number} x - 鼠标位置横坐标。
  75518. * @param {number} y - 鼠标位置纵坐标。
  75519. * @returns {boolean} 图形是否包含鼠标位置,true表示坐标处在图形内。
  75520. */
  75521. }, {
  75522. key: "isInsideLine",
  75523. value: function isInsideLine(x0, y0, x1, y1, lineWidth, x, y) {
  75524. if (lineWidth === 0) {
  75525. return false;
  75526. }
  75527. var _l = Math.max(lineWidth, 5);
  75528. var _a = 0;
  75529. var _b = 0;
  75530. // Quick reject
  75531. if (y > y0 + _l && y > y1 + _l || y < y0 - _l && y < y1 - _l || x > x0 + _l && x > x1 + _l || x < x0 - _l && x < x1 - _l) {
  75532. return false;
  75533. }
  75534. if (x0 !== x1) {
  75535. _a = (y0 - y1) / (x0 - x1);
  75536. _b = (x0 * y1 - x1 * y0) / (x0 - x1);
  75537. } else {
  75538. return Math.abs(x - x0) <= _l / 2;
  75539. }
  75540. var tmp = _a * x - y + _b;
  75541. var _s = tmp * tmp / (_a * _a + 1);
  75542. return _s <= _l / 2 * _l / 2;
  75543. }
  75544. /**
  75545. * @function LevelRenderer.Tool.Areal.prototype.isInsideCubicStroke
  75546. * @description 三次贝塞尔曲线描边包含判断。
  75547. * @param {number} x0 - 点1横坐标。
  75548. * @param {number} y0 - 点1纵坐标。
  75549. * @param {number} x1 - 点2横坐标。
  75550. * @param {number} y1 - 点2纵坐标。
  75551. * @param {number} x2 - 点3纵坐标。
  75552. * @param {number} y2 - 点3纵坐标。
  75553. * @param {number} lineWidth - 线宽。
  75554. * @param {number} x - 鼠标位置横坐标。
  75555. * @param {number} y - 鼠标位置纵坐标。
  75556. * @returns {boolean} 图形是否包含鼠标位置, true表示坐标处在图形内。
  75557. */
  75558. }, {
  75559. key: "isInsideCubicStroke",
  75560. value: function isInsideCubicStroke(x0, y0, x1, y1, x2, y2, x3, y3, lineWidth, x, y) {
  75561. if (lineWidth === 0) {
  75562. return false;
  75563. }
  75564. var _l = Math.max(lineWidth, 5);
  75565. // Quick reject
  75566. if (y > y0 + _l && y > y1 + _l && y > y2 + _l && y > y3 + _l || y < y0 - _l && y < y1 - _l && y < y2 - _l && y < y3 - _l || x > x0 + _l && x > x1 + _l && x > x2 + _l && x > x3 + _l || x < x0 - _l && x < x1 - _l && x < x2 - _l && x < x3 - _l) {
  75567. return false;
  75568. }
  75569. var d = this.curve.cubicProjectPoint(x0, y0, x1, y1, x2, y2, x3, y3, x, y, null);
  75570. return d <= _l / 2;
  75571. }
  75572. /**
  75573. * @function LevelRenderer.Tool.Areal.prototype.isInsideQuadraticStroke
  75574. * @description 二次贝塞尔曲线描边包含判断。
  75575. * @param {number} x0 - 点1横坐标。
  75576. * @param {number} y0 - 点1纵坐标。
  75577. * @param {number} x1 - 点2横坐标。
  75578. * @param {number} y1 - 点2纵坐标。
  75579. * @param {number} x2 - 点3纵坐标。
  75580. * @param {number} y2 - 点3纵坐标。
  75581. * @param {number} lineWidth - 线宽。
  75582. * @param {number} x - 鼠标位置横坐标。
  75583. * @param {number} y - 鼠标位置纵坐标。
  75584. * @returns {boolean} 图形是否包含鼠标位置, true表示坐标处在图形内。
  75585. */
  75586. }, {
  75587. key: "isInsideQuadraticStroke",
  75588. value: function isInsideQuadraticStroke(x0, y0, x1, y1, x2, y2, lineWidth, x, y) {
  75589. if (lineWidth === 0) {
  75590. return false;
  75591. }
  75592. var _l = Math.max(lineWidth, 5);
  75593. // Quick reject
  75594. if (y > y0 + _l && y > y1 + _l && y > y2 + _l || y < y0 - _l && y < y1 - _l && y < y2 - _l || x > x0 + _l && x > x1 + _l && x > x2 + _l || x < x0 - _l && x < x1 - _l && x < x2 - _l) {
  75595. return false;
  75596. }
  75597. var d = this.curve.quadraticProjectPoint(x0, y0, x1, y1, x2, y2, x, y, null);
  75598. return d <= _l / 2;
  75599. }
  75600. /**
  75601. * @function LevelRenderer.Tool.Areal.prototype.isInsideArcStroke
  75602. * @description 圆弧描边包含判断。
  75603. * @param {number} cx - 圆心横坐标。
  75604. * @param {number} cy - 圆心纵坐标。
  75605. * @param {number} r - 圆半径。
  75606. * @param {number} startAngle - 起始角度。
  75607. * @param {number} endAngle - 终止角度。
  75608. * @param {number} anticlockwise - 顺时针还是逆时针。
  75609. * @param {number} lineWidth - 线宽。
  75610. * @param {number} x - 鼠标位置横坐标。
  75611. * @param {number} y - 鼠标位置纵坐标。
  75612. * @returns {boolean} 图形是否包含鼠标位置, true表示坐标处在图形内。
  75613. */
  75614. }, {
  75615. key: "isInsideArcStroke",
  75616. value: function isInsideArcStroke(cx, cy, r, startAngle, endAngle, anticlockwise, lineWidth, x, y) {
  75617. var PI2 = this.PI2;
  75618. if (lineWidth === 0) {
  75619. return false;
  75620. }
  75621. var _l = Math.max(lineWidth, 5);
  75622. x -= cx;
  75623. y -= cy;
  75624. var d = Math.sqrt(x * x + y * y);
  75625. if (d - _l > r || d + _l < r) {
  75626. return false;
  75627. }
  75628. if (Math.abs(startAngle - endAngle) >= PI2) {
  75629. // Is a circle
  75630. return true;
  75631. }
  75632. if (anticlockwise) {
  75633. var tmp = startAngle;
  75634. startAngle = this.normalizeRadian(endAngle);
  75635. endAngle = this.normalizeRadian(tmp);
  75636. } else {
  75637. startAngle = this.normalizeRadian(startAngle);
  75638. endAngle = this.normalizeRadian(endAngle);
  75639. }
  75640. if (startAngle > endAngle) {
  75641. endAngle += PI2;
  75642. }
  75643. var angle = Math.atan2(y, x);
  75644. if (angle < 0) {
  75645. angle += PI2;
  75646. }
  75647. return angle >= startAngle && angle <= endAngle || angle + PI2 >= startAngle && angle + PI2 <= endAngle;
  75648. }
  75649. /**
  75650. * @function LevelRenderer.Tool.Areal.prototype.isInsideBrokenLine
  75651. * @description 图形 BrokenLine 是否包含鼠标位置, true表示坐标处在图形内。
  75652. * @param {Array} points - 曲线点对象。
  75653. * @param {number} lineWidth - 线宽。
  75654. * @param {number} x - 鼠标位置横坐标。
  75655. * @param {number} y - 鼠标位置纵坐标。
  75656. * @returns {boolean} 图形是否包含鼠标位置, true表示坐标处在图形内。
  75657. */
  75658. }, {
  75659. key: "isInsideBrokenLine",
  75660. value: function isInsideBrokenLine(points, lineWidth, x, y) {
  75661. var _lineWidth = Math.max(lineWidth, 10);
  75662. for (var i = 0, l = points.length - 1; i < l; i++) {
  75663. var x0 = points[i][0];
  75664. var y0 = points[i][1];
  75665. var x1 = points[i + 1][0];
  75666. var y1 = points[i + 1][1];
  75667. if (this.isInsideLine(x0, y0, x1, y1, _lineWidth, x, y)) {
  75668. return true;
  75669. }
  75670. }
  75671. return false;
  75672. }
  75673. /**
  75674. * @function LevelRenderer.Tool.Areal.prototype.isInsideRing
  75675. * @description 图形 Ring 是否包含鼠标位置, true表示坐标处在图形内。
  75676. * @returns {boolean} 图形是否包含鼠标位置, true表示坐标处在图形内。
  75677. */
  75678. }, {
  75679. key: "isInsideRing",
  75680. value: function isInsideRing(cx, cy, r0, r, x, y) {
  75681. var d = (x - cx) * (x - cx) + (y - cy) * (y - cy);
  75682. return d < r * r && d > r0 * r0;
  75683. }
  75684. /**
  75685. * @function LevelRenderer.Tool.Areal.prototype.isInsideRect
  75686. * @description 图形 Rect 是否包含鼠标位置, true表示坐标处在图形内。
  75687. * @returns {boolean} 图形是否包含鼠标位置, true表示坐标处在图形内。
  75688. */
  75689. }, {
  75690. key: "isInsideRect",
  75691. value: function isInsideRect(x0, y0, width, height, x, y) {
  75692. return x >= x0 && x <= x0 + width && y >= y0 && y <= y0 + height;
  75693. }
  75694. /**
  75695. * @function LevelRenderer.Tool.Areal.prototype.isInsideCircle
  75696. * @description 图形 Circle 是否包含鼠标位置, true表示坐标处在图形内。
  75697. * @returns {boolean} 图形是否包含鼠标位置, true表示坐标处在图形内。
  75698. */
  75699. }, {
  75700. key: "isInsideCircle",
  75701. value: function isInsideCircle(x0, y0, r, x, y) {
  75702. return (x - x0) * (x - x0) + (y - y0) * (y - y0) < r * r;
  75703. }
  75704. /**
  75705. * @function LevelRenderer.Tool.Areal.prototype.isInsideSector
  75706. * @description 图形 Sector 是否包含鼠标位置, true表示坐标处在图形内。
  75707. * @returns {boolean} 图形是否包含鼠标位置, true表示坐标处在图形内。
  75708. */
  75709. }, {
  75710. key: "isInsideSector",
  75711. value: function isInsideSector(cx, cy, r0, r, startAngle, endAngle, anticlockwise, x, y) {
  75712. return this.isInsideArcStroke(cx, cy, (r0 + r) / 2, startAngle, endAngle, anticlockwise, r - r0, x, y);
  75713. }
  75714. /**
  75715. * @function LevelRenderer.Tool.Areal.prototype.isInsidePolygon
  75716. * @description 图形 Polygon 是否包含鼠标位置, true表示坐标处在图形内。与 canvas 一样采用 non-zero winding rule
  75717. * @returns {boolean} 图形是否包含鼠标位置, true表示坐标处在图形内。
  75718. */
  75719. }, {
  75720. key: "isInsidePolygon",
  75721. value: function isInsidePolygon(points, x, y) {
  75722. var N = points.length;
  75723. var w = 0;
  75724. for (var i = 0, j = N - 1; i < N; i++) {
  75725. var x0 = points[j][0];
  75726. var y0 = points[j][1];
  75727. var x1 = points[i][0];
  75728. var y1 = points[i][1];
  75729. w += this.windingLine(x0, y0, x1, y1, x, y);
  75730. j = i;
  75731. }
  75732. return w !== 0;
  75733. }
  75734. /**
  75735. * @function LevelRenderer.Tool.Areal.prototype.windingLine
  75736. */
  75737. }, {
  75738. key: "windingLine",
  75739. value: function windingLine(x0, y0, x1, y1, x, y) {
  75740. if (y > y0 && y > y1 || y < y0 && y < y1) {
  75741. return 0;
  75742. }
  75743. if (y1 == y0) {
  75744. return 0;
  75745. }
  75746. var dir = y1 < y0 ? 1 : -1;
  75747. var t = (y - y0) / (y1 - y0);
  75748. var x_ = t * (x1 - x0) + x0;
  75749. return x_ > x ? dir : 0;
  75750. }
  75751. /**
  75752. * @function LevelRenderer.Tool.Areal.prototype.swapExtrema
  75753. */
  75754. }, {
  75755. key: "swapExtrema",
  75756. value: function swapExtrema() {
  75757. var tmp = this.extrema[0];
  75758. this.extrema[0] = this.extrema[1];
  75759. this.extrema[1] = tmp;
  75760. }
  75761. /**
  75762. * @function LevelRenderer.Tool.Areal.prototype.windingCubic
  75763. */
  75764. }, {
  75765. key: "windingCubic",
  75766. value: function windingCubic(x0, y0, x1, y1, x2, y2, x3, y3, x, y) {
  75767. var curve = this.curve;
  75768. var roots = this.roots;
  75769. var extrema = this.extrema;
  75770. // Quick reject
  75771. if (y > y0 && y > y1 && y > y2 && y > y3 || y < y0 && y < y1 && y < y2 && y < y3) {
  75772. return 0;
  75773. }
  75774. var nRoots = curve.cubicRootAt(y0, y1, y2, y3, y, roots);
  75775. if (nRoots === 0) {
  75776. return 0;
  75777. } else {
  75778. var w = 0;
  75779. var nExtrema = -1;
  75780. var y0_, y1_;
  75781. for (var i = 0; i < nRoots; i++) {
  75782. var t = roots[i];
  75783. var x_ = curve.cubicAt(x0, x1, x2, x3, t);
  75784. if (x_ < x) {
  75785. // Quick reject
  75786. continue;
  75787. }
  75788. if (nExtrema < 0) {
  75789. nExtrema = curve.cubicExtrema(y0, y1, y2, y3, extrema);
  75790. if (extrema[1] < extrema[0] && nExtrema > 1) {
  75791. this.swapExtrema();
  75792. }
  75793. y0_ = curve.cubicAt(y0, y1, y2, y3, extrema[0]);
  75794. if (nExtrema > 1) {
  75795. y1_ = curve.cubicAt(y0, y1, y2, y3, extrema[1]);
  75796. }
  75797. }
  75798. if (nExtrema == 2) {
  75799. // 分成三段单调函数
  75800. if (t < extrema[0]) {
  75801. w += y0_ < y0 ? 1 : -1;
  75802. } else if (t < extrema[1]) {
  75803. w += y1_ < y0_ ? 1 : -1;
  75804. } else {
  75805. w += y3 < y1_ ? 1 : -1;
  75806. }
  75807. } else {
  75808. // 分成两段单调函数
  75809. if (t < extrema[0]) {
  75810. w += y0_ < y0 ? 1 : -1;
  75811. } else {
  75812. w += y3 < y0_ ? 1 : -1;
  75813. }
  75814. }
  75815. }
  75816. return w;
  75817. }
  75818. }
  75819. /**
  75820. * @function LevelRenderer.Tool.Areal.prototype.windingQuadratic
  75821. */
  75822. }, {
  75823. key: "windingQuadratic",
  75824. value: function windingQuadratic(x0, y0, x1, y1, x2, y2, x, y) {
  75825. var curve = this.curve;
  75826. var roots = this.roots;
  75827. // Quick reject
  75828. if (y > y0 && y > y1 && y > y2 || y < y0 && y < y1 && y < y2) {
  75829. return 0;
  75830. }
  75831. var nRoots = curve.quadraticRootAt(y0, y1, y2, y, roots);
  75832. if (nRoots === 0) {
  75833. return 0;
  75834. } else {
  75835. var t = curve.quadraticExtremum(y0, y1, y2);
  75836. if (t >= 0 && t <= 1) {
  75837. var w = 0;
  75838. var y_ = curve.quadraticAt(y0, y1, y2, t);
  75839. for (var i = 0; i < nRoots; i++) {
  75840. var x_ = curve.quadraticAt(x0, x1, x2, roots[i]);
  75841. if (x_ > x) {
  75842. continue;
  75843. }
  75844. if (roots[i] < t) {
  75845. w += y_ < y0 ? 1 : -1;
  75846. } else {
  75847. w += y2 < y_ ? 1 : -1;
  75848. }
  75849. }
  75850. return w;
  75851. } else {
  75852. var _x_ = curve.quadraticAt(x0, x1, x2, roots[0]);
  75853. if (_x_ > x) {
  75854. return 0;
  75855. }
  75856. return y2 < y0 ? 1 : -1;
  75857. }
  75858. }
  75859. }
  75860. /**
  75861. * @function LevelRenderer.Tool.Areal.prototype.windingArc
  75862. * // TODO Arc 旋转
  75863. */
  75864. }, {
  75865. key: "windingArc",
  75866. value: function windingArc(cx, cy, r, startAngle, endAngle, anticlockwise, x, y) {
  75867. var roots = this.roots;
  75868. var PI2 = this.PI2;
  75869. y -= cy;
  75870. if (y > r || y < -r) {
  75871. return 0;
  75872. }
  75873. var tmp = Math.sqrt(r * r - y * y);
  75874. roots[0] = -tmp;
  75875. roots[1] = tmp;
  75876. if (Math.abs(startAngle - endAngle) >= PI2) {
  75877. // Is a circle
  75878. startAngle = 0;
  75879. endAngle = PI2;
  75880. var dir = anticlockwise ? 1 : -1;
  75881. if (x >= roots[0] + cx && x <= roots[1] + cx) {
  75882. return dir;
  75883. } else {
  75884. return 0;
  75885. }
  75886. }
  75887. if (anticlockwise) {
  75888. var _tmp = startAngle;
  75889. startAngle = this.normalizeRadian(endAngle);
  75890. endAngle = this.normalizeRadian(_tmp);
  75891. } else {
  75892. startAngle = this.normalizeRadian(startAngle);
  75893. endAngle = this.normalizeRadian(endAngle);
  75894. }
  75895. if (startAngle > endAngle) {
  75896. endAngle += PI2;
  75897. }
  75898. var w = 0;
  75899. for (var i = 0; i < 2; i++) {
  75900. var x_ = roots[i];
  75901. if (x_ + cx > x) {
  75902. var angle = Math.atan2(y, x_);
  75903. var _dir = anticlockwise ? 1 : -1;
  75904. if (angle < 0) {
  75905. angle = PI2 + angle;
  75906. }
  75907. if (angle >= startAngle && angle <= endAngle || angle + PI2 >= startAngle && angle + PI2 <= endAngle) {
  75908. if (angle > Math.PI / 2 && angle < Math.PI * 1.5) {
  75909. _dir = -_dir;
  75910. }
  75911. w += _dir;
  75912. }
  75913. }
  75914. }
  75915. return w;
  75916. }
  75917. /**
  75918. * @function LevelRenderer.Tool.Areal.prototype.isInsidePath
  75919. * @description 与 canvas 一样采用 non-zero winding rule
  75920. */
  75921. }, {
  75922. key: "isInsidePath",
  75923. value: function isInsidePath(pathArray, lineWidth, brushType, x, y) {
  75924. var w = 0;
  75925. var xi = 0;
  75926. var yi = 0;
  75927. var x0 = 0;
  75928. var y0 = 0;
  75929. var beginSubpath = true;
  75930. var firstCmd = true;
  75931. brushType = brushType || 'fill';
  75932. var hasStroke = brushType === 'stroke' || brushType === 'both';
  75933. var hasFill = brushType === 'fill' || brushType === 'both';
  75934. // var roots = [-1, -1, -1];
  75935. for (var i = 0; i < pathArray.length; i++) {
  75936. var seg = pathArray[i];
  75937. var p = seg.points;
  75938. // Begin a new subpath
  75939. if (beginSubpath || seg.command === 'M') {
  75940. if (i > 0) {
  75941. // Close previous subpath
  75942. if (hasFill) {
  75943. w += this.windingLine(xi, yi, x0, y0, x, y);
  75944. }
  75945. if (w !== 0) {
  75946. return true;
  75947. }
  75948. }
  75949. x0 = p[p.length - 2];
  75950. y0 = p[p.length - 1];
  75951. beginSubpath = false;
  75952. if (firstCmd && seg.command !== 'A') {
  75953. // 如果第一个命令不是M, 是lineTo, bezierCurveTo
  75954. // 等绘制命令的话,是会从该绘制的起点开始算的
  75955. // Arc 会在之后做单独处理所以这里忽略
  75956. firstCmd = false;
  75957. xi = x0;
  75958. yi = y0;
  75959. }
  75960. }
  75961. switch (seg.command) {
  75962. case 'M':
  75963. xi = p[0];
  75964. yi = p[1];
  75965. break;
  75966. case 'L':
  75967. if (hasStroke) {
  75968. if (this.isInsideLine(xi, yi, p[0], p[1], lineWidth, x, y)) {
  75969. return true;
  75970. }
  75971. }
  75972. if (hasFill) {
  75973. w += this.windingLine(xi, yi, p[0], p[1], x, y);
  75974. }
  75975. xi = p[0];
  75976. yi = p[1];
  75977. break;
  75978. case 'C':
  75979. if (hasStroke) {
  75980. if (this.isInsideCubicStroke(xi, yi, p[0], p[1], p[2], p[3], p[4], p[5], lineWidth, x, y)) {
  75981. return true;
  75982. }
  75983. }
  75984. if (hasFill) {
  75985. w += this.windingCubic(xi, yi, p[0], p[1], p[2], p[3], p[4], p[5], x, y);
  75986. }
  75987. xi = p[4];
  75988. yi = p[5];
  75989. break;
  75990. case 'Q':
  75991. if (hasStroke) {
  75992. if (this.isInsideQuadraticStroke(xi, yi, p[0], p[1], p[2], p[3], lineWidth, x, y)) {
  75993. return true;
  75994. }
  75995. }
  75996. if (hasFill) {
  75997. w += this.windingQuadratic(xi, yi, p[0], p[1], p[2], p[3], x, y);
  75998. }
  75999. xi = p[2];
  76000. yi = p[3];
  76001. break;
  76002. case 'A':
  76003. // TODO Arc 旋转
  76004. // TODO Arc 判断的开销比较大
  76005. var cx = p[0];
  76006. var cy = p[1];
  76007. var rx = p[2];
  76008. var ry = p[3];
  76009. var theta = p[4];
  76010. var dTheta = p[5];
  76011. var x1 = Math.cos(theta) * rx + cx;
  76012. var y1 = Math.sin(theta) * ry + cy;
  76013. // 不是直接使用 arc 命令
  76014. if (!firstCmd) {
  76015. w += this.windingLine(xi, yi, x1, y1);
  76016. } else {
  76017. firstCmd = false;
  76018. // 第一个命令起点还未定义
  76019. x0 = x1;
  76020. y0 = y1;
  76021. }
  76022. // zr 使用scale来模拟椭圆, 这里也对x做一定的缩放
  76023. var _x = (x - cx) * ry / rx + cx;
  76024. if (hasStroke) {
  76025. if (this.isInsideArcStroke(cx, cy, ry, theta, theta + dTheta, 1 - p[7], lineWidth, _x, y)) {
  76026. return true;
  76027. }
  76028. }
  76029. if (hasFill) {
  76030. w += this.windingArc(cx, cy, ry, theta, theta + dTheta, 1 - p[7], _x, y);
  76031. }
  76032. xi = Math.cos(theta + dTheta) * rx + cx;
  76033. yi = Math.sin(theta + dTheta) * ry + cy;
  76034. break;
  76035. case 'z':
  76036. if (hasStroke) {
  76037. if (this.isInsideLine(xi, yi, x0, y0, lineWidth, x, y)) {
  76038. return true;
  76039. }
  76040. }
  76041. beginSubpath = true;
  76042. break;
  76043. }
  76044. }
  76045. if (hasFill) {
  76046. w += this.windingLine(xi, yi, x0, y0, x, y);
  76047. }
  76048. return w !== 0;
  76049. }
  76050. /**
  76051. * @function LevelRenderer.Tool.Areal.prototype.getTextWidth
  76052. * @description 测算多行文本宽度
  76053. */
  76054. }, {
  76055. key: "getTextWidth",
  76056. value: function getTextWidth(text, textFont) {
  76057. var key = text + ':' + textFont;
  76058. if (this._textWidthCache[key]) {
  76059. return this._textWidthCache[key];
  76060. }
  76061. this._ctx = this._ctx || this.util.getContext();
  76062. this._ctx.save();
  76063. if (textFont) {
  76064. this._ctx.font = textFont;
  76065. }
  76066. text = (text + '').split('\n');
  76067. var width = 0;
  76068. for (var i = 0, l = text.length; i < l; i++) {
  76069. width = Math.max(this._ctx.measureText(text[i]).width, width);
  76070. }
  76071. this._ctx.restore();
  76072. this._textWidthCache[key] = width;
  76073. if (++this._textWidthCacheCounter > this.TEXT_CACHE_MAX) {
  76074. // 内存释放
  76075. this._textWidthCacheCounter = 0;
  76076. this._textWidthCache = {};
  76077. }
  76078. return width;
  76079. }
  76080. /**
  76081. * @function LevelRenderer.Tool.Areal.prototype.getTextHeight
  76082. * @description 测算多行文本高度
  76083. */
  76084. }, {
  76085. key: "getTextHeight",
  76086. value: function getTextHeight(text, textFont) {
  76087. var key = text + ':' + textFont;
  76088. if (this._textHeightCache[key]) {
  76089. return this._textHeightCache[key];
  76090. }
  76091. this._ctx = this._ctx || this.util.getContext();
  76092. this._ctx.save();
  76093. if (textFont) {
  76094. this._ctx.font = textFont;
  76095. }
  76096. text = (text + '').split('\n');
  76097. // 比较粗暴
  76098. //var height = (this._ctx.measureText('国').width + 2) * text.length; //打包不支持中文,替换掉
  76099. var height = (this._ctx.measureText('ZH').width + 2) * text.length;
  76100. this._ctx.restore();
  76101. this._textHeightCache[key] = height;
  76102. if (++this._textHeightCacheCounter > this.TEXT_CACHE_MAX) {
  76103. // 内存释放
  76104. this._textHeightCacheCounter = 0;
  76105. this._textHeightCache = {};
  76106. }
  76107. return height;
  76108. }
  76109. }]);
  76110. return Area;
  76111. }();
  76112. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/ComputeBoundingBox.js
  76113. function ComputeBoundingBox_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  76114. function ComputeBoundingBox_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  76115. function ComputeBoundingBox_createClass(Constructor, protoProps, staticProps) { if (protoProps) ComputeBoundingBox_defineProperties(Constructor.prototype, protoProps); if (staticProps) ComputeBoundingBox_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  76116. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  76117. * This program are made available under the terms of the Apache License, Version 2.0
  76118. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  76119. /**
  76120. * @class LevelRenderer.Tool.ComputeBoundingBox
  76121. * @category Visualization Theme
  76122. * @classdesc LevelRenderer 工具-图形 Bounds 计算
  76123. * @private
  76124. */
  76125. var ComputeBoundingBox = /*#__PURE__*/function () {
  76126. function ComputeBoundingBox() {
  76127. ComputeBoundingBox_classCallCheck(this, ComputeBoundingBox);
  76128. if (arguments.length === 3) {
  76129. this.computeBoundingBox(arguments);
  76130. }
  76131. this.CLASS_NAME = "SuperMap.LevelRenderer.Tool.ComputeBoundingBox";
  76132. }
  76133. /**
  76134. * @function LevelRenderer.Tool.ComputeBoundingBox.prototype.computeBoundingBox
  76135. * @description 从顶点数组中计算出最小包围盒,写入'min'和'max'中。
  76136. * @param {Array.<Object>} points - 顶点数组。
  76137. * @param {Array.<number>} min - 最小
  76138. * @param {Array.<number>} max - 最大
  76139. */
  76140. ComputeBoundingBox_createClass(ComputeBoundingBox, [{
  76141. key: "computeBoundingBox",
  76142. value: function computeBoundingBox(points, min, max) {
  76143. if (points.length === 0) {
  76144. return;
  76145. }
  76146. var left = points[0][0];
  76147. var right = points[0][0];
  76148. var top = points[0][1];
  76149. var bottom = points[0][1];
  76150. for (var i = 1; i < points.length; i++) {
  76151. var p = points[i];
  76152. if (p[0] < left) {
  76153. left = p[0];
  76154. }
  76155. if (p[0] > right) {
  76156. right = p[0];
  76157. }
  76158. if (p[1] < top) {
  76159. top = p[1];
  76160. }
  76161. if (p[1] > bottom) {
  76162. bottom = p[1];
  76163. }
  76164. }
  76165. min[0] = left;
  76166. min[1] = top;
  76167. max[0] = right;
  76168. max[1] = bottom;
  76169. }
  76170. /**
  76171. * @function LevelRenderer.Tool.ComputeBoundingBox.prototype.cubeBezier
  76172. * @description 从三阶贝塞尔曲线(p0, p1, p2, p3)中计算出最小包围盒,写入'min'和'max'中。原:computeCubeBezierBoundingBox。
  76173. * @param {Array.<number>} p0 - 三阶贝塞尔曲线p0点
  76174. * @param {Array.<number>} p1 - 三阶贝塞尔曲线p1点
  76175. * @param {Array.<number>} p2 - 三阶贝塞尔曲线p2点
  76176. * @param {Array.<number>} p3 - 三阶贝塞尔曲线p3点
  76177. * @param {Array.<number>} min - 最小
  76178. * @param {Array.<number>} max - 最大
  76179. */
  76180. }, {
  76181. key: "cubeBezier",
  76182. value: function cubeBezier(p0, p1, p2, p3, min, max) {
  76183. var curve = new Curve_Curve();
  76184. var xDim = [];
  76185. curve.cubicExtrema(p0[0], p1[0], p2[0], p3[0], xDim);
  76186. for (var i = 0; i < xDim.length; i++) {
  76187. xDim[i] = curve.cubicAt(p0[0], p1[0], p2[0], p3[0], xDim[i]);
  76188. }
  76189. var yDim = [];
  76190. curve.cubicExtrema(p0[1], p1[1], p2[1], p3[1], yDim);
  76191. for (var _i2 = 0; _i2 < yDim.length; _i2++) {
  76192. yDim[_i2] = curve.cubicAt(p0[1], p1[1], p2[1], p3[1], yDim[_i2]);
  76193. }
  76194. xDim.push(p0[0], p3[0]);
  76195. yDim.push(p0[1], p3[1]);
  76196. var left = Math.min.apply(null, xDim);
  76197. var right = Math.max.apply(null, xDim);
  76198. var top = Math.min.apply(null, yDim);
  76199. var bottom = Math.max.apply(null, yDim);
  76200. min[0] = left;
  76201. min[1] = top;
  76202. max[0] = right;
  76203. max[1] = bottom;
  76204. }
  76205. /**
  76206. * @function LevelRenderer.Tool.ComputeBoundingBox.prototype.quadraticBezier
  76207. * @description 从二阶贝塞尔曲线(p0, p1, p2)中计算出最小包围盒,写入'min'和'max'中。原:computeQuadraticBezierBoundingBox。
  76208. * @param {Array.<number>} p0 - 二阶贝塞尔曲线p0点
  76209. * @param {Array.<number>} p1 - 二阶贝塞尔曲线p1点
  76210. * @param {Array.<number>} p2 - 二阶贝塞尔曲线p2点
  76211. * @param {Array.<number>} min - 最小
  76212. * @param {Array.<number>} max - 最大
  76213. */
  76214. }, {
  76215. key: "quadraticBezier",
  76216. value: function quadraticBezier(p0, p1, p2, min, max) {
  76217. var curve = new Curve_Curve();
  76218. // Find extremities, where derivative in x dim or y dim is zero
  76219. var t1 = curve.quadraticExtremum(p0[0], p1[0], p2[0]);
  76220. var t2 = curve.quadraticExtremum(p0[1], p1[1], p2[1]);
  76221. t1 = Math.max(Math.min(t1, 1), 0);
  76222. t2 = Math.max(Math.min(t2, 1), 0);
  76223. var ct1 = 1 - t1;
  76224. var ct2 = 1 - t2;
  76225. var x1 = ct1 * ct1 * p0[0] + 2 * ct1 * t1 * p1[0] + t1 * t1 * p2[0];
  76226. var y1 = ct1 * ct1 * p0[1] + 2 * ct1 * t1 * p1[1] + t1 * t1 * p2[1];
  76227. var x2 = ct2 * ct2 * p0[0] + 2 * ct2 * t2 * p1[0] + t2 * t2 * p2[0];
  76228. var y2 = ct2 * ct2 * p0[1] + 2 * ct2 * t2 * p1[1] + t2 * t2 * p2[1];
  76229. min[0] = Math.min(p0[0], p2[0], x1, x2);
  76230. min[1] = Math.min(p0[1], p2[1], y1, y2);
  76231. max[0] = Math.max(p0[0], p2[0], x1, x2);
  76232. max[1] = Math.max(p0[1], p2[1], y1, y2);
  76233. }
  76234. /**
  76235. * @function LevelRenderer.Tool.ComputeBoundingBox.prototype.arc
  76236. * @description 从圆弧中计算出最小包围盒,写入'min'和'max'中。原:computeArcBoundingBox。
  76237. * @param {number} x - 圆弧中心点 x
  76238. * @param {number} y - 圆弧中心点 y
  76239. * @param {number} r - 圆弧半径
  76240. * @param {number} startAngle - 圆弧开始角度
  76241. * @param {number} endAngle - 圆弧结束角度
  76242. * @param {number} anticlockwise - 是否是顺时针
  76243. * @param {number} min - 最小
  76244. * @param {number} max - 最大
  76245. */
  76246. }, {
  76247. key: "arc",
  76248. value: function arc(x, y, r, startAngle, endAngle, anticlockwise, min, max) {
  76249. var vec2 = new levelRenderer_Vector_Vector();
  76250. var start = vec2.create();
  76251. var end = vec2.create();
  76252. var extremity = vec2.create();
  76253. start[0] = Math.cos(startAngle) * r + x;
  76254. start[1] = Math.sin(startAngle) * r + y;
  76255. end[0] = Math.cos(endAngle) * r + x;
  76256. end[1] = Math.sin(endAngle) * r + y;
  76257. vec2.min(min, start, end);
  76258. vec2.max(max, start, end);
  76259. // Thresh to [0, Math.PI * 2]
  76260. startAngle = startAngle % (Math.PI * 2);
  76261. if (startAngle < 0) {
  76262. startAngle = startAngle + Math.PI * 2;
  76263. }
  76264. endAngle = endAngle % (Math.PI * 2);
  76265. if (endAngle < 0) {
  76266. endAngle = endAngle + Math.PI * 2;
  76267. }
  76268. if (startAngle > endAngle && !anticlockwise) {
  76269. endAngle += Math.PI * 2;
  76270. } else if (startAngle < endAngle && anticlockwise) {
  76271. startAngle += Math.PI * 2;
  76272. }
  76273. if (anticlockwise) {
  76274. var tmp = endAngle;
  76275. endAngle = startAngle;
  76276. startAngle = tmp;
  76277. }
  76278. // var number = 0;
  76279. // var step = (anticlockwise ? -Math.PI : Math.PI) / 2;
  76280. for (var angle = 0; angle < endAngle; angle += Math.PI / 2) {
  76281. if (angle > startAngle) {
  76282. extremity[0] = Math.cos(angle) * r + x;
  76283. extremity[1] = Math.sin(angle) * r + y;
  76284. vec2.min(min, extremity, min);
  76285. vec2.max(max, extremity, max);
  76286. }
  76287. }
  76288. }
  76289. }]);
  76290. return ComputeBoundingBox;
  76291. }();
  76292. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Env.js
  76293. function Env_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  76294. function Env_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  76295. function Env_createClass(Constructor, protoProps, staticProps) { if (protoProps) Env_defineProperties(Constructor.prototype, protoProps); if (staticProps) Env_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  76296. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  76297. * This program are made available under the terms of the Apache License, Version 2.0
  76298. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  76299. /**
  76300. * @class LevelRenderer.Tool.Env
  76301. * @category Visualization Theme
  76302. * @classdesc 环境识别
  76303. * @private
  76304. */
  76305. var Env = /*#__PURE__*/function () {
  76306. function Env() {
  76307. Env_classCallCheck(this, Env);
  76308. // Zepto.js
  76309. // (c) 2010-2013 Thomas Fuchs
  76310. // Zepto.js may be freely distributed under the MIT license.
  76311. this.CLASS_NAME = "SuperMap.LevelRenderer.Tool.Env";
  76312. var me = this;
  76313. function detect(ua) {
  76314. var os = me.os = {};
  76315. var browser = me.browser = {};
  76316. var webkit = ua.match(/Web[kK]it[\/]{0,1}([\d.]+)/);
  76317. var android = ua.match(/(Android);?[\s\/]+([\d.]+)?/);
  76318. var ipad = ua.match(/(iPad).*OS\s([\d_]+)/);
  76319. var ipod = ua.match(/(iPod)(.*OS\s([\d_]+))?/);
  76320. var iphone = !ipad && ua.match(/(iPhone\sOS)\s([\d_]+)/);
  76321. var webos = ua.match(/(webOS|hpwOS)[\s\/]([\d.]+)/);
  76322. var touchpad = webos && ua.match(/TouchPad/);
  76323. var kindle = ua.match(/Kindle\/([\d.]+)/);
  76324. var silk = ua.match(/Silk\/([\d._]+)/);
  76325. var blackberry = ua.match(/(BlackBerry).*Version\/([\d.]+)/);
  76326. var bb10 = ua.match(/(BB10).*Version\/([\d.]+)/);
  76327. var rimtabletos = ua.match(/(RIM\sTablet\sOS)\s([\d.]+)/);
  76328. var playbook = ua.match(/PlayBook/);
  76329. var chrome = ua.match(/Chrome\/([\d.]+)/) || ua.match(/CriOS\/([\d.]+)/);
  76330. var firefox = ua.match(/Firefox\/([\d.]+)/);
  76331. var ie = ua.match(/MSIE ([\d.]+)/);
  76332. var safari = webkit && ua.match(/Mobile\//) && !chrome;
  76333. var webview = ua.match(/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/) && !chrome;
  76334. // Todo: clean this up with a better OS/browser seperation:
  76335. // - discern (more) between multiple browsers on android
  76336. // - decide if kindle fire in silk mode is android or not
  76337. // - Firefox on Android doesn't specify the Android version
  76338. // - possibly devide in os, device and browser hashes
  76339. /*eslint-disable*/
  76340. if (browser.webkit = !!webkit) {
  76341. browser.version = webkit[1];
  76342. }
  76343. if (android) {
  76344. os.android = true;
  76345. os.version = android[2];
  76346. }
  76347. if (iphone && !ipod) {
  76348. os.ios = os.iphone = true;
  76349. os.version = iphone[2].replace(/_/g, '.');
  76350. }
  76351. if (ipad) {
  76352. os.ios = os.ipad = true;
  76353. os.version = ipad[2].replace(/_/g, '.');
  76354. }
  76355. if (ipod) {
  76356. os.ios = os.ipod = true;
  76357. os.version = ipod[3] ? ipod[3].replace(/_/g, '.') : null;
  76358. }
  76359. if (webos) {
  76360. os.webos = true;
  76361. os.version = webos[2];
  76362. }
  76363. if (touchpad) {
  76364. os.touchpad = true;
  76365. }
  76366. if (blackberry) {
  76367. os.blackberry = true;
  76368. os.version = blackberry[2];
  76369. }
  76370. if (bb10) {
  76371. os.bb10 = true;
  76372. os.version = bb10[2];
  76373. }
  76374. if (rimtabletos) {
  76375. os.rimtabletos = true;
  76376. os.version = rimtabletos[2];
  76377. }
  76378. if (playbook) {
  76379. browser.playbook = true;
  76380. }
  76381. if (kindle) {
  76382. os.kindle = true;
  76383. os.version = kindle[1];
  76384. }
  76385. if (silk) {
  76386. browser.silk = true;
  76387. browser.version = silk[1];
  76388. }
  76389. if (!silk && os.android && ua.match(/Kindle Fire/)) {
  76390. browser.silk = true;
  76391. }
  76392. if (chrome) {
  76393. browser.chrome = true;
  76394. browser.version = chrome[1];
  76395. }
  76396. if (firefox) {
  76397. browser.firefox = true;
  76398. browser.version = firefox[1];
  76399. }
  76400. if (ie) {
  76401. browser.ie = true;
  76402. browser.version = ie[1];
  76403. }
  76404. if (safari && (ua.match(/Safari/) || !!os.ios)) {
  76405. browser.safari = true;
  76406. }
  76407. if (webview) {
  76408. browser.webview = true;
  76409. }
  76410. if (ie) {
  76411. browser.ie = true;
  76412. browser.version = ie[1];
  76413. }
  76414. os.tablet = !!(ipad || playbook || android && !ua.match(/Mobile/) || firefox && ua.match(/Tablet/) || ie && !ua.match(/Phone/) && ua.match(/Touch/));
  76415. os.phone = !!(!os.tablet && !os.ipod && (android || iphone || webos || blackberry || bb10 || chrome && ua.match(/Android/) || chrome && ua.match(/CriOS\/([\d.]+)/) || firefox && ua.match(/Mobile/) || ie && ua.match(/Touch/)));
  76416. return {
  76417. browser: browser,
  76418. os: os,
  76419. // 原生canvas支持
  76420. canvasSupported: document.createElement('canvas').getContext ? true : false
  76421. };
  76422. }
  76423. return detect(navigator.userAgent);
  76424. }
  76425. Env_createClass(Env, [{
  76426. key: "destory",
  76427. value: function destory() {
  76428. return true;
  76429. }
  76430. }]);
  76431. return Env;
  76432. }();
  76433. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Event.js
  76434. function Event_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  76435. function Event_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  76436. function Event_createClass(Constructor, protoProps, staticProps) { if (protoProps) Event_defineProperties(Constructor.prototype, protoProps); if (staticProps) Event_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  76437. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  76438. * This program are made available under the terms of the Apache License, Version 2.0
  76439. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  76440. /**
  76441. * @class LevelRenderer.Tool.Event
  76442. * @category Visualization Theme
  76443. * @classdesc LevelRenderer 工具-事件辅助类
  76444. * @private
  76445. */
  76446. var Event_Event = /*#__PURE__*/function () {
  76447. function Event() {
  76448. Event_classCallCheck(this, Event);
  76449. /**
  76450. * @member {function} LevelRenderer.Tool.Event.prototype.stop
  76451. * @description 停止冒泡和阻止默认行为
  76452. */
  76453. this.stop = typeof window.addEventListener === 'function' ? function (e) {
  76454. e.preventDefault();
  76455. e.stopPropagation();
  76456. e.cancelBubble = true;
  76457. } : function (e) {
  76458. e.returnValue = false;
  76459. e.cancelBubble = true;
  76460. };
  76461. this.CLASS_NAME = "SuperMap.LevelRenderer.Tool.Event";
  76462. }
  76463. /**
  76464. * @function LevelRenderer.Tool.Event.prototype.getX
  76465. * @description 提取鼠标(手指)x坐标。
  76466. * @param {Event} e - 事件。
  76467. * @returns {number} 鼠标(手指)x坐标。
  76468. */
  76469. Event_createClass(Event, [{
  76470. key: "getX",
  76471. value: function getX(e) {
  76472. return typeof e.zrenderX != 'undefined' && e.zrenderX || typeof e.offsetX != 'undefined' && e.offsetX || typeof e.layerX != 'undefined' && e.layerX || typeof e.clientX != 'undefined' && e.clientX;
  76473. }
  76474. /**
  76475. * @function LevelRenderer.Tool.Event.prototype.getY
  76476. * @description 提取鼠标(手指)y坐标。
  76477. * @param {Event} e - 事件。
  76478. * @returns {number} 鼠标(手指)y坐标。
  76479. */
  76480. }, {
  76481. key: "getY",
  76482. value: function getY(e) {
  76483. return typeof e.zrenderY != 'undefined' && e.zrenderY || typeof e.offsetY != 'undefined' && e.offsetY || typeof e.layerY != 'undefined' && e.layerY || typeof e.clientY != 'undefined' && e.clientY;
  76484. }
  76485. /**
  76486. * @function LevelRenderer.Tool.Event.prototype.getDelta
  76487. * @description 提取鼠标滚轮变化。
  76488. * @param {Event} e - 事件。
  76489. * @returns {number} 滚轮变化,正值说明滚轮是向上滚动,如果是负值说明滚轮是向下滚动。
  76490. */
  76491. }, {
  76492. key: "getDelta",
  76493. value: function getDelta(e) {
  76494. return typeof e.zrenderDelta != 'undefined' && e.zrenderDelta || typeof e.wheelDelta != 'undefined' && e.wheelDelta || typeof e.detail != 'undefined' && -e.detail;
  76495. }
  76496. }]);
  76497. return Event;
  76498. }();
  76499. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Http.js
  76500. function Http_typeof(obj) { "@babel/helpers - typeof"; return Http_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, Http_typeof(obj); }
  76501. function Http_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  76502. function Http_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  76503. function Http_createClass(Constructor, protoProps, staticProps) { if (protoProps) Http_defineProperties(Constructor.prototype, protoProps); if (staticProps) Http_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  76504. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  76505. * This program are made available under the terms of the Apache License, Version 2.0
  76506. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  76507. /**
  76508. * @private
  76509. * @class LevelRenderer.Tool.Http
  76510. * @category Visualization Theme
  76511. * @classdesc LevelRenderer 工具-Http
  76512. */
  76513. var Http = /*#__PURE__*/function () {
  76514. function Http() {
  76515. Http_classCallCheck(this, Http);
  76516. this.CLASS_NAME = "SuperMap.LevelRenderer.Tool.Http";
  76517. }
  76518. /**
  76519. * @function LevelRenderer.Tool.Http.prototype.get
  76520. * @description get请求。
  76521. * @param {(string|IHTTPGetOption)} url - 请求url
  76522. * @param {function} onsuccess - 请求成功函数
  76523. * @param {function} onerror - 请求失败函数
  76524. * @param {Object} opts - 额外参数
  76525. * @returns {number} cos值
  76526. */
  76527. Http_createClass(Http, [{
  76528. key: "get",
  76529. value: function get(url, onsuccess, onerror) {
  76530. if (Http_typeof(url) === 'object') {
  76531. var obj = url;
  76532. url = obj.url;
  76533. onsuccess = obj.onsuccess;
  76534. onerror = obj.onerror;
  76535. }
  76536. var xhr = window.XMLHttpRequest ? new XMLHttpRequest() : new window.ActiveXObject('Microsoft.XMLHTTP');
  76537. xhr.open('GET', url, true);
  76538. xhr.onreadystatechange = function () {
  76539. if (xhr.readyState == 4) {
  76540. if (xhr.status >= 200 && xhr.status < 300 || xhr.status === 304) {
  76541. onsuccess && onsuccess(xhr.responseText);
  76542. } else {
  76543. onerror && onerror();
  76544. }
  76545. xhr.onreadystatechange = new Function();
  76546. xhr = null;
  76547. }
  76548. };
  76549. xhr.send(null);
  76550. }
  76551. }]);
  76552. return Http;
  76553. }();
  76554. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Config.js
  76555. function Config_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  76556. function Config_createClass(Constructor, protoProps, staticProps) { if (protoProps) Config_defineProperties(Constructor.prototype, protoProps); if (staticProps) Config_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  76557. function Config_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  76558. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  76559. * This program are made available under the terms of the Apache License, Version 2.0
  76560. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  76561. var Config_Config = /*#__PURE__*/Config_createClass(function Config() {
  76562. Config_classCallCheck(this, Config);
  76563. });
  76564. /**
  76565. * @enum EVENT
  76566. * @description 事件
  76567. * @type {Object}
  76568. * @private
  76569. */
  76570. Config_Config.EVENT = {
  76571. //窗口大小变化
  76572. RESIZE: 'resize',
  76573. //鼠标按钮被(手指)按下,事件对象是:目标图形元素或空
  76574. CLICK: 'click',
  76575. //双击事件
  76576. DBLCLICK: 'dblclick',
  76577. //鼠标滚轮变化,事件对象是:目标图形元素或空
  76578. MOUSEWHEEL: 'mousewheel',
  76579. //鼠标(手指)被移动,事件对象是:目标图形元素或空
  76580. MOUSEMOVE: 'mousemove',
  76581. //鼠标移到某图形元素之上,事件对象是:目标图形元素
  76582. MOUSEOVER: 'mouseover',
  76583. //鼠标从某图形元素移开,事件对象是:目标图形元素
  76584. MOUSEOUT: 'mouseout',
  76585. //鼠标按钮(手指)被按下,事件对象是:目标图形元素或空
  76586. MOUSEDOWN: 'mousedown',
  76587. //鼠标按键(手指)被松开,事件对象是:目标图形元素或空
  76588. MOUSEUP: 'mouseup',
  76589. //全局离开,MOUSEOUT触发比较频繁,一次离开优化绑定
  76590. GLOBALOUT: 'globalout',
  76591. // 一次成功元素拖拽的行为事件过程是:
  76592. // dragstart > dragenter > dragover [> dragleave] > drop > dragend
  76593. //开始拖拽时触发,事件对象是:被拖拽图形元素
  76594. DRAGSTART: 'dragstart',
  76595. //拖拽完毕时触发(在drop之后触发),事件对象是:被拖拽图形元素
  76596. DRAGEND: 'dragend',
  76597. //拖拽图形元素进入目标图形元素时触发,事件对象是:目标图形元素
  76598. DRAGENTER: 'dragenter',
  76599. //拖拽图形元素在目标图形元素上移动时触发,事件对象是:目标图形元素
  76600. DRAGOVER: 'dragover',
  76601. //拖拽图形元素离开目标图形元素时触发,事件对象是:目标图形元素
  76602. DRAGLEAVE: 'dragleave',
  76603. //拖拽图形元素放在目标图形元素内时触发,事件对象是:目标图形元素
  76604. DROP: 'drop',
  76605. //touch end - start < delay is click
  76606. touchClickDelay: 300
  76607. };
  76608. /**
  76609. * @enum catchBrushException
  76610. * @description 是否异常捕获
  76611. * @type {boolean}
  76612. * @private
  76613. */
  76614. Config_Config.catchBrushException = false;
  76615. /**
  76616. * @enum debugMode
  76617. * @description debug 日志选项:catchBrushException 为 true 下有效。
  76618. * 0 : 不生成debug数据,发布用
  76619. * 1 : 异常抛出,调试用
  76620. * 2 : 控制台输出,调试用
  76621. * @type {boolean}
  76622. * @private
  76623. */
  76624. Config_Config.debugMode = 0;
  76625. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Log.js
  76626. function Log_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  76627. function Log_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  76628. function Log_createClass(Constructor, protoProps, staticProps) { if (protoProps) Log_defineProperties(Constructor.prototype, protoProps); if (staticProps) Log_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  76629. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  76630. * This program are made available under the terms of the Apache License, Version 2.0
  76631. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  76632. /**
  76633. * @private
  76634. * @class LevelRenderer.Tool.Log
  76635. * @category Visualization Theme
  76636. * @classdesc LevelRenderer 工具-日志
  76637. */
  76638. var Log = /*#__PURE__*/function () {
  76639. function Log() {
  76640. Log_classCallCheck(this, Log);
  76641. this.CLASS_NAME = "SuperMap.LevelRenderer.Tool.Log";
  76642. return function () {
  76643. if (+Config_Config.debugMode === 0) {
  76644. return;
  76645. } else if (+Config_Config.debugMode === 1) {
  76646. for (var k in arguments) {
  76647. throw new Error(arguments[k]);
  76648. }
  76649. } else if (+Config_Config.debugMode > 1) {
  76650. for (var _k2 in arguments) {
  76651. console.log(arguments[_k2]);
  76652. }
  76653. }
  76654. };
  76655. /* for debug
  76656. return function(mes) {
  76657. document.getElementById('wrong-message').innerHTML =
  76658. mes + ' ' + (new Date() - 0)
  76659. + '<br/>'
  76660. + document.getElementById('wrong-message').innerHTML;
  76661. };
  76662. */
  76663. }
  76664. Log_createClass(Log, [{
  76665. key: "destory",
  76666. value: function destory() {
  76667. return true;
  76668. }
  76669. }]);
  76670. return Log;
  76671. }();
  76672. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Math.js
  76673. function Math_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  76674. function Math_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  76675. function Math_createClass(Constructor, protoProps, staticProps) { if (protoProps) Math_defineProperties(Constructor.prototype, protoProps); if (staticProps) Math_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  76676. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  76677. * This program are made available under the terms of the Apache License, Version 2.0
  76678. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  76679. /**
  76680. * @private
  76681. * @class LevelRenderer.Tool.Math
  76682. * @category Visualization Theme
  76683. * @classdesc LevelRenderer 工具-数学辅助类
  76684. */
  76685. var MathTool = /*#__PURE__*/function () {
  76686. function MathTool() {
  76687. Math_classCallCheck(this, MathTool);
  76688. /**
  76689. * @member {number} LevelRenderer.Tool.Math._radians
  76690. * @description 角度与弧度转化参数
  76691. */
  76692. this._radians = window.Math.PI / 180;
  76693. this.CLASS_NAME = "SuperMap.LevelRenderer.Tool.Math";
  76694. }
  76695. /**
  76696. * @function LevelRenderer.Tool.Math.prototype.sin
  76697. * @description 正弦函数。
  76698. * @param {number} angle - 弧度(角度)参数。
  76699. * @param {boolean} [isDegrees=false] - angle参数是否为角度计算,angle为以弧度计量的角度。
  76700. * @returns {number} sin 值。
  76701. */
  76702. Math_createClass(MathTool, [{
  76703. key: "sin",
  76704. value: function sin(angle, isDegrees) {
  76705. return window.Math.sin(isDegrees ? angle * this._radians : angle);
  76706. }
  76707. /**
  76708. * @function LevelRenderer.Tool.Math.prototype.cos
  76709. * @description 余弦函数。
  76710. * @param {number} angle - 弧度(角度)参数。
  76711. * @param {boolean} [isDegrees=false] - angle参数是否为角度计算,angle为以弧度计量的角度。
  76712. * @returns {number} cos 值。
  76713. */
  76714. }, {
  76715. key: "cos",
  76716. value: function cos(angle, isDegrees) {
  76717. return window.Math.cos(isDegrees ? angle * this._radians : angle);
  76718. }
  76719. /**
  76720. * @function LevelRenderer.Tool.Math.prototype.degreeToRadian
  76721. * @description 角度转弧度。
  76722. * @param {number} angle - 弧度(角度)参数。
  76723. * @param {boolean} [isDegrees=false] - angle参数是否为角度计算,angle为以弧度计量的角度。
  76724. * @returns {number} 弧度值。
  76725. */
  76726. }, {
  76727. key: "degreeToRadian",
  76728. value: function degreeToRadian(angle) {
  76729. return angle * this._radians;
  76730. }
  76731. /**
  76732. * @function LevelRenderer.Tool.Math.prototype.radianToDegree
  76733. * @description 弧度转角度。
  76734. * @param {number} angle - 弧度(角度)参数。
  76735. * @param {boolean} [isDegrees=false] - angle参数是否为角度计算,angle为以弧度计量的角度。
  76736. * @returns {number} 角度。
  76737. */
  76738. }, {
  76739. key: "radianToDegree",
  76740. value: function radianToDegree(angle) {
  76741. return angle / this._radians;
  76742. }
  76743. }]);
  76744. return MathTool;
  76745. }();
  76746. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Matrix.js
  76747. function Matrix_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  76748. function Matrix_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  76749. function Matrix_createClass(Constructor, protoProps, staticProps) { if (protoProps) Matrix_defineProperties(Constructor.prototype, protoProps); if (staticProps) Matrix_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  76750. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  76751. * This program are made available under the terms of the Apache License, Version 2.0
  76752. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  76753. /**
  76754. * @private
  76755. * @class LevelRenderer.Tool.Matrix
  76756. * @category Visualization Theme
  76757. * @classdesc LevelRenderer 工具-3x2矩阵操作类
  76758. */
  76759. var Matrix = /*#__PURE__*/function () {
  76760. function Matrix() {
  76761. Matrix_classCallCheck(this, Matrix);
  76762. /**
  76763. * @member {Object} LevelRenderer.Tool.Matrix.prototype.ArrayCtor
  76764. * @description 数组类型控制
  76765. */
  76766. this.ArrayCtor = typeof Float32Array === 'undefined' ? Array : Float32Array;
  76767. this.CLASS_NAME = "SuperMap.LevelRenderer.Tool.Matrix";
  76768. }
  76769. /**
  76770. * @function LevelRenderer.Tool.Matrix.prototype.create
  76771. * @description 创建一个单位矩阵。
  76772. * @returns {(Float32Array|Array.<number>)} 单位矩阵。
  76773. */
  76774. Matrix_createClass(Matrix, [{
  76775. key: "create",
  76776. value: function create() {
  76777. var ArrayCtor = this.ArrayCtor;
  76778. var out = new ArrayCtor(6);
  76779. this.identity(out);
  76780. return out;
  76781. }
  76782. /**
  76783. * @function LevelRenderer.Tool.Matrix.prototype.identity
  76784. * @description 设置矩阵为单位矩阵。
  76785. * @param {(Float32Array|Array.<number>)} out - 单位矩阵。
  76786. * @returns {(Float32Array|Array.<number>)} 单位矩阵。
  76787. */
  76788. }, {
  76789. key: "identity",
  76790. value: function identity(out) {
  76791. out[0] = 1;
  76792. out[1] = 0;
  76793. out[2] = 0;
  76794. out[3] = 1;
  76795. out[4] = 0;
  76796. out[5] = 0;
  76797. return out;
  76798. }
  76799. /**
  76800. * @function LevelRenderer.Tool.Matrix.prototype.copy
  76801. * @description 复制矩阵。
  76802. * @param {(Float32Array|Array.<number>)} out - 单位矩阵。
  76803. * @returns {(Float32Array|Array.<number>)} 克隆矩阵。
  76804. */
  76805. }, {
  76806. key: "copy",
  76807. value: function copy(out, m) {
  76808. out[0] = m[0];
  76809. out[1] = m[1];
  76810. out[2] = m[2];
  76811. out[3] = m[3];
  76812. out[4] = m[4];
  76813. out[5] = m[5];
  76814. return out;
  76815. }
  76816. /**
  76817. * @function LevelRenderer.Tool.Matrix.prototype.mul
  76818. * @description 矩阵相乘。
  76819. * @param {(Float32Array|Array.<number>)} out - 单位矩阵。
  76820. * @param {(Float32Array|Array.<number>)} m1 - 矩阵m1。
  76821. * @param {(Float32Array|Array.<number>)} m2- 矩阵m2。
  76822. * @returns {(Float32Array|Array.<number>)} 结果矩阵。
  76823. */
  76824. }, {
  76825. key: "mul",
  76826. value: function mul(out, m1, m2) {
  76827. out[0] = m1[0] * m2[0] + m1[2] * m2[1];
  76828. out[1] = m1[1] * m2[0] + m1[3] * m2[1];
  76829. out[2] = m1[0] * m2[2] + m1[2] * m2[3];
  76830. out[3] = m1[1] * m2[2] + m1[3] * m2[3];
  76831. out[4] = m1[0] * m2[4] + m1[2] * m2[5] + m1[4];
  76832. out[5] = m1[1] * m2[4] + m1[3] * m2[5] + m1[5];
  76833. return out;
  76834. }
  76835. /**
  76836. * @function LevelRenderer.Tool.Matrix.prototype.mul
  76837. * @description 平移变换。
  76838. * @param {(Float32Array|Array.<number>)} out - 单位矩阵。
  76839. * @param {(Float32Array|Array.<number>)} a - 矩阵。
  76840. * @param {(Float32Array|Array.<number>)} v- 平移参数。
  76841. * @returns {(Float32Array|Array.<number>)} 结果矩阵。
  76842. */
  76843. }, {
  76844. key: "translate",
  76845. value: function translate(out, a, v) {
  76846. out[0] = a[0];
  76847. out[1] = a[1];
  76848. out[2] = a[2];
  76849. out[3] = a[3];
  76850. out[4] = a[4] + v[0];
  76851. out[5] = a[5] + v[1];
  76852. return out;
  76853. }
  76854. /**
  76855. * @function LevelRenderer.Tool.Matrix.prototype.rotate
  76856. * @description 平移变换。
  76857. * @param {(Float32Array|Array.<number>)} out - 单位矩阵。
  76858. * @param {(Float32Array|Array.<number>)} a - 矩阵。
  76859. * @param {(Float32Array|Array.<number>)} rad - 旋转参数。
  76860. * @returns {(Float32Array|Array.<number>)} 结果矩阵。
  76861. */
  76862. }, {
  76863. key: "rotate",
  76864. value: function rotate(out, a, rad) {
  76865. var aa = a[0];
  76866. var ac = a[2];
  76867. var atx = a[4];
  76868. var ab = a[1];
  76869. var ad = a[3];
  76870. var aty = a[5];
  76871. var st = Math.sin(rad);
  76872. var ct = Math.cos(rad);
  76873. out[0] = aa * ct + ab * st;
  76874. out[1] = -aa * st + ab * ct;
  76875. out[2] = ac * ct + ad * st;
  76876. out[3] = -ac * st + ct * ad;
  76877. out[4] = ct * atx + st * aty;
  76878. out[5] = ct * aty - st * atx;
  76879. return out;
  76880. }
  76881. /**
  76882. * @function LevelRenderer.Tool.Matrix.prototype.scale
  76883. * @description 缩放变换。
  76884. * @param {(Float32Array|Array.<number>)} out - 单位矩阵。
  76885. * @param {(Float32Array|Array.<number>)} a - 矩阵。
  76886. * @param {(Float32Array|Array.<number>)} v - 缩放参数。
  76887. * @returns {(Float32Array|Array.<number>)} 结果矩阵。
  76888. */
  76889. }, {
  76890. key: "scale",
  76891. value: function scale(out, a, v) {
  76892. var vx = v[0];
  76893. var vy = v[1];
  76894. out[0] = a[0] * vx;
  76895. out[1] = a[1] * vy;
  76896. out[2] = a[2] * vx;
  76897. out[3] = a[3] * vy;
  76898. out[4] = a[4] * vx;
  76899. out[5] = a[5] * vy;
  76900. return out;
  76901. }
  76902. /**
  76903. * @function LevelRenderer.Tool.Matrix.prototype.invert
  76904. * @description 求逆矩阵。
  76905. * @param {(Float32Array|Array.<number>)} out - 单位矩阵。
  76906. * @param {(Float32Array|Array.<number>)} a - 矩阵。
  76907. * @returns {(Float32Array|Array.<number>)} 结果矩阵。
  76908. */
  76909. }, {
  76910. key: "invert",
  76911. value: function invert(out, a) {
  76912. var aa = a[0];
  76913. var ac = a[2];
  76914. var atx = a[4];
  76915. var ab = a[1];
  76916. var ad = a[3];
  76917. var aty = a[5];
  76918. var det = aa * ad - ab * ac;
  76919. if (!det) {
  76920. return null;
  76921. }
  76922. det = 1.0 / det;
  76923. out[0] = ad * det;
  76924. out[1] = -ab * det;
  76925. out[2] = -ac * det;
  76926. out[3] = aa * det;
  76927. out[4] = (ac * aty - ad * atx) * det;
  76928. out[5] = (ab * atx - aa * aty) * det;
  76929. return out;
  76930. }
  76931. /**
  76932. * @function LevelRenderer.Tool.Matrix.prototype.mulVector
  76933. * @description 矩阵左乘向量。
  76934. * @param {(Float32Array|Array.<number>)} out - 单位矩阵。
  76935. * @param {(Float32Array|Array.<number>)} a - 矩阵。
  76936. * @param {(Float32Array|Array.<number>)} v - 缩放参数。
  76937. * @returns {(Float32Array|Array.<number>)} 结果矩阵。
  76938. */
  76939. }, {
  76940. key: "mulVector",
  76941. value: function mulVector(out, a, v) {
  76942. var aa = a[0];
  76943. var ac = a[2];
  76944. var atx = a[4];
  76945. var ab = a[1];
  76946. var ad = a[3];
  76947. var aty = a[5];
  76948. out[0] = v[0] * aa + v[1] * ac + atx;
  76949. out[1] = v[0] * ab + v[1] * ad + aty;
  76950. return out;
  76951. }
  76952. }]);
  76953. return Matrix;
  76954. }();
  76955. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/SUtil.js
  76956. function SUtil_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  76957. function SUtil_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  76958. function SUtil_createClass(Constructor, protoProps, staticProps) { if (protoProps) SUtil_defineProperties(Constructor.prototype, protoProps); if (staticProps) SUtil_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  76959. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  76960. * This program are made available under the terms of the Apache License, Version 2.0
  76961. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  76962. var SUtil_SUtil = /*#__PURE__*/function () {
  76963. function SUtil() {
  76964. SUtil_classCallCheck(this, SUtil);
  76965. }
  76966. SUtil_createClass(SUtil, null, [{
  76967. key: "SUtil_smoothBezier",
  76968. value:
  76969. /**
  76970. * @function LevelRenderer.SUtil.SUtil_smoothBezier
  76971. * @description 贝塞尔平滑曲线。
  76972. * @private
  76973. * @param {Array} points - 线段顶点数组。
  76974. * @param {number} smooth - 平滑等级, 0-1。
  76975. * @param {boolean} isLoop - isLoop。
  76976. * @param {Array} constraint - 将计算出来的控制点约束在一个包围盒内,比如 [[0, 0], [100, 100]], 这个包围盒会与整个折线的包围盒做一个并集用来约束控制点。
  76977. * @param {Array.<number>} [originalPosition=[0, 0]] - 参考原点。
  76978. * @return {Array} 生成的平滑节点数组。
  76979. */
  76980. function SUtil_smoothBezier(points, smooth, isLoop, constraint, originalPosition) {
  76981. if (!originalPosition || originalPosition.length !== 2) {
  76982. originalPosition = [0, 0];
  76983. }
  76984. var __OP = originalPosition;
  76985. var cps = [];
  76986. var v = [];
  76987. var v1 = [];
  76988. var v2 = [];
  76989. var hasConstraint = !!constraint;
  76990. var min, max;
  76991. if (hasConstraint) {
  76992. min = [Infinity, Infinity];
  76993. max = [-Infinity, -Infinity];
  76994. var _len = points.length;
  76995. for (var i = 0; i < _len; i++) {
  76996. SUtil.Util_vector.min(min, min, [points[i][0] + __OP[0], points[i][1] + __OP[1]]);
  76997. SUtil.Util_vector.max(max, max, [points[i][0] + __OP[0], points[i][1] + __OP[1]]);
  76998. }
  76999. // 与指定的包围盒做并集
  77000. SUtil.Util_vector.min(min, min, constraint[0]);
  77001. SUtil.Util_vector.max(max, max, constraint[1]);
  77002. }
  77003. var len = points.length;
  77004. for (var _i2 = 0; _i2 < len; _i2++) {
  77005. var point = [points[_i2][0] + __OP[0], points[_i2][1] + __OP[1]];
  77006. var prevPoint = void 0;
  77007. var nextPoint = void 0;
  77008. if (isLoop) {
  77009. prevPoint = [points[_i2 ? _i2 - 1 : len - 1][0] + __OP[0], points[_i2 ? _i2 - 1 : len - 1][1] + __OP[1]];
  77010. nextPoint = [points[(_i2 + 1) % len][0] + __OP[0], points[(_i2 + 1) % len][1] + __OP[1]];
  77011. } else {
  77012. if (_i2 === 0 || _i2 === len - 1) {
  77013. cps.push([points[_i2][0] + __OP[0], points[_i2][1] + __OP[1]]);
  77014. continue;
  77015. } else {
  77016. prevPoint = [points[_i2 - 1][0] + __OP[0], points[_i2 - 1][1] + __OP[1]];
  77017. nextPoint = [points[_i2 + 1][0] + __OP[0], points[_i2 + 1][1] + __OP[1]];
  77018. }
  77019. }
  77020. SUtil.Util_vector.sub(v, nextPoint, prevPoint);
  77021. // use degree to scale the handle length
  77022. SUtil.Util_vector.scale(v, v, smooth);
  77023. var d0 = SUtil.Util_vector.distance(point, prevPoint);
  77024. var d1 = SUtil.Util_vector.distance(point, nextPoint);
  77025. var sum = d0 + d1;
  77026. if (sum !== 0) {
  77027. d0 /= sum;
  77028. d1 /= sum;
  77029. }
  77030. SUtil.Util_vector.scale(v1, v, -d0);
  77031. SUtil.Util_vector.scale(v2, v, d1);
  77032. var cp0 = SUtil.Util_vector.add([], point, v1);
  77033. var cp1 = SUtil.Util_vector.add([], point, v2);
  77034. if (hasConstraint) {
  77035. SUtil.Util_vector.max(cp0, cp0, min);
  77036. SUtil.Util_vector.min(cp0, cp0, max);
  77037. SUtil.Util_vector.max(cp1, cp1, min);
  77038. SUtil.Util_vector.min(cp1, cp1, max);
  77039. }
  77040. cps.push(cp0);
  77041. cps.push(cp1);
  77042. }
  77043. if (isLoop) {
  77044. cps.push(cps.shift());
  77045. }
  77046. return cps;
  77047. }
  77048. /**
  77049. * @function LevelRenderer.SUtil.SUtil_smoothSpline
  77050. * @description 插值折线。
  77051. * @private
  77052. * @param {Array} points - 线段顶点数组。
  77053. * @param {boolean} isLoop - isLoop。
  77054. * @param {Array} constraint - 将计算出来的控制点约束在一个包围盒内,比如 [[0, 0], [100, 100]], 这个包围盒会与整个折线的包围盒做一个并集用来约束控制点。
  77055. * @param {Array.<number>} originalPosition - 参考原点。默认值:[0, 0]。
  77056. * @return {Array} 生成的平滑节点数组。
  77057. */
  77058. }, {
  77059. key: "SUtil_smoothSpline",
  77060. value: function SUtil_smoothSpline(points, isLoop, constraint, originalPosition) {
  77061. if (!originalPosition || originalPosition.length !== 2) {
  77062. originalPosition = [0, 0];
  77063. }
  77064. var __OP = originalPosition;
  77065. var len = points.length;
  77066. var ret = [];
  77067. var distance = 0;
  77068. for (var i = 1; i < len; i++) {
  77069. distance += SUtil.Util_vector.distance([points[i - 1][0] + __OP[0], points[i - 1][1] + __OP[1]], [points[i][0] + __OP[0], points[i][1] + __OP[1]]);
  77070. }
  77071. var segs = distance / 5;
  77072. segs = segs < len ? len : segs;
  77073. for (var _i4 = 0; _i4 < segs; _i4++) {
  77074. var pos = _i4 / (segs - 1) * (isLoop ? len : len - 1);
  77075. var idx = Math.floor(pos);
  77076. var w = pos - idx;
  77077. var p0 = void 0;
  77078. var p1 = [points[idx % len][0] + __OP[0], points[idx % len][1] + __OP[1]];
  77079. var p2 = void 0;
  77080. var p3 = void 0;
  77081. if (!isLoop) {
  77082. p0 = [points[idx === 0 ? idx : idx - 1][0] + __OP[0], points[idx === 0 ? idx : idx - 1][1] + __OP[1]];
  77083. p2 = [points[idx > len - 2 ? len - 1 : idx + 1][0] + __OP[0], points[idx > len - 2 ? len - 1 : idx + 1][1] + __OP[1]];
  77084. p3 = [points[idx > len - 3 ? len - 1 : idx + 2][0] + __OP[0], points[idx > len - 3 ? len - 1 : idx + 2][1] + __OP[1]];
  77085. } else {
  77086. p0 = [points[(idx - 1 + len) % len][0] + __OP[0], points[(idx - 1 + len) % len][1] + __OP[1]];
  77087. p2 = [points[(idx + 1) % len][0] + __OP[0], points[(idx + 1) % len][1] + __OP[1]];
  77088. p3 = [points[(idx + 2) % len][0] + __OP[0], points[(idx + 2) % len][1] + __OP[1]];
  77089. }
  77090. var w2 = w * w;
  77091. var w3 = w * w2;
  77092. ret.push([interpolate(p0[0], p1[0], p2[0], p3[0], w, w2, w3), interpolate(p0[1], p1[1], p2[1], p3[1], w, w2, w3)]);
  77093. }
  77094. return ret;
  77095. // inner Function
  77096. function interpolate(p0, p1, p2, p3, t, t2, t3) {
  77097. var v0 = (p2 - p0) * 0.5;
  77098. var v1 = (p3 - p1) * 0.5;
  77099. return (2 * (p1 - p2) + v0 + v1) * t3 + (-3 * (p1 - p2) - 2 * v0 - v1) * t2 + v0 * t + p1;
  77100. }
  77101. }
  77102. /**
  77103. * @function LevelRenderer.SUtil.SUtil_dashedLineTo
  77104. * @description 虚线 lineTo。
  77105. */
  77106. }, {
  77107. key: "SUtil_dashedLineTo",
  77108. value: function SUtil_dashedLineTo(ctx, x1, y1, x2, y2, dashLength, customDashPattern) {
  77109. // http://msdn.microsoft.com/en-us/library/ie/dn265063(v=vs.85).aspx
  77110. var dashPattern = [5, 5];
  77111. dashLength = typeof dashLength != 'number' ? 5 : dashLength;
  77112. if (ctx.setLineDash) {
  77113. dashPattern[0] = dashLength;
  77114. dashPattern[1] = dashLength;
  77115. if (customDashPattern && customDashPattern instanceof Array) {
  77116. ctx.setLineDash(customDashPattern);
  77117. } else {
  77118. ctx.setLineDash(dashPattern);
  77119. }
  77120. // ctx.setLineDash(dashPattern);
  77121. ctx.moveTo(x1, y1);
  77122. ctx.lineTo(x2, y2);
  77123. return;
  77124. }
  77125. var dx = x2 - x1;
  77126. var dy = y2 - y1;
  77127. var numDashes = Math.floor(Math.sqrt(dx * dx + dy * dy) / dashLength);
  77128. dx = dx / numDashes;
  77129. dy = dy / numDashes;
  77130. var flag = true;
  77131. for (var i = 0; i < numDashes; ++i) {
  77132. if (flag) {
  77133. ctx.moveTo(x1, y1);
  77134. } else {
  77135. ctx.lineTo(x1, y1);
  77136. }
  77137. flag = !flag;
  77138. x1 += dx;
  77139. y1 += dy;
  77140. }
  77141. ctx.lineTo(x2, y2);
  77142. }
  77143. }]);
  77144. return SUtil;
  77145. }();
  77146. // 把所有工具对象放到全局静态变量上,以便直接调用工具方法,
  77147. // 避免使用工具时频繁的创建工具对象带来的性能消耗。
  77148. SUtil_SUtil.Util_area = new Area();
  77149. SUtil_SUtil.Util_color = new Color_Color();
  77150. SUtil_SUtil.Util_computeBoundingBox = new ComputeBoundingBox();
  77151. SUtil_SUtil.Util_curve = new Curve_Curve();
  77152. SUtil_SUtil.Util_env = new Env();
  77153. SUtil_SUtil.Util_event = new Event_Event();
  77154. SUtil_SUtil.Util_http = new Http();
  77155. SUtil_SUtil.Util_log = new Log();
  77156. SUtil_SUtil.Util_math = new MathTool();
  77157. SUtil_SUtil.Util_matrix = new Matrix();
  77158. SUtil_SUtil.Util = new levelRenderer_Util_Util();
  77159. SUtil_SUtil.Util_vector = new levelRenderer_Vector_Vector();
  77160. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Transformable.js
  77161. function Transformable_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  77162. function Transformable_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  77163. function Transformable_createClass(Constructor, protoProps, staticProps) { if (protoProps) Transformable_defineProperties(Constructor.prototype, protoProps); if (staticProps) Transformable_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  77164. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  77165. * This program are made available under the terms of the Apache License, Version 2.0
  77166. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  77167. /**
  77168. * @private
  77169. * @class LevelRenderer.Transformable
  77170. * @category Visualization Theme
  77171. * @classdesc 可变换超类,所有支持 Canvas Transform 变换操作的类均是此类的子类。此类不可实例化。
  77172. */
  77173. var Transformable = /*#__PURE__*/function () {
  77174. function Transformable() {
  77175. Transformable_classCallCheck(this, Transformable);
  77176. /**
  77177. * @member {Array.<number>} LevelRenderer.Transformable.prototype.position
  77178. * @description 平移,默认值:[0, 0]。
  77179. */
  77180. this.position = [0, 0];
  77181. /**
  77182. * @member {Array.<number>} LevelRenderer.Transformable.prototype.rotation
  77183. * @description 旋转,可以通过数组二三项指定旋转的原点,默认值:[0, 0, 0]。
  77184. */
  77185. this.rotation = [0, 0, 0];
  77186. /**
  77187. * @member {Array.<number>} LevelRenderer.Transformable.prototype.scale
  77188. * @description 缩放,可以通过数组三四项指定缩放的原点,默认值:[1, 1, 0, 0]。
  77189. */
  77190. this.scale = [1, 1, 0, 0];
  77191. /**
  77192. * @member {boolean} LevelRenderer.Transformable.prototype.needLocalTransform
  77193. * @description 是否变换。默认值:false。
  77194. */
  77195. this.needLocalTransform = false;
  77196. /**
  77197. * @member {boolean} LevelRenderer.Transformable.prototype.needTransform
  77198. * @description 是否有坐标变换。默认值:false。
  77199. */
  77200. this.needTransform = false;
  77201. this.CLASS_NAME = "SuperMap.LevelRenderer.Transformable";
  77202. /**
  77203. * @function LevelRenderer.Transformable.prototype.lookAt
  77204. * @description 设置图形的朝向。
  77205. */
  77206. this.lookAt = function () {
  77207. var v = SUtil_SUtil.Util_vector.create();
  77208. // {Array.<Number>|Float32Array} target
  77209. return function (target) {
  77210. if (!this.transform) {
  77211. this.transform = SUtil_SUtil.Util_matrix.create();
  77212. }
  77213. var m = this.transform;
  77214. SUtil_SUtil.Util_vector.sub(v, target, this.position);
  77215. if (isAroundZero(v[0]) && isAroundZero(v[1])) {
  77216. return;
  77217. }
  77218. SUtil_SUtil.Util_vector.normalize(v, v);
  77219. // Y Axis
  77220. // TODO Scale origin ?
  77221. m[2] = v[0] * this.scale[1];
  77222. m[3] = v[1] * this.scale[1];
  77223. // X Axis
  77224. m[0] = v[1] * this.scale[0];
  77225. m[1] = -v[0] * this.scale[0];
  77226. // Position
  77227. m[4] = this.position[0];
  77228. m[5] = this.position[1];
  77229. this.decomposeTransform();
  77230. function isAroundZero(val) {
  77231. var EPSILON = 5e-5;
  77232. return val > -EPSILON && val < EPSILON;
  77233. }
  77234. };
  77235. }();
  77236. }
  77237. /**
  77238. * @function LevelRenderer.Transformable.prototype.destroy
  77239. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  77240. */
  77241. Transformable_createClass(Transformable, [{
  77242. key: "destroy",
  77243. value: function destroy() {
  77244. this.position = null;
  77245. this.rotation = null;
  77246. this.scale = null;
  77247. this.needLocalTransform = null;
  77248. this.needTransform = null;
  77249. }
  77250. /**
  77251. * @function LevelRenderer.Transformable.prototype.updateNeedTransform
  77252. * @description 更新 needLocalTransform
  77253. */
  77254. }, {
  77255. key: "updateNeedTransform",
  77256. value: function updateNeedTransform() {
  77257. this.needLocalTransform = isNotAroundZero(this.rotation[0]) || isNotAroundZero(this.position[0]) || isNotAroundZero(this.position[1]) || isNotAroundZero(this.scale[0] - 1) || isNotAroundZero(this.scale[1] - 1);
  77258. function isNotAroundZero(val) {
  77259. var EPSILON = 5e-5;
  77260. return val > EPSILON || val < -EPSILON;
  77261. }
  77262. }
  77263. /**
  77264. * @function LevelRenderer.Transformable.prototype.updateTransform
  77265. * @description 判断是否需要有坐标变换,更新 needTransform 属性。如果有坐标变换,则从 position, rotation, scale 以及父节点的 transform 计算出自身的 transform 矩阵。
  77266. */
  77267. }, {
  77268. key: "updateTransform",
  77269. value: function updateTransform() {
  77270. this.updateNeedTransform();
  77271. if (this.parent) {
  77272. this.needTransform = this.needLocalTransform || this.parent.needTransform;
  77273. } else {
  77274. this.needTransform = this.needLocalTransform;
  77275. }
  77276. if (!this.needTransform) {
  77277. return;
  77278. }
  77279. var origin = [0, 0];
  77280. var m = this.transform || SUtil_SUtil.Util_matrix.create();
  77281. SUtil_SUtil.Util_matrix.identity(m);
  77282. if (this.needLocalTransform) {
  77283. if (isNotAroundZero(this.scale[0]) || isNotAroundZero(this.scale[1])) {
  77284. origin[0] = -this.scale[2] || 0;
  77285. origin[1] = -this.scale[3] || 0;
  77286. var haveOrigin = isNotAroundZero(origin[0]) || isNotAroundZero(origin[1]);
  77287. if (haveOrigin) {
  77288. SUtil_SUtil.Util_matrix.translate(m, m, origin);
  77289. }
  77290. SUtil_SUtil.Util_matrix.scale(m, m, this.scale);
  77291. if (haveOrigin) {
  77292. origin[0] = -origin[0];
  77293. origin[1] = -origin[1];
  77294. SUtil_SUtil.Util_matrix.translate(m, m, origin);
  77295. }
  77296. }
  77297. if (this.rotation instanceof Array) {
  77298. if (this.rotation[0] !== 0) {
  77299. origin[0] = -this.rotation[1] || 0;
  77300. origin[1] = -this.rotation[2] || 0;
  77301. var _haveOrigin = isNotAroundZero(origin[0]) || isNotAroundZero(origin[1]);
  77302. if (_haveOrigin) {
  77303. SUtil_SUtil.Util_matrix.translate(m, m, origin);
  77304. }
  77305. SUtil_SUtil.Util_matrix.rotate(m, m, this.rotation[0]);
  77306. if (_haveOrigin) {
  77307. origin[0] = -origin[0];
  77308. origin[1] = -origin[1];
  77309. SUtil_SUtil.Util_matrix.translate(m, m, origin);
  77310. }
  77311. }
  77312. } else {
  77313. if (+this.rotation !== 0) {
  77314. SUtil_SUtil.Util_matrix.rotate(m, m, this.rotation);
  77315. }
  77316. }
  77317. if (isNotAroundZero(this.position[0]) || isNotAroundZero(this.position[1])) {
  77318. SUtil_SUtil.Util_matrix.translate(m, m, this.position);
  77319. }
  77320. }
  77321. // 保存这个变换矩阵
  77322. this.transform = m;
  77323. // 应用父节点变换
  77324. if (this.parent && this.parent.needTransform) {
  77325. if (this.needLocalTransform) {
  77326. SUtil_SUtil.Util_matrix.mul(this.transform, this.parent.transform, this.transform);
  77327. } else {
  77328. SUtil_SUtil.Util_matrix.copy(this.transform, this.parent.transform);
  77329. }
  77330. }
  77331. function isNotAroundZero(val) {
  77332. var EPSILON = 5e-5;
  77333. return val > EPSILON || val < -EPSILON;
  77334. }
  77335. }
  77336. /**
  77337. * @function LevelRenderer.Transformable.prototype.setTransform
  77338. * @description 将自己的 transform 应用到 context 上。
  77339. *
  77340. * @param {Context2D} ctx - Context2D 上下文。
  77341. */
  77342. }, {
  77343. key: "setTransform",
  77344. value: function setTransform(ctx) {
  77345. if (this.needTransform) {
  77346. var m = this.transform;
  77347. ctx.transform(m[0], m[1], m[2], m[3], m[4], m[5]);
  77348. }
  77349. }
  77350. /**
  77351. * @function LevelRenderer.Transformable.prototype.decomposeTransform
  77352. * @description 分解`transform`矩阵到`position`, `rotation`, `scale` 。
  77353. */
  77354. }, {
  77355. key: "decomposeTransform",
  77356. value: function decomposeTransform() {
  77357. if (!this.transform) {
  77358. return;
  77359. }
  77360. var m = this.transform;
  77361. var sx = m[0] * m[0] + m[1] * m[1];
  77362. var position = this.position;
  77363. var scale = this.scale;
  77364. var rotation = this.rotation;
  77365. if (isNotAroundZero(sx - 1)) {
  77366. sx = Math.sqrt(sx);
  77367. }
  77368. var sy = m[2] * m[2] + m[3] * m[3];
  77369. if (isNotAroundZero(sy - 1)) {
  77370. sy = Math.sqrt(sy);
  77371. }
  77372. position[0] = m[4];
  77373. position[1] = m[5];
  77374. scale[0] = sx;
  77375. scale[1] = sy;
  77376. scale[2] = scale[3] = 0;
  77377. rotation[0] = Math.atan2(-m[1] / sy, m[0] / sx);
  77378. rotation[1] = rotation[2] = 0;
  77379. function isNotAroundZero(val) {
  77380. var EPSILON = 5e-5;
  77381. return val > EPSILON || val < -EPSILON;
  77382. }
  77383. }
  77384. }]);
  77385. return Transformable;
  77386. }();
  77387. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Shape.js
  77388. function Shape_typeof(obj) { "@babel/helpers - typeof"; return Shape_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, Shape_typeof(obj); }
  77389. function Shape_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  77390. function Shape_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  77391. function Shape_createClass(Constructor, protoProps, staticProps) { if (protoProps) Shape_defineProperties(Constructor.prototype, protoProps); if (staticProps) Shape_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  77392. function Shape_get() { if (typeof Reflect !== "undefined" && Reflect.get) { Shape_get = Reflect.get.bind(); } else { Shape_get = function _get(target, property, receiver) { var base = Shape_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return Shape_get.apply(this, arguments); }
  77393. function Shape_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Shape_getPrototypeOf(object); if (object === null) break; } return object; }
  77394. function Shape_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) Shape_setPrototypeOf(subClass, superClass); }
  77395. function Shape_setPrototypeOf(o, p) { Shape_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Shape_setPrototypeOf(o, p); }
  77396. function Shape_createSuper(Derived) { var hasNativeReflectConstruct = Shape_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Shape_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Shape_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Shape_possibleConstructorReturn(this, result); }; }
  77397. function Shape_possibleConstructorReturn(self, call) { if (call && (Shape_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return Shape_assertThisInitialized(self); }
  77398. function Shape_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  77399. function Shape_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  77400. function Shape_getPrototypeOf(o) { Shape_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Shape_getPrototypeOf(o); }
  77401. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  77402. * This program are made available under the terms of the Apache License, Version 2.0
  77403. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  77404. /**
  77405. * @private
  77406. * @class LevelRenderer.Shape
  77407. * @category Visualization Theme
  77408. * @classdesc 图形(shape)基类。
  77409. * @extends LevelRenderer.Eventful
  77410. * @extends LevelRenderer.Transformable
  77411. * @param {Array} options - shape 的配置(options)项,可以是 shape 的自有属性,也可以是自定义的属性。
  77412. */
  77413. var Shape_Shape = /*#__PURE__*/function (_mixin) {
  77414. Shape_inherits(Shape, _mixin);
  77415. var _super = Shape_createSuper(Shape);
  77416. function Shape(options) {
  77417. var _this;
  77418. Shape_classCallCheck(this, Shape);
  77419. _this = _super.call(this, options);
  77420. options = options || {};
  77421. /**
  77422. * @member {string} LevelRenderer.Shape.prototype.id
  77423. * @description 唯一标识。
  77424. */
  77425. _this.id = null;
  77426. /**
  77427. * @member {Object} LevelRenderer.Shape.prototype.style
  77428. * @description 基础绘制样式。
  77429. * @param {string} style.brushType - 画笔类型。可设值:"fill", "stroke", "both"。默认值:"fill"。
  77430. * @param {string} style.color - 填充颜色。默认值:"#000000'"。
  77431. * @param {string} style.strokeColor - 描边颜色。默认值:"#000000'"。
  77432. * @param {string} style.lineCape - 线帽样式。可设值:"butt", "round", "square"。默认值:"butt"。
  77433. * @param {number} style.lineWidth - 描边宽度。默认值:1。
  77434. * @param {number} style.opacity - 绘制透明度。默认值:1。
  77435. * @param {number} style.shadowBlur - 阴影模糊度,大于0有效。默认值:0。
  77436. * @param {number} style.shadowColor - 阴影颜色。默认值:"#000000'"。
  77437. * @param {number} style.shadowOffsetX - 阴影横向偏移。默认值:0。
  77438. * @param {number} style.shadowOffsetY - 阴影纵向偏移。默认值:0。
  77439. * @param {string} style.text - 图形中的附加文本。默认值:""。
  77440. * @param {string} style.textColor - 文本颜色。默认值:"#000000'"。
  77441. * @param {string} style.textFont - 附加文本样式。示例:'bold 18px verdana'。
  77442. * @param {string} style.textPosition - 附加文本位置。可设值:"inside", "left", "right", top", "bottom", "end"。默认值:"end"。
  77443. * @param {string} style.textAlign - 附加文本水平对齐。可设值:"start", "end", "left", "right", "center"。默认根据 textPosition 自动设置。
  77444. * @param {string} style.textBaseline - 附加文本垂直对齐。可设值:"top", "bottom", "middle", "alphabetic", "hanging", "ideographic"。默认根据 textPosition 自动设置。
  77445. *
  77446. */
  77447. _this.style = {};
  77448. /**
  77449. * @member {Object} LevelRenderer.Shape.prototype.style.__rect
  77450. * @description 包围图形的最小矩形盒子。
  77451. *
  77452. * @param {number} x - 左上角顶点x轴坐标。
  77453. * @param {number} y - 左上角顶点y轴坐标。
  77454. * @param {number} width - 包围盒矩形宽度。
  77455. * @param {number} height - 包围盒矩形高度。
  77456. */
  77457. /**
  77458. * @member {Object} LevelRenderer.Shape.prototype.highlightStyle
  77459. * @description 高亮样式。
  77460. *
  77461. * @param {string} highlightStyle.brushType - 画笔类型。可设值:"fill", "stroke", "both"。默认值:"fill"。
  77462. * @param {string} highlightStyle.color - 填充颜色。默认值:"#000000'"。
  77463. * @param {string} highlightStyle.strokeColor - 描边颜色。默认值:"#000000'"。
  77464. * @param {string} highlightStyle.lineCape - 线帽样式。可设值:"butt", "round", "square"。默认值:"butt"。
  77465. * @param {number} highlightStyle.lineWidth - 描边宽度。默认值:1。
  77466. * @param {number} highlightStyle.opacity - 绘制透明度。默认值:1。
  77467. * @param {number} highlightStyle.shadowBlur - 阴影模糊度,大于0有效。默认值:0。
  77468. * @param {number} highlightStyle.shadowColor - 阴影颜色。默认值:"#000000'"。
  77469. * @param {number} highlightStyle.shadowOffsetX - 阴影横向偏移。默认值:0。
  77470. * @param {number} highlightStyle.shadowOffsetY - 阴影纵向偏移。默认值:0。
  77471. * @param {string} highlightStyle.text - 图形中的附加文本。默认值:""。
  77472. * @param {string} highlightStyle.textColor - 文本颜色。默认值:"#000000'"。
  77473. * @param {string} highlightStyle.textFont - 附加文本样式。示例:'bold 18px verdana'。
  77474. * @param {string} highlightStyle.textPosition - 附加文本位置。可设值:"inside", "left", "right", top", "bottom", "end"。默认值:"end"。
  77475. * @param {string} highlightStyle.textAlign - 附加文本水平对齐。可设值:"start", "end", "left", "right", "center"。默认根据 textPosition 自动设置。
  77476. * @param {string} highlightStyle.textBaseline - 附加文本垂直对齐。可设值:"top", "bottom", "middle", "alphabetic", "hanging", "ideographic"。默认根据 textPosition 自动设置。
  77477. */
  77478. _this.highlightStyle = null;
  77479. /**
  77480. * @member {Object} LevelRenderer.Shape.prototype.parent
  77481. * @description 父节点,只读属性。<LevelRenderer.Group>
  77482. */
  77483. _this.parent = null;
  77484. /**
  77485. * @member {boolean} LevelRenderer.Shape.prototype.__dirty
  77486. * @description {boolean}
  77487. */
  77488. _this.__dirty = true;
  77489. /**
  77490. * @member {Array} LevelRenderer.Shape.prototype.__clipShapes
  77491. * @description {Array}
  77492. *
  77493. */
  77494. _this.__clipShapes = [];
  77495. /**
  77496. * @member {boolean} LevelRenderer.Shape.prototype.invisible
  77497. * @description 图形是否可见,为 true 时不绘制图形,但是仍能触发鼠标事件。默认值:false。
  77498. */
  77499. _this.invisible = false;
  77500. /**
  77501. * @member {boolean} LevelRenderer.Shape.prototype.ignore
  77502. * @description 图形是否忽略,为 true 时忽略图形的绘制以及事件触发。默认值:false。
  77503. */
  77504. _this.ignore = false;
  77505. /**
  77506. * @member {boolean} LevelRenderer.Shape.prototype.zlevel
  77507. * @description z 层 level,决定绘画在哪层 canvas 中。默认值:0。
  77508. */
  77509. _this.zlevel = 0;
  77510. /**
  77511. * @member {boolean} LevelRenderer.Shape.prototype.draggable
  77512. * @description 是否可拖拽。默认值:false。
  77513. */
  77514. _this.draggable = false;
  77515. /**
  77516. * @member {boolean} LevelRenderer.Shape.prototype.clickable
  77517. * @description 是否可点击。默认值:false。
  77518. */
  77519. _this.clickable = false;
  77520. /**
  77521. * @member {boolean} LevelRenderer.Shape.prototype.hoverable
  77522. * @description 是否可以 hover。默认值:true。
  77523. */
  77524. _this.hoverable = true;
  77525. /**
  77526. * @member {number} LevelRenderer.Shape.prototype.z
  77527. * @description z值,跟zlevel一样影响shape绘制的前后顺序,z值大的shape会覆盖在z值小的上面,但是并不会创建新的canvas,所以优先级低于zlevel,而且频繁改动的开销比zlevel小很多。默认值:0。
  77528. */
  77529. _this.z = 0;
  77530. //地理扩展
  77531. /**
  77532. * @member {Array.<number>} LevelRenderer.Shape.prototype.refOriginalPosition
  77533. * @description 图形参考原点位置,图形的参考中心位置。
  77534. * refOriginalPosition 是长度为 2 的数组,第一个元素表示 x 坐标,第二个元素表示 y 坐标。
  77535. *
  77536. * refOriginalPosition 表示图形的参考中心,通常情况下,图形是使用 canvas 的原点位置作为位置参考,
  77537. * 但 refOriginalPosition 可以改变图形的参考位置,例如: refOriginalPosition = [80, 80],
  77538. * 图形圆的 style.x = 20, style.y = 20,那么圆在 canvas 中的实际位置是 [100, 100]。
  77539. *
  77540. * 图形(Shape) 的所有位置相关属性都是以 refOriginalPosition 为参考中心,
  77541. * 也就是说图形的所有位置信息在 canvas 中都是以 refOriginalPosition 为参考的相对位置,只有
  77542. * refOriginalPosition 的值为 [0, 0] 时,形的位置信息才是 canvas 绝对位置。
  77543. *
  77544. * 图形的位置信息通常有:style.pointList,style.x,style.y。
  77545. *
  77546. * refOriginalPosition。默认值是: [0, 0]。
  77547. */
  77548. _this.refOriginalPosition = [0, 0];
  77549. /**
  77550. * @member {string} LevelRenderer.Shape.prototype.refDataID
  77551. * @description 图形所关联数据的 ID。
  77552. *
  77553. */
  77554. _this.refDataID = null;
  77555. /**
  77556. * @member {boolean} LevelRenderer.Shape.prototype.isHoverByRefDataID
  77557. * @description 是否根据 refDataID 进行高亮。用于同时高亮所有 refDataID 相同的图形。
  77558. *
  77559. */
  77560. _this.isHoverByRefDataID = false;
  77561. /**
  77562. * @member {string} LevelRenderer.Shape.prototype.refDataHoverGroup
  77563. * @description 高亮图形组的组名。此属性在 refDataID 有效且 isHoverByRefDataID 为 true 时生效。
  77564. * 一旦设置此属性,且属性值有效,只有关联同一个数据的图形且此属性相同的图形才会高亮。
  77565. *
  77566. */
  77567. _this.refDataHoverGroup = null;
  77568. /**
  77569. * @member {Object} LevelRenderer.Shape.prototype.dataInfo
  77570. * @description 图形的数据信息。
  77571. *
  77572. */
  77573. _this.dataInfo = null;
  77574. Util_Util.extend(Shape_assertThisInitialized(_this), options);
  77575. _this.id = _this.id || Util_Util.createUniqueID("smShape_");
  77576. _this.CLASS_NAME = "SuperMap.LevelRenderer.Shape";
  77577. /**
  77578. * @function LevelRenderer.Shape.prototype.getTansform
  77579. * @description 变换鼠标位置到 shape 的局部坐标空间
  77580. *
  77581. */
  77582. _this.getTansform = function () {
  77583. var invTransform = [];
  77584. return function (x, y) {
  77585. var originPos = [x, y];
  77586. // 对鼠标的坐标也做相同的变换
  77587. if (this.needTransform && this.transform) {
  77588. SUtil_SUtil.Util_matrix.invert(invTransform, this.transform);
  77589. SUtil_SUtil.Util_matrix.mulVector(originPos, invTransform, [x, y, 1]);
  77590. if (x == originPos[0] && y == originPos[1]) {
  77591. // 避免外部修改导致的 needTransform 不准确
  77592. this.updateNeedTransform();
  77593. }
  77594. }
  77595. return originPos;
  77596. };
  77597. }();
  77598. return _this;
  77599. }
  77600. /**
  77601. * @function LevelRenderer.Shape.prototype.destroy
  77602. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  77603. */
  77604. Shape_createClass(Shape, [{
  77605. key: "destroy",
  77606. value: function destroy() {
  77607. this.id = null;
  77608. this.style = null;
  77609. this.highlightStyle = null;
  77610. this.parent = null;
  77611. this.__dirty = null;
  77612. this.__clipShapes = null;
  77613. this.invisible = null;
  77614. this.ignore = null;
  77615. this.zlevel = null;
  77616. this.draggable = null;
  77617. this.clickable = null;
  77618. this.hoverable = null;
  77619. this.z = null;
  77620. this.refOriginalPosition = null;
  77621. this.refDataID = null;
  77622. this.refDataHoverGroup = null;
  77623. this.isHoverByRefDataID = null;
  77624. this.dataInfo = null;
  77625. Shape_get(Shape_getPrototypeOf(Shape.prototype), "destroy", this).call(this);
  77626. }
  77627. /**
  77628. * @function LevelRenderer.Shape.prototype.brush
  77629. * @description 绘制图形。
  77630. *
  77631. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  77632. * @param {boolean} isHighlight - 是否使用高亮属性。
  77633. * @param {function} updateCallback - 需要异步加载资源的 shape 可以通过这个 callback(e),让painter更新视图,base.brush 没用,需要的话重载 brush。
  77634. */
  77635. }, {
  77636. key: "brush",
  77637. value: function brush(ctx, isHighlight) {
  77638. var style = this.beforeBrush(ctx, isHighlight);
  77639. ctx.beginPath();
  77640. this.buildPath(ctx, style);
  77641. switch (style.brushType) {
  77642. /* jshint ignore:start */
  77643. case 'both':
  77644. this.setCtxGlobalAlpha(ctx, "fill", style);
  77645. ctx.fill();
  77646. if (style.lineWidth > 0) {
  77647. this.setCtxGlobalAlpha(ctx, "stroke", style);
  77648. ctx.stroke();
  77649. }
  77650. this.setCtxGlobalAlpha(ctx, "reset", style);
  77651. break;
  77652. case 'stroke':
  77653. this.setCtxGlobalAlpha(ctx, "stroke", style);
  77654. style.lineWidth > 0 && ctx.stroke();
  77655. this.setCtxGlobalAlpha(ctx, "reset", style);
  77656. break;
  77657. /* jshint ignore:end */
  77658. default:
  77659. this.setCtxGlobalAlpha(ctx, "fill", style);
  77660. ctx.fill();
  77661. this.setCtxGlobalAlpha(ctx, "reset", style);
  77662. break;
  77663. }
  77664. this.drawText(ctx, style, this.style);
  77665. this.afterBrush(ctx);
  77666. }
  77667. /**
  77668. * @function LevelRenderer.Shape.prototype.beforeBrush
  77669. * @description 具体绘制操作前的一些公共操作。
  77670. *
  77671. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  77672. * @param {boolean} isHighlight - 是否使用高亮属性。
  77673. * @return {Object} 处理后的样式。
  77674. */
  77675. }, {
  77676. key: "beforeBrush",
  77677. value: function beforeBrush(ctx, isHighlight) {
  77678. var style = this.style;
  77679. if (this.brushTypeOnly) {
  77680. style.brushType = this.brushTypeOnly;
  77681. }
  77682. if (isHighlight) {
  77683. // 根据style扩展默认高亮样式
  77684. style = this.getHighlightStyle(style, this.highlightStyle || {}, this.brushTypeOnly);
  77685. }
  77686. if (this.brushTypeOnly == 'stroke') {
  77687. style.strokeColor = style.strokeColor || style.color;
  77688. }
  77689. ctx.save();
  77690. this.doClip(ctx);
  77691. this.setContext(ctx, style);
  77692. // 设置transform
  77693. this.setTransform(ctx);
  77694. return style;
  77695. }
  77696. /**
  77697. * @function LevelRenderer.Shape.prototype.afterBrush
  77698. * @description 绘制后的处理。
  77699. *
  77700. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  77701. *
  77702. */
  77703. }, {
  77704. key: "afterBrush",
  77705. value: function afterBrush(ctx) {
  77706. ctx.restore();
  77707. }
  77708. /**
  77709. * @function LevelRenderer.Shape.prototype.setContext
  77710. * @description 设置 fillStyle, strokeStyle, shadow 等通用绘制样式。
  77711. *
  77712. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  77713. * @param {Object} style - 样式。
  77714. *
  77715. */
  77716. }, {
  77717. key: "setContext",
  77718. value: function setContext(ctx, style) {
  77719. var STYLE_CTX_MAP = [['color', 'fillStyle'], ['strokeColor', 'strokeStyle'], ['opacity', 'globalAlpha'], ['lineCap', 'lineCap'], ['lineJoin', 'lineJoin'], ['miterLimit', 'miterLimit'], ['lineWidth', 'lineWidth'], ['shadowBlur', 'shadowBlur'], ['shadowColor', 'shadowColor'], ['shadowOffsetX', 'shadowOffsetX'], ['shadowOffsetY', 'shadowOffsetY']];
  77720. for (var i = 0, len = STYLE_CTX_MAP.length; i < len; i++) {
  77721. var styleProp = STYLE_CTX_MAP[i][0];
  77722. var styleValue = style[styleProp];
  77723. var ctxProp = STYLE_CTX_MAP[i][1];
  77724. if (typeof styleValue != 'undefined') {
  77725. ctx[ctxProp] = styleValue;
  77726. }
  77727. }
  77728. }
  77729. /**
  77730. * @function LevelRenderer.Shape.prototype.doClip
  77731. *
  77732. */
  77733. }, {
  77734. key: "doClip",
  77735. value: function doClip(ctx) {
  77736. var clipShapeInvTransform = SUtil_SUtil.Util_matrix.create();
  77737. if (this.__clipShapes) {
  77738. for (var i = 0; i < this.__clipShapes.length; i++) {
  77739. var clipShape = this.__clipShapes[i];
  77740. if (clipShape.needTransform) {
  77741. var m = clipShape.transform;
  77742. SUtil_SUtil.Util_matrix.invert(clipShapeInvTransform, m);
  77743. ctx.transform(m[0], m[1], m[2], m[3], m[4], m[5]);
  77744. }
  77745. ctx.beginPath();
  77746. clipShape.buildPath(ctx, clipShape.style);
  77747. ctx.clip();
  77748. // Transform back
  77749. if (clipShape.needTransform) {
  77750. var _m = clipShapeInvTransform;
  77751. ctx.transform(_m[0], _m[1], _m[2], _m[3], _m[4], _m[5]);
  77752. }
  77753. }
  77754. }
  77755. }
  77756. /**
  77757. * @function LevelRenderer.Shape.prototype.getHighlightStyle
  77758. * @description 根据默认样式扩展高亮样式
  77759. *
  77760. * @param {Object} style - 样式。
  77761. * @param {Object} highlightStyle - 高亮样式。
  77762. * @param {string} brushTypeOnly - brushTypeOnly。
  77763. *
  77764. */
  77765. }, {
  77766. key: "getHighlightStyle",
  77767. value: function getHighlightStyle(style, highlightStyle, brushTypeOnly) {
  77768. var newStyle = {};
  77769. for (var k in style) {
  77770. newStyle[k] = style[k];
  77771. }
  77772. var highlightColor = SUtil_SUtil.Util_color.getHighlightColor();
  77773. // 根据highlightStyle扩展
  77774. if (style.brushType != 'stroke') {
  77775. // 带填充则用高亮色加粗边线
  77776. newStyle.strokeColor = highlightColor;
  77777. // SMIC-方法修改 - start
  77778. newStyle.lineWidth = style.lineWidth || 1;
  77779. // 原始代码
  77780. // newStyle.lineWidth = (style.lineWidth || 1)
  77781. // + this.getHighlightZoom();
  77782. // 修改代码1
  77783. // if(!style.lineType || style.lineType === "solid"){
  77784. // newStyle.lineWidth = (style.lineWidth || 1)
  77785. // + this.getHighlightZoom();
  77786. // }
  77787. // else{
  77788. // newStyle.lineWidth = (style.lineWidth || 1);
  77789. // }
  77790. // SMIC-方法修改 - end
  77791. newStyle.brushType = 'both';
  77792. } else {
  77793. if (brushTypeOnly != 'stroke') {
  77794. // 描边型的则用原色加工高亮
  77795. newStyle.strokeColor = highlightColor;
  77796. // SMIC-方法修改 - start
  77797. newStyle.lineWidth = style.lineWidth || 1;
  77798. // 原始代码
  77799. // newStyle.lineWidth = (style.lineWidth || 1)
  77800. // + this.getHighlightZoom();
  77801. // 修改代码1
  77802. // if(!style.lineType || style.lineType === "solid"){
  77803. // newStyle.lineWidth = (style.lineWidth || 1)
  77804. // + this.getHighlightZoom();
  77805. // }
  77806. // else{
  77807. // newStyle.lineWidth = (style.lineWidth || 1);
  77808. // }
  77809. // SMIC-方法修改 - end
  77810. } else {
  77811. // 线型的则用原色加工高亮
  77812. newStyle.strokeColor = highlightStyle.strokeColor || SUtil_SUtil.Util_color.mix(style.strokeColor, SUtil_SUtil.Util_color.toRGB(highlightColor));
  77813. }
  77814. }
  77815. // 可自定义覆盖默认值
  77816. for (var _k2 in highlightStyle) {
  77817. if (typeof highlightStyle[_k2] != 'undefined') {
  77818. newStyle[_k2] = highlightStyle[_k2];
  77819. }
  77820. }
  77821. return newStyle;
  77822. }
  77823. /**
  77824. * @function LevelRenderer.Shape.prototype.getHighlightZoom
  77825. * @description 高亮放大效果参数,当前统一设置为6,如有需要差异设置,通过 this.type 判断实例类型
  77826. *
  77827. */
  77828. }, {
  77829. key: "getHighlightZoom",
  77830. value: function getHighlightZoom() {
  77831. return this.type != 'text' ? 6 : 2;
  77832. }
  77833. /**
  77834. * @function LevelRenderer.Shape.prototype.drift
  77835. * @description 移动位置
  77836. *
  77837. * @param {Object} dx - 横坐标变化。
  77838. * @param {Object} dy - 纵坐标变化。
  77839. *
  77840. */
  77841. }, {
  77842. key: "drift",
  77843. value: function drift(dx, dy) {
  77844. this.position[0] += dx;
  77845. this.position[1] += dy;
  77846. }
  77847. /**
  77848. * @function LevelRenderer.Shape.prototype.buildPath
  77849. * @description 构建绘制的Path。子类必须重新实现此方法。
  77850. *
  77851. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  77852. * @param {Object} style - 样式。
  77853. */
  77854. }, {
  77855. key: "buildPath",
  77856. value: function buildPath(ctx, style) {
  77857. // eslint-disable-line no-unused-vars
  77858. SUtil_SUtil.Util_log('buildPath not implemented in ' + this.type);
  77859. }
  77860. /**
  77861. * @function LevelRenderer.Shape.prototype.getRect
  77862. * @description 计算返回包围盒矩形。子类必须重新实现此方法。
  77863. *
  77864. * @param {Object} style - 样式。
  77865. */
  77866. }, {
  77867. key: "getRect",
  77868. value: function getRect(style) {
  77869. // eslint-disable-line no-unused-vars
  77870. SUtil_SUtil.Util_log('getRect not implemented in ' + this.type);
  77871. }
  77872. /**
  77873. * @function LevelRenderer.Shape.prototype.isCover
  77874. * @description 判断鼠标位置是否在图形内。
  77875. *
  77876. * @param {number} x - x。
  77877. * @param {number} y - y。
  77878. */
  77879. }, {
  77880. key: "isCover",
  77881. value: function isCover(x, y) {
  77882. var originPos = this.getTansform(x, y);
  77883. x = originPos[0];
  77884. y = originPos[1];
  77885. // 快速预判并保留判断矩形
  77886. var rect = this.style.__rect;
  77887. if (!rect) {
  77888. rect = this.style.__rect = this.getRect(this.style);
  77889. }
  77890. if (x >= rect.x && x <= rect.x + rect.width && y >= rect.y && y <= rect.y + rect.height) {
  77891. // 矩形内
  77892. return SUtil_SUtil.Util_area.isInside(this, this.style, x, y);
  77893. }
  77894. return false;
  77895. }
  77896. /**
  77897. * @function LevelRenderer.Shape.prototype.drawText
  77898. * @description 绘制附加文本。
  77899. *
  77900. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  77901. * @param {string} style - 样式。
  77902. * @param {string} normalStyle - normalStyle 默认样式,用于定位文字显示。
  77903. */
  77904. }, {
  77905. key: "drawText",
  77906. value: function drawText(ctx, style, normalStyle) {
  77907. if (typeof style.text == 'undefined' || style.text === false) {
  77908. return;
  77909. }
  77910. // 字体颜色策略
  77911. var textColor = style.textColor || style.color || style.strokeColor;
  77912. ctx.fillStyle = textColor;
  77913. // 文本与图形间空白间隙
  77914. var dd = 10;
  77915. var al; // 文本水平对齐
  77916. var bl; // 文本垂直对齐
  77917. var tx; // 文本横坐标
  77918. var ty; // 文本纵坐标
  77919. var textPosition = style.textPosition // 用户定义
  77920. || this.textPosition // shape默认
  77921. || 'top'; // 全局默认
  77922. // Smic 方法修改 -start
  77923. var __OP = [];
  77924. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  77925. __OP = [0, 0];
  77926. } else {
  77927. __OP = this.refOriginalPosition;
  77928. }
  77929. //原代码:
  77930. // Smic 方法修改 -end
  77931. switch (textPosition) {
  77932. case 'inside':
  77933. case 'top':
  77934. case 'bottom':
  77935. case 'left':
  77936. case 'right':
  77937. if (this.getRect) {
  77938. var rect = (normalStyle || style).__rect || this.getRect(normalStyle || style);
  77939. switch (textPosition) {
  77940. case 'inside':
  77941. tx = rect.x + rect.width / 2;
  77942. ty = rect.y + rect.height / 2;
  77943. al = 'center';
  77944. bl = 'middle';
  77945. if (style.brushType != 'stroke' && textColor == style.color) {
  77946. ctx.fillStyle = '#fff';
  77947. }
  77948. break;
  77949. case 'left':
  77950. tx = rect.x - dd;
  77951. ty = rect.y + rect.height / 2;
  77952. al = 'end';
  77953. bl = 'middle';
  77954. break;
  77955. case 'right':
  77956. tx = rect.x + rect.width + dd;
  77957. ty = rect.y + rect.height / 2;
  77958. al = 'start';
  77959. bl = 'middle';
  77960. break;
  77961. case 'top':
  77962. tx = rect.x + rect.width / 2;
  77963. ty = rect.y - dd;
  77964. al = 'center';
  77965. bl = 'bottom';
  77966. break;
  77967. case 'bottom':
  77968. tx = rect.x + rect.width / 2;
  77969. ty = rect.y + rect.height + dd;
  77970. al = 'center';
  77971. bl = 'top';
  77972. break;
  77973. }
  77974. }
  77975. break;
  77976. case 'start':
  77977. case 'end':
  77978. var xStart = 0;
  77979. var xEnd = 0;
  77980. var yStart = 0;
  77981. var yEnd = 0;
  77982. if (typeof style.pointList != 'undefined') {
  77983. var pointList = style.pointList;
  77984. if (pointList.length < 2) {
  77985. // 少于2个点就不画了~
  77986. return;
  77987. }
  77988. var length = pointList.length;
  77989. switch (textPosition) {
  77990. // Smic 方法修改 -start
  77991. case 'start':
  77992. xStart = pointList[0][0] + __OP[0];
  77993. xEnd = pointList[1][0] + __OP[0];
  77994. yStart = pointList[0][1] + __OP[1];
  77995. yEnd = pointList[1][1] + __OP[1];
  77996. break;
  77997. case 'end':
  77998. xStart = pointList[length - 2][0] + __OP[0];
  77999. xEnd = pointList[length - 1][0] + __OP[0];
  78000. yStart = pointList[length - 2][1] + __OP[1];
  78001. yEnd = pointList[length - 1][1] + __OP[1];
  78002. break;
  78003. //原代码:
  78004. /*
  78005. case 'start':
  78006. xStart = pointList[0][0];
  78007. xEnd = pointList[1][0];
  78008. yStart = pointList[0][1];
  78009. yEnd = pointList[1][1];
  78010. break;
  78011. case 'end':
  78012. xStart = pointList[length - 2][0];
  78013. xEnd = pointList[length - 1][0];
  78014. yStart = pointList[length - 2][1];
  78015. yEnd = pointList[length - 1][1];
  78016. break;
  78017. */
  78018. // Smic 方法修改 -end
  78019. }
  78020. } else {
  78021. // Smic 方法修改 -start
  78022. xStart = style.xStart + __OP[0] || 0;
  78023. xEnd = style.xEnd + __OP[0] || 0;
  78024. yStart = style.yStart + __OP[1] || 0;
  78025. yEnd = style.yEnd + __OP[1] || 0;
  78026. //原代码:
  78027. /*
  78028. xStart = style.xStart || 0;
  78029. xEnd = style.xEnd || 0;
  78030. yStart = style.yStart || 0;
  78031. yEnd = style.yEnd || 0;
  78032. */
  78033. // Smic 方法修改 -end
  78034. }
  78035. switch (textPosition) {
  78036. case 'start':
  78037. al = xStart < xEnd ? 'end' : 'start';
  78038. bl = yStart < yEnd ? 'bottom' : 'top';
  78039. tx = xStart;
  78040. ty = yStart;
  78041. break;
  78042. case 'end':
  78043. al = xStart < xEnd ? 'start' : 'end';
  78044. bl = yStart < yEnd ? 'top' : 'bottom';
  78045. tx = xEnd;
  78046. ty = yEnd;
  78047. break;
  78048. }
  78049. dd -= 4;
  78050. if (xStart && xEnd && xStart != xEnd) {
  78051. tx -= al == 'end' ? dd : -dd;
  78052. } else {
  78053. al = 'center';
  78054. }
  78055. if (yStart != yEnd) {
  78056. ty -= bl == 'bottom' ? dd : -dd;
  78057. } else {
  78058. bl = 'middle';
  78059. }
  78060. break;
  78061. case 'specific':
  78062. tx = style.textX || 0;
  78063. ty = style.textY || 0;
  78064. al = 'start';
  78065. bl = 'middle';
  78066. break;
  78067. }
  78068. // Smic 方法修改 -start
  78069. if (style.labelXOffset && !isNaN(style.labelXOffset)) {
  78070. tx += style.labelXOffset;
  78071. }
  78072. if (style.labelYOffset && !isNaN(style.labelYOffset)) {
  78073. ty += style.labelYOffset;
  78074. }
  78075. //原代码:
  78076. // Smic 方法修改 -end
  78077. if (tx != null && ty != null) {
  78078. Shape._fillText(ctx, style.text, tx, ty, style.textFont, style.textAlign || al, style.textBaseline || bl);
  78079. }
  78080. }
  78081. /**
  78082. * @function LevelRenderer.Shape.prototype.modSelf
  78083. * @description 图形发生改变
  78084. */
  78085. }, {
  78086. key: "modSelf",
  78087. value: function modSelf() {
  78088. this.__dirty = true;
  78089. if (this.style) {
  78090. this.style.__rect = null;
  78091. }
  78092. if (this.highlightStyle) {
  78093. this.highlightStyle.__rect = null;
  78094. }
  78095. }
  78096. /**
  78097. * @function LevelRenderer.Shape.prototype.isSilent
  78098. * @description 图形是否会触发事件,通过 bind 绑定的事件
  78099. */
  78100. }, {
  78101. key: "isSilent",
  78102. value: function isSilent() {
  78103. return !(this.hoverable || this.draggable || this.clickable || this.onmousemove || this.onmouseover || this.onmouseout || this.onmousedown || this.onmouseup || this.onclick || this.ondragenter || this.ondragover || this.ondragleave || this.ondrop);
  78104. }
  78105. /**
  78106. * @function LevelRenderer.Shape.prototype.setCtxGlobalAlpha
  78107. * @description 设置 Cavans 上下文全局透明度
  78108. *
  78109. * @param {Object} _ctx - Cavans 上下文
  78110. * @param {string} type - one of 'stroke', 'fill', or 'reset'
  78111. * @param {Object} style - Symbolizer hash
  78112. */
  78113. }, {
  78114. key: "setCtxGlobalAlpha",
  78115. value: function setCtxGlobalAlpha(_ctx, type, style) {
  78116. if (type === "fill") {
  78117. _ctx.globalAlpha = typeof style["fillOpacity"] === "undefined" ? typeof style["opacity"] === "undefined" ? 1 : style['opacity'] : style['fillOpacity'];
  78118. } else if (type === "stroke") {
  78119. _ctx.globalAlpha = typeof style["strokeOpacity"] === "undefined" ? typeof style["opacity"] === "undefined" ? 1 : style['opacity'] : style['strokeOpacity'];
  78120. } else {
  78121. _ctx.globalAlpha = typeof style["opacity"] === "undefined" ? 1 : style['opacity'];
  78122. }
  78123. }
  78124. /**
  78125. * @function LevelRenderer.Shape.prototype._fillText
  78126. * @description 填充文本
  78127. */
  78128. }], [{
  78129. key: "_fillText",
  78130. value: function _fillText(ctx, text, x, y, textFont, textAlign, textBaseline) {
  78131. if (textFont) {
  78132. ctx.font = textFont;
  78133. }
  78134. ctx.textAlign = textAlign;
  78135. ctx.textBaseline = textBaseline;
  78136. var rect = Shape._getTextRect(text, x, y, textFont, textAlign, textBaseline);
  78137. text = (text + '').split('\n');
  78138. var lineHeight = SUtil_SUtil.Util_area.getTextHeight('ZH', textFont);
  78139. switch (textBaseline) {
  78140. case 'top':
  78141. y = rect.y;
  78142. break;
  78143. case 'bottom':
  78144. y = rect.y + lineHeight;
  78145. break;
  78146. default:
  78147. y = rect.y + lineHeight / 2;
  78148. }
  78149. for (var i = 0, l = text.length; i < l; i++) {
  78150. ctx.fillText(text[i], x, y);
  78151. y += lineHeight;
  78152. }
  78153. }
  78154. /**
  78155. * @function LevelRenderer.Shape._getTextRect
  78156. * @description 返回矩形区域,用于局部刷新和文字定位
  78157. *
  78158. * @param {string} text - text。
  78159. * @param {number} x - x。
  78160. * @param {number} y - y。
  78161. * @param {string} textFont - textFont。
  78162. * @param {string} textAlign - textAlign。
  78163. * @param {string} textBaseline - textBaseline。
  78164. * @return {Object} 矩形区域。
  78165. */
  78166. }, {
  78167. key: "_getTextRect",
  78168. value: function _getTextRect(text, x, y, textFont, textAlign, textBaseline) {
  78169. var width = SUtil_SUtil.Util_area.getTextWidth(text, textFont);
  78170. var lineHeight = SUtil_SUtil.Util_area.getTextHeight('ZH', textFont);
  78171. text = (text + '').split('\n');
  78172. switch (textAlign) {
  78173. case 'end':
  78174. case 'right':
  78175. x -= width;
  78176. break;
  78177. case 'center':
  78178. x -= width / 2;
  78179. break;
  78180. }
  78181. switch (textBaseline) {
  78182. case 'top':
  78183. break;
  78184. case 'bottom':
  78185. y -= lineHeight * text.length;
  78186. break;
  78187. default:
  78188. y -= lineHeight * text.length / 2;
  78189. }
  78190. return {
  78191. x: x,
  78192. y: y,
  78193. width: width,
  78194. height: lineHeight * text.length
  78195. };
  78196. }
  78197. }]);
  78198. return Shape;
  78199. }(mixinExt(Eventful, Transformable));
  78200. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/SmicPoint.js
  78201. function SmicPoint_typeof(obj) { "@babel/helpers - typeof"; return SmicPoint_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, SmicPoint_typeof(obj); }
  78202. function SmicPoint_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  78203. function SmicPoint_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  78204. function SmicPoint_createClass(Constructor, protoProps, staticProps) { if (protoProps) SmicPoint_defineProperties(Constructor.prototype, protoProps); if (staticProps) SmicPoint_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  78205. function SmicPoint_get() { if (typeof Reflect !== "undefined" && Reflect.get) { SmicPoint_get = Reflect.get.bind(); } else { SmicPoint_get = function _get(target, property, receiver) { var base = SmicPoint_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return SmicPoint_get.apply(this, arguments); }
  78206. function SmicPoint_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SmicPoint_getPrototypeOf(object); if (object === null) break; } return object; }
  78207. function SmicPoint_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) SmicPoint_setPrototypeOf(subClass, superClass); }
  78208. function SmicPoint_setPrototypeOf(o, p) { SmicPoint_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SmicPoint_setPrototypeOf(o, p); }
  78209. function SmicPoint_createSuper(Derived) { var hasNativeReflectConstruct = SmicPoint_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = SmicPoint_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = SmicPoint_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return SmicPoint_possibleConstructorReturn(this, result); }; }
  78210. function SmicPoint_possibleConstructorReturn(self, call) { if (call && (SmicPoint_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return SmicPoint_assertThisInitialized(self); }
  78211. function SmicPoint_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  78212. function SmicPoint_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  78213. function SmicPoint_getPrototypeOf(o) { SmicPoint_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SmicPoint_getPrototypeOf(o); }
  78214. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  78215. * This program are made available under the terms of the Apache License, Version 2.0
  78216. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  78217. /**
  78218. * @private
  78219. * @class LevelRenderer.Shape.SmicPoint
  78220. * @category Visualization Theme
  78221. * @classdesc 点。
  78222. * @extends LevelRenderer.Shape
  78223. * @example
  78224. * var shape = new LevelRenderer.Shape.SmicPoint({
  78225. * style: {
  78226. * x: 100,
  78227. * y: 100,
  78228. * r: 40,
  78229. * brushType: 'both',
  78230. * color: 'blue',
  78231. * strokeColor: 'red',
  78232. * lineWidth: 3,
  78233. * text: 'point'
  78234. * }
  78235. * });
  78236. * levelRenderer.addShape(shape);
  78237. * @param {Array} options - shape 的配置(options)项,可以是 shape 的自有属性,也可以是自定义的属性。
  78238. *
  78239. */
  78240. var SmicPoint = /*#__PURE__*/function (_Shape) {
  78241. SmicPoint_inherits(SmicPoint, _Shape);
  78242. var _super = SmicPoint_createSuper(SmicPoint);
  78243. function SmicPoint(options) {
  78244. var _this;
  78245. SmicPoint_classCallCheck(this, SmicPoint);
  78246. _this = _super.call(this, options);
  78247. /**
  78248. * @member {string} LevelRenderer.Shape.SmicPoint.prototype.type
  78249. * @description 图形类型。
  78250. */
  78251. _this.type = 'smicpoint';
  78252. if (!_this.refOriginalPosition || _this.refOriginalPosition.length !== 2) {
  78253. _this.refOriginalPosition = [0, 0];
  78254. }
  78255. _this.CLASS_NAME = "SuperMap.LevelRenderer.Shape.SmicPoint";
  78256. return _this;
  78257. }
  78258. /**
  78259. * @function cdestroy
  78260. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  78261. */
  78262. SmicPoint_createClass(SmicPoint, [{
  78263. key: "destroy",
  78264. value: function destroy() {
  78265. this.type = null;
  78266. SmicPoint_get(SmicPoint_getPrototypeOf(SmicPoint.prototype), "destroy", this).call(this);
  78267. }
  78268. /**
  78269. * @function LevelRenderer.Shape.SmicPoint.prototype.buildPath
  78270. * @description 创建点触。
  78271. *
  78272. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  78273. * @param {Object} style - style。
  78274. *
  78275. */
  78276. }, {
  78277. key: "buildPath",
  78278. value: function buildPath(ctx, style) {
  78279. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  78280. this.refOriginalPosition = [0, 0];
  78281. }
  78282. var __OP = this.refOriginalPosition;
  78283. ctx.arc(style.x + __OP[0], style.y + __OP[1], style.r, 0, Math.PI * 2, true);
  78284. return;
  78285. }
  78286. /**
  78287. * @function LevelRenderer.Shape.SmicPoint.prototype.getRect
  78288. * @description 计算返回点的包围盒矩形。该包围盒是直接从四个控制点计算,并非最小包围盒。
  78289. *
  78290. * @param {Object} style - style
  78291. * @return {Object} 边框对象。包含属性:x,y,width,height。
  78292. */
  78293. }, {
  78294. key: "getRect",
  78295. value: function getRect(style) {
  78296. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  78297. this.refOriginalPosition = [0, 0];
  78298. }
  78299. var __OP = this.refOriginalPosition;
  78300. if (style.__rect) {
  78301. return style.__rect;
  78302. }
  78303. var lineWidth;
  78304. if (style.brushType == 'stroke' || style.brushType == 'fill') {
  78305. lineWidth = style.lineWidth || 1;
  78306. } else {
  78307. lineWidth = 0;
  78308. }
  78309. style.__rect = {
  78310. x: Math.round(style.x + __OP[0] - style.r - lineWidth / 2),
  78311. y: Math.round(style.y + __OP[1] - style.r - lineWidth / 2),
  78312. width: style.r * 2 + lineWidth,
  78313. height: style.r * 2 + lineWidth
  78314. };
  78315. return style.__rect;
  78316. }
  78317. }]);
  78318. return SmicPoint;
  78319. }(Shape_Shape);
  78320. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/SmicText.js
  78321. function SmicText_typeof(obj) { "@babel/helpers - typeof"; return SmicText_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, SmicText_typeof(obj); }
  78322. function SmicText_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  78323. function SmicText_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  78324. function SmicText_createClass(Constructor, protoProps, staticProps) { if (protoProps) SmicText_defineProperties(Constructor.prototype, protoProps); if (staticProps) SmicText_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  78325. function SmicText_get() { if (typeof Reflect !== "undefined" && Reflect.get) { SmicText_get = Reflect.get.bind(); } else { SmicText_get = function _get(target, property, receiver) { var base = SmicText_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return SmicText_get.apply(this, arguments); }
  78326. function SmicText_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SmicText_getPrototypeOf(object); if (object === null) break; } return object; }
  78327. function SmicText_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) SmicText_setPrototypeOf(subClass, superClass); }
  78328. function SmicText_setPrototypeOf(o, p) { SmicText_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SmicText_setPrototypeOf(o, p); }
  78329. function SmicText_createSuper(Derived) { var hasNativeReflectConstruct = SmicText_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = SmicText_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = SmicText_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return SmicText_possibleConstructorReturn(this, result); }; }
  78330. function SmicText_possibleConstructorReturn(self, call) { if (call && (SmicText_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return SmicText_assertThisInitialized(self); }
  78331. function SmicText_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  78332. function SmicText_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  78333. function SmicText_getPrototypeOf(o) { SmicText_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SmicText_getPrototypeOf(o); }
  78334. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  78335. * This program are made available under the terms of the Apache License, Version 2.0
  78336. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  78337. /**
  78338. * @private
  78339. * @class LevelRenderer.Shape.SmicText
  78340. * @category Visualization Theme
  78341. * @extends {LevelRenderer.Shape}
  78342. * @example
  78343. * var shape = new LevelRenderer.Shape.SmicText({
  78344. * style: {
  78345. * text: 'Label',
  78346. * x: 100,
  78347. * y: 100,
  78348. * textFont: '14px Arial'
  78349. * }
  78350. * });
  78351. * levelRenderer.addShape(shape);
  78352. * @param {Array} options - shape 的配置(options)项,可以是 shape 的自有属性,也可以是自定义的属性。
  78353. */
  78354. var SmicText = /*#__PURE__*/function (_Shape) {
  78355. SmicText_inherits(SmicText, _Shape);
  78356. var _super = SmicText_createSuper(SmicText);
  78357. function SmicText(options) {
  78358. var _this;
  78359. SmicText_classCallCheck(this, SmicText);
  78360. _this = _super.call(this, options);
  78361. /**
  78362. * @member {string} LevelRenderer.Shape.SmicText.prototype.type
  78363. * @description 图形类型.
  78364. */
  78365. _this.type = 'smictext';
  78366. if (!_this.refOriginalPosition || _this.refOriginalPosition.length !== 2) {
  78367. _this.refOriginalPosition = [0, 0];
  78368. }
  78369. _this.CLASS_NAME = "SuperMap.LevelRenderer.Shape.SmicText";
  78370. return _this;
  78371. }
  78372. /**
  78373. * @function LevelRenderer.Shape.SmicText.prototype.destroy
  78374. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  78375. */
  78376. SmicText_createClass(SmicText, [{
  78377. key: "destroy",
  78378. value: function destroy() {
  78379. this.type = null;
  78380. SmicText_get(SmicText_getPrototypeOf(SmicText.prototype), "destroy", this).call(this);
  78381. }
  78382. /**
  78383. * @function LevelRenderer.Shape.SmicText.prototype.brush
  78384. * @description 笔触。
  78385. *
  78386. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  78387. * @param {boolean} isHighlight - 是否使用高亮属性。
  78388. *
  78389. */
  78390. }, {
  78391. key: "brush",
  78392. value: function brush(ctx, isHighlight) {
  78393. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  78394. this.refOriginalPosition = [0, 0];
  78395. }
  78396. var __OP = this.refOriginalPosition;
  78397. var style = this.style;
  78398. if (isHighlight) {
  78399. // 根据style扩展默认高亮样式
  78400. style = this.getHighlightStyle(style, this.highlightStyle || {});
  78401. }
  78402. if (typeof style.text == 'undefined' || style.text === false) {
  78403. return;
  78404. }
  78405. ctx.save();
  78406. this.doClip(ctx);
  78407. this.setContext(ctx, style);
  78408. // 设置transform
  78409. this.setTransform(ctx);
  78410. if (style.textFont) {
  78411. ctx.font = style.textFont;
  78412. }
  78413. ctx.textAlign = style.textAlign || 'start';
  78414. ctx.textBaseline = style.textBaseline || 'middle';
  78415. var text = (style.text + '').split('\n');
  78416. var lineHeight = SUtil_SUtil.Util_area.getTextHeight('ZH', style.textFont);
  78417. var rect = this.getRectNoRotation(style);
  78418. // var x = style.x;
  78419. var x = style.x + __OP[0];
  78420. var y;
  78421. if (style.textBaseline == 'top') {
  78422. y = rect.y;
  78423. } else if (style.textBaseline == 'bottom') {
  78424. y = rect.y + lineHeight;
  78425. } else {
  78426. y = rect.y + lineHeight / 2;
  78427. }
  78428. var ox = style.x + __OP[0];
  78429. var oy = style.y + __OP[1];
  78430. //文本绘制
  78431. for (var i = 0, l = text.length; i < l; i++) {
  78432. //是否渲染矩形背景及颜色
  78433. if (style.labelRect) {
  78434. //+4,-2是为了让文字距边框左右边缘有点间隔
  78435. ctx.fillRect(rect.x - 2, rect.y, rect.width + 4, rect.height);
  78436. ctx.fillStyle = style.strokeColor;
  78437. ctx.strokeRect(rect.x - 2, rect.y, rect.width + 4, rect.height);
  78438. ctx.fillStyle = style.textColor;
  78439. }
  78440. switch (style.brushType) {
  78441. case 'stroke':
  78442. this.setCtxGlobalAlpha(ctx, "stroke", style);
  78443. if (style.textRotation && style.textRotation !== 0) {
  78444. ctx.save();
  78445. ctx.translate(ox, oy);
  78446. ctx.rotate(style.textRotation * Math.PI / 180);
  78447. if (style.textBaseline == 'top') {
  78448. if (style.maxWidth) {
  78449. ctx.strokeText(text[i], 0, lineHeight * i, style.maxWidth);
  78450. } else {
  78451. ctx.strokeText(text[i], 0, lineHeight * i);
  78452. }
  78453. } else if (style.textBaseline == 'bottom') {
  78454. if (style.maxWidth) {
  78455. ctx.strokeText(text[i], 0, lineHeight * (i + 1) - rect.height, style.maxWidth);
  78456. } else {
  78457. ctx.strokeText(text[i], 0, lineHeight * (i + 1) - rect.height);
  78458. }
  78459. } else {
  78460. if (style.maxWidth) {
  78461. ctx.strokeText(text[i], 0, lineHeight * (i + 1) - rect.height / 2 - lineHeight / 2, style.maxWidth);
  78462. } else {
  78463. ctx.strokeText(text[i], 0, lineHeight * (i + 1) - rect.height / 2 - lineHeight / 2);
  78464. }
  78465. }
  78466. ctx.restore();
  78467. } else {
  78468. if (style.maxWidth) {
  78469. ctx.strokeText(text[i], x, y, style.maxWidth);
  78470. } else {
  78471. ctx.strokeText(text[i], x, y);
  78472. }
  78473. }
  78474. this.setCtxGlobalAlpha(ctx, "reset", style);
  78475. break;
  78476. case 'both':
  78477. if (style.textRotation && style.textRotation !== 0) {
  78478. ctx.save();
  78479. ctx.translate(ox, oy);
  78480. ctx.rotate(style.textRotation * Math.PI / 180);
  78481. if (style.textBaseline == 'top') {
  78482. if (style.maxWidth) {
  78483. this.setCtxGlobalAlpha(ctx, "fill", style);
  78484. ctx.fillText(text[i], 0, lineHeight * i, style.maxWidth);
  78485. this.setCtxGlobalAlpha(ctx, "reset", style);
  78486. this.setCtxGlobalAlpha(ctx, "stroke", style);
  78487. ctx.strokeText(text[i], 0, lineHeight * i, style.maxWidth);
  78488. this.setCtxGlobalAlpha(ctx, "reset", style);
  78489. } else {
  78490. this.setCtxGlobalAlpha(ctx, "fill", style);
  78491. ctx.fillText(text[i], 0, lineHeight * i);
  78492. this.setCtxGlobalAlpha(ctx, "reset", style);
  78493. this.setCtxGlobalAlpha(ctx, "stroke", style);
  78494. ctx.strokeText(text[i], 0, lineHeight * i);
  78495. this.setCtxGlobalAlpha(ctx, "reset", style);
  78496. }
  78497. } else if (style.textBaseline == 'bottom') {
  78498. if (style.maxWidth) {
  78499. this.setCtxGlobalAlpha(ctx, "fill", style);
  78500. ctx.fillText(text[i], 0, lineHeight * (i + 1) - rect.height, style.maxWidth);
  78501. this.setCtxGlobalAlpha(ctx, "reset", style);
  78502. this.setCtxGlobalAlpha(ctx, "stroke", style);
  78503. ctx.strokeText(text[i], 0, lineHeight * (i + 1) - rect.height, style.maxWidth);
  78504. this.setCtxGlobalAlpha(ctx, "reset", style);
  78505. } else {
  78506. this.setCtxGlobalAlpha(ctx, "fill", style);
  78507. ctx.fillText(text[i], 0, lineHeight * (i + 1) - rect.height);
  78508. this.setCtxGlobalAlpha(ctx, "reset", style);
  78509. this.setCtxGlobalAlpha(ctx, "stroke", style);
  78510. ctx.strokeText(text[i], 0, lineHeight * (i + 1) - rect.height);
  78511. this.setCtxGlobalAlpha(ctx, "reset", style);
  78512. }
  78513. } else {
  78514. if (style.maxWidth) {
  78515. this.setCtxGlobalAlpha(ctx, "fill", style);
  78516. ctx.fillText(text[i], 0, lineHeight * (i + 1) - rect.height / 2 - lineHeight / 2, style.maxWidth);
  78517. this.setCtxGlobalAlpha(ctx, "reset", style);
  78518. this.setCtxGlobalAlpha(ctx, "stroke", style);
  78519. ctx.strokeText(text[i], 0, lineHeight * (i + 1) - rect.height / 2 - lineHeight / 2, style.maxWidth);
  78520. this.setCtxGlobalAlpha(ctx, "reset", style);
  78521. } else {
  78522. this.setCtxGlobalAlpha(ctx, "fill", style);
  78523. ctx.fillText(text[i], 0, lineHeight * (i + 1) - rect.height / 2 - lineHeight / 2);
  78524. this.setCtxGlobalAlpha(ctx, "reset", style);
  78525. this.setCtxGlobalAlpha(ctx, "stroke", style);
  78526. ctx.strokeText(text[i], 0, lineHeight * (i + 1) - rect.height / 2 - lineHeight / 2);
  78527. this.setCtxGlobalAlpha(ctx, "reset", style);
  78528. }
  78529. }
  78530. ctx.restore();
  78531. } else {
  78532. if (style.maxWidth) {
  78533. this.setCtxGlobalAlpha(ctx, "fill", style);
  78534. ctx.fillText(text[i], x, y, style.maxWidth);
  78535. this.setCtxGlobalAlpha(ctx, "reset", style);
  78536. this.setCtxGlobalAlpha(ctx, "stroke", style);
  78537. ctx.strokeText(text[i], x, y, style.maxWidth);
  78538. this.setCtxGlobalAlpha(ctx, "reset", style);
  78539. } else {
  78540. this.setCtxGlobalAlpha(ctx, "fill", style);
  78541. ctx.fillText(text[i], x, y);
  78542. this.setCtxGlobalAlpha(ctx, "reset", style);
  78543. this.setCtxGlobalAlpha(ctx, "stroke", style);
  78544. ctx.strokeText(text[i], x, y);
  78545. this.setCtxGlobalAlpha(ctx, "reset", style);
  78546. }
  78547. }
  78548. break;
  78549. default:
  78550. //fill or others
  78551. this.setCtxGlobalAlpha(ctx, "fill", style);
  78552. if (style.textRotation && style.textRotation !== 0) {
  78553. ctx.save();
  78554. ctx.translate(ox, oy);
  78555. ctx.rotate(style.textRotation * Math.PI / 180);
  78556. if (style.textBaseline == 'top') {
  78557. if (style.maxWidth) {
  78558. ctx.fillText(text[i], 0, lineHeight * i, style.maxWidth);
  78559. } else {
  78560. ctx.fillText(text[i], 0, lineHeight * i);
  78561. }
  78562. } else if (style.textBaseline == 'bottom') {
  78563. if (style.maxWidth) {
  78564. ctx.fillText(text[i], 0, lineHeight * (i + 1) - rect.height, style.maxWidth);
  78565. } else {
  78566. ctx.fillText(text[i], 0, lineHeight * (i + 1) - rect.height);
  78567. }
  78568. } else {
  78569. if (style.maxWidth) {
  78570. ctx.fillText(text[i], 0, lineHeight * (i + 1) - rect.height / 2 - lineHeight / 2, style.maxWidth);
  78571. } else {
  78572. ctx.fillText(text[i], 0, lineHeight * (i + 1) - rect.height / 2 - lineHeight / 2);
  78573. }
  78574. }
  78575. ctx.restore();
  78576. } else {
  78577. if (style.maxWidth) {
  78578. ctx.fillText(text[i], x, y, style.maxWidth);
  78579. } else {
  78580. ctx.fillText(text[i], x, y);
  78581. }
  78582. }
  78583. this.setCtxGlobalAlpha(ctx, "reset", style);
  78584. }
  78585. y += lineHeight;
  78586. }
  78587. ctx.restore();
  78588. return;
  78589. }
  78590. /**
  78591. * @function LevelRenderer.Shape.SmicText.prototype.getRect
  78592. * @description 返回文字包围盒矩形
  78593. */
  78594. }, {
  78595. key: "getRect",
  78596. value: function getRect(style) {
  78597. if (style.__rect) {
  78598. return style.__rect;
  78599. }
  78600. var left, top, right, bottom;
  78601. var tbg = this.getTextBackground(style, true);
  78602. for (var i = 0, len = tbg.length; i < len; i++) {
  78603. var poi = tbg[i];
  78604. //用第一个点初始化
  78605. if (i == 0) {
  78606. left = poi[0];
  78607. right = poi[0];
  78608. top = poi[1];
  78609. bottom = poi[1];
  78610. } else {
  78611. if (poi[0] < left) {
  78612. left = poi[0];
  78613. }
  78614. if (poi[0] > right) {
  78615. right = poi[0];
  78616. }
  78617. if (poi[1] < top) {
  78618. top = poi[1];
  78619. }
  78620. if (poi[1] > bottom) {
  78621. bottom = poi[1];
  78622. }
  78623. }
  78624. }
  78625. style.__rect = {
  78626. x: left,
  78627. y: top,
  78628. width: right - left,
  78629. height: bottom - top
  78630. };
  78631. return style.__rect;
  78632. }
  78633. /**
  78634. * @function LevelRenderer.Shape.SmicText.prototype.getRectNoRotation
  78635. * @description 返回忽略旋转和maxWidth时文字包围盒矩形
  78636. */
  78637. }, {
  78638. key: "getRectNoRotation",
  78639. value: function getRectNoRotation(style) {
  78640. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  78641. this.refOriginalPosition = [0, 0];
  78642. }
  78643. var __OP = this.refOriginalPosition;
  78644. var lineHeight = SUtil_SUtil.Util_area.getTextHeight('ZH', style.textFont);
  78645. var width = SUtil_SUtil.Util_area.getTextWidth(style.text, style.textFont);
  78646. var height = SUtil_SUtil.Util_area.getTextHeight(style.text, style.textFont);
  78647. //处理文字位置,注:文本的绘制是由此 rect 决定
  78648. var textX = style.x + __OP[0]; // 默认start == left
  78649. if (style.textAlign == 'end' || style.textAlign == 'right') {
  78650. textX -= width;
  78651. } else if (style.textAlign == 'center') {
  78652. textX -= width / 2;
  78653. }
  78654. var textY;
  78655. if (style.textBaseline == 'top') {
  78656. // textY = style.y;
  78657. textY = style.y + __OP[1];
  78658. } else if (style.textBaseline == 'bottom') {
  78659. textY = style.y + __OP[1] - height;
  78660. } else {
  78661. // middle
  78662. textY = style.y + __OP[1] - height / 2;
  78663. }
  78664. var isWidthChangeByMaxWidth = false;
  78665. var widthBeforeChangeByMaxWidth;
  78666. //处理 maxWidth
  78667. if (style.maxWidth) {
  78668. var maxWidth = parseInt(style.maxWidth);
  78669. if (maxWidth < width) {
  78670. widthBeforeChangeByMaxWidth = width;
  78671. isWidthChangeByMaxWidth = true;
  78672. width = maxWidth;
  78673. }
  78674. textX = style.x + __OP[0];
  78675. if (style.textAlign == 'end' || style.textAlign == 'right') {
  78676. textX -= width;
  78677. } else if (style.textAlign == 'center') {
  78678. textX -= width / 2;
  78679. }
  78680. }
  78681. //处理斜体字
  78682. if (style.textFont) {
  78683. var textFont = style.textFont;
  78684. var textFontStr = textFont.toLowerCase();
  78685. if (textFontStr.indexOf("italic") > -1) {
  78686. if (isWidthChangeByMaxWidth === true) {
  78687. width += lineHeight / 3 * (width / widthBeforeChangeByMaxWidth);
  78688. } else {
  78689. width += lineHeight / 3;
  78690. }
  78691. }
  78692. }
  78693. var rect = {
  78694. x: textX,
  78695. y: textY,
  78696. width: width,
  78697. height: height
  78698. };
  78699. return rect;
  78700. }
  78701. /**
  78702. * @function LevelRenderer.Shape.SmicText.prototype.getTextBackground
  78703. * @description 获取文本背景框范围
  78704. *
  78705. * @param {Object} style - 样式。
  78706. * @param {boolean} redo - 是否强制重新计算 textBackground。
  78707. */
  78708. }, {
  78709. key: "getTextBackground",
  78710. value: function getTextBackground(style, redo) {
  78711. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  78712. this.refOriginalPosition = [0, 0];
  78713. }
  78714. var __OP = this.refOriginalPosition;
  78715. if (!redo && style.__textBackground) {
  78716. return style.__textBackground;
  78717. }
  78718. //不旋转时矩形框
  78719. var rect = this.getRectNoRotation(style);
  78720. //旋转中心点
  78721. var ox = style.x + __OP[0];
  78722. var oy = style.y + __OP[1];
  78723. //背景框
  78724. var background = [];
  78725. if (style.textRotation && style.textRotation !== 0) {
  78726. var textRotation = style.textRotation;
  78727. var ltPoi = this.getRotatedLocation(rect.x, rect.y, ox, oy, textRotation);
  78728. var rtPoi = this.getRotatedLocation(rect.x + rect.width, rect.y, ox, oy, textRotation);
  78729. var rbPoi = this.getRotatedLocation(rect.x + rect.width, rect.y + rect.height, ox, oy, textRotation);
  78730. var lbPoi = this.getRotatedLocation(rect.x, rect.y + rect.height, ox, oy, textRotation);
  78731. background.push(ltPoi);
  78732. background.push(rtPoi);
  78733. background.push(rbPoi);
  78734. background.push(lbPoi);
  78735. } else {
  78736. var _ltPoi = [rect.x, rect.y];
  78737. var _rtPoi = [rect.x + rect.width, rect.y];
  78738. var _rbPoi = [rect.x + rect.width, rect.y + rect.height];
  78739. var _lbPoi = [rect.x, rect.y + rect.height];
  78740. background.push(_ltPoi);
  78741. background.push(_rtPoi);
  78742. background.push(_rbPoi);
  78743. background.push(_lbPoi);
  78744. }
  78745. style.__textBackground = background;
  78746. return style.__textBackground;
  78747. }
  78748. /**
  78749. * @function LevelRenderer.Shape.SmicText.prototype.getRotatedLocation
  78750. * @description 获取一个点绕旋转中心顺时针旋转后的位置。(此方法用于屏幕坐标)
  78751. *
  78752. * @param {number} x - 旋转点横坐标。
  78753. * @param {number} y - 旋转点纵坐标。
  78754. * @param {number} rx - 旋转中心点横坐标。
  78755. * @param {number} ry - 旋转中心点纵坐标。
  78756. * @param {number} angle - 旋转角度(度)。
  78757. * @return {Array.<number>} 旋转后的坐标位置,长度为 2 的一维数组,数组第一个元素表示 x 坐标,第二个元素表示 y 坐标。
  78758. */
  78759. }, {
  78760. key: "getRotatedLocation",
  78761. value: function getRotatedLocation(x, y, rx, ry, angle) {
  78762. var loc = new Array(),
  78763. x0,
  78764. y0;
  78765. y = -y;
  78766. ry = -ry;
  78767. angle = -angle; //顺时针旋转
  78768. x0 = (x - rx) * Math.cos(angle / 180 * Math.PI) - (y - ry) * Math.sin(angle / 180 * Math.PI) + rx;
  78769. y0 = (x - rx) * Math.sin(angle / 180 * Math.PI) + (y - ry) * Math.cos(angle / 180 * Math.PI) + ry;
  78770. loc[0] = x0;
  78771. loc[1] = -y0;
  78772. return loc;
  78773. }
  78774. }]);
  78775. return SmicText;
  78776. }(Shape_Shape);
  78777. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/SmicCircle.js
  78778. function SmicCircle_typeof(obj) { "@babel/helpers - typeof"; return SmicCircle_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, SmicCircle_typeof(obj); }
  78779. function SmicCircle_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  78780. function SmicCircle_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  78781. function SmicCircle_createClass(Constructor, protoProps, staticProps) { if (protoProps) SmicCircle_defineProperties(Constructor.prototype, protoProps); if (staticProps) SmicCircle_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  78782. function SmicCircle_get() { if (typeof Reflect !== "undefined" && Reflect.get) { SmicCircle_get = Reflect.get.bind(); } else { SmicCircle_get = function _get(target, property, receiver) { var base = SmicCircle_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return SmicCircle_get.apply(this, arguments); }
  78783. function SmicCircle_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SmicCircle_getPrototypeOf(object); if (object === null) break; } return object; }
  78784. function SmicCircle_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) SmicCircle_setPrototypeOf(subClass, superClass); }
  78785. function SmicCircle_setPrototypeOf(o, p) { SmicCircle_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SmicCircle_setPrototypeOf(o, p); }
  78786. function SmicCircle_createSuper(Derived) { var hasNativeReflectConstruct = SmicCircle_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = SmicCircle_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = SmicCircle_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return SmicCircle_possibleConstructorReturn(this, result); }; }
  78787. function SmicCircle_possibleConstructorReturn(self, call) { if (call && (SmicCircle_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return SmicCircle_assertThisInitialized(self); }
  78788. function SmicCircle_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  78789. function SmicCircle_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  78790. function SmicCircle_getPrototypeOf(o) { SmicCircle_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SmicCircle_getPrototypeOf(o); }
  78791. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  78792. * This program are made available under the terms of the Apache License, Version 2.0
  78793. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  78794. /**
  78795. * @private
  78796. * @class LevelRenderer.Shape.SmicCircle
  78797. * @category Visualization Theme
  78798. * @classdesc 圆形
  78799. * @extends LevelRenderer.Shape
  78800. * @example
  78801. * var shape = new LevelRenderer.Shape.SmicCircle({
  78802. * style: {
  78803. * x: 100,
  78804. * y: 100,
  78805. * r: 60,
  78806. * brushType: "both",
  78807. * color: "blue",
  78808. * strokeColor: "red",
  78809. * lineWidth: 3,
  78810. * text: "Circle"
  78811. * }
  78812. * });
  78813. * levelRenderer.addShape(shape);
  78814. * @param {Array} options - shape 的配置(options)项,可以是 shape 的自有属性,也可以是自定义的属性。
  78815. *
  78816. */
  78817. var SmicCircle = /*#__PURE__*/function (_Shape) {
  78818. SmicCircle_inherits(SmicCircle, _Shape);
  78819. var _super = SmicCircle_createSuper(SmicCircle);
  78820. function SmicCircle(options) {
  78821. var _this;
  78822. SmicCircle_classCallCheck(this, SmicCircle);
  78823. _this = _super.call(this, options);
  78824. /**
  78825. * @member {string} LevelRenderer.Shape.SmicCircle.prototype.type
  78826. * @description 图形类型。
  78827. */
  78828. _this.type = 'smiccircle';
  78829. if (!_this.refOriginalPosition || _this.refOriginalPosition.length !== 2) {
  78830. _this.refOriginalPosition = [0, 0];
  78831. }
  78832. _this.CLASS_NAME = "SuperMap.LevelRenderer.Shape.SmicCircle";
  78833. return _this;
  78834. }
  78835. /**
  78836. * @function LevelRenderer.Shape.SmicCircle.prototype.destroy
  78837. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  78838. */
  78839. SmicCircle_createClass(SmicCircle, [{
  78840. key: "destroy",
  78841. value: function destroy() {
  78842. this.type = null;
  78843. SmicCircle_get(SmicCircle_getPrototypeOf(SmicCircle.prototype), "destroy", this).call(this);
  78844. }
  78845. /**
  78846. * @function LevelRenderer.Shape.SmicCircle.prototype.buildPath
  78847. * @description 创建图形路径。
  78848. *
  78849. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  78850. * @param {Object} style - style。
  78851. *
  78852. */
  78853. }, {
  78854. key: "buildPath",
  78855. value: function buildPath(ctx, style) {
  78856. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  78857. this.refOriginalPosition = [0, 0];
  78858. }
  78859. var __OP = this.refOriginalPosition;
  78860. var x = style.x + __OP[0]; // 圆心x
  78861. var y = style.y + __OP[1]; // 圆心y
  78862. ctx.moveTo(x + style.r, y);
  78863. ctx.arc(x, y, style.r, 0, Math.PI * 2, true);
  78864. return true;
  78865. }
  78866. /**
  78867. * @function LevelRenderer.Shape.SmicCircle.prototype.getRect
  78868. * @description 返回圆形包围盒矩形
  78869. *
  78870. * @param {Object} style - style
  78871. * @return {Object} 边框对象。包含属性:x,y,width,height。
  78872. *
  78873. */
  78874. }, {
  78875. key: "getRect",
  78876. value: function getRect(style) {
  78877. if (style.__rect) {
  78878. return style.__rect;
  78879. }
  78880. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  78881. this.refOriginalPosition = [0, 0];
  78882. }
  78883. var __OP = this.refOriginalPosition;
  78884. var x = style.x + __OP[0]; // 圆心x
  78885. var y = style.y + __OP[1]; // 圆心y
  78886. var r = style.r; // 圆r
  78887. var lineWidth;
  78888. if (style.brushType == 'stroke' || style.brushType == 'fill') {
  78889. lineWidth = style.lineWidth || 1;
  78890. } else {
  78891. lineWidth = 0;
  78892. }
  78893. style.__rect = {
  78894. x: Math.round(x - r - lineWidth / 2),
  78895. y: Math.round(y - r - lineWidth / 2),
  78896. width: r * 2 + lineWidth,
  78897. height: r * 2 + lineWidth
  78898. };
  78899. return style.__rect;
  78900. }
  78901. }]);
  78902. return SmicCircle;
  78903. }(Shape_Shape);
  78904. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/SmicPolygon.js
  78905. function SmicPolygon_typeof(obj) { "@babel/helpers - typeof"; return SmicPolygon_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, SmicPolygon_typeof(obj); }
  78906. function SmicPolygon_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  78907. function SmicPolygon_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  78908. function SmicPolygon_createClass(Constructor, protoProps, staticProps) { if (protoProps) SmicPolygon_defineProperties(Constructor.prototype, protoProps); if (staticProps) SmicPolygon_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  78909. function SmicPolygon_get() { if (typeof Reflect !== "undefined" && Reflect.get) { SmicPolygon_get = Reflect.get.bind(); } else { SmicPolygon_get = function _get(target, property, receiver) { var base = SmicPolygon_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return SmicPolygon_get.apply(this, arguments); }
  78910. function SmicPolygon_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SmicPolygon_getPrototypeOf(object); if (object === null) break; } return object; }
  78911. function SmicPolygon_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) SmicPolygon_setPrototypeOf(subClass, superClass); }
  78912. function SmicPolygon_setPrototypeOf(o, p) { SmicPolygon_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SmicPolygon_setPrototypeOf(o, p); }
  78913. function SmicPolygon_createSuper(Derived) { var hasNativeReflectConstruct = SmicPolygon_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = SmicPolygon_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = SmicPolygon_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return SmicPolygon_possibleConstructorReturn(this, result); }; }
  78914. function SmicPolygon_possibleConstructorReturn(self, call) { if (call && (SmicPolygon_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return SmicPolygon_assertThisInitialized(self); }
  78915. function SmicPolygon_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  78916. function SmicPolygon_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  78917. function SmicPolygon_getPrototypeOf(o) { SmicPolygon_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SmicPolygon_getPrototypeOf(o); }
  78918. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  78919. * This program are made available under the terms of the Apache License, Version 2.0
  78920. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  78921. /**
  78922. * @private
  78923. * @class LevelRenderer.Shape.SmicPolygon
  78924. * @category Visualization Theme
  78925. * @classdesc 多边形。
  78926. * @extends LevelRenderer.Shape
  78927. * @example
  78928. * var shape = new LevelRenderer.Shape.SmicPolygon({
  78929. * style: {
  78930. * // 100x100 的正方形
  78931. * pointList: [[0, 0], [100, 0], [100, 100], [0, 100]],
  78932. * color: 'blue'
  78933. * }
  78934. * });
  78935. * levelRenderer.addShape(shape);
  78936. * @param {Array} options - shape 的配置(options)项,可以是 shape 的自有属性,也可以是自定义的属性。
  78937. */
  78938. var SmicPolygon = /*#__PURE__*/function (_Shape) {
  78939. SmicPolygon_inherits(SmicPolygon, _Shape);
  78940. var _super = SmicPolygon_createSuper(SmicPolygon);
  78941. function SmicPolygon(options) {
  78942. var _this;
  78943. SmicPolygon_classCallCheck(this, SmicPolygon);
  78944. _this = _super.call(this, options);
  78945. /**
  78946. * @member {string} LevelRenderer.Shape.SmicPolygon.prototype.type
  78947. * @description 图形类型.
  78948. */
  78949. _this.type = 'smicpolygon';
  78950. /**
  78951. * @member {Array} LevelRenderer.Shape.SmicPolygon.prototype._holePolygonPointList
  78952. * @description 岛洞面多边形顶点数组(三维数组)
  78953. *
  78954. */
  78955. _this.holePolygonPointLists = null;
  78956. if (!_this.refOriginalPosition || _this.refOriginalPosition.length !== 2) {
  78957. _this.refOriginalPosition = [0, 0];
  78958. }
  78959. _this.CLASS_NAME = "SuperMap.LevelRenderer.Shape.SmicPolygon";
  78960. return _this;
  78961. }
  78962. /**
  78963. * @function LevelRenderer.Shape.SmicPolygon.prototype.destroy
  78964. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  78965. */
  78966. SmicPolygon_createClass(SmicPolygon, [{
  78967. key: "destroy",
  78968. value: function destroy() {
  78969. this.type = null;
  78970. this.holePolygonPointLists = null;
  78971. SmicPolygon_get(SmicPolygon_getPrototypeOf(SmicPolygon.prototype), "destroy", this).call(this);
  78972. }
  78973. /**
  78974. * @function LevelRenderer.Shape.SmicPolygon.prototype.brush
  78975. * @description 笔触。
  78976. *
  78977. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  78978. * @param {boolean} isHighlight - 是否使用高亮属性。
  78979. *
  78980. */
  78981. }, {
  78982. key: "brush",
  78983. value: function brush(ctx, isHighlight) {
  78984. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  78985. this.refOriginalPosition = [0, 0];
  78986. }
  78987. var style = this.style;
  78988. if (isHighlight) {
  78989. // 根据style扩展默认高亮样式
  78990. style = this.getHighlightStyle(style, this.highlightStyle || {});
  78991. }
  78992. ctx.save();
  78993. this.setContext(ctx, style);
  78994. // 设置 transform
  78995. this.setTransform(ctx);
  78996. // 先 fill 再stroke
  78997. var hasPath = false;
  78998. if (style.brushType == 'fill' || style.brushType == 'both' || typeof style.brushType == 'undefined') {
  78999. // 默认为fill
  79000. ctx.beginPath();
  79001. if (style.lineType == 'dashed' || style.lineType == 'dotted' || style.lineType == 'dot' || style.lineType == 'dash' || style.lineType == 'dashdot' || style.lineType == 'longdash' || style.lineType == 'longdashdot') {
  79002. // 特殊处理,虚线围不成path,实线再build一次
  79003. this.buildPath(ctx, {
  79004. lineType: 'solid',
  79005. lineWidth: style.lineWidth,
  79006. pointList: style.pointList
  79007. });
  79008. } else {
  79009. this.buildPath(ctx, style);
  79010. hasPath = true; // 这个path能用
  79011. }
  79012. ctx.closePath();
  79013. this.setCtxGlobalAlpha(ctx, "fill", style);
  79014. ctx.fill();
  79015. this.setCtxGlobalAlpha(ctx, "reset", style);
  79016. }
  79017. if (style.lineWidth > 0 && (style.brushType == 'stroke' || style.brushType == 'both')) {
  79018. if (!hasPath) {
  79019. ctx.beginPath();
  79020. this.buildPath(ctx, style);
  79021. }
  79022. this.setCtxGlobalAlpha(ctx, "stroke", style);
  79023. ctx.stroke();
  79024. this.setCtxGlobalAlpha(ctx, "reset", style);
  79025. }
  79026. this.drawText(ctx, style, this.style);
  79027. //岛洞
  79028. var hpStyle = Util_Util.cloneObject(style);
  79029. if (hpStyle.pointList) {
  79030. if (this.holePolygonPointLists && this.holePolygonPointLists.length > 0) {
  79031. var holePLS = this.holePolygonPointLists;
  79032. var holePLSen = holePLS.length;
  79033. for (var i = 0; i < holePLSen; i++) {
  79034. var holePL = holePLS[i];
  79035. //岛洞面
  79036. hpStyle.pointList = holePL;
  79037. ctx.globalCompositeOperation = "destination-out";
  79038. // 先 fill 再stroke
  79039. hasPath = false;
  79040. if (hpStyle.brushType == 'fill' || hpStyle.brushType == 'both' || typeof hpStyle.brushType == 'undefined') {
  79041. // 默认为fill
  79042. ctx.beginPath();
  79043. if (hpStyle.lineType == 'dashed' || hpStyle.lineType == 'dotted' || hpStyle.lineType == 'dot' || hpStyle.lineType == 'dash' || hpStyle.lineType == 'dashdot' || hpStyle.lineType == 'longdash' || hpStyle.lineType == 'longdashdot') {
  79044. // 特殊处理,虚线围不成path,实线再build一次
  79045. this.buildPath(ctx, {
  79046. lineType: 'solid',
  79047. lineWidth: hpStyle.lineWidth,
  79048. pointList: hpStyle.pointList
  79049. });
  79050. } else {
  79051. this.buildPath(ctx, hpStyle);
  79052. hasPath = true; // 这个path能用
  79053. }
  79054. ctx.closePath();
  79055. this.setCtxGlobalAlpha(ctx, "fill", hpStyle);
  79056. ctx.fill();
  79057. this.setCtxGlobalAlpha(ctx, "reset", hpStyle);
  79058. }
  79059. if (hpStyle.lineWidth > 0 && (hpStyle.brushType == 'stroke' || hpStyle.brushType == 'both')) {
  79060. if (!hasPath) {
  79061. ctx.beginPath();
  79062. this.buildPath(ctx, hpStyle);
  79063. }
  79064. //如果描边,先回复 globalCompositeOperation 默认值再描边。
  79065. ctx.globalCompositeOperation = "source-over";
  79066. this.setCtxGlobalAlpha(ctx, "stroke", hpStyle);
  79067. ctx.stroke();
  79068. this.setCtxGlobalAlpha(ctx, "reset", hpStyle);
  79069. } else {
  79070. ctx.globalCompositeOperation = "source-over";
  79071. }
  79072. }
  79073. }
  79074. }
  79075. ctx.restore();
  79076. return;
  79077. }
  79078. /**
  79079. * @function LevelRenderer.Shape.SmicPolygon.prototype.buildPath
  79080. * @description 创建多边形路径。
  79081. *
  79082. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  79083. * @param {Object} style - style。
  79084. *
  79085. */
  79086. }, {
  79087. key: "buildPath",
  79088. value: function buildPath(ctx, style) {
  79089. if (style.showShadow) {
  79090. ctx.shadowBlur = style.shadowBlur;
  79091. ctx.shadowColor = style.shadowColor;
  79092. ctx.shadowOffsetX = style.shadowOffsetX;
  79093. ctx.shadowOffsetY = style.shadowOffsetY;
  79094. }
  79095. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  79096. this.refOriginalPosition = [0, 0];
  79097. }
  79098. var __OP = this.refOriginalPosition;
  79099. // 虽然能重用 brokenLine,但底层图形基于性能考虑,重复代码减少调用吧
  79100. var pointList = style.pointList;
  79101. if (pointList.length < 2) {
  79102. // 少于2个点就不画了~
  79103. return;
  79104. }
  79105. if (style.smooth && style.smooth !== 'spline') {
  79106. var controlPoints = SUtil_SUtil.SUtil_smoothBezier(pointList, style.smooth, true, style.smoothConstraint, __OP);
  79107. ctx.moveTo(pointList[0][0] + __OP[0], pointList[0][1] + __OP[1]);
  79108. var cp1;
  79109. var cp2;
  79110. var p;
  79111. var len = pointList.length;
  79112. for (var i = 0; i < len; i++) {
  79113. cp1 = controlPoints[i * 2];
  79114. cp2 = controlPoints[i * 2 + 1];
  79115. p = [pointList[(i + 1) % len][0] + __OP[0], pointList[(i + 1) % len][1] + __OP[1]];
  79116. ctx.bezierCurveTo(cp1[0], cp1[1], cp2[0], cp2[1], p[0], p[1]);
  79117. }
  79118. } else {
  79119. if (style.smooth === 'spline') {
  79120. pointList = SUtil_SUtil.SUtil_smoothSpline(pointList, true, null, __OP);
  79121. }
  79122. if (!style.lineType || style.lineType == 'solid') {
  79123. // 默认为实线
  79124. ctx.moveTo(pointList[0][0] + __OP[0], pointList[0][1] + __OP[1]);
  79125. for (var _i2 = 1; _i2 < pointList.length; _i2++) {
  79126. ctx.lineTo(pointList[_i2][0] + __OP[0], pointList[_i2][1] + __OP[1]);
  79127. }
  79128. ctx.lineTo(pointList[0][0] + __OP[0], pointList[0][1] + __OP[1]);
  79129. } else if (style.lineType === 'dashed' || style.lineType === 'dotted' || style.lineType === 'dot' || style.lineType === 'dash' || style.lineType === 'longdash') {
  79130. // SMIC-方法修改 - start
  79131. var dashLengthForStyle = style._dashLength || (style.lineWidth || 1) * (style.lineType == 'dashed' ? 5 : 1);
  79132. style._dashLength = dashLengthForStyle;
  79133. var dashLength = style.lineWidth || 1;
  79134. var pattern1 = dashLength;
  79135. var pattern2 = dashLength;
  79136. //dashed
  79137. if (style.lineType === 'dashed') {
  79138. pattern1 *= 5;
  79139. pattern2 *= 5;
  79140. if (style.lineCap && style.lineCap !== "butt") {
  79141. pattern1 -= dashLength;
  79142. pattern2 += dashLength;
  79143. }
  79144. }
  79145. //dotted
  79146. if (style.lineType === 'dotted') {
  79147. if (style.lineCap && style.lineCap !== "butt") {
  79148. pattern1 = 1;
  79149. pattern2 += dashLength;
  79150. }
  79151. }
  79152. //dot
  79153. if (style.lineType === 'dot') {
  79154. pattern2 *= 4;
  79155. if (style.lineCap && style.lineCap !== "butt") {
  79156. pattern1 = 1;
  79157. pattern2 += dashLength;
  79158. }
  79159. }
  79160. //dash
  79161. if (style.lineType === 'dash') {
  79162. pattern1 *= 4;
  79163. pattern2 *= 4;
  79164. if (style.lineCap && style.lineCap !== "butt") {
  79165. pattern1 -= dashLength;
  79166. pattern2 += dashLength;
  79167. }
  79168. }
  79169. //longdash
  79170. if (style.lineType === 'longdash') {
  79171. pattern1 *= 8;
  79172. pattern2 *= 4;
  79173. if (style.lineCap && style.lineCap !== "butt") {
  79174. pattern1 -= dashLength;
  79175. pattern2 += dashLength;
  79176. }
  79177. }
  79178. ctx.moveTo(pointList[0][0] + __OP[0], pointList[0][1] + __OP[1]);
  79179. for (var _i4 = 1; _i4 < pointList.length; _i4++) {
  79180. SUtil_SUtil.SUtil_dashedLineTo(ctx, pointList[_i4 - 1][0] + __OP[0], pointList[_i4 - 1][1] + __OP[1], pointList[_i4][0] + __OP[0], pointList[_i4][1] + __OP[1], dashLength, [pattern1, pattern2]);
  79181. }
  79182. SUtil_SUtil.SUtil_dashedLineTo(ctx, pointList[pointList.length - 1][0] + __OP[0], pointList[pointList.length - 1][1] + __OP[1], pointList[0][0] + __OP[0], pointList[0][1] + __OP[1], dashLength, [pattern1, pattern2]);
  79183. } else if (style.lineType === 'dashdot' || style.lineType === 'longdashdot') {
  79184. var _dashLengthForStyle = style._dashLength || (style.lineWidth || 1) * (style.lineType == 'dashed' ? 5 : 1);
  79185. style._dashLength = _dashLengthForStyle;
  79186. var _dashLength = style.lineWidth || 1;
  79187. var _pattern = _dashLength;
  79188. var _pattern2 = _dashLength;
  79189. var pattern3 = _dashLength;
  79190. var pattern4 = _dashLength;
  79191. //dashdot
  79192. if (style.lineType === 'dashdot') {
  79193. _pattern *= 4;
  79194. _pattern2 *= 4;
  79195. pattern4 *= 4;
  79196. if (style.lineCap && style.lineCap !== "butt") {
  79197. _pattern -= _dashLength;
  79198. _pattern2 += _dashLength;
  79199. pattern3 = 1;
  79200. pattern4 += _dashLength;
  79201. }
  79202. }
  79203. //longdashdot
  79204. if (style.lineType === 'longdashdot') {
  79205. _pattern *= 8;
  79206. _pattern2 *= 4;
  79207. pattern4 *= 4;
  79208. if (style.lineCap && style.lineCap !== "butt") {
  79209. _pattern -= _dashLength;
  79210. _pattern2 += _dashLength;
  79211. pattern3 = 1;
  79212. pattern4 += _dashLength;
  79213. }
  79214. }
  79215. ctx.moveTo(pointList[0][0] + __OP[0], pointList[0][1] + __OP[1]);
  79216. for (var _i6 = 1; _i6 < pointList.length; _i6++) {
  79217. SUtil_SUtil.SUtil_dashedLineTo(ctx, pointList[_i6 - 1][0] + __OP[0], pointList[_i6 - 1][1] + __OP[1], pointList[_i6][0] + __OP[0], pointList[_i6][1] + __OP[1], _dashLength, [_pattern, _pattern2, pattern3, pattern4]);
  79218. }
  79219. SUtil_SUtil.SUtil_dashedLineTo(ctx, pointList[pointList.length - 1][0] + __OP[0], pointList[pointList.length - 1][1] + __OP[1], pointList[0][0] + __OP[0], pointList[0][1] + __OP[1], _dashLength, [_pattern, _pattern2, pattern3, pattern4]);
  79220. }
  79221. }
  79222. return;
  79223. }
  79224. /**
  79225. * @function LevelRenderer.Shape.SmicPolygon.prototype.getRect
  79226. * @description 计算返回多边形包围盒矩阵。该包围盒是直接从四个控制点计算,并非最小包围盒。
  79227. *
  79228. * @param {Object} style - style
  79229. * @return {Object} 边框对象。包含属性:x,y,width,height。
  79230. *
  79231. */
  79232. }, {
  79233. key: "getRect",
  79234. value: function getRect(style, refOriginalPosition) {
  79235. var __OP;
  79236. if (!refOriginalPosition) {
  79237. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  79238. this.refOriginalPosition = [0, 0];
  79239. }
  79240. __OP = this.refOriginalPosition;
  79241. } else {
  79242. __OP = refOriginalPosition;
  79243. }
  79244. if (style.__rect) {
  79245. return style.__rect;
  79246. }
  79247. var minX = Number.MAX_VALUE;
  79248. var maxX = Number.MIN_VALUE;
  79249. var minY = Number.MAX_VALUE;
  79250. var maxY = Number.MIN_VALUE;
  79251. var pointList = style.pointList;
  79252. for (var i = 0, l = pointList.length; i < l; i++) {
  79253. if (pointList[i][0] + __OP[0] < minX) {
  79254. minX = pointList[i][0] + __OP[0];
  79255. }
  79256. if (pointList[i][0] + __OP[0] > maxX) {
  79257. maxX = pointList[i][0] + __OP[0];
  79258. }
  79259. if (pointList[i][1] + __OP[1] < minY) {
  79260. minY = pointList[i][1] + __OP[1];
  79261. }
  79262. if (pointList[i][1] + __OP[1] > maxY) {
  79263. maxY = pointList[i][1] + __OP[1];
  79264. }
  79265. }
  79266. var lineWidth;
  79267. if (style.brushType == 'stroke' || style.brushType == 'fill') {
  79268. lineWidth = style.lineWidth || 1;
  79269. } else {
  79270. lineWidth = 0;
  79271. }
  79272. style.__rect = {
  79273. x: Math.round(minX - lineWidth / 2),
  79274. y: Math.round(minY - lineWidth / 2),
  79275. width: maxX - minX + lineWidth,
  79276. height: maxY - minY + lineWidth
  79277. };
  79278. return style.__rect;
  79279. }
  79280. }]);
  79281. return SmicPolygon;
  79282. }(Shape_Shape);
  79283. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/SmicBrokenLine.js
  79284. function SmicBrokenLine_typeof(obj) { "@babel/helpers - typeof"; return SmicBrokenLine_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, SmicBrokenLine_typeof(obj); }
  79285. function SmicBrokenLine_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  79286. function SmicBrokenLine_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  79287. function SmicBrokenLine_createClass(Constructor, protoProps, staticProps) { if (protoProps) SmicBrokenLine_defineProperties(Constructor.prototype, protoProps); if (staticProps) SmicBrokenLine_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  79288. function SmicBrokenLine_get() { if (typeof Reflect !== "undefined" && Reflect.get) { SmicBrokenLine_get = Reflect.get.bind(); } else { SmicBrokenLine_get = function _get(target, property, receiver) { var base = SmicBrokenLine_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return SmicBrokenLine_get.apply(this, arguments); }
  79289. function SmicBrokenLine_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SmicBrokenLine_getPrototypeOf(object); if (object === null) break; } return object; }
  79290. function SmicBrokenLine_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) SmicBrokenLine_setPrototypeOf(subClass, superClass); }
  79291. function SmicBrokenLine_setPrototypeOf(o, p) { SmicBrokenLine_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SmicBrokenLine_setPrototypeOf(o, p); }
  79292. function SmicBrokenLine_createSuper(Derived) { var hasNativeReflectConstruct = SmicBrokenLine_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = SmicBrokenLine_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = SmicBrokenLine_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return SmicBrokenLine_possibleConstructorReturn(this, result); }; }
  79293. function SmicBrokenLine_possibleConstructorReturn(self, call) { if (call && (SmicBrokenLine_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return SmicBrokenLine_assertThisInitialized(self); }
  79294. function SmicBrokenLine_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  79295. function SmicBrokenLine_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  79296. function SmicBrokenLine_getPrototypeOf(o) { SmicBrokenLine_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SmicBrokenLine_getPrototypeOf(o); }
  79297. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  79298. * This program are made available under the terms of the Apache License, Version 2.0
  79299. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  79300. /**
  79301. * @private
  79302. * @class LevelRenderer.Shape.SmicBrokenLine
  79303. * @category Visualization Theme
  79304. * @classdesc 折线(ic)。
  79305. * @extends LevelRenderer.Shape
  79306. * @example
  79307. * var shape = new LevelRenderer.Shape.SmicBrokenLine({
  79308. * style: {
  79309. * pointList: [[0, 0], [100, 100], [100, 0]],
  79310. * smooth: 'bezier',
  79311. * strokeColor: 'purple'
  79312. * }
  79313. * });
  79314. * levelRenderer.addShape(shape);
  79315. * @param {Array} options - shape 的配置(options)项,可以是 shape 的自有属性,也可以是自定义的属性。
  79316. *
  79317. */
  79318. var SmicBrokenLine = /*#__PURE__*/function (_Shape) {
  79319. SmicBrokenLine_inherits(SmicBrokenLine, _Shape);
  79320. var _super = SmicBrokenLine_createSuper(SmicBrokenLine);
  79321. function SmicBrokenLine(options) {
  79322. var _this;
  79323. SmicBrokenLine_classCallCheck(this, SmicBrokenLine);
  79324. _this = _super.call(this, options);
  79325. /**
  79326. * @member {string} LevelRenderer.Shape.SmicBrokenLine.prototype.brushTypeOnly
  79327. * @description 线条只能描边。
  79328. */
  79329. _this.brushTypeOnly = 'stroke';
  79330. /**
  79331. * @member {string} LevelRenderer.Shape.SmicBrokenLine.prototype.textPosition
  79332. * @description 文本位置。
  79333. */
  79334. _this.textPosition = 'end';
  79335. /**
  79336. * @member {string} LevelRenderer.Shape.SmicBrokenLine.prototype.type
  79337. * @description 图形类型.
  79338. */
  79339. _this.type = 'smicbroken-line';
  79340. if (!_this.refOriginalPosition || _this.refOriginalPosition.length !== 2) {
  79341. _this.refOriginalPosition = [0, 0];
  79342. }
  79343. _this.CLASS_NAME = "SuperMap.LevelRenderer.Shape.SmicBrokenLine";
  79344. return _this;
  79345. }
  79346. /**
  79347. * @function LevelRenderer.Shape.SmicBrokenLine.prototype.destroy
  79348. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  79349. */
  79350. SmicBrokenLine_createClass(SmicBrokenLine, [{
  79351. key: "destroy",
  79352. value: function destroy() {
  79353. this.brushTypeOnly = null;
  79354. this.textPosition = null;
  79355. this.type = null;
  79356. SmicBrokenLine_get(SmicBrokenLine_getPrototypeOf(SmicBrokenLine.prototype), "destroy", this).call(this);
  79357. }
  79358. /**
  79359. * @function LevelRenderer.Shape.SmicBrokenLine.prototype.buildPath
  79360. * @description 创建折线路径。
  79361. *
  79362. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  79363. * @param {Object} style - style。
  79364. *
  79365. */
  79366. }, {
  79367. key: "buildPath",
  79368. value: function buildPath(ctx, style) {
  79369. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  79370. this.refOriginalPosition = [0, 0];
  79371. }
  79372. var __OP = this.refOriginalPosition;
  79373. var pointList = style.pointList;
  79374. if (pointList.length < 2) {
  79375. // 少于2个点就不画了~
  79376. return;
  79377. }
  79378. var len = Math.min(style.pointList.length, Math.round(style.pointListLength || style.pointList.length));
  79379. if (style.smooth && style.smooth !== 'spline') {
  79380. var controlPoints = SUtil_SUtil.SUtil_smoothBezier(pointList, style.smooth, false, style.smoothConstraint, __OP);
  79381. ctx.moveTo(pointList[0][0] + __OP[0], pointList[0][1] + __OP[1]);
  79382. var cp1;
  79383. var cp2;
  79384. var p;
  79385. for (var _i2 = 0; _i2 < len - 1; _i2++) {
  79386. cp1 = controlPoints[_i2 * 2];
  79387. cp2 = controlPoints[_i2 * 2 + 1];
  79388. p = [pointList[_i2 + 1][0] + __OP[0], pointList[_i2 + 1][1] + __OP[1]];
  79389. ctx.bezierCurveTo(cp1[0], cp1[1], cp2[0], cp2[1], p[0], p[1]);
  79390. }
  79391. } else {
  79392. if (style.smooth === 'spline') {
  79393. pointList = SUtil_SUtil.SUtil_smoothSpline(pointList, null, null, __OP);
  79394. len = pointList.length;
  79395. }
  79396. if (!style.lineType || style.lineType === 'solid') {
  79397. // 默认为实线
  79398. ctx.moveTo(pointList[0][0] + __OP[0], pointList[0][1] + __OP[1]);
  79399. for (var _i4 = 1; _i4 < len; _i4++) {
  79400. ctx.lineTo(pointList[_i4][0] + __OP[0], pointList[_i4][1] + __OP[1]);
  79401. }
  79402. } else if (style.lineType === 'dashed' || style.lineType === 'dotted' || style.lineType === 'dot' || style.lineType === 'dash' || style.lineType === 'longdash') {
  79403. var dashLength = style.lineWidth || 1;
  79404. var pattern1 = dashLength;
  79405. var pattern2 = dashLength;
  79406. //dashed
  79407. if (style.lineType === 'dashed') {
  79408. pattern1 *= 5;
  79409. pattern2 *= 5;
  79410. if (style.lineCap && style.lineCap !== "butt") {
  79411. pattern1 -= dashLength;
  79412. pattern2 += dashLength;
  79413. }
  79414. }
  79415. //dotted
  79416. if (style.lineType === 'dotted') {
  79417. if (style.lineCap && style.lineCap !== "butt") {
  79418. pattern1 = 1;
  79419. pattern2 += dashLength;
  79420. }
  79421. }
  79422. //dot
  79423. if (style.lineType === 'dot') {
  79424. pattern2 *= 4;
  79425. if (style.lineCap && style.lineCap !== "butt") {
  79426. pattern1 = 1;
  79427. pattern2 += dashLength;
  79428. }
  79429. }
  79430. //dash
  79431. if (style.lineType === 'dash') {
  79432. pattern1 *= 4;
  79433. pattern2 *= 4;
  79434. if (style.lineCap && style.lineCap !== "butt") {
  79435. pattern1 -= dashLength;
  79436. pattern2 += dashLength;
  79437. }
  79438. }
  79439. //longdash
  79440. if (style.lineType === 'longdash') {
  79441. pattern1 *= 8;
  79442. pattern2 *= 4;
  79443. if (style.lineCap && style.lineCap !== "butt") {
  79444. pattern1 -= dashLength;
  79445. pattern2 += dashLength;
  79446. }
  79447. }
  79448. ctx.moveTo(pointList[0][0] + __OP[0], pointList[0][1] + __OP[1]);
  79449. for (var i = 1; i < len; i++) {
  79450. SUtil_SUtil.SUtil_dashedLineTo(ctx, pointList[i - 1][0] + __OP[0], pointList[i - 1][1] + __OP[1], pointList[i][0] + __OP[0], pointList[i][1] + __OP[1], dashLength, [pattern1, pattern2]);
  79451. }
  79452. } else if (style.lineType === 'dashdot' || style.lineType === 'longdashdot') {
  79453. var _dashLength = style.lineWidth || 1;
  79454. var _pattern = _dashLength;
  79455. var _pattern2 = _dashLength;
  79456. var pattern3 = _dashLength;
  79457. var pattern4 = _dashLength;
  79458. //dashdot
  79459. if (style.lineType === 'dashdot') {
  79460. _pattern *= 4;
  79461. _pattern2 *= 4;
  79462. pattern4 *= 4;
  79463. if (style.lineCap && style.lineCap !== "butt") {
  79464. _pattern -= _dashLength;
  79465. _pattern2 += _dashLength;
  79466. pattern3 = 1;
  79467. pattern4 += _dashLength;
  79468. }
  79469. }
  79470. //longdashdot
  79471. if (style.lineType === 'longdashdot') {
  79472. _pattern *= 8;
  79473. _pattern2 *= 4;
  79474. pattern4 *= 4;
  79475. if (style.lineCap && style.lineCap !== "butt") {
  79476. _pattern -= _dashLength;
  79477. _pattern2 += _dashLength;
  79478. pattern3 = 1;
  79479. pattern4 += _dashLength;
  79480. }
  79481. }
  79482. _dashLength = (style.lineWidth || 1) * (style.lineType === 'dashed' ? 5 : 1);
  79483. ctx.moveTo(pointList[0][0] + __OP[0], pointList[0][1] + __OP[1]);
  79484. for (var _i6 = 1; _i6 < len; _i6++) {
  79485. SUtil_SUtil.SUtil_dashedLineTo(ctx, pointList[_i6 - 1][0] + __OP[0], pointList[_i6 - 1][1] + __OP[1], pointList[_i6][0] + __OP[0], pointList[_i6][1] + __OP[1], _dashLength, [_pattern, _pattern2, pattern3, pattern4]);
  79486. }
  79487. }
  79488. }
  79489. return;
  79490. }
  79491. /**
  79492. * @function LevelRenderer.Shape.SmicBrokenLine.prototype.getRect
  79493. * @description 计算返回折线包围盒矩形。该包围盒是直接从四个控制点计算,并非最小包围盒。
  79494. *
  79495. * @param {Object} style - style
  79496. * @return {Object} 边框对象。包含属性:x,y,width,height。
  79497. */
  79498. }, {
  79499. key: "getRect",
  79500. value: function getRect(style) {
  79501. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  79502. this.refOriginalPosition = [0, 0];
  79503. }
  79504. var __OP = this.refOriginalPosition;
  79505. return SmicPolygon.prototype.getRect.apply(this, [style, __OP]);
  79506. }
  79507. }]);
  79508. return SmicBrokenLine;
  79509. }(Shape_Shape);
  79510. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/SmicImage.js
  79511. function SmicImage_typeof(obj) { "@babel/helpers - typeof"; return SmicImage_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, SmicImage_typeof(obj); }
  79512. function SmicImage_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  79513. function SmicImage_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  79514. function SmicImage_createClass(Constructor, protoProps, staticProps) { if (protoProps) SmicImage_defineProperties(Constructor.prototype, protoProps); if (staticProps) SmicImage_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  79515. function SmicImage_get() { if (typeof Reflect !== "undefined" && Reflect.get) { SmicImage_get = Reflect.get.bind(); } else { SmicImage_get = function _get(target, property, receiver) { var base = SmicImage_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return SmicImage_get.apply(this, arguments); }
  79516. function SmicImage_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SmicImage_getPrototypeOf(object); if (object === null) break; } return object; }
  79517. function SmicImage_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) SmicImage_setPrototypeOf(subClass, superClass); }
  79518. function SmicImage_setPrototypeOf(o, p) { SmicImage_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SmicImage_setPrototypeOf(o, p); }
  79519. function SmicImage_createSuper(Derived) { var hasNativeReflectConstruct = SmicImage_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = SmicImage_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = SmicImage_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return SmicImage_possibleConstructorReturn(this, result); }; }
  79520. function SmicImage_possibleConstructorReturn(self, call) { if (call && (SmicImage_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return SmicImage_assertThisInitialized(self); }
  79521. function SmicImage_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  79522. function SmicImage_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  79523. function SmicImage_getPrototypeOf(o) { SmicImage_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SmicImage_getPrototypeOf(o); }
  79524. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  79525. * This program are made available under the terms of the Apache License, Version 2.0
  79526. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  79527. /**
  79528. * @private
  79529. * @class LevelRenderer.Shape.SmicImage
  79530. * @category Visualization Theme
  79531. * @classdesc 图片绘制。
  79532. * @extends LevelRenderer.Shape
  79533. * @example
  79534. * var shape = new LevelRenderer.Shape.SmicImage({
  79535. * style: {
  79536. * image: 'test.jpg',
  79537. * x: 100,
  79538. * y: 100
  79539. * }
  79540. * });
  79541. * levelRenderer.addShape(shape);
  79542. * @param {Array} options - shape 的配置(options)项,可以是 shape 的自有属性,也可以是自定义的属性。
  79543. *
  79544. */
  79545. var SmicImage = /*#__PURE__*/function (_Shape) {
  79546. SmicImage_inherits(SmicImage, _Shape);
  79547. var _super = SmicImage_createSuper(SmicImage);
  79548. function SmicImage(options) {
  79549. var _this;
  79550. SmicImage_classCallCheck(this, SmicImage);
  79551. _this = _super.call(this, options);
  79552. /**
  79553. * @member {string} LevelRenderer.Shape.SmicImage.prototype.type
  79554. * @description 图形类型。
  79555. */
  79556. _this.type = 'smicimage';
  79557. /**
  79558. * @member {string} LevelRenderer.Shape.SmicImage.prototype._imageCache
  79559. * @description 图片缓存。
  79560. */
  79561. _this._imageCache = {};
  79562. if (!_this.refOriginalPosition || _this.refOriginalPosition.length !== 2) {
  79563. _this.refOriginalPosition = [0, 0];
  79564. }
  79565. _this.CLASS_NAME = "SuperMap.LevelRenderer.Shape.SmicImage";
  79566. return _this;
  79567. }
  79568. /**
  79569. * @function LevelRenderer.Shape.SmicImage.prototype.destroy
  79570. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  79571. */
  79572. SmicImage_createClass(SmicImage, [{
  79573. key: "destroy",
  79574. value: function destroy() {
  79575. this.type = null;
  79576. this._imageCache = null;
  79577. SmicImage_get(SmicImage_getPrototypeOf(SmicImage.prototype), "destroy", this).call(this);
  79578. }
  79579. /**
  79580. * @function LevelRenderer.Shape.SmicImage.prototype.buildPath
  79581. * @description 创建图片。
  79582. *
  79583. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  79584. * @param {Object} style - style。
  79585. *
  79586. */
  79587. }, {
  79588. key: "brush",
  79589. value: function brush(ctx, isHighlight, refresh) {
  79590. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  79591. this.refOriginalPosition = [0, 0];
  79592. }
  79593. var __OP = this.refOriginalPosition;
  79594. var style = this.style || {};
  79595. if (isHighlight) {
  79596. // 根据style扩展默认高亮样式
  79597. style = this.getHighlightStyle(style, this.highlightStyle || {});
  79598. }
  79599. var image = style.image;
  79600. var me = this;
  79601. if (typeof image === 'string') {
  79602. var src = image;
  79603. if (this._imageCache[src]) {
  79604. image = this._imageCache[src];
  79605. } else {
  79606. image = new Image();
  79607. image.onload = function () {
  79608. image.onload = null;
  79609. clearTimeout(SmicImage._refreshTimeout);
  79610. SmicImage._needsRefresh.push(me);
  79611. // 防止因为缓存短时间内触发多次onload事件
  79612. SmicImage._refreshTimeout = setTimeout(function () {
  79613. refresh && refresh(SmicImage._needsRefresh);
  79614. // 清空 needsRefresh
  79615. SmicImage._needsRefresh = [];
  79616. }, 10);
  79617. };
  79618. image.src = src;
  79619. this._imageCache[src] = image;
  79620. }
  79621. }
  79622. if (image) {
  79623. // 图片已经加载完成
  79624. if (image.nodeName.toUpperCase() == 'IMG') {
  79625. if (window.ActiveXObject) {
  79626. if (image.readyState != 'complete') {
  79627. return;
  79628. }
  79629. } else {
  79630. if (!image.complete) {
  79631. return;
  79632. }
  79633. }
  79634. }
  79635. // Else is canvas
  79636. var width = style.width || image.width;
  79637. var height = style.height || image.height;
  79638. var x = style.x + __OP[0];
  79639. var y = style.y + __OP[1];
  79640. // 图片加载失败
  79641. if (!image.width || !image.height) {
  79642. return;
  79643. }
  79644. ctx.save();
  79645. this.doClip(ctx);
  79646. this.setContext(ctx, style);
  79647. // 设置transform
  79648. this.setTransform(ctx);
  79649. if (style.sWidth && style.sHeight) {
  79650. var sx = style.sx + __OP[0] || 0;
  79651. var sy = style.sy + __OP[1] || 0;
  79652. ctx.drawImage(image, sx, sy, style.sWidth, style.sHeight, x, y, width, height);
  79653. } else if (style.sx && style.sy) {
  79654. var _sx = style.sx + __OP[0];
  79655. var _sy = style.sy + __OP[1];
  79656. var sWidth = width - _sx;
  79657. var sHeight = height - _sy;
  79658. ctx.drawImage(image, _sx, _sy, sWidth, sHeight, x, y, width, height);
  79659. } else {
  79660. ctx.drawImage(image, x, y, width, height);
  79661. }
  79662. // 如果没设置宽和高的话自动根据图片宽高设置
  79663. if (!style.width) {
  79664. style.width = width;
  79665. }
  79666. if (!style.height) {
  79667. style.height = height;
  79668. }
  79669. if (!this.style.width) {
  79670. this.style.width = width;
  79671. }
  79672. if (!this.style.height) {
  79673. this.style.height = height;
  79674. }
  79675. this.drawText(ctx, style, this.style);
  79676. ctx.restore();
  79677. }
  79678. }
  79679. /**
  79680. * @function LevelRenderer.Shape.SmicImage.prototype.getRect
  79681. * @description 计算返回图片的包围盒矩形。
  79682. *
  79683. * @param {Object} style - style
  79684. * @return {Object} 边框对象。包含属性:x,y,width,height。
  79685. */
  79686. }, {
  79687. key: "getRect",
  79688. value: function getRect(style) {
  79689. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  79690. this.refOriginalPosition = [0, 0];
  79691. }
  79692. var __OP = this.refOriginalPosition;
  79693. return {
  79694. x: style.x + __OP[0],
  79695. y: style.y + __OP[1],
  79696. width: style.width,
  79697. height: style.height
  79698. };
  79699. }
  79700. /**
  79701. * @function LevelRenderer.Shape.SmicImage.prototype.clearCache
  79702. * @description 清除图片缓存。
  79703. *
  79704. * @param {Object} style - style
  79705. * @return {Object} 边框对象。包含属性:x,y,width,height。
  79706. *
  79707. */
  79708. }, {
  79709. key: "clearCache",
  79710. value: function clearCache() {
  79711. this._imageCache = {};
  79712. }
  79713. }]);
  79714. return SmicImage;
  79715. }(Shape_Shape);
  79716. SmicImage._needsRefresh = [];
  79717. SmicImage._refreshTimeout = null;
  79718. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/SmicRectangle.js
  79719. function SmicRectangle_typeof(obj) { "@babel/helpers - typeof"; return SmicRectangle_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, SmicRectangle_typeof(obj); }
  79720. function SmicRectangle_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  79721. function SmicRectangle_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  79722. function SmicRectangle_createClass(Constructor, protoProps, staticProps) { if (protoProps) SmicRectangle_defineProperties(Constructor.prototype, protoProps); if (staticProps) SmicRectangle_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  79723. function SmicRectangle_get() { if (typeof Reflect !== "undefined" && Reflect.get) { SmicRectangle_get = Reflect.get.bind(); } else { SmicRectangle_get = function _get(target, property, receiver) { var base = SmicRectangle_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return SmicRectangle_get.apply(this, arguments); }
  79724. function SmicRectangle_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SmicRectangle_getPrototypeOf(object); if (object === null) break; } return object; }
  79725. function SmicRectangle_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) SmicRectangle_setPrototypeOf(subClass, superClass); }
  79726. function SmicRectangle_setPrototypeOf(o, p) { SmicRectangle_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SmicRectangle_setPrototypeOf(o, p); }
  79727. function SmicRectangle_createSuper(Derived) { var hasNativeReflectConstruct = SmicRectangle_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = SmicRectangle_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = SmicRectangle_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return SmicRectangle_possibleConstructorReturn(this, result); }; }
  79728. function SmicRectangle_possibleConstructorReturn(self, call) { if (call && (SmicRectangle_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return SmicRectangle_assertThisInitialized(self); }
  79729. function SmicRectangle_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  79730. function SmicRectangle_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  79731. function SmicRectangle_getPrototypeOf(o) { SmicRectangle_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SmicRectangle_getPrototypeOf(o); }
  79732. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  79733. * This program are made available under the terms of the Apache License, Version 2.0
  79734. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  79735. /**
  79736. * @private
  79737. * @class LevelRenderer.Shape.SmicRectangle
  79738. * @category Visualization Theme
  79739. * @classdesc 矩形。
  79740. * @extends LevelRenderer.Shape
  79741. * @example
  79742. * var shape = new LevelRenderer.Shape.SmicRectangle({
  79743. * style: {
  79744. * x: 0,
  79745. * y: 0,
  79746. * width: 100,
  79747. * height: 100,
  79748. * radius: 20
  79749. * }
  79750. * });
  79751. * levelRenderer.addShape(shape);
  79752. * @param {Array} options - shape 的配置(options)项,可以是 shape 的自有属性,也可以是自定义的属性。
  79753. */
  79754. var SmicRectangle = /*#__PURE__*/function (_Shape) {
  79755. SmicRectangle_inherits(SmicRectangle, _Shape);
  79756. var _super = SmicRectangle_createSuper(SmicRectangle);
  79757. function SmicRectangle(options) {
  79758. var _this;
  79759. SmicRectangle_classCallCheck(this, SmicRectangle);
  79760. _this = _super.call(this, options);
  79761. /**
  79762. * @member {string} LevelRenderer.Shape.SmicRectangle.prototype.type
  79763. * @description 图形类型.
  79764. */
  79765. _this.type = 'smicrectangle';
  79766. if (!_this.refOriginalPosition || _this.refOriginalPosition.length !== 2) {
  79767. _this.refOriginalPosition = [0, 0];
  79768. }
  79769. _this.CLASS_NAME = "SuperMap.LevelRenderer.Shape.SmicRectangle";
  79770. return _this;
  79771. }
  79772. /**
  79773. * @function LevelRenderer.Shape.SmicRectangle.prototype.destroy
  79774. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  79775. */
  79776. SmicRectangle_createClass(SmicRectangle, [{
  79777. key: "destroy",
  79778. value: function destroy() {
  79779. this.type = null;
  79780. SmicRectangle_get(SmicRectangle_getPrototypeOf(SmicRectangle.prototype), "destroy", this).call(this);
  79781. }
  79782. /**
  79783. * APIMethod: _buildRadiusPath
  79784. * 创建矩形的圆角路径。
  79785. *
  79786. * Parameters:
  79787. * ctx - {CanvasRenderingContext2D} Context2D 上下文。
  79788. * style - {Object} style。
  79789. *
  79790. */
  79791. }, {
  79792. key: "_buildRadiusPath",
  79793. value: function _buildRadiusPath(ctx, style) {
  79794. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  79795. this.refOriginalPosition = [0, 0];
  79796. }
  79797. var __OP = this.refOriginalPosition;
  79798. // 左上、右上、右下、左下角的半径依次为r1、r2、r3、r4
  79799. // r缩写为1 相当于 [1, 1, 1, 1]
  79800. // r缩写为[1] 相当于 [1, 1, 1, 1]
  79801. // r缩写为[1, 2] 相当于 [1, 2, 1, 2]
  79802. // r缩写为[1, 2, 3] 相当于 [1, 2, 3, 2]
  79803. var x = style.x + __OP[0];
  79804. var y = style.y + __OP[1];
  79805. var width = style.width;
  79806. var height = style.height;
  79807. var r = style.radius;
  79808. var r1;
  79809. var r2;
  79810. var r3;
  79811. var r4;
  79812. if (typeof r === 'number') {
  79813. r1 = r2 = r3 = r4 = r;
  79814. } else if (r instanceof Array) {
  79815. if (r.length === 1) {
  79816. r1 = r2 = r3 = r4 = r[0];
  79817. } else if (r.length === 2) {
  79818. r1 = r3 = r[0];
  79819. r2 = r4 = r[1];
  79820. } else if (r.length === 3) {
  79821. r1 = r[0];
  79822. r2 = r4 = r[1];
  79823. r3 = r[2];
  79824. } else {
  79825. r1 = r[0];
  79826. r2 = r[1];
  79827. r3 = r[2];
  79828. r4 = r[3];
  79829. }
  79830. } else {
  79831. r1 = r2 = r3 = r4 = 0;
  79832. }
  79833. var total;
  79834. if (r1 + r2 > width) {
  79835. total = r1 + r2;
  79836. r1 *= width / total;
  79837. r2 *= width / total;
  79838. }
  79839. if (r3 + r4 > width) {
  79840. total = r3 + r4;
  79841. r3 *= width / total;
  79842. r4 *= width / total;
  79843. }
  79844. if (r2 + r3 > height) {
  79845. total = r2 + r3;
  79846. r2 *= height / total;
  79847. r3 *= height / total;
  79848. }
  79849. if (r1 + r4 > height) {
  79850. total = r1 + r4;
  79851. r1 *= height / total;
  79852. r4 *= height / total;
  79853. }
  79854. ctx.moveTo(x + r1, y);
  79855. ctx.lineTo(x + width - r2, y);
  79856. r2 !== 0 && ctx.quadraticCurveTo(x + width, y, x + width, y + r2);
  79857. ctx.lineTo(x + width, y + height - r3);
  79858. r3 !== 0 && ctx.quadraticCurveTo(x + width, y + height, x + width - r3, y + height);
  79859. ctx.lineTo(x + r4, y + height);
  79860. r4 !== 0 && ctx.quadraticCurveTo(x, y + height, x, y + height - r4);
  79861. ctx.lineTo(x, y + r1);
  79862. r1 !== 0 && ctx.quadraticCurveTo(x, y, x + r1, y);
  79863. }
  79864. /**
  79865. * @function LevelRenderer.Shape.SmicRectangle.prototype.buildPath
  79866. * @description 创建矩形路径。
  79867. *
  79868. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  79869. * @param {Object} style - style。
  79870. *
  79871. */
  79872. }, {
  79873. key: "buildPath",
  79874. value: function buildPath(ctx, style) {
  79875. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  79876. this.refOriginalPosition = [0, 0];
  79877. }
  79878. var __OP = this.refOriginalPosition;
  79879. if (!style.radius) {
  79880. ctx.moveTo(style.x + __OP[0], style.y + __OP[1]);
  79881. ctx.lineTo(style.x + __OP[0] + style.width, style.y + __OP[1]);
  79882. ctx.lineTo(style.x + __OP[0] + style.width, style.y + __OP[1] + style.height);
  79883. ctx.lineTo(style.x + __OP[0], style.y + __OP[1] + style.height);
  79884. ctx.lineTo(style.x + __OP[0], style.y + __OP[1]);
  79885. // ctx.rect(style.x, style.y, style.width, style.height);
  79886. } else {
  79887. this._buildRadiusPath(ctx, style);
  79888. }
  79889. ctx.closePath();
  79890. return;
  79891. }
  79892. /**
  79893. * @function LevelRenderer.Shape.SmicRectangle.prototype.getRect
  79894. * @description 计算返回矩形包围盒矩阵。该包围盒是直接从四个控制点计算,并非最小包围盒。
  79895. *
  79896. * @param {Object} style - style
  79897. * @return {Object} 边框对象。包含属性:x,y,width,height。
  79898. */
  79899. }, {
  79900. key: "getRect",
  79901. value: function getRect(style) {
  79902. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  79903. this.refOriginalPosition = [0, 0];
  79904. }
  79905. var __OP = this.refOriginalPosition;
  79906. if (style.__rect) {
  79907. return style.__rect;
  79908. }
  79909. var lineWidth;
  79910. if (style.brushType == 'stroke' || style.brushType == 'fill') {
  79911. lineWidth = style.lineWidth || 1;
  79912. } else {
  79913. lineWidth = 0;
  79914. }
  79915. style.__rect = {
  79916. x: Math.round(style.x + __OP[0] - lineWidth / 2),
  79917. y: Math.round(style.y + __OP[1] - lineWidth / 2),
  79918. width: style.width + lineWidth,
  79919. height: style.height + lineWidth
  79920. };
  79921. return style.__rect;
  79922. }
  79923. }]);
  79924. return SmicRectangle;
  79925. }(Shape_Shape);
  79926. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/SmicSector.js
  79927. function SmicSector_typeof(obj) { "@babel/helpers - typeof"; return SmicSector_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, SmicSector_typeof(obj); }
  79928. function SmicSector_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  79929. function SmicSector_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  79930. function SmicSector_createClass(Constructor, protoProps, staticProps) { if (protoProps) SmicSector_defineProperties(Constructor.prototype, protoProps); if (staticProps) SmicSector_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  79931. function SmicSector_get() { if (typeof Reflect !== "undefined" && Reflect.get) { SmicSector_get = Reflect.get.bind(); } else { SmicSector_get = function _get(target, property, receiver) { var base = SmicSector_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return SmicSector_get.apply(this, arguments); }
  79932. function SmicSector_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SmicSector_getPrototypeOf(object); if (object === null) break; } return object; }
  79933. function SmicSector_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) SmicSector_setPrototypeOf(subClass, superClass); }
  79934. function SmicSector_setPrototypeOf(o, p) { SmicSector_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SmicSector_setPrototypeOf(o, p); }
  79935. function SmicSector_createSuper(Derived) { var hasNativeReflectConstruct = SmicSector_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = SmicSector_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = SmicSector_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return SmicSector_possibleConstructorReturn(this, result); }; }
  79936. function SmicSector_possibleConstructorReturn(self, call) { if (call && (SmicSector_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return SmicSector_assertThisInitialized(self); }
  79937. function SmicSector_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  79938. function SmicSector_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  79939. function SmicSector_getPrototypeOf(o) { SmicSector_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SmicSector_getPrototypeOf(o); }
  79940. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  79941. * This program are made available under the terms of the Apache License, Version 2.0
  79942. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  79943. /**
  79944. * @private
  79945. * @class LevelRenderer.Shape.SmicSector
  79946. * @category Visualization Theme
  79947. * @classdesc 扇形。
  79948. * @extends LevelRenderer.Shape
  79949. * @example
  79950. * var shape = new LevelRenderer.Shape.SmicSector({
  79951. * style: {
  79952. * x: 100,
  79953. * y: 100,
  79954. * r: 60,
  79955. * r0: 30,
  79956. * startAngle: 0,
  79957. * endEngle: 180
  79958. * }
  79959. * });
  79960. * levelRenderer.addShape(shape);
  79961. * @param {Array} options - shape 的配置(options)项,可以是 shape 的自有属性,也可以是自定义的属性。
  79962. *
  79963. */
  79964. var SmicSector = /*#__PURE__*/function (_Shape) {
  79965. SmicSector_inherits(SmicSector, _Shape);
  79966. var _super = SmicSector_createSuper(SmicSector);
  79967. function SmicSector(options) {
  79968. var _this;
  79969. SmicSector_classCallCheck(this, SmicSector);
  79970. _this = _super.call(this, options);
  79971. /**
  79972. * @member {string} LevelRenderer.Shape.SmicSector.protptype.type
  79973. * @description 图形类型。
  79974. */
  79975. _this.type = 'smicsector';
  79976. if (!_this.refOriginalPosition || _this.refOriginalPosition.length !== 2) {
  79977. _this.refOriginalPosition = [0, 0];
  79978. }
  79979. _this.CLASS_NAME = "SuperMap.LevelRenderer.Shape.SmicSector";
  79980. return _this;
  79981. }
  79982. /**
  79983. * @function LevelRenderer.Shape.SmicSector.prototype.destroy
  79984. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  79985. */
  79986. SmicSector_createClass(SmicSector, [{
  79987. key: "destroy",
  79988. value: function destroy() {
  79989. this.type = null;
  79990. SmicSector_get(SmicSector_getPrototypeOf(SmicSector.prototype), "destroy", this).call(this);
  79991. }
  79992. /**
  79993. * @function LevelRenderer.Shape.SmicSector.prototype.buildPath
  79994. * @description 创建扇形路径。
  79995. *
  79996. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  79997. * @param {Object} style - style。
  79998. *
  79999. */
  80000. }, {
  80001. key: "buildPath",
  80002. value: function buildPath(ctx, style) {
  80003. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  80004. this.refOriginalPosition = [0, 0];
  80005. }
  80006. var __OP = this.refOriginalPosition;
  80007. var x = style.x + __OP[0]; // 圆心x
  80008. var y = style.y + __OP[1]; // 圆心y
  80009. var r0 = style.r0 || 0; // 形内半径[0,r)
  80010. var r = style.r; // 扇形外半径(0,r]
  80011. var startAngle = style.startAngle; // 起始角度[0,360)
  80012. var endAngle = style.endAngle; // 结束角度(0,360]
  80013. var clockWise = style.clockWise || false;
  80014. startAngle = SUtil_SUtil.Util_math.degreeToRadian(startAngle);
  80015. endAngle = SUtil_SUtil.Util_math.degreeToRadian(endAngle);
  80016. if (!clockWise) {
  80017. // 扇形默认是逆时针方向,Y轴向上
  80018. // 这个跟arc的标准不一样,为了兼容echarts
  80019. startAngle = -startAngle;
  80020. endAngle = -endAngle;
  80021. }
  80022. var unitX = SUtil_SUtil.Util_math.cos(startAngle);
  80023. var unitY = SUtil_SUtil.Util_math.sin(startAngle);
  80024. ctx.moveTo(unitX * r0 + x, unitY * r0 + y);
  80025. ctx.lineTo(unitX * r + x, unitY * r + y);
  80026. ctx.arc(x, y, r, startAngle, endAngle, !clockWise);
  80027. ctx.lineTo(SUtil_SUtil.Util_math.cos(endAngle) * r0 + x, SUtil_SUtil.Util_math.sin(endAngle) * r0 + y);
  80028. if (r0 !== 0) {
  80029. ctx.arc(x, y, r0, endAngle, startAngle, clockWise);
  80030. }
  80031. ctx.closePath();
  80032. return;
  80033. }
  80034. /**
  80035. * @function LevelRenderer.Shape.SmicSector.prototype.getRect
  80036. * @description 返回扇形包围盒矩形
  80037. *
  80038. * @param {Object} style - style
  80039. * @return {Object} 边框对象。包含属性:x,y,width,height。
  80040. *
  80041. */
  80042. }, {
  80043. key: "getRect",
  80044. value: function getRect(style) {
  80045. if (style.__rect) {
  80046. return style.__rect;
  80047. }
  80048. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  80049. this.refOriginalPosition = [0, 0];
  80050. }
  80051. var __OP = this.refOriginalPosition;
  80052. var min0 = SUtil_SUtil.Util_vector.create();
  80053. var min1 = SUtil_SUtil.Util_vector.create();
  80054. var max0 = SUtil_SUtil.Util_vector.create();
  80055. var max1 = SUtil_SUtil.Util_vector.create();
  80056. var x = style.x + __OP[0]; // 圆心x
  80057. var y = style.y + __OP[1]; // 圆心y
  80058. var r0 = style.r0 || 0; // 形内半径[0,r)
  80059. var r = style.r; // 扇形外半径(0,r]
  80060. var startAngle = SUtil_SUtil.Util_math.degreeToRadian(style.startAngle);
  80061. var endAngle = SUtil_SUtil.Util_math.degreeToRadian(style.endAngle);
  80062. var clockWise = style.clockWise;
  80063. if (!clockWise) {
  80064. startAngle = -startAngle;
  80065. endAngle = -endAngle;
  80066. }
  80067. if (r0 > 1) {
  80068. SUtil_SUtil.Util_computeBoundingBox.arc(x, y, r0, startAngle, endAngle, !clockWise, min0, max0);
  80069. } else {
  80070. min0[0] = max0[0] = x;
  80071. min0[1] = max0[1] = y;
  80072. }
  80073. SUtil_SUtil.Util_computeBoundingBox.arc(x, y, r, startAngle, endAngle, !clockWise, min1, max1);
  80074. SUtil_SUtil.Util_vector.min(min0, min0, min1);
  80075. SUtil_SUtil.Util_vector.max(max0, max0, max1);
  80076. style.__rect = {
  80077. x: min0[0],
  80078. y: min0[1],
  80079. width: max0[0] - min0[0],
  80080. height: max0[1] - min0[1]
  80081. };
  80082. return style.__rect;
  80083. }
  80084. }]);
  80085. return SmicSector;
  80086. }(Shape_Shape);
  80087. ;// CONCATENATED MODULE: ./src/common/overlay/feature/ShapeFactory.js
  80088. function ShapeFactory_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  80089. function ShapeFactory_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  80090. function ShapeFactory_createClass(Constructor, protoProps, staticProps) { if (protoProps) ShapeFactory_defineProperties(Constructor.prototype, protoProps); if (staticProps) ShapeFactory_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  80091. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  80092. * This program are made available under the terms of the Apache License, Version 2.0
  80093. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  80094. /**
  80095. * @class FeatureShapeFactory
  80096. * @aliasclass Feature.ShapeFactory
  80097. * @deprecatedclass SuperMap.Feature.ShapeFactory
  80098. * @category Visualization Theme
  80099. * @classdesc 图形工厂类。
  80100. * 目前支持创建的图形有:<br>
  80101. * 用于统计专题图:<br>
  80102. * 点 - 参数对象 <{@link ShapeParametersPoint}> <br>
  80103. * 线 - 参数对象 <{@link ShapeParametersLine}> <br>
  80104. * 面 - 参数对象 <{@link ShapeParametersPolygon}> <br>
  80105. * 矩形 - 参数对象 <{@link ShapeParametersPolygon}> <br>
  80106. * 扇形 - 参数对象 <{@link ShapeParametersSector}> <br>
  80107. * 标签 - 参数对象 <{@link ShapeParametersLabel}> <br>
  80108. * 图片 - 参数对象 <{@link ShapeParametersImage}> <br>
  80109. * 用于符号专题图:<br>
  80110. * 圆形 - 参数对象:<{@link ShapeParametersCircle}>
  80111. * @param {Object} [shapeParameters] - 图形参数对象,<{@link ShapeParameters}> 子类对象。
  80112. * @usage
  80113. */
  80114. var ShapeFactory = /*#__PURE__*/function () {
  80115. function ShapeFactory(shapeParameters) {
  80116. ShapeFactory_classCallCheck(this, ShapeFactory);
  80117. /**
  80118. * @member {Object} FeatureShapeFactory.prototype.shapeParameters
  80119. * @description 图形参数对象,<{@link ShapeParameters}> 子类对象。必设参数,默认值 null。
  80120. */
  80121. this.shapeParameters = shapeParameters;
  80122. this.CLASS_NAME = "SuperMap.Feature.ShapeFactory";
  80123. }
  80124. /**
  80125. * @function FeatureShapeFactory.prototype.destroy
  80126. * @description 销毁图形工厂类对象。
  80127. */
  80128. ShapeFactory_createClass(ShapeFactory, [{
  80129. key: "destroy",
  80130. value: function destroy() {
  80131. this.shapeParameters = null;
  80132. }
  80133. /**
  80134. * @function FeatureShapeFactory.prototype.createShape
  80135. * @description 创建一个图形。具体图形由 shapeParameters 决定。
  80136. * @param {Object} shapeParameters - 图形参数对象,<{@link ShapeParameters}> 子类对象。
  80137. * 此参数可选,如果使用此参数(不为 null),shapeParameters 属性值将被修改为参数的值,然后再使用 shapeParameters 属性值创建图形;
  80138. * 如果不使用此参数,createShape 方法将直接使用 shapeParameters 属性创建图形。
  80139. * @returns {Object} 图形对象(或 null - 图形创建失败)。
  80140. */
  80141. }, {
  80142. key: "createShape",
  80143. value: function createShape(shapeParameters) {
  80144. if (shapeParameters) {
  80145. this.shapeParameters = shapeParameters;
  80146. }
  80147. if (!this.shapeParameters) {
  80148. return null;
  80149. }
  80150. var sps = this.shapeParameters;
  80151. if (sps instanceof Point_Point) {
  80152. // 点
  80153. //设置style
  80154. var style = new Object();
  80155. style["x"] = sps.x;
  80156. style["y"] = sps.y;
  80157. style["r"] = sps.r;
  80158. style = Util_Util.copyAttributesWithClip(style, sps.style, ['x', 'y']);
  80159. //创建图形
  80160. var shape = new SmicPoint();
  80161. shape.style = ShapeFactory.transformStyle(style);
  80162. shape.highlightStyle = ShapeFactory.transformStyle(sps.highlightStyle);
  80163. Util_Util.copyAttributesWithClip(shape, sps, ['x', 'y', 'style', 'highlightStyle']);
  80164. return shape;
  80165. } else if (sps instanceof Line_Line) {
  80166. // 线
  80167. //检查参数 pointList 是否存在
  80168. if (!sps.pointList) {
  80169. return null;
  80170. }
  80171. // 设置style
  80172. var _style = new Object();
  80173. _style["pointList"] = sps.pointList;
  80174. _style = Util_Util.copyAttributesWithClip(_style, sps.style, ['pointList']);
  80175. // 创建图形
  80176. var _shape = new SmicBrokenLine();
  80177. _shape.style = ShapeFactory.transformStyle(_style);
  80178. _shape.highlightStyle = ShapeFactory.transformStyle(sps.highlightStyle);
  80179. Util_Util.copyAttributesWithClip(_shape, sps, ['pointList', 'style', 'highlightStyle']);
  80180. return _shape;
  80181. } else if (sps instanceof feature_Polygon_Polygon) {
  80182. // 面
  80183. //检查参数 pointList 是否存在
  80184. if (!sps.pointList) {
  80185. return null;
  80186. }
  80187. //设置style
  80188. var _style2 = new Object();
  80189. _style2["pointList"] = sps.pointList;
  80190. _style2 = Util_Util.copyAttributesWithClip(_style2, sps.style, ['pointList']);
  80191. //创建图形
  80192. var _shape2 = new SmicPolygon();
  80193. _shape2.style = ShapeFactory.transformStyle(_style2);
  80194. _shape2.highlightStyle = ShapeFactory.transformStyle(sps.highlightStyle);
  80195. Util_Util.copyAttributesWithClip(_shape2, sps, ['pointList', 'style', "highlightStyle"]);
  80196. return _shape2;
  80197. } else if (sps instanceof Rectangle_Rectangle) {
  80198. // 矩形
  80199. //检查参数 pointList 是否存在
  80200. if (!sps.x && !sps.y & !sps.width & !sps.height) {
  80201. return null;
  80202. }
  80203. //设置style
  80204. var _style3 = new Object();
  80205. _style3["x"] = sps.x;
  80206. _style3["y"] = sps.y;
  80207. _style3["width"] = sps.width;
  80208. _style3["height"] = sps.height;
  80209. _style3 = Util_Util.copyAttributesWithClip(_style3, sps.style, ['x', 'y', 'width', 'height']);
  80210. //创建图形
  80211. var _shape3 = new SmicRectangle();
  80212. _shape3.style = ShapeFactory.transformStyle(_style3);
  80213. _shape3.highlightStyle = ShapeFactory.transformStyle(sps.highlightStyle);
  80214. Util_Util.copyAttributesWithClip(_shape3, sps, ['x', 'y', 'width', 'height', 'style', 'highlightStyle']);
  80215. return _shape3;
  80216. } else if (sps instanceof Sector) {
  80217. // 扇形
  80218. //设置style
  80219. var _style4 = new Object();
  80220. _style4["x"] = sps.x;
  80221. _style4["y"] = sps.y;
  80222. _style4["r"] = sps.r;
  80223. _style4["startAngle"] = sps.startAngle;
  80224. _style4["endAngle"] = sps.endAngle;
  80225. if (sps["r0"]) {
  80226. _style4["r0"] = sps.r0;
  80227. }
  80228. if (sps["clockWise"]) {
  80229. _style4["clockWise"] = sps.clockWise;
  80230. }
  80231. _style4 = Util_Util.copyAttributesWithClip(_style4, sps.style, ['x', 'y', 'r', 'startAngle', 'endAngle', 'r0', 'endAngle']);
  80232. //创建图形
  80233. var _shape4 = new SmicSector();
  80234. _shape4.style = ShapeFactory.transformStyle(_style4);
  80235. _shape4.highlightStyle = ShapeFactory.transformStyle(sps.highlightStyle);
  80236. Util_Util.copyAttributesWithClip(_shape4, sps, ['x', 'y', 'r', 'startAngle', 'endAngle', 'r0', 'endAngle', 'style', 'highlightStyle']);
  80237. return _shape4;
  80238. } else if (sps instanceof Label) {
  80239. // 标签
  80240. //设置style
  80241. var _style5 = new Object();
  80242. _style5["x"] = sps.x;
  80243. _style5["y"] = sps.y;
  80244. _style5["text"] = sps.text;
  80245. _style5 = Util_Util.copyAttributesWithClip(_style5, sps.style, ['x', 'y', 'text']);
  80246. //创建图形
  80247. var _shape5 = new SmicText();
  80248. _shape5.style = ShapeFactory.transformStyle(_style5);
  80249. _shape5.highlightStyle = ShapeFactory.transformStyle(sps.highlightStyle);
  80250. Util_Util.copyAttributesWithClip(_shape5, sps, ['x', 'y', 'text', 'style', 'highlightStyle']);
  80251. return _shape5;
  80252. } else if (sps instanceof Image_Image) {
  80253. // 图片
  80254. //设置style
  80255. var _style6 = new Object();
  80256. _style6["x"] = sps.x;
  80257. _style6["y"] = sps.y;
  80258. if (sps["image"]) {
  80259. _style6["image"] = sps.image;
  80260. }
  80261. if (sps["width"]) {
  80262. _style6["width"] = sps.width;
  80263. }
  80264. if (sps["height"]) {
  80265. _style6["height"] = sps.height;
  80266. }
  80267. if (sps["sx"]) {
  80268. _style6["sx"] = sps.sx;
  80269. }
  80270. if (sps["sy"]) {
  80271. _style6["sy"] = sps.sy;
  80272. }
  80273. if (sps["sWidth"]) {
  80274. _style6["sWidth"] = sps.sWidth;
  80275. }
  80276. if (sps["sHeight"]) {
  80277. _style6["sHeight"] = sps.sHeight;
  80278. }
  80279. _style6 = Util_Util.copyAttributesWithClip(_style6, sps.style, ['x', 'y', 'image', 'width', 'height', 'sx', 'sy', 'sWidth', 'sHeight']);
  80280. //创建图形
  80281. var _shape6 = new SmicImage();
  80282. _shape6.style = ShapeFactory.transformStyle(_style6);
  80283. _shape6.highlightStyle = ShapeFactory.transformStyle(sps.highlightStyle);
  80284. Util_Util.copyAttributesWithClip(_shape6, sps, ['x', 'y', 'image', 'width', 'height', 'style', 'highlightStyle']);
  80285. return _shape6;
  80286. } else if (sps instanceof Circle_Circle) {
  80287. //圆形 用于符号专题图
  80288. //设置stytle
  80289. var _style7 = new Object();
  80290. _style7["x"] = sps.x;
  80291. _style7["r"] = sps.r;
  80292. _style7["y"] = sps.y;
  80293. _style7 = Util_Util.copyAttributesWithClip(_style7, sps.style, ['x', 'y', 'r']);
  80294. //创建图形
  80295. var _shape7 = new SmicCircle();
  80296. _shape7.style = ShapeFactory.transformStyle(_style7);
  80297. _shape7.highlightStyle = ShapeFactory.transformStyle(sps.highlightStyle);
  80298. Util_Util.copyAttributesWithClip(_shape7, sps, ['x', 'y', 'r', 'style', 'highlightStyle', 'lineWidth', 'text', 'textPosition']);
  80299. return _shape7;
  80300. }
  80301. return null;
  80302. }
  80303. /**
  80304. * @function FeatureShapeFactory.prototype.transformStyle
  80305. * @description 将用户 feature.style (类 Svg style 标准) 的样式,转换为 levelRenderer 的样式标准(类 CSS-Canvas 样式)
  80306. * @param {Object} style - 用户 style。
  80307. * @returns {Object} 符合 levelRenderer 的 style。
  80308. */
  80309. }], [{
  80310. key: "transformStyle",
  80311. value: function transformStyle(style) {
  80312. var newStyle = {};
  80313. //字体 ["font-style", "font-variant", "font-weight", "font-size / line-height", "font-family"];
  80314. var fontStr = ["normal", "normal", "normal", "12", "arial,sans-serif"];
  80315. //画笔类型 ["fill", "stroke"];
  80316. var brushType = [true, false];
  80317. for (var ss in style) {
  80318. switch (ss) {
  80319. case "fill":
  80320. brushType[0] = style[ss];
  80321. break;
  80322. case "fillColor":
  80323. newStyle["color"] = style[ss];
  80324. break;
  80325. case "stroke":
  80326. brushType[1] = style[ss];
  80327. break;
  80328. case "strokeWidth":
  80329. newStyle["lineWidth"] = style[ss];
  80330. break;
  80331. case "strokeLinecap":
  80332. newStyle["lineCap"] = style[ss];
  80333. break;
  80334. case "strokeLineJoin":
  80335. newStyle["lineJoin"] = style[ss];
  80336. break;
  80337. case "strokeDashstyle":
  80338. newStyle["lineType"] = style[ss];
  80339. break;
  80340. case "pointRadius":
  80341. newStyle["r"] = style[ss];
  80342. break;
  80343. case "label":
  80344. newStyle["text"] = style[ss];
  80345. break;
  80346. case "labelRect":
  80347. newStyle["labelRect"] = style[ss];
  80348. break;
  80349. case "fontColor":
  80350. newStyle["textColor"] = style[ss];
  80351. break;
  80352. case "fontStyle":
  80353. fontStr[0] = style[ss];
  80354. break;
  80355. case "fontVariant":
  80356. fontStr[1] = style[ss];
  80357. break;
  80358. case "fontWeight":
  80359. fontStr[2] = style[ss];
  80360. break;
  80361. case "fontSize":
  80362. var unit = "";
  80363. if (style[ss] && style[ss].toString().indexOf("px") < 0) {
  80364. unit = "px";
  80365. }
  80366. fontStr[3] = style[ss] + unit;
  80367. break;
  80368. case "fontFamily":
  80369. fontStr[4] = style[ss];
  80370. break;
  80371. case "fontOpacity":
  80372. newStyle["opacity"] = style[ss];
  80373. break;
  80374. case "labelPosition":
  80375. newStyle["textPosition"] = style[ss];
  80376. break;
  80377. case "labelAlign":
  80378. newStyle["textAlign"] = style[ss];
  80379. break;
  80380. case "labelBaseline":
  80381. newStyle["textBaseline"] = style[ss];
  80382. break;
  80383. case "labelRotation":
  80384. newStyle["textRotation"] = style[ss];
  80385. break;
  80386. default:
  80387. newStyle[ss] = style[ss];
  80388. break;
  80389. }
  80390. }
  80391. //拼接字体字符串
  80392. newStyle["textFont"] = fontStr.join(" ");
  80393. //画笔类型
  80394. if (brushType[0] === true && brushType[1] === false) {
  80395. newStyle["brushType"] = "fill";
  80396. } else if (brushType[0] === false && brushType[1] === true) {
  80397. newStyle["brushType"] = "stroke";
  80398. } else if (brushType[0] === true && brushType[1] === true) {
  80399. newStyle["brushType"] = "both";
  80400. } else {
  80401. newStyle["brushType"] = "fill";
  80402. }
  80403. //默认线宽 1
  80404. if (newStyle["lineWidth"] == null) {
  80405. newStyle["lineWidth"] = 1;
  80406. }
  80407. return newStyle;
  80408. }
  80409. /**
  80410. * @function FeatureShapeFactory.prototype.Background
  80411. * @description 创建一个矩形背景框图形对象。
  80412. * @param {FeatureShapeFactory} shapeFactory - 图形工厂对象。
  80413. * @param {Array.<number>} box - 框区域,长度为 4 的一维数组,像素坐标,[left, bottom, right, top]。
  80414. * @param {Object} setting - 图表配置参数。本函数中图形配置对象 setting 可设属性:
  80415. * @param {Object} setting.backgroundStyle - 背景样式,此样式对象对象可设属性:<ShapeParametersRectangle#style>。
  80416. * @param {Array.<number>} [setting.backgroundRadius=[0,0,0,0]] - 背景框矩形圆角半径,可以用数组分别指定四个角的圆角半径,设:左上、右上、右下、左下角的半径依次为 r1、r2、r3、r4,则 backgroundRadius 为 [r1、r2、r3、r4 ]。
  80417. * @returns {Object} 背景框图形,一个可视化图形(矩形)对象。
  80418. */
  80419. }, {
  80420. key: "Background",
  80421. value: function Background(shapeFactory, box, setting) {
  80422. var sets = setting ? setting : {};
  80423. // 背景框图形参数对象
  80424. var bgSP = new Rectangle_Rectangle(box[0], box[3], Math.abs(box[2] - box[0]), Math.abs(box[3] - box[1]));
  80425. // 默认样式
  80426. bgSP.style = {
  80427. fillColor: "#f3f3f3"
  80428. };
  80429. // 设置用户 style
  80430. if (sets.backgroundStyle) {
  80431. Util_Util.copyAttributesWithClip(bgSP.style, sets.backgroundStyle);
  80432. }
  80433. // 设置背景框圆角参数
  80434. if (sets.backgroundRadius) {
  80435. bgSP.style["radius"] = sets.backgroundRadius;
  80436. }
  80437. // 禁止背景框响应事件
  80438. bgSP.clickable = false;
  80439. bgSP.hoverable = false;
  80440. return shapeFactory.createShape(bgSP);
  80441. }
  80442. /**
  80443. * @function FeatureShapeFactory.prototype.GraphAxis
  80444. * @description 创建一个统计图表坐标轴图形对象组。
  80445. * @param {FeatureShapeFactory} shapeFactory - 图形工厂对象。
  80446. * @param {Array.<number>} dataViewBox - 统计图表模型的数据视图框,长度为 4 的一维数组,像素坐标,[left, bottom, right, top]。
  80447. * @param {Object} setting - 图表配置参数。
  80448. * @param {Object} setting.axisStyle - 坐标轴样式,此样式对象对象可设属性:<ShapeParametersLine#style>。
  80449. * @param {boolean} [setting.axisUseArrow=false] - 坐标轴是否使用箭头。
  80450. * @param {number} [setting.axisYTick=0] - y 轴刻度数量,0表示不使用箭头。
  80451. * @param {Array.<string>} setting.axisYLabels - y 轴上的标签组内容,标签顺序沿着数据视图框左面条边自上而下,等距排布。例如:["1000", "750", "500", "250", "0"]。
  80452. * @param {Object} setting.axisYLabelsStyle - y 轴上的标签组样式,此样式对象对象可设属性:<ShapeParametersLabel#style>。
  80453. * @param {Array.<number>} [setting.axisYLabelsOffset=[0,0]] - y 轴上的标签组偏移量。长度为 2 的数组,数组第一项表示 y 轴标签组横向上的偏移量,向左为正,默认值:0;数组第二项表示 y 轴标签组纵向上的偏移量,向下为正,默认值:0。
  80454. * @param {Array.<string>} setting.axisXLabels - x 轴上的标签组内容,标签顺序沿着数据视图框下面条边自左向右排布,例如:["92年", "95年", "99年"]。
  80455. * 标签排布规则:当标签数量与 xShapeInfo 中的属性 xPositions 数量相同(即标签个数与数据个数相等时), 按照 xPositions 提供的位置在水平方向上排布标签,否则沿数据视图框下面条边等距排布标签。
  80456. * @param {Object} setting.axisXLabelsStyle - x 轴上的标签组样式,此样式对象对象可设属性:<ShapeParametersLabel#style>。
  80457. * @param {Array.<number>} [setting.axisXLabelsOffset=[0,0]] - x 轴上的标签组偏移量。长度为 2 的数组,数组第一项表示 x 轴标签组横向上的偏移量,向左为正,默认值:0;数组第二项表示 x 轴标签组纵向上的偏移量,向下为正,默认值:0。
  80458. * @param {boolean} setting.useXReferenceLine - 是否使用水平参考线,如果为 true,在 axisYTick 大于 0 时有效,水平参考线是 y 轴刻度在数据视图框里的延伸。
  80459. * @param {Object} setting.xReferenceLineStyle - 水平参考线样式,此样式对象对象可设属性:<ShapeParametersLine#style>。
  80460. * @param {number} [setting.axis3DParameter=0] - 3D 坐标轴参数,此属性值在大于等于 15 时有效。
  80461. * @param {Object} xShapeInfo - X 方向上的图形信息对象,包含两个属性。
  80462. * @param {Array.<number>} xShapeInfo.xPositions - 图形在 x 轴方向上的像素坐标值,是一个一维数组,如果图形在 x 方向上有一定宽度,通常取图形在 x 方向上的中心点为图形在 x 方向上的坐标值。
  80463. * @param {number} xShapeInfo.width - 图形的宽度(特别注意:点的宽度始终为 0,而不是其直径)。
  80464. * @returns {Array.<Object>} 统计图表坐标轴图形对象数组。
  80465. */
  80466. }, {
  80467. key: "GraphAxis",
  80468. value: function GraphAxis(shapeFactory, dataViewBox, setting, xShapeInfo) {
  80469. var dvb = dataViewBox;
  80470. var sets = setting ? setting : {};
  80471. // 参考线图形对象组
  80472. var refLines = [];
  80473. //坐标轴箭头对象组
  80474. var arrows = [];
  80475. // 是否使用参水平考线,默认不使用
  80476. var isAddRefLine = sets.useXReferenceLine ? sets.useXReferenceLine : false;
  80477. // y 轴上的刻度
  80478. var axisytick = sets.axisYTick && !isNaN(sets.axisYTick) ? sets.axisYTick : 0;
  80479. // 坐标轴节点数组
  80480. var pois = [];
  80481. //z 轴箭头数组
  80482. var zArrowPois = [];
  80483. // x,y 轴主干节点数组
  80484. var xMainPois = [];
  80485. if (axisytick == 0) {
  80486. xMainPois.push([dvb[0], dvb[3] - 5]);
  80487. xMainPois.push([dvb[0], dvb[1]]);
  80488. // 3D 坐标轴 第三象限平分线
  80489. if (sets.axis3DParameter && !isNaN(sets.axis3DParameter) && sets.axis3DParameter >= 15) {
  80490. var axis3DParameter = parseInt(sets.axis3DParameter);
  80491. var axis3DPoi = [dvb[0] - axis3DParameter, dvb[1] + axis3DParameter];
  80492. // 添加 3D 轴节点
  80493. if (sets.axisUseArrow) {
  80494. // 添加 3D 轴箭头节点坐标
  80495. //箭头坐标
  80496. zArrowPois.push([axis3DPoi[0] + 1.5, axis3DPoi[1] - 7.5]);
  80497. zArrowPois.push([axis3DPoi[0] - 1, axis3DPoi[1] + 1]);
  80498. zArrowPois.push([axis3DPoi[0] + 7.5, axis3DPoi[1] - 1.5]);
  80499. //3D轴
  80500. xMainPois.push([axis3DPoi[0], axis3DPoi[1]]);
  80501. } else {
  80502. xMainPois.push([axis3DPoi[0], axis3DPoi[1]]);
  80503. }
  80504. xMainPois.push([dvb[0], dvb[1]]);
  80505. }
  80506. xMainPois.push([dvb[2] + 5, dvb[1]]);
  80507. } else {
  80508. // 单位刻度长度
  80509. var unitTick = Math.abs(dvb[1] - dvb[3]) / axisytick;
  80510. // 刻度 y 坐标
  80511. var thckY = dvb[3];
  80512. xMainPois.push([dvb[0], thckY - 5]);
  80513. for (var i = 0; i < axisytick; i++) {
  80514. xMainPois.push([dvb[0], thckY]);
  80515. xMainPois.push([dvb[0] - 5, thckY]);
  80516. xMainPois.push([dvb[0], thckY]);
  80517. // 参考线
  80518. if (isAddRefLine) {
  80519. // 参考线参数对象
  80520. var refLineSP = new Line_Line([[dvb[0], thckY], [dvb[2], thckY]]);
  80521. // 参考线默认样式对象
  80522. refLineSP.style = {
  80523. strokeColor: "#cfcfcf",
  80524. strokeLinecap: "butt",
  80525. strokeLineJoin: "round",
  80526. strokeWidth: 1
  80527. };
  80528. // 禁止事件
  80529. refLineSP.clickable = false;
  80530. refLineSP.hoverable = false;
  80531. // 用户style
  80532. if (sets.xReferenceLineStyle) {
  80533. Util_Util.copyAttributesWithClip(refLineSP.style, sets.xReferenceLineStyle);
  80534. }
  80535. // 生成参考线图形对象
  80536. refLines.push(shapeFactory.createShape(refLineSP));
  80537. }
  80538. // y 刻度增量
  80539. thckY += unitTick;
  80540. }
  80541. xMainPois.push([dvb[0], dvb[1]]);
  80542. // 3D 坐标轴 第三象限平分线
  80543. if (sets.axis3DParameter && !isNaN(sets.axis3DParameter) && sets.axis3DParameter >= 15) {
  80544. var _axis3DParameter = parseInt(sets.axis3DParameter);
  80545. var _axis3DPoi = [dvb[0] - _axis3DParameter, dvb[1] + _axis3DParameter];
  80546. /*
  80547. // 箭头计算过程
  80548. var axis3DPoiRef = [axis3DPoi[0] + 7, axis3DPoi[1] - 7]; // 7 是 10 为斜边 cos(45度)时邻边的值
  80549. var axis3DPoiLT = [axis3DPoiRef[0] - 4, axis3DPoiRef[1] - 4];
  80550. var axis3DPoiRB = [axis3DPoiRef[0] + 4, axis3DPoiRef[1] + 4];
  80551. if(sets.axisUseArrow){
  80552. xMainPois.push([axis3DPoi[0], axis3DPoi[1]]);
  80553. xMainPois.push([axis3DPoiLT[0], axis3DPoiLT[1]]);
  80554. xMainPois.push([axis3DPoi[0], axis3DPoi[1]]);
  80555. xMainPois.push([axis3DPoiRB[0], axis3DPoiRB[1]]);
  80556. xMainPois.push([axis3DPoi[0], axis3DPoi[1]]);
  80557. }
  80558. else{
  80559. xMainPois.push([axis3DPoi[0], axis3DPoi[1]]);
  80560. }
  80561. */
  80562. // 添加 3D 轴节点
  80563. if (sets.axisUseArrow) {
  80564. // 添加 3D 轴和箭头坐标
  80565. //箭头坐标
  80566. zArrowPois.push([_axis3DPoi[0] + 1.5, _axis3DPoi[1] - 7.5]);
  80567. zArrowPois.push([_axis3DPoi[0] - 1, _axis3DPoi[1] + 1]);
  80568. zArrowPois.push([_axis3DPoi[0] + 7.5, _axis3DPoi[1] - 1.5]);
  80569. //3D轴
  80570. xMainPois.push([_axis3DPoi[0], _axis3DPoi[1]]);
  80571. } else {
  80572. xMainPois.push([_axis3DPoi[0], _axis3DPoi[1]]);
  80573. }
  80574. xMainPois.push([dvb[0], dvb[1]]);
  80575. }
  80576. xMainPois.push([dvb[2] + 5, dvb[1]]);
  80577. }
  80578. // 坐标轴箭头
  80579. if (sets.axisUseArrow) {
  80580. // x 轴箭头节点数组
  80581. var xArrowPois = [[dvb[2] + 5, dvb[1] + 4], [dvb[2] + 13, dvb[1]], [dvb[2] + 5, dvb[1] - 4]];
  80582. // y 轴箭头节点数组
  80583. var yArrowPois = [[dvb[0] - 4, dvb[3] - 5], [dvb[0], dvb[3] - 13], [dvb[0] + 4, dvb[3] - 5]];
  80584. //x轴箭头
  80585. var xSP = new feature_Polygon_Polygon(xArrowPois);
  80586. xSP.style = {
  80587. fillColor: "#008acd"
  80588. };
  80589. Util_Util.copyAttributesWithClip(xSP.style, sets.axisStyle);
  80590. arrows.push(shapeFactory.createShape(xSP));
  80591. //y轴箭头
  80592. var ySP = new feature_Polygon_Polygon(yArrowPois);
  80593. ySP.style = {
  80594. fillColor: "#008acd"
  80595. };
  80596. Util_Util.copyAttributesWithClip(ySP.style, sets.axisStyle);
  80597. arrows.push(shapeFactory.createShape(ySP));
  80598. // z轴箭头 坐标轴箭头是否要使用
  80599. if (sets.axis3DParameter && !isNaN(sets.axis3DParameter) && sets.axis3DParameter >= 15) {
  80600. var zSP = new feature_Polygon_Polygon(zArrowPois);
  80601. zSP.style = {
  80602. fillColor: "#008acd"
  80603. };
  80604. Util_Util.copyAttributesWithClip(zSP.style, sets.axisStyle);
  80605. arrows.push(shapeFactory.createShape(zSP));
  80606. }
  80607. }
  80608. //不带箭头的坐标轴
  80609. pois = xMainPois;
  80610. // 坐标轴参数对象
  80611. var axisSP = new Line_Line(pois);
  80612. // 坐标轴默认style
  80613. axisSP.style = {
  80614. strokeLinecap: "butt",
  80615. strokeLineJoin: "round",
  80616. strokeColor: "#008acd",
  80617. strokeWidth: 1
  80618. };
  80619. // 用户 style
  80620. if (sets.axisStyle) {
  80621. Util_Util.copyAttributesWithClip(axisSP.style, sets.axisStyle);
  80622. }
  80623. // 禁止事件
  80624. axisSP.clickable = false;
  80625. axisSP.hoverable = false;
  80626. // 创建坐标轴图形对象
  80627. var axisMain = [shapeFactory.createShape(axisSP)];
  80628. // Y 轴标签
  80629. var yLabels = [];
  80630. if (sets.axisYLabels && sets.axisYLabels.length && sets.axisYLabels.length > 0) {
  80631. var axisYLabels = sets.axisYLabels;
  80632. var len = axisYLabels.length;
  80633. // 标签偏移量
  80634. var ylOffset = [0, 0];
  80635. if (sets.axisYLabelsOffset && sets.axisYLabelsOffset.length) {
  80636. ylOffset = sets.axisYLabelsOffset;
  80637. }
  80638. if (len == 1) {
  80639. // 标签参数对象
  80640. var labelYSP = new Label(dvb[0] - 5 + ylOffset[0], dvb[3] + ylOffset[1], axisYLabels[0]);
  80641. labelYSP.style = {
  80642. labelAlign: "right"
  80643. };
  80644. // 用户 style
  80645. if (sets.axisYLabelsStyle) {
  80646. Util_Util.copyAttributesWithClip(labelYSP.style, sets.axisYLabelsStyle);
  80647. }
  80648. // 禁止事件
  80649. labelYSP.clickable = false;
  80650. labelYSP.hoverable = false;
  80651. // 制作标签
  80652. yLabels.push(shapeFactory.createShape(labelYSP));
  80653. } else {
  80654. var labelY = dvb[3];
  80655. // y 轴标签单位距离
  80656. var yUnit = Math.abs(dvb[1] - dvb[3]) / (len - 1);
  80657. for (var j = 0; j < len; j++) {
  80658. // 标签参数对象
  80659. var _labelYSP = new Label(dvb[0] - 5 + ylOffset[0], labelY + ylOffset[1], axisYLabels[j]);
  80660. _labelYSP.style = {
  80661. labelAlign: "right"
  80662. };
  80663. // 用户 style
  80664. if (sets.axisYLabelsStyle) {
  80665. Util_Util.copyAttributesWithClip(_labelYSP.style, sets.axisYLabelsStyle);
  80666. }
  80667. // 禁止事件
  80668. _labelYSP.clickable = false;
  80669. _labelYSP.hoverable = false;
  80670. // 制作标签
  80671. yLabels.push(shapeFactory.createShape(_labelYSP));
  80672. // y 轴标签 y 方向增量
  80673. labelY += yUnit;
  80674. }
  80675. }
  80676. }
  80677. // X 轴标签
  80678. var xLabels = [];
  80679. if (sets.axisXLabels && sets.axisXLabels.length && sets.axisXLabels.length > 0) {
  80680. var axisXLabels = sets.axisXLabels;
  80681. var _len = axisXLabels.length;
  80682. // 标签偏移量
  80683. var xlOffset = [0, 0];
  80684. if (sets.axisXLabelsOffset && sets.axisXLabelsOffset.length) {
  80685. xlOffset = sets.axisXLabelsOffset;
  80686. }
  80687. // 标签个数与数据字段个数相等等时,标签在 x 轴均匀排列
  80688. if (xShapeInfo && xShapeInfo.xPositions && xShapeInfo.xPositions.length && xShapeInfo.xPositions.length == _len) {
  80689. var xsCenter = xShapeInfo.xPositions;
  80690. for (var K = 0; K < _len; K++) {
  80691. // 标签参数对象
  80692. var labelXSP = new Label(xsCenter[K] + xlOffset[0], dvb[1] + xlOffset[1], axisXLabels[K]);
  80693. // 默认 style
  80694. labelXSP.style = {
  80695. labelAlign: "center",
  80696. labelBaseline: "top"
  80697. };
  80698. // 用户 style
  80699. if (sets.axisXLabelsStyle) {
  80700. Util_Util.copyAttributesWithClip(labelXSP.style, sets.axisXLabelsStyle);
  80701. }
  80702. // 禁止事件
  80703. labelXSP.clickable = false;
  80704. labelXSP.hoverable = false;
  80705. // 创建标签对象
  80706. xLabels.push(shapeFactory.createShape(labelXSP));
  80707. }
  80708. } else {
  80709. if (_len == 1) {
  80710. // 标签参数对象
  80711. var _labelXSP = new Label(dvb[0] - 5 + xlOffset[0], dvb[1] + xlOffset[0], axisXLabels[0]);
  80712. // 默认 style
  80713. _labelXSP.style = {
  80714. labelAlign: "center",
  80715. labelBaseline: "top"
  80716. };
  80717. // 用户 style
  80718. if (sets.axisXLabelsStyle) {
  80719. Util_Util.copyAttributesWithClip(_labelXSP.style, sets.axisXLabelsStyle);
  80720. }
  80721. // 禁止事件
  80722. _labelXSP.clickable = false;
  80723. _labelXSP.hoverable = false;
  80724. // 创建标签对象
  80725. xLabels.push(shapeFactory.createShape(_labelXSP));
  80726. } else {
  80727. var labelX = dvb[0];
  80728. // x 轴标签单位距离
  80729. var xUnit = Math.abs(dvb[2] - dvb[0]) / (_len - 1);
  80730. for (var m = 0; m < _len; m++) {
  80731. // 标签参数对象
  80732. var _labelXSP2 = new Label(labelX + xlOffset[0], dvb[1] + xlOffset[1], axisXLabels[m]);
  80733. // 默认 style
  80734. _labelXSP2.style = {
  80735. labelAlign: "center",
  80736. labelBaseline: "top"
  80737. };
  80738. // 用户 style
  80739. if (sets.axisXLabelsStyle) {
  80740. Util_Util.copyAttributesWithClip(_labelXSP2.style, sets.axisXLabelsStyle);
  80741. }
  80742. // 禁止事件
  80743. _labelXSP2.clickable = false;
  80744. _labelXSP2.hoverable = false;
  80745. // 创建标签对象
  80746. xLabels.push(shapeFactory.createShape(_labelXSP2));
  80747. // x 轴标签 x 方向增量
  80748. labelX += xUnit;
  80749. }
  80750. }
  80751. }
  80752. }
  80753. // 组装并返回构成坐标轴的图形
  80754. return refLines.concat(axisMain).concat(yLabels).concat(xLabels).concat(arrows);
  80755. }
  80756. /**
  80757. * @function FeatureShapeFactory.prototype.ShapeStyleTool
  80758. * @description 一个图形 style 处理工具。此工具将指定的默认 style,通用 style,按 styleGroup 取得的 style 和按数据值 value 范围取得的 style 进行合并,得到图形最终的 style。
  80759. * @param {Object} defaultStyle - 默认style,此样式对象可设属性根据图形类型参考 <{@link ShapeParameters}> 子类对象的 style 属性。
  80760. * @param {Object} style - 图形对象基础 style,此参数控制图形的基础样式,可设属性根据图形类型参考 <{@link ShapeParameters}> 子类对象的 style 属性。优先级低于 styleGroup,styleByCodomain。
  80761. * @param {Array.<Object>} styleGroup - 一个 style 数组,优先级低于 styleByCodomain,高于 style。此数组每个元素是样式对象,
  80762. * 其可设属性根据图形类型参考 <{@link ShapeParameters}> 子类对象的 style 属性。通过 index 参数从 styleGroup 中取 style。
  80763. * @param {Array.<Object>} styleByCodomain - 按数据(参数 value)所在值域范围控制数据的可视化对象样式。
  80764. * (start code)
  80765. * // styleByCodomain 的每个元素是个包含值域信息和与值域对应样式信息的对象,该对象(必须)有三个属性:
  80766. * // start: 值域值下限(包含);
  80767. * // end: 值域值上限(不包含);
  80768. * // style: 数据可视化图形的 style,其可设属性根据图形类型参考 <ShapeParameters> 子类对象的 style 属性。
  80769. * // dataStyleByCodomain 数组形如:
  80770. * [
  80771. * {
  80772. * start:0,
  80773. * end:250,
  80774. * style:{
  80775. * fillColor:"#00CD00"
  80776. * }
  80777. * },
  80778. * {
  80779. * start:250,
  80780. * end:500,
  80781. * style:{
  80782. * fillColor:"#00EE00"
  80783. * }
  80784. * },
  80785. * {
  80786. * start:500,
  80787. * end:750,
  80788. * style:{
  80789. * fillColor:"#00FF7F"
  80790. * }
  80791. * },
  80792. * {
  80793. * start:750,
  80794. * end:1500,
  80795. * style:{
  80796. * fillColor:"#00FF00"
  80797. * }
  80798. * }
  80799. * ]
  80800. * (end)
  80801. * @param {number} index - styleGroup 的索引值,用于取出 styleGroup 指定的 style。
  80802. * @param {number} value - 数据值,用于取出 styleByCodomain 指定的 style。
  80803. * @returns {Object} 合并后的样式 (style) 对象。
  80804. */
  80805. }, {
  80806. key: "ShapeStyleTool",
  80807. value: function ShapeStyleTool(defaultStyle, style, styleGroup, styleByCodomain, index, value) {
  80808. // 用 defaultStyle 初始化 style 对象
  80809. var finalStyle = defaultStyle ? defaultStyle : {};
  80810. // 基础 style
  80811. if (style) {
  80812. Util_Util.copyAttributesWithClip(finalStyle, style);
  80813. }
  80814. // 按索引赋 style
  80815. if (styleGroup && styleGroup.length && typeof index !== "undefined" && !isNaN(index) && index >= 0) {
  80816. if (styleGroup[index]) {
  80817. Util_Util.copyAttributesWithClip(finalStyle, styleGroup[index]);
  80818. }
  80819. }
  80820. // 按值域赋 style
  80821. if (styleByCodomain && styleByCodomain.length && typeof value !== "undefined") {
  80822. var dsc = styleByCodomain;
  80823. var dscLen = dsc.length;
  80824. var v = parseFloat(value);
  80825. for (var i = 0; i < dscLen; i++) {
  80826. if (dsc[i].start <= v && v < dsc[i].end) {
  80827. Util_Util.copyAttributesWithClip(finalStyle, dsc[i].style);
  80828. break;
  80829. }
  80830. }
  80831. }
  80832. return finalStyle;
  80833. }
  80834. }]);
  80835. return ShapeFactory;
  80836. }();
  80837. ;// CONCATENATED MODULE: ./src/common/overlay/feature/Theme.js
  80838. function feature_Theme_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  80839. function feature_Theme_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  80840. function feature_Theme_createClass(Constructor, protoProps, staticProps) { if (protoProps) feature_Theme_defineProperties(Constructor.prototype, protoProps); if (staticProps) feature_Theme_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  80841. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  80842. * This program are made available under the terms of the Apache License, Version 2.0
  80843. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  80844. /**
  80845. * @class FeatureTheme
  80846. * @aliasclass Feature.Theme
  80847. * @deprecatedclass SuperMap.Feature.Theme
  80848. * @category Visualization Theme
  80849. * @classdesc 专题要素基类。
  80850. * @param {Object} data - 用户数据,用于生成可视化 shape。
  80851. * @param {SuperMap.Layer.Theme} layer - 此专题要素所在图层。
  80852. * @usage
  80853. */
  80854. var Theme_Theme = /*#__PURE__*/function () {
  80855. function Theme(data, layer) {
  80856. feature_Theme_classCallCheck(this, Theme);
  80857. if (!data) {
  80858. return;
  80859. }
  80860. // layer 必须已经添加到地图, 且已初始化渲染器
  80861. if (!layer || !layer.map || !layer.renderer) {
  80862. return;
  80863. }
  80864. /**
  80865. * @member {string} FeatureTheme.prototype.id
  80866. * @description 专题要素唯一标识。
  80867. */
  80868. this.id = Util_Util.createUniqueID(this.CLASS_NAME + "_");
  80869. /**
  80870. * @member {LonLat} FeatureTheme.prototype.lonlat
  80871. * @description 专题要素地理参考位置。子类中必须根据用户数据(或地理位置参数)对其赋值。
  80872. */
  80873. this.lonlat = null;
  80874. /**
  80875. * @member {Array.<number>} FeatureTheme.prototype.location
  80876. * @description 专题要素像素参考位置。通常由地理参考位置决定。长度为 2 的数组,第一个元素表示 x 坐标,第二个元素表示 y 坐标。
  80877. */
  80878. this.location = [];
  80879. /**
  80880. * @readonly
  80881. * @member {Object} FeatureTheme.prototype.data
  80882. * @description 用户数据,用于生成可视化 shape,可在子类中规定数据格式或类型,如:<{@link FeatureVector}>。
  80883. */
  80884. this.data = data;
  80885. /**
  80886. * @readonly
  80887. * @member {Array.<Object>} FeatureTheme.prototype.shapes
  80888. * @description 构成此专题要素的可视化图形对象数组,数组顺序控制渲染。
  80889. */
  80890. this.shapes = [];
  80891. /**
  80892. * @readonly
  80893. * @member {SuperMap.Layer.Theme} FeatureTheme.prototype.layer
  80894. * @description 此专题要素所在专题图层。
  80895. */
  80896. this.layer = layer;
  80897. this.CLASS_NAME = "SuperMap.Feature.Theme";
  80898. }
  80899. /**
  80900. * @function FeatureTheme.prototype.destroy
  80901. * @description 销毁专题要素。
  80902. */
  80903. feature_Theme_createClass(Theme, [{
  80904. key: "destroy",
  80905. value: function destroy() {
  80906. this.data = null;
  80907. this.id = null;
  80908. this.lonlat = null;
  80909. this.location = null;
  80910. this.shapes = null;
  80911. this.layer = null;
  80912. }
  80913. /**
  80914. * @function FeatureTheme.prototype.getLocalXY
  80915. * @description 地理坐标转为像素坐标。
  80916. * @param {GeometryPoint|GeometryGeoText|LonLat} coordinate - 地理坐标点。
  80917. * @returns {Array.<number>} 长度为 2 的数组,第一个元素表示 x 坐标,第二个元素表示 y 坐标。
  80918. */
  80919. }, {
  80920. key: "getLocalXY",
  80921. value: function getLocalXY(coordinate) {
  80922. var resolution = this.layer.map.getResolution();
  80923. var extent = this.layer.map.getExtent();
  80924. if (coordinate instanceof Point || coordinate instanceof GeoText) {
  80925. var x = coordinate.x / resolution + -extent.left / resolution;
  80926. var y = extent.top / resolution - coordinate.y / resolution;
  80927. return [x, y];
  80928. } else if (coordinate instanceof LonLat) {
  80929. var _x = coordinate.lon / resolution + -extent.left / resolution;
  80930. var _y = extent.top / resolution - coordinate.lat / resolution;
  80931. return [_x, _y];
  80932. } else {
  80933. return null;
  80934. }
  80935. }
  80936. }]);
  80937. return Theme;
  80938. }();
  80939. ;// CONCATENATED MODULE: ./src/common/overlay/Graph.js
  80940. function Graph_typeof(obj) { "@babel/helpers - typeof"; return Graph_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, Graph_typeof(obj); }
  80941. function Graph_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  80942. function Graph_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  80943. function Graph_createClass(Constructor, protoProps, staticProps) { if (protoProps) Graph_defineProperties(Constructor.prototype, protoProps); if (staticProps) Graph_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  80944. function Graph_get() { if (typeof Reflect !== "undefined" && Reflect.get) { Graph_get = Reflect.get.bind(); } else { Graph_get = function _get(target, property, receiver) { var base = Graph_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return Graph_get.apply(this, arguments); }
  80945. function Graph_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Graph_getPrototypeOf(object); if (object === null) break; } return object; }
  80946. function Graph_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) Graph_setPrototypeOf(subClass, superClass); }
  80947. function Graph_setPrototypeOf(o, p) { Graph_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Graph_setPrototypeOf(o, p); }
  80948. function Graph_createSuper(Derived) { var hasNativeReflectConstruct = Graph_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Graph_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Graph_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Graph_possibleConstructorReturn(this, result); }; }
  80949. function Graph_possibleConstructorReturn(self, call) { if (call && (Graph_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return Graph_assertThisInitialized(self); }
  80950. function Graph_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  80951. function Graph_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  80952. function Graph_getPrototypeOf(o) { Graph_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Graph_getPrototypeOf(o); }
  80953. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  80954. * This program are made available under the terms of the Apache License, Version 2.0
  80955. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  80956. /**
  80957. * @class FeatureThemeGraph
  80958. * @aliasclass Feature.Theme.Graph
  80959. * @deprecatedclass SuperMap.Feature.Theme.Graph
  80960. * @category Visualization Theme
  80961. * @classdesc 统计专题要素基类。
  80962. * 此类定义了统计专题要素基础模型,具体的图表模型通过继承此类,在子类中实现 assembleShapes 方法。
  80963. * 统计专题要素模型采用了可视化图形大小自适应策略,用较少的参数控制着图表诸多图形,图表配置对象 <FeatureThemeGraph.setting> 的基础属性只有 7 个,
  80964. * 它们控制着图表结构、值域范围、数据小数位等基础图表形态。构成图表的图形必须在图表结构里自适应大小。
  80965. * 此类不可实例化,此类的可实例化子类必须实现 assembleShapes() 方法。
  80966. * @extends FeatureTheme
  80967. * @param {FeatureVector} data - 用户数据。
  80968. * @param {SuperMap.Layer.Theme} layer - 此专题要素所在图层。
  80969. * @param {Array.<string>} fields - data 中的参与此图表生成的字段名称。
  80970. * @param {Object} setting - 图表配置对象。
  80971. * @param {LonLat} [lonlat] - 专题要素地理位置。默认为 data 指代的地理要素 Bounds 中心。
  80972. * @usage
  80973. */
  80974. var Graph = /*#__PURE__*/function (_Theme) {
  80975. Graph_inherits(Graph, _Theme);
  80976. var _super = Graph_createSuper(Graph);
  80977. function Graph(data, layer, fields, setting, lonlat, options) {
  80978. var _this;
  80979. Graph_classCallCheck(this, Graph);
  80980. _this = _super.call(this, data, layer, fields, setting, lonlat, options);
  80981. /**
  80982. * @member {FeatureShapeFactory} FeatureThemeGraph.prototype.shapeFactory
  80983. * @description 内置的图形工厂对象,调用其 createShape 方法创建图形。
  80984. */
  80985. _this.shapeFactory = new ShapeFactory();
  80986. /**
  80987. * @member {Object} FeatureThemeGraph.prototype.shapeParameters
  80988. * @description 当前图形参数对象,<{@link ShapeParameters}> 的子类对象。
  80989. */
  80990. _this.shapeParameters = null;
  80991. /**
  80992. * @member {boolean} [FeatureThemeGraph.prototype.RelativeCoordinate]
  80993. * @description 图形是否已经计算了相对坐标。
  80994. */
  80995. _this.RelativeCoordinate = false;
  80996. /**
  80997. * @member {Object} FeatureThemeGraph.prototype.setting
  80998. * @description 图表配置对象,该对象控制着图表的可视化显示。
  80999. * @param {number} width - 专题要素(图表)宽度。
  81000. * @param {number} height - 专题要素(图表)高度。
  81001. * @param {Array.<number>} codomain - 值域,长度为 2 的一维数组,第一个元素表示值域下限,第二个元素表示值域上限。
  81002. * @param {number} [XOffset] - 专题要素(图表)在 X 方向上的偏移值,单位像素。
  81003. * @param {number} [YOffset] - 专题要素(图表)在 Y 方向上的偏移值,单位像素。
  81004. * @param {Array.<number>} [dataViewBoxParameter] - 数据视图框 dataViewBox 参数,它是指图表框 chartBox
  81005. * (由图表位置、图表宽度、图表高度构成的图表范围框)在左、下,右,上四个方向上的内偏距值。
  81006. * @param {number} [decimalNumber] - 数据值数组 dataValues 元素值小数位数,数据的小数位处理参数,取值范围:[0, 16]。
  81007. * 如果不设置此参数,在取数据值时不对数据做小数位处理。
  81008. *
  81009. */
  81010. _this.setting = null;
  81011. /**
  81012. * @readonly
  81013. * @member {Array.<number>} FeatureThemeGraph.prototype.origonPoint
  81014. * @description 专题要素(图表)原点,图表左上角点像素坐标,是长度为 2 的一维数组,第一个元素表示 x 坐标,第二个元素表示 y 坐标。
  81015. */
  81016. _this.origonPoint = null;
  81017. /**
  81018. * @readonly
  81019. * @member {Array.<number>} FeatureThemeGraph.prototype.chartBox
  81020. * @description 专题要素(图表)区域,即图表框,长度为 4 的一维数组,数组的 4 个元素依次表示图表框左端 x 坐标值、
  81021. * 下端 y坐标值、右端 x坐标值、上端 y 坐标值;[left, bottom, right, top]。
  81022. */
  81023. _this.chartBox = null;
  81024. /**
  81025. * @readonly
  81026. * @member {Bounds} FeatureThemeGraph.prototype.chartBounds
  81027. * @description 图表 Bounds 随着 lonlat、XOffset、YOffset 更新,注意 chartBounds 是图表像素范围,不是地理范围。
  81028. */
  81029. _this.chartBounds = null;
  81030. /**
  81031. * @readonly
  81032. * @member {number} FeatureThemeGraph.prototype.width
  81033. * @description 专题要素(图表)宽度 。
  81034. */
  81035. _this.width = null;
  81036. /**
  81037. * @readonly
  81038. * @member {number} FeatureThemeGraph.prototype.height
  81039. * @description 专题要素(图表)高度 。
  81040. */
  81041. _this.height = null;
  81042. /**
  81043. * @readonly
  81044. * @member {number} FeatureThemeGraph.prototype.XOffset
  81045. * @description 专题要素(图表)在 X 方向上的偏移值,单位像素。
  81046. */
  81047. _this.XOffset = 0;
  81048. /**
  81049. * @readonly
  81050. * @member {number} FeatureThemeGraph.prototype.YOffset
  81051. * @description 专题要素(图表)在 Y 方向上的偏移值,单位像素。
  81052. */
  81053. _this.YOffset = 0;
  81054. /**
  81055. * @readonly
  81056. * @member {Array.<number>} FeatureThemeGraph.prototype.DVBParameter
  81057. * @description 数据视图框参数,长度为 4 的一维数组(数组元素值 >= 0),[leftOffset, bottomOffset, rightOffset, topOffset],chartBox 内偏距值。
  81058. * 此属性用于指定数据视图框 dataViewBox 的范围。
  81059. */
  81060. _this.DVBParameter = null;
  81061. /**
  81062. * @readonly
  81063. * @member {Array.<number>} FeatureThemeGraph.prototype.dataViewBox
  81064. * @description 数据视图框,长度为 4 的一维数组,[left, bottom, right, top]。
  81065. * dataViewBox 是统计专题要素最核心的内容,它负责解释数据在一个像素区域里的数据可视化含义,
  81066. * 这种含义用可视化图形表达出来,这些表示数据的图形和一些辅助图形组合在一起构成统计专题图表。
  81067. */
  81068. _this.dataViewBox = null;
  81069. /**
  81070. * @readonly
  81071. * @member {Array.<number>} FeatureThemeGraph.prototype.DVBCodomain
  81072. * @description 数据视图框的内允许展示的数据值域,长度为 2 的一维数组,第一个元素表示值域下限,第二个元素表示值域上限。
  81073. * dataViewBox 中允许的数据范围,对数据溢出值域范围情况的处理需要在 assembleShapes 中进行。
  81074. */
  81075. _this.DVBCodomain = null;
  81076. /**
  81077. * @readonly
  81078. * @member {Array.<number>} FeatureThemeGraph.prototype.DVBCenterPoint
  81079. * @description 数据视图框中心点,长度为 2 的一维数组,第一个元素表示 x 坐标,第二个元素表示 y 坐标。
  81080. */
  81081. _this.DVBCenterPoint = null;
  81082. /**
  81083. * @readonly
  81084. * @member {string} FeatureThemeGraph.prototype.DVBUnitValue
  81085. * @description 单位值。在 assembleShapes() 中初始化其具体意义,例如:饼图的 DVBUnitValue 可以定义为"360/数据总和",
  81086. * 折线图的 DVBUnitValue 可以定义为 "DVBCodomain/DVBHeight"。
  81087. */
  81088. _this.DVBUnitValue = null;
  81089. /**
  81090. * @readonly
  81091. * @member {Array.<number>} FeatureThemeGraph.prototype.DVBOrigonPoint
  81092. * @description 数据视图框原点,数据视图框左上角点,长度为 2 的一维数组,第一个元素表示 x 坐标,第二个元素表示 y 坐标。
  81093. */
  81094. _this.DVBOrigonPoint = null;
  81095. /**
  81096. * @readonly
  81097. * @member {number} FeatureThemeGraph.prototype.DVBWidth
  81098. * @description 数据视图框宽度。
  81099. */
  81100. _this.DVBWidth = null;
  81101. /**
  81102. * @readonly
  81103. * @member {number} FeatureThemeGraph.prototype.DVBHeight
  81104. * @description 数据视图框高度。
  81105. */
  81106. _this.DVBHeight = null;
  81107. /**
  81108. * @readonly
  81109. * @member {Array.<number>} FeatureThemeGraph.prototype.origonPointOffset
  81110. * @description 数据视图框原点相对于图表框的原点偏移量,长度为 2 的一维数组,第一个元素表示 x 偏移量,第二个元素表示 y 偏移量。
  81111. */
  81112. _this.origonPointOffset = null;
  81113. /**
  81114. * @readonly
  81115. * @member {Array.<string>} FeatureThemeGraph.prototype.fields
  81116. * @description 数据{FeatureVector}属性字段。
  81117. */
  81118. _this.fields = fields || [];
  81119. /**
  81120. * @readonly
  81121. * @member {Array.<number>} FeatureThemeGraph.prototype.dataValues
  81122. * @description 图表展示的数据值,通过 fields 从数据 feature 属性中获得。
  81123. */
  81124. _this.dataValues = null;
  81125. // 图表位置
  81126. if (lonlat) {
  81127. _this.lonlat = lonlat;
  81128. } else {
  81129. // 默认使用 bounds 中心
  81130. _this.lonlat = _this.data.geometry.getBounds().getCenterLonLat();
  81131. }
  81132. // 配置项检测与赋值
  81133. if (setting && setting.width && setting.height && setting.codomain) {
  81134. _this.setting = setting;
  81135. }
  81136. _this.CLASS_NAME = "SuperMap.Feature.Theme.Graph";
  81137. return _this;
  81138. }
  81139. /**
  81140. * @function FeatureThemeGraph.prototype.destroy
  81141. * @description 销毁专题要素。
  81142. */
  81143. Graph_createClass(Graph, [{
  81144. key: "destroy",
  81145. value: function destroy() {
  81146. this.shapeFactory = null;
  81147. this.shapeParameters = null;
  81148. this.width = null;
  81149. this.height = null;
  81150. this.origonPoint = null;
  81151. this.chartBox = null;
  81152. this.dataViewBox = null;
  81153. this.chartBounds = null;
  81154. this.DVBParameter = null;
  81155. this.DVBOrigonPoint = null;
  81156. this.DVBCenterPoint = null;
  81157. this.DVBWidth = null;
  81158. this.DVBHeight = null;
  81159. this.DVBCodomain = null;
  81160. this.DVBUnitValue = null;
  81161. this.origonPointOffset = null;
  81162. this.XOffset = null;
  81163. this.YOffset = null;
  81164. this.fields = null;
  81165. this.dataValues = null;
  81166. this.setting = null;
  81167. Graph_get(Graph_getPrototypeOf(Graph.prototype), "destroy", this).call(this);
  81168. }
  81169. /**
  81170. * @function FeatureThemeGraph.prototype.initBaseParameter
  81171. * @description 初始化专题要素(图表)基础参数。在调用此方法前,此类的图表模型相关属性都是不可用的 ,此方法在 assembleShapes 函数中调用。
  81172. * 调用此函数关系到 setting 对象的以下属性。
  81173. * @param {number} width - 专题要素(图表)宽度。
  81174. * @param {number} height - 专题要素(图表)高度。
  81175. * @param {Array.<number>} codomain - 值域,长度为 2 的一维数组,第一个元素表示值域下限,第二个元素表示值域上限。
  81176. * @param {number} [XOffset] - 专题要素(图表)在 X 方向上的偏移值,单位像素。
  81177. * @param {number} [YOffset] - 专题要素(图表)在 Y 方向上的偏移值,单位像素。
  81178. * @param {Array.<number>} [dataViewBoxParameter] - 数据视图框 dataViewBox 参数,它是指图表框 chartBox。
  81179. * (由图表位置、图表宽度、图表高度构成的图表范围框)在左、下,右,上四个方向上的内偏距值。
  81180. * @param {number} [decimalNumber] - 数据值数组 dataValues 元素值小数位数,数据的小数位处理参数,取值范围:[0, 16]。如果不设置此参数,在取数据值时不对数据做小数位处理。
  81181. * @returns {boolean} 初始化参数是否成功。
  81182. */
  81183. }, {
  81184. key: "initBaseParameter",
  81185. value: function initBaseParameter() {
  81186. // 参数初始化是否成功
  81187. var isSuccess = true;
  81188. // setting 属性是否已成功赋值
  81189. if (!this.setting) {
  81190. return false;
  81191. }
  81192. var sets = this.setting;
  81193. // 检测 setting 的必设参数
  81194. if (!(sets.width && sets.height && sets.codomain)) {
  81195. return false;
  81196. }
  81197. // 数据
  81198. var decimalNumber = typeof sets.decimalNumber !== "undefined" && !isNaN(sets.decimalNumber) ? sets.decimalNumber : -1;
  81199. var dataEffective = Theme_Theme.getDataValues(this.data, this.fields, decimalNumber);
  81200. this.dataValues = dataEffective ? dataEffective : [];
  81201. // 基础参数 width, height, codomain
  81202. this.width = parseFloat(sets.width);
  81203. this.height = parseFloat(sets.height);
  81204. this.DVBCodomain = sets.codomain;
  81205. // 图表偏移
  81206. // if(sets.XOffset) {this.XOffset = sets.XOffset};
  81207. // if(sets.YOffset) {this.YOffset = sets.YOffset};
  81208. this.XOffset = sets.XOffset ? sets.XOffset : 0;
  81209. this.YOffset = sets.YOffset ? sets.YOffset : 0;
  81210. // 其他默认值
  81211. this.origonPoint = [];
  81212. this.chartBox = [];
  81213. this.dataViewBox = [];
  81214. this.DVBParameter = sets.dataViewBoxParameter ? sets.dataViewBoxParameter : [0, 0, 0, 0];
  81215. this.DVBOrigonPoint = [];
  81216. this.DVBCenterPoint = [];
  81217. this.origonPointOffset = [];
  81218. // 图表位置
  81219. this.resetLocation();
  81220. // 专题要素宽度 w
  81221. var w = this.width;
  81222. // 专题要素高度 h
  81223. var h = this.height;
  81224. // 专题要素像素位置 loc
  81225. var loc = this.location;
  81226. // 专题要素像素位置 loc
  81227. this.origonPoint = [loc[0] - w / 2, loc[1] - h / 2];
  81228. // 专题要素原点(左上角)
  81229. var op = this.origonPoint;
  81230. // 图表框([left, bottom, right, top])
  81231. this.chartBox = [op[0], op[1] + h, op[0] + w, op[1]];
  81232. // 图表框
  81233. var cb = this.chartBox;
  81234. // 数据视图框参数,它是图表框各方向对应的内偏距
  81235. var dbbP = this.DVBParameter;
  81236. // 数据视图框 ([left, bottom, right, top])
  81237. this.dataViewBox = [cb[0] + dbbP[0], cb[1] - dbbP[1], cb[2] - dbbP[2], cb[3] + dbbP[3]];
  81238. // 数据视图框
  81239. var dvb = this.dataViewBox;
  81240. //检查数据视图框是否合法
  81241. if (dvb[0] >= dvb[2] || dvb[1] <= dvb[3]) {
  81242. return false;
  81243. }
  81244. // 数据视图框原点
  81245. this.DVBOrigonPoint = [dvb[0], dvb[3]];
  81246. // 数据视图框宽度
  81247. this.DVBWidth = Math.abs(dvb[2] - dvb[0]);
  81248. // 数据视图框高度
  81249. this.DVBHeight = Math.abs(dvb[1] - dvb[3]);
  81250. // 数据视图框中心点
  81251. this.DVBCenterPoint = [this.DVBOrigonPoint[0] + this.DVBWidth / 2, this.DVBOrigonPoint[1] + this.DVBHeight / 2];
  81252. // 数据视图框原点与图表框的原点偏移量
  81253. this.origonPointOffset = [this.DVBOrigonPoint[0] - op[0], this.DVBOrigonPoint[1] - op[1]];
  81254. return isSuccess;
  81255. }
  81256. /**
  81257. * @function FeatureThemeGraph.prototype.resetLocation
  81258. * @description 根据地理位置 lonlat 重置专题要素(图表)位置。
  81259. * @param {LonLat} lonlat - 专题要素新的像素中心位置。
  81260. * @returns {Array.<number>} 新专题要素像素参考位置。长度为 2 的数组,第一个元素表示 x 坐标,第二个元素表示 y 坐标。
  81261. */
  81262. }, {
  81263. key: "resetLocation",
  81264. value: function resetLocation(lonlat) {
  81265. if (lonlat) {
  81266. this.lonlat = lonlat;
  81267. }
  81268. // 获取地理位置对应的像素坐标 newLocalLX
  81269. var newLocalLX = this.getLocalXY(this.lonlat);
  81270. // 处理偏移量 XOffset, YOffset
  81271. newLocalLX[0] += this.XOffset;
  81272. newLocalLX[1] += this.YOffset;
  81273. // 将图形位置赋予 location 属性(注意 location 属性表示的是专题要素中心位置)
  81274. this.location = newLocalLX;
  81275. // 更新图表像素 Bounds
  81276. var w = this.width;
  81277. var h = this.height;
  81278. var loc = this.location;
  81279. this.chartBounds = new Bounds(loc[0] - w / 2, loc[1] + h / 2, loc[0] + w / 2, loc[1] - h / 2);
  81280. //重新计算当前渐变色
  81281. this.resetLinearGradient();
  81282. return loc;
  81283. }
  81284. /**
  81285. * @function FeatureThemeGraph.prototype.resetLinearGradient
  81286. * @description resetLocation 中调用 图表的相对坐标存在的时候,重新计算渐变的颜色(目前用于二维柱状图渐变色 所以子类实现此方法)。
  81287. */
  81288. }, {
  81289. key: "resetLinearGradient",
  81290. value: function resetLinearGradient() {
  81291. //子类实现此方法
  81292. }
  81293. /**
  81294. * @function FeatureThemeGraph.prototype.shapesConvertToRelativeCoordinate
  81295. * @description 将(构成图表)图形的节点转为相对坐标表示,此函数必须且只能在 assembleShapes() 结束时调用。
  81296. */
  81297. }, {
  81298. key: "shapesConvertToRelativeCoordinate",
  81299. value: function shapesConvertToRelativeCoordinate() {
  81300. var shapes = this.shapes;
  81301. var shapeROP = this.location;
  81302. for (var i = 0, len = shapes.length; i < len; i++) {
  81303. shapes[i].refOriginalPosition = shapeROP;
  81304. var style = shapes[i].style;
  81305. for (var sty in style) {
  81306. switch (sty) {
  81307. case "pointList":
  81308. var pl = style[sty];
  81309. for (var j = 0, len2 = pl.length; j < len2; j++) {
  81310. pl[j][0] -= shapeROP[0];
  81311. pl[j][1] -= shapeROP[1];
  81312. }
  81313. break;
  81314. case "x":
  81315. style[sty] -= shapeROP[0];
  81316. break;
  81317. case "y":
  81318. style[sty] -= shapeROP[1];
  81319. break;
  81320. default:
  81321. break;
  81322. }
  81323. }
  81324. }
  81325. this.RelativeCoordinate = true;
  81326. }
  81327. /**
  81328. * @function FeatureThemeGraph.prototype.assembleShapes
  81329. * @description 图形装配函数。抽象方法,可视化子类必须实现此方法。<br>
  81330. * 重写此方法的步骤:<br>
  81331. * 1. 图表的某些特殊配置项(setting)处理,例如多数图表模型需要重新指定 dataViewBoxParameter 的默认值。<br>
  81332. * 2. 调用 initBaseParameter() 方法初始化模型属性值,此步骤必须执行,只有当 initBaseParameter 返回 true 时才可以允许进行后续步骤。<br>
  81333. * 3. 计算图形参数,制作图形,图形组合。在组装图表过程中,应该特别注意数据视图框单位值的定义、数据值溢出值域范围的处理和图形大小自适应。<br>
  81334. * 4. 调用 shapesConvertToRelativeCoordinate() 方法,将图形的坐标值转为相对坐标,此步骤必须执行。
  81335. * @example
  81336. * //子类实现 assembleShapes() 接口的步骤示例:
  81337. * assembleShapes: function(){
  81338. * // 第一步:图表的某些特殊配置项(setting)处理,例如多数图表模型需要重新指定 dataViewBoxParameter 的默认值。此步骤是非必须过程。
  81339. *
  81340. * // 图表配置对象
  81341. * var sets = this.setting;
  81342. * // 默认数据视图框,这里展示在使用坐标轴和不使用坐标轴情况下对数据视图框参数赋予不同的默认值
  81343. * if(!sets.dataViewBoxParameter){
  81344. * if(typeof(sets.useAxis) === "undefined" || sets.useAxis){
  81345. * sets.dataViewBoxParameter = [45, 15, 15, 15];
  81346. * }
  81347. * else{
  81348. * sets.dataViewBoxParameter = [5, 5, 5, 5];
  81349. * }
  81350. * }
  81351. *
  81352. * // 第二步:初始化图表模型基本参数,只有在图表模型基本参数初始化成功时才可模型相关属性,如 this.dataViewBox、 this.DVBCodomain等。此步骤是必须过程。
  81353. * if(!this.initBaseParameter()) return;
  81354. *
  81355. * // 第三步:用图形组装图表,在组装图表过程中,应该特别注意数据视图框单位值的定义、数据值溢出值域范围的处理和图形大小自适应。
  81356. * // 定义图表数据视图框中单位值的含义,下面行代码表示将数据视图框单位值定义为数据视图框高度上每像素代表的数据值
  81357. * this.DVBUnitValue = (this.codomain[1] - this.codomain[0])/this.DVBHeight;
  81358. * var uv = this.DVBUnitValue;
  81359. *
  81360. * // 图形参数计算代码......
  81361. *
  81362. * // 关于图形装配,实际上就是利用图形工程对象 this.shapeFactory 的 createShape() 方法通过图形参数对象创建可视化的图形对象,并把这些图形对象按序添加到模型的图形库(his.shapes)中。下面的代码演示创建一个面图形参数对象,并允许通过图形配置对象设置图形的 style 和 highlightStyle,
  81363. * var barParams = new ShapeParametersPolygon(poiLists);
  81364. * barParams.style = sets.barStyle? sets.barStyle:{fillColor: "lightblue"};
  81365. * barParams.highlightStyle = sets.barHoverStyle? sets.barHoverStyle:{fillColor: "blue"};
  81366. * // 图形携带数据ID信息
  81367. * barParams.refDataID = this.data.id;
  81368. * // 创建图形并添加到图表图形数组中
  81369. * this.shapes.push(this.shapeFactory.createShape(barParams));
  81370. *
  81371. * // 第四步:调用 shapesConvertToRelativeCoordinate() 方法,将图形库(his.shapes)中的图形转为由相对坐标表示的图形,客户端统计专题图模块从结构上要求可视化图形使用相对坐标,assembleShapes() 函数必须在图形装配完成后调用 shapesConvertToRelativeCoordinate() 函数。此步骤是必须过程。
  81372. * this.shapesConvertToRelativeCoordinate();
  81373. * },
  81374. */
  81375. }, {
  81376. key: "assembleShapes",
  81377. value: function assembleShapes() {
  81378. //子类必须实现此方法
  81379. }
  81380. /**
  81381. * @function FeatureThemeGraph.prototype.getLocalXY
  81382. * @description 地理坐标转为像素坐标。
  81383. * @param {LonLat} lonlat - 带转换的地理坐标。
  81384. * @returns 屏幕像素坐标。
  81385. */
  81386. }, {
  81387. key: "getLocalXY",
  81388. value: function getLocalXY(lonlat) {
  81389. return this.layer.getLocalXY(lonlat);
  81390. }
  81391. }]);
  81392. return Graph;
  81393. }(Theme_Theme);
  81394. /**
  81395. * @function FeatureTheme.getDataValues
  81396. * @description 根据字段名数组获取指定数据(feature)的属性值数组。属性值类型必须为 Number。
  81397. * @param {FeatureVector} data - 数据。
  81398. * @param {Array.<string>} [fields] - 字段名数组。
  81399. * @param {number} [decimalNumber] - 小数位处理参数,对获取到的属性数据值进行小数位处理。
  81400. * @returns {Array.<string>} 字段名数组对应的属性数据值数组。
  81401. */
  81402. Theme_Theme.getDataValues = function (data, fields, decimalNumber) {
  81403. if (!data.attributes) {
  81404. return false;
  81405. }
  81406. var fieldsValue = [];
  81407. var attrs = data.attributes;
  81408. for (var i = 0; i < fields.length; i++) {
  81409. for (var field in attrs) {
  81410. if (field !== fields[i]) {
  81411. continue;
  81412. }
  81413. // 数字转换判断
  81414. try {
  81415. if (!isNaN(decimalNumber) && decimalNumber >= 0) {
  81416. fieldsValue.push(parseFloat(attrs[field].toString()).toFixed(decimalNumber));
  81417. } else {
  81418. fieldsValue.push(parseFloat(attrs[field].toString()));
  81419. }
  81420. } catch (e) {
  81421. throw new Error("not a number");
  81422. }
  81423. }
  81424. }
  81425. if (fieldsValue.length === fields.length) {
  81426. return fieldsValue;
  81427. } else {
  81428. return false;
  81429. }
  81430. };
  81431. ;// CONCATENATED MODULE: ./src/common/overlay/Bar.js
  81432. function Bar_typeof(obj) { "@babel/helpers - typeof"; return Bar_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, Bar_typeof(obj); }
  81433. function Bar_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  81434. function Bar_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  81435. function Bar_createClass(Constructor, protoProps, staticProps) { if (protoProps) Bar_defineProperties(Constructor.prototype, protoProps); if (staticProps) Bar_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  81436. function Bar_get() { if (typeof Reflect !== "undefined" && Reflect.get) { Bar_get = Reflect.get.bind(); } else { Bar_get = function _get(target, property, receiver) { var base = Bar_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return Bar_get.apply(this, arguments); }
  81437. function Bar_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Bar_getPrototypeOf(object); if (object === null) break; } return object; }
  81438. function Bar_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) Bar_setPrototypeOf(subClass, superClass); }
  81439. function Bar_setPrototypeOf(o, p) { Bar_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Bar_setPrototypeOf(o, p); }
  81440. function Bar_createSuper(Derived) { var hasNativeReflectConstruct = Bar_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Bar_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Bar_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Bar_possibleConstructorReturn(this, result); }; }
  81441. function Bar_possibleConstructorReturn(self, call) { if (call && (Bar_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return Bar_assertThisInitialized(self); }
  81442. function Bar_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  81443. function Bar_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  81444. function Bar_getPrototypeOf(o) { Bar_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Bar_getPrototypeOf(o); }
  81445. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  81446. * This program are made available under the terms of the Apache License, Version 2.0
  81447. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  81448. /**
  81449. * @class FeatureThemeBar
  81450. * @aliasclass Feature.Theme.Bar
  81451. * @deprecatedclass SuperMap.Feature.Theme.Bar
  81452. * @classdesc 柱状图 。
  81453. * @category Visualization Theme
  81454. * @example
  81455. * // barStyleByCodomain参数用法如下:
  81456. * // barStyleByCodomain 的每个元素是个包含值域信息和与值域对应样式信息的对象,该对象(必须)有三个属性:
  81457. * // start: 值域值下限(包含);
  81458. * // end: 值域值上限(不包含);
  81459. * // style: 数据可视化图形的 style,这个样式对象的可设属性: <ShapeParametersPolygon.style> 。
  81460. * // barStyleByCodomain 数组形如:
  81461. * [
  81462. * {
  81463. * start:0,
  81464. * end:250,
  81465. * style:{
  81466. * fillColor:"#00CD00"
  81467. * }
  81468. * },
  81469. * {
  81470. * start:250,
  81471. * end:500,
  81472. * style:{
  81473. * fillColor:"#00EE00"
  81474. * }
  81475. * },
  81476. * {
  81477. * start:500,
  81478. * end:750,
  81479. * style:{
  81480. * fillColor:"#00FF7F"
  81481. * }
  81482. * },
  81483. * {
  81484. * start:750,
  81485. * end:1500,
  81486. * style:{
  81487. * fillColor:"#00FF00"
  81488. * }
  81489. * }
  81490. * ]
  81491. * @extends FeatureThemeGraph
  81492. * @param {FeatureVector} data - 用户数据。
  81493. * @param {SuperMap.Layer.Graph} layer - 此专题要素所在图层。
  81494. * @param {Array.<string>} fields - data 属性中的参与此图表生成的属性字段名称。
  81495. * @param {FeatureThemeBar.setting} setting - 图表配置对象。
  81496. * @param {LonLat} [lonlat] - 专题要素地理位置。默认为 data 指代的地理要素 Bounds 中心。
  81497. * @usage
  81498. * @private
  81499. */
  81500. var Bar = /*#__PURE__*/function (_Graph) {
  81501. Bar_inherits(Bar, _Graph);
  81502. var _super = Bar_createSuper(Bar);
  81503. function Bar(data, layer, fields, setting, lonlat) {
  81504. var _this;
  81505. Bar_classCallCheck(this, Bar);
  81506. _this = _super.call(this, data, layer, fields, setting, lonlat);
  81507. _this.CLASS_NAME = "SuperMap.Feature.Theme.Bar";
  81508. return _this;
  81509. }
  81510. /**
  81511. * @function FeatureThemeBar.prototype.destroy
  81512. * @override
  81513. */
  81514. Bar_createClass(Bar, [{
  81515. key: "destroy",
  81516. value: function destroy() {
  81517. Bar_get(Bar_getPrototypeOf(Bar.prototype), "destroy", this).call(this);
  81518. }
  81519. /**
  81520. * @function FeatureThemeBar.prototype.assembleShapes
  81521. * @description 图表图形装配函数。
  81522. */
  81523. }, {
  81524. key: "assembleShapes",
  81525. value: function assembleShapes() {
  81526. //默认渐变颜色数组
  81527. var deafaultColors = [["#00FF00", "#00CD00"], ["#00CCFF", "#5E87A2"], ["#00FF66", "#669985"], ["#CCFF00", "#94A25E"], ["#FF9900", "#A2945E"]];
  81528. //默认阴影
  81529. var deafaultShawdow = {
  81530. showShadow: true,
  81531. shadowBlur: 8,
  81532. shadowColor: "rgba(100,100,100,0.8)",
  81533. shadowOffsetX: 2,
  81534. shadowOffsetY: 2
  81535. };
  81536. // 图表配置对象
  81537. var sets = this.setting;
  81538. if (!sets.barLinearGradient) {
  81539. sets.barLinearGradient = deafaultColors;
  81540. }
  81541. // 默认数据视图框
  81542. if (!sets.dataViewBoxParameter) {
  81543. if (typeof sets.useAxis === "undefined" || sets.useAxis) {
  81544. sets.dataViewBoxParameter = [45, 15, 15, 15];
  81545. } else {
  81546. sets.dataViewBoxParameter = [5, 5, 5, 5];
  81547. }
  81548. }
  81549. // 重要步骤:初始化参数
  81550. if (!this.initBaseParameter()) {
  81551. return;
  81552. }
  81553. // 值域
  81554. var codomain = this.DVBCodomain;
  81555. // 重要步骤:定义图表 BaFeatureThemeBarr 数据视图框中单位值的含义
  81556. this.DVBUnitValue = (codomain[1] - codomain[0]) / this.DVBHeight;
  81557. // 数据视图域
  81558. var dvb = this.dataViewBox;
  81559. // 用户数据值
  81560. var fv = this.dataValues;
  81561. if (fv.length < 1) {
  81562. return;
  81563. } // 没有数据
  81564. // 数据溢出值域范围处理
  81565. for (var _i2 = 0, fvLen = fv.length; _i2 < fvLen; _i2++) {
  81566. if (fv[_i2] < codomain[0] || fv[_i2] > codomain[1]) {
  81567. return;
  81568. }
  81569. }
  81570. // 获取 x 轴上的图形信息
  81571. var xShapeInfo = this.calculateXShapeInfo();
  81572. if (!xShapeInfo) {
  81573. return;
  81574. }
  81575. // 每个柱条 x 位置
  81576. var xsLoc = xShapeInfo.xPositions;
  81577. // 柱条宽度
  81578. var xsWdith = xShapeInfo.width;
  81579. // 背景框,默认启用
  81580. if (typeof sets.useBackground === "undefined" || sets.useBackground) {
  81581. // 将背景框图形添加到模型的 shapes 数组,注意添加顺序,后添加的图形在先添加的图形之上。
  81582. this.shapes.push(ShapeFactory.Background(this.shapeFactory, this.chartBox, sets));
  81583. }
  81584. // 坐标轴, 默认启用
  81585. if (typeof sets.useAxis === "undefined" || sets.useAxis) {
  81586. // 添加坐标轴图形数组
  81587. this.shapes = this.shapes.concat(ShapeFactory.GraphAxis(this.shapeFactory, dvb, sets, xShapeInfo));
  81588. }
  81589. for (var i = 0; i < fv.length; i++) {
  81590. // 计算柱条 top 边的 y 轴坐标值
  81591. var yPx = dvb[1] - (fv[i] - codomain[0]) / this.DVBUnitValue;
  81592. // 柱条节点数组
  81593. var poiLists = [[xsLoc[i] - xsWdith / 2, dvb[1] - 1], [xsLoc[i] + xsWdith / 2, dvb[1] - 1], [xsLoc[i] + xsWdith / 2, yPx], [xsLoc[i] - xsWdith / 2, yPx]];
  81594. // 柱条参数对象(一个面参数对象)
  81595. var barParams = new feature_Polygon_Polygon(poiLists);
  81596. // 柱条 阴影 style
  81597. if (typeof sets.showShadow === "undefined" || sets.showShadow) {
  81598. if (sets.barShadowStyle) {
  81599. var sss = sets.barShadowStyle;
  81600. if (sss.shadowBlur) {
  81601. deafaultShawdow.shadowBlur = sss.shadowBlur;
  81602. }
  81603. if (sss.shadowColor) {
  81604. deafaultShawdow.shadowColor = sss.shadowColor;
  81605. }
  81606. if (sss.shadowOffsetX) {
  81607. deafaultShawdow.shadowOffsetX = sss.shadowOffsetX;
  81608. }
  81609. if (sss.shadowOffsetY) {
  81610. deafaultShawdow.shadowOffsetY = sss.shadowOffsetY;
  81611. }
  81612. }
  81613. barParams.style = {};
  81614. Util_Util.copyAttributesWithClip(barParams.style, deafaultShawdow);
  81615. }
  81616. // 图形携带的数据信息
  81617. barParams.refDataID = this.data.id;
  81618. barParams.dataInfo = {
  81619. field: this.fields[i],
  81620. value: fv[i]
  81621. };
  81622. // 柱条 hover click
  81623. if (typeof sets.barHoverAble !== "undefined") {
  81624. barParams.hoverable = sets.barHoverAble;
  81625. }
  81626. if (typeof sets.barClickAble !== "undefined") {
  81627. barParams.clickable = sets.barClickAble;
  81628. }
  81629. // 创建柱条并添加到图表图形数组中
  81630. this.shapes.push(this.shapeFactory.createShape(barParams));
  81631. }
  81632. // 重要步骤:将图形转为由相对坐标表示的图形,以便在地图平移缩放过程中快速重绘图形
  81633. // (统计专题图模块从结构上要求使用相对坐标,assembleShapes() 函数必须在图形装配完成后调用 shapesConvertToRelativeCoordinate() 函数)
  81634. this.shapesConvertToRelativeCoordinate();
  81635. }
  81636. /**
  81637. * @function FeatureThemeBar.prototype.calculateXShapeInfo
  81638. * @description 计算 X 轴方向上的图形信息,此信息是一个对象,包含两个属性,
  81639. * 属性 xPositions 是一个一维数组,该数组元素表示图形在 x 轴方向上的像素坐标值,
  81640. * 如果图形在 x 方向上有一定宽度,通常取图形在 x 方向上的中心点为图形在 x 方向上的坐标值。
  81641. * width 表示图形的宽度(特别注意:点的宽度始终为 0,而不是其直径)。
  81642. * 本函数中图形配置对象 setting 可设属性:
  81643. * xShapeBlank - {Array.<number>} 水平方向上的图形空白间隔参数。
  81644. * 长度为 3 的数组,第一元素表示第一个图形左端与数据视图框左端的空白间距,第二个元素表示图形间空白间距,
  81645. * 第三个元素表示最后一个图形右端与数据视图框右端端的空白间距 。
  81646. * @returns {Object} 如果计算失败,返回 null;如果计算成功,返回 X 轴方向上的图形信息,此信息是一个对象,包含以下两个属性:
  81647. * xPositions - {Array.<number>} 表示图形在 x 轴方向上的像素坐标值,如果图形在 x 方向上有一定宽度,通常取图形在 x 方向上的中心点为图形在 x 方向上的坐标值。
  81648. * width - {number} 表示图形的宽度(特别注意:点的宽度始终为 0,而不是其直径)。
  81649. *
  81650. */
  81651. }, {
  81652. key: "calculateXShapeInfo",
  81653. value: function calculateXShapeInfo() {
  81654. var dvb = this.dataViewBox; // 数据视图框
  81655. var sets = this.setting; // 图表配置对象
  81656. var fvc = this.dataValues.length; // 数组值个数
  81657. if (fvc < 1) {
  81658. return null;
  81659. }
  81660. var xBlank; // x 轴空白间隔参数
  81661. var xShapePositions = []; // x 轴上图形的位置
  81662. var xShapeWidth = 0; // x 轴上图形宽度(自适应)
  81663. var dvbWidth = this.DVBWidth; // 数据视图框宽度
  81664. // x 轴空白间隔参数处理
  81665. if (sets.xShapeBlank && sets.xShapeBlank.length && sets.xShapeBlank.length == 3) {
  81666. xBlank = sets.xShapeBlank;
  81667. var xsLen = dvbWidth - (xBlank[0] + xBlank[2] + (fvc - 1) * xBlank[1]);
  81668. if (xsLen <= fvc) {
  81669. return null;
  81670. }
  81671. xShapeWidth = xsLen / fvc;
  81672. } else {
  81673. // 默认使用等距离空白间隔,空白间隔为图形宽度
  81674. xShapeWidth = dvbWidth / (2 * fvc + 1);
  81675. xBlank = [xShapeWidth, xShapeWidth, xShapeWidth];
  81676. }
  81677. // 图形 x 轴上的位置计算
  81678. var xOffset = 0;
  81679. for (var i = 0; i < fvc; i++) {
  81680. if (i == 0) {
  81681. xOffset = xBlank[0] + xShapeWidth / 2;
  81682. } else {
  81683. xOffset += xShapeWidth + xBlank[1];
  81684. }
  81685. xShapePositions.push(dvb[0] + xOffset);
  81686. }
  81687. return {
  81688. "xPositions": xShapePositions,
  81689. "width": xShapeWidth
  81690. };
  81691. }
  81692. /**
  81693. * @function FeatureThemeBar.prototype.resetLinearGradient
  81694. * @description 图表的相对坐标存在的时候,重新计算渐变的颜色(目前用于二维柱状图 所以子类实现此方法)。
  81695. */
  81696. }, {
  81697. key: "resetLinearGradient",
  81698. value: function resetLinearGradient() {
  81699. if (this.RelativeCoordinate) {
  81700. var shpelength = this.shapes.length;
  81701. var barLinearGradient = this.setting.barLinearGradient;
  81702. var index = -1;
  81703. for (var i = 0; i < shpelength; i++) {
  81704. var shape = this.shapes[i];
  81705. if (shape.CLASS_NAME === "SuperMap.LevelRenderer.Shape.SmicPolygon") {
  81706. var style = shape.style;
  81707. //计算出当前的绝对 x y
  81708. var x1 = this.location[0] + style.pointList[0][0];
  81709. var x2 = this.location[0] + style.pointList[1][0];
  81710. //渐变颜色
  81711. index++;
  81712. //以防定义的颜色数组不够用
  81713. if (index >= barLinearGradient.length) {
  81714. index = index % barLinearGradient.length;
  81715. }
  81716. var color1 = barLinearGradient[index][0];
  81717. var color2 = barLinearGradient[index][1];
  81718. //颜色
  81719. var zcolor = new Color_Color();
  81720. var linearGradient = zcolor.getLinearGradient(x1, 0, x2, 0, [[0, color1], [1, color2]]);
  81721. //赋值
  81722. shape.style.color = linearGradient;
  81723. }
  81724. }
  81725. }
  81726. }
  81727. }]);
  81728. return Bar;
  81729. }(Graph);
  81730. ;// CONCATENATED MODULE: ./src/common/overlay/Bar3D.js
  81731. function Bar3D_typeof(obj) { "@babel/helpers - typeof"; return Bar3D_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, Bar3D_typeof(obj); }
  81732. function Bar3D_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  81733. function Bar3D_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  81734. function Bar3D_createClass(Constructor, protoProps, staticProps) { if (protoProps) Bar3D_defineProperties(Constructor.prototype, protoProps); if (staticProps) Bar3D_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  81735. function Bar3D_get() { if (typeof Reflect !== "undefined" && Reflect.get) { Bar3D_get = Reflect.get.bind(); } else { Bar3D_get = function _get(target, property, receiver) { var base = Bar3D_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return Bar3D_get.apply(this, arguments); }
  81736. function Bar3D_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Bar3D_getPrototypeOf(object); if (object === null) break; } return object; }
  81737. function Bar3D_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) Bar3D_setPrototypeOf(subClass, superClass); }
  81738. function Bar3D_setPrototypeOf(o, p) { Bar3D_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Bar3D_setPrototypeOf(o, p); }
  81739. function Bar3D_createSuper(Derived) { var hasNativeReflectConstruct = Bar3D_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Bar3D_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Bar3D_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Bar3D_possibleConstructorReturn(this, result); }; }
  81740. function Bar3D_possibleConstructorReturn(self, call) { if (call && (Bar3D_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return Bar3D_assertThisInitialized(self); }
  81741. function Bar3D_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  81742. function Bar3D_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  81743. function Bar3D_getPrototypeOf(o) { Bar3D_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Bar3D_getPrototypeOf(o); }
  81744. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  81745. * This program are made available under the terms of the Apache License, Version 2.0
  81746. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  81747. /**
  81748. * @class FeatureThemeBar3D
  81749. * @aliasclass Feature.Theme.Bar3D
  81750. * @deprecatedclass SuperMap.Feature.Theme.Bar3D
  81751. * @classdesc 三维柱状图 。
  81752. * @category Visualization Theme
  81753. * @extends FeatureThemeGraph
  81754. * @param {FeatureVector} data - 用户数据。
  81755. * @param {SuperMap.Layer.Graph} layer - 此专题要素所在图层。
  81756. * @param {Array.<string>} fields - data 中的参与此图表生成的字段名称。
  81757. * @param {FeatureThemeBar3D.setting} setting - 图表配置对象。
  81758. * @param {LonLat} [lonlat] - 专题要素地理位置,默认为 data 指代的地理要素 Bounds 中心。
  81759. *
  81760. *
  81761. * @example
  81762. * // barFaceStyleByCodomain 用法示例如下:
  81763. * // barFaceStyleByCodomain 的每个元素是个包含值域信息和与值域对应样式信息的对象,该对象(必须)有三个属性:
  81764. * // start: 值域值下限(包含);
  81765. * // end: 值域值上限(不包含);
  81766. * // style: 数据可视化图形的 style,这个样式对象的可设属性: <ShapeParametersPolygon.style> 。
  81767. * // barFaceStyleByCodomain 数组形如:
  81768. * [
  81769. * {
  81770. * start:0,
  81771. * end:250,
  81772. * style:{
  81773. * fillColor:"#00CD00"
  81774. * }
  81775. * },
  81776. * {
  81777. * start:250,
  81778. * end:500,
  81779. * style:{
  81780. * fillColor:"#00EE00"
  81781. * }
  81782. * },
  81783. * {
  81784. * start:500,
  81785. * end:750,
  81786. * style:{
  81787. * fillColor:"#00FF7F"
  81788. * }
  81789. * },
  81790. * {
  81791. * start:750,
  81792. * end:1500,
  81793. * style:{
  81794. * fillColor:"#00FF00"
  81795. * }
  81796. * }
  81797. * ]
  81798. *
  81799. * @example
  81800. * // barSideStyleByCodomain 用法示例如下:
  81801. * // barSideStyleByCodomain 的每个元素是个包含值域信息和与值域对应样式信息的对象,该对象(必须)有三个属性:
  81802. * // start: 值域值下限(包含);
  81803. * // end: 值域值上限(不包含);
  81804. * // style: 数据可视化图形的 style,这个样式对象的可设属性: <ShapeParametersPolygon.style> 。
  81805. * // barSideStyleByCodomain 数组形如:
  81806. * [
  81807. * {
  81808. * start:0,
  81809. * end:250,
  81810. * style:{
  81811. * fillColor:"#00CD00"
  81812. * }
  81813. * },
  81814. * {
  81815. * start:250,
  81816. * end:500,
  81817. * style:{
  81818. * fillColor:"#00EE00"
  81819. * }
  81820. * },
  81821. * {
  81822. * start:500,
  81823. * end:750,
  81824. * style:{
  81825. * fillColor:"#00FF7F"
  81826. * }
  81827. * },
  81828. * {
  81829. * start:750,
  81830. * end:1500,
  81831. * style:{
  81832. * fillColor:"#00FF00"
  81833. * }
  81834. * }
  81835. * ]
  81836. *
  81837. * @example
  81838. * // barTopStyleByCodomain 用法示例如下:
  81839. * // barTopStyleByCodomain 的每个元素是个包含值域信息和与值域对应样式信息的对象,该对象(必须)有三个属性:
  81840. * // start: 值域值下限(包含);
  81841. * // end: 值域值上限(不包含);
  81842. * // style: 数据可视化图形的 style,这个样式对象的可设属性:<ShapeParametersPolygon.style> 。
  81843. * // barTopStyleByCodomain 数组形如:
  81844. * [
  81845. * {
  81846. * start:0,
  81847. * end:250,
  81848. * style:{
  81849. * fillColor:"#00CD00"
  81850. * }
  81851. * },
  81852. * {
  81853. * start:250,
  81854. * end:500,
  81855. * style:{
  81856. * fillColor:"#00EE00"
  81857. * }
  81858. * },
  81859. * {
  81860. * start:500,
  81861. * end:750,
  81862. * style:{
  81863. * fillColor:"#00FF7F"
  81864. * }
  81865. * },
  81866. * {
  81867. * start:750,
  81868. * end:1500,
  81869. * style:{
  81870. * fillColor:"#00FF00"
  81871. * }
  81872. * }
  81873. * ]
  81874. * @usage
  81875. * @private
  81876. */
  81877. var Bar3D = /*#__PURE__*/function (_Graph) {
  81878. Bar3D_inherits(Bar3D, _Graph);
  81879. var _super = Bar3D_createSuper(Bar3D);
  81880. function Bar3D(data, layer, fields, setting, lonlat) {
  81881. var _this;
  81882. Bar3D_classCallCheck(this, Bar3D);
  81883. _this = _super.call(this, data, layer, fields, setting, lonlat);
  81884. _this.CLASS_NAME = "SuperMap.Feature.Theme.Bar3D";
  81885. return _this;
  81886. }
  81887. /**
  81888. * @function FeatureThemeBar3D.prototype.destroy
  81889. * @override
  81890. */
  81891. Bar3D_createClass(Bar3D, [{
  81892. key: "destroy",
  81893. value: function destroy() {
  81894. Bar3D_get(Bar3D_getPrototypeOf(Bar3D.prototype), "destroy", this).call(this);
  81895. }
  81896. /**
  81897. * @function FeatureThemeBar3D.prototype.assembleShapes
  81898. * @description 图形装配实现(扩展接口)。
  81899. */
  81900. }, {
  81901. key: "assembleShapes",
  81902. value: function assembleShapes() {
  81903. // 图表配置对象
  81904. var sets = this.setting;
  81905. // 默认数据视图框
  81906. if (!sets.dataViewBoxParameter) {
  81907. if (typeof sets.useAxis === "undefined" || sets.useAxis) {
  81908. sets.dataViewBoxParameter = [45, 25, 20, 20];
  81909. } else {
  81910. sets.dataViewBoxParameter = [5, 5, 5, 5];
  81911. }
  81912. }
  81913. // 3d 柱图的坐标轴默认使用坐标轴箭头
  81914. sets.axisUseArrow = typeof sets.axisUseArrow !== "undefined" ? sets.axisUseArrow : true;
  81915. sets.axisXLabelsOffset = typeof sets.axisXLabelsOffset !== "undefined" ? sets.axisXLabelsOffset : [-10, 10];
  81916. // 重要步骤:初始化参数
  81917. if (!this.initBaseParameter()) {
  81918. return;
  81919. }
  81920. // 值域
  81921. var codomain = this.DVBCodomain;
  81922. // 重要步骤:定义图表 FeatureThemeBar 数据视图框中单位值的含义
  81923. this.DVBUnitValue = (codomain[1] - codomain[0]) / this.DVBHeight;
  81924. // 数据视图域
  81925. var dvb = this.dataViewBox;
  81926. // 用户数据值
  81927. var fv = this.dataValues;
  81928. if (fv.length < 1) {
  81929. return;
  81930. } // 没有数据
  81931. // 数据溢出值域范围处理
  81932. for (var i = 0, fvLen = fv.length; i < fvLen; i++) {
  81933. if (fv[i] < codomain[0] || fv[i] > codomain[1]) {
  81934. return;
  81935. }
  81936. }
  81937. // 获取 x 轴上的图形信息
  81938. var xShapeInfo = this.calculateXShapeInfo();
  81939. if (!xShapeInfo) {
  81940. return;
  81941. }
  81942. // 每个柱条 x 位置
  81943. var xsLoc = xShapeInfo.xPositions;
  81944. // 柱条宽度
  81945. var xsWdith = xShapeInfo.width;
  81946. // 坐标轴, 默认启用
  81947. if (typeof sets.useBackground === "undefined" || sets.useBackground) {
  81948. this.shapes.push(ShapeFactory.Background(this.shapeFactory, this.chartBox, sets));
  81949. }
  81950. // 坐标轴
  81951. if (!sets.axis3DParameter || isNaN(sets.axis3DParameter) || sets.axis3DParameter < 15) {
  81952. sets.axis3DParameter = 20;
  81953. }
  81954. if (typeof sets.useAxis === "undefined" || sets.useAxis) {
  81955. this.shapes = this.shapes.concat(ShapeFactory.GraphAxis(this.shapeFactory, dvb, sets, xShapeInfo));
  81956. }
  81957. // 3d 偏移量, 默认值 10;
  81958. var offset3d = sets.bar3DParameter && !isNaN(sets.bar3DParameter) ? sets.bar3DParameter : 10;
  81959. for (var _i2 = 0; _i2 < fv.length; _i2++) {
  81960. // 无 3d 偏移量时的柱面顶部 y 坐标
  81961. var yPx = dvb[1] - (fv[_i2] - codomain[0]) / this.DVBUnitValue;
  81962. // 无 3d 偏移量时的柱面的左、右端 x 坐标
  81963. var iPoiL = xsLoc[_i2] - xsWdith / 2;
  81964. var iPoiR = xsLoc[_i2] + xsWdith / 2;
  81965. // 3d 柱顶面节点
  81966. var bar3DTopPois = [[iPoiL, yPx], [iPoiR, yPx], [iPoiR - offset3d, yPx + offset3d], [iPoiL - offset3d, yPx + offset3d]];
  81967. // 3d 柱侧面节点
  81968. var bar3DSidePois = [[iPoiR, yPx], [iPoiR - offset3d, yPx + offset3d], [iPoiR - offset3d, dvb[1] + offset3d], [iPoiR, dvb[1]]];
  81969. // 3d 柱正面节点
  81970. var bar3DFacePois = [[iPoiL - offset3d, dvb[1] + offset3d], [iPoiR - offset3d, dvb[1] + offset3d], [iPoiR - offset3d, yPx + offset3d], [iPoiL - offset3d, yPx + offset3d]];
  81971. if (offset3d <= 0) {
  81972. // offset3d <= 0 时正面不偏移
  81973. bar3DFacePois = [[iPoiL, dvb[1]], [iPoiR, dvb[1]], [iPoiR, yPx], [iPoiL, yPx]];
  81974. }
  81975. // 新建 3d 柱面顶面、侧面、正面图形参数对象
  81976. var polyTopSP = new feature_Polygon_Polygon(bar3DTopPois);
  81977. var polySideSP = new feature_Polygon_Polygon(bar3DSidePois);
  81978. var polyFaceSP = new feature_Polygon_Polygon(bar3DFacePois);
  81979. // 侧面、正面图形 style 默认值
  81980. sets.barSideStyle = sets.barSideStyle ? sets.barSideStyle : sets.barFaceStyle;
  81981. sets.barSideStyleByFields = sets.barSideStyleByFields ? sets.barSideStyleByFields : sets.barFaceStyleByFields;
  81982. sets.barSideStyleByCodomain = sets.barSideStyleByCodomain ? sets.barSideStyleByCodomain : sets.barFaceStyleByCodomain;
  81983. sets.barTopStyle = sets.barTopStyle ? sets.barTopStyle : sets.barFaceStyle;
  81984. sets.barTopStyleByFields = sets.barTopStyleByFields ? sets.barTopStyleByFields : sets.barFaceStyleByFields;
  81985. sets.barTopStyleByCodomain = sets.barTopStyleByCodomain ? sets.barTopStyleByCodomain : sets.barFaceStyleByCodomain;
  81986. // 顶面、侧面、正面图形 style
  81987. polyFaceSP.style = ShapeFactory.ShapeStyleTool({
  81988. stroke: true,
  81989. strokeColor: "#ffffff",
  81990. fillColor: "#ee9900"
  81991. }, sets.barFaceStyle, sets.barFaceStyleByFields, sets.barFaceStyleByCodomain, _i2, fv[_i2]);
  81992. polySideSP.style = ShapeFactory.ShapeStyleTool({
  81993. stroke: true,
  81994. strokeColor: "#ffffff",
  81995. fillColor: "#ee9900"
  81996. }, sets.barSideStyle, sets.barSideStyleByFields, sets.barSideStyleByCodomain, _i2, fv[_i2]);
  81997. polyTopSP.style = ShapeFactory.ShapeStyleTool({
  81998. stroke: true,
  81999. strokeColor: "#ffffff",
  82000. fillColor: "#ee9900"
  82001. }, sets.barTopStyle, sets.barTopStyleByFields, sets.barTopStyleByCodomain, _i2, fv[_i2]);
  82002. // 3d 柱条高亮样式
  82003. sets.barSideHoverStyle = sets.barSideHoverStyle ? sets.barSideHoverStyle : sets.barFaceHoverStyle;
  82004. sets.barTopHoverStyle = sets.barTopHoverStyle ? sets.barTopHoverStyle : sets.barFaceHoverStyle;
  82005. polyFaceSP.highlightStyle = ShapeFactory.ShapeStyleTool({
  82006. stroke: true
  82007. }, sets.barFaceHoverStyle);
  82008. polySideSP.highlightStyle = ShapeFactory.ShapeStyleTool({
  82009. stroke: true
  82010. }, sets.barSideHoverStyle);
  82011. polyTopSP.highlightStyle = ShapeFactory.ShapeStyleTool({
  82012. stroke: true
  82013. }, sets.barTopHoverStyle);
  82014. // 图形携带的数据 id 信息 & 高亮模式
  82015. polyTopSP.refDataID = polySideSP.refDataID = polyFaceSP.refDataID = this.data.id;
  82016. // hover 模式(组合)
  82017. polyTopSP.isHoverByRefDataID = polySideSP.isHoverByRefDataID = polyFaceSP.isHoverByRefDataID = true;
  82018. // 高亮组(当鼠标 hover 到组内任何一个图形,整个组的图形都会高亮。refDataHoverGroup 在 isHoverByRefDataID 为 true 时有效)
  82019. polyTopSP.refDataHoverGroup = polySideSP.refDataHoverGroup = polyFaceSP.refDataHoverGroup = Util_Util.createUniqueID("lr_shg");
  82020. // 图形携带的数据信息
  82021. polyTopSP.dataInfo = polySideSP.dataInfo = polyFaceSP.dataInfo = {
  82022. field: this.fields[_i2],
  82023. value: fv[_i2]
  82024. };
  82025. // 3d 柱条顶面、侧面、正面图形 hover click 设置
  82026. if (typeof sets.barHoverAble !== "undefined") {
  82027. polyTopSP.hoverable = polySideSP.hoverable = polyFaceSP.hoverable = sets.barHoverAble;
  82028. }
  82029. if (typeof sets.barClickAble !== "undefined") {
  82030. polyTopSP.clickable = polySideSP.clickable = polyFaceSP.clickable = sets.barClickAble;
  82031. }
  82032. // 创建3d 柱条的顶面、侧面、正面图形并添加到图表的图形列表数组
  82033. this.shapes.push(this.shapeFactory.createShape(polySideSP));
  82034. this.shapes.push(this.shapeFactory.createShape(polyTopSP));
  82035. this.shapes.push(this.shapeFactory.createShape(polyFaceSP));
  82036. }
  82037. // 重要步骤:将图形转为由相对坐标表示的图形,以便在地图平移缩放过程中快速重绘图形
  82038. // (统计专题图模块从结构上要求使用相对坐标,assembleShapes() 函数必须在图形装配完成后调用 shapesConvertToRelativeCoordinate() 函数)
  82039. this.shapesConvertToRelativeCoordinate();
  82040. }
  82041. /**
  82042. * @function FeatureThemeBar3D.prototype.calculateXShapeInfo
  82043. * @description 计算 X 轴方向上的图形信息,此信息是一个对象,包含两个属性,
  82044. * 属性 xPositions 是一个一维数组,该数组元素表示图形在 x 轴方向上的像素坐标值,
  82045. * 如果图形在 x 方向上有一定宽度,通常取图形在 x 方向上的中心点为图形在 x 方向上的坐标值。
  82046. * width 表示图形的宽度(特别注意:点的宽度始终为 0,而不是其直径)。
  82047. * 本函数中图形配置对象 setting 可设属性:
  82048. * xShapeBlank - {Array.<number>} 水平方向上的图形空白间隔参数。
  82049. * 长度为 3 的数组,第一元素表示第一个图形左端与数据视图框左端的空白间距,第二个元素表示图形间空白间距,
  82050. * 第三个元素表示最后一个图形右端与数据视图框右端端的空白间距 。
  82051. * @returns {Object} 如果计算失败,返回 null;如果计算成功,返回 X 轴方向上的图形信息,此信息是一个对象,包含以下两个属性:
  82052. * xPositions - {Array.<number>} 表示图形在 x 轴方向上的像素坐标值,如果图形在 x 方向上有一定宽度,通常取图形在 x 方向上的中心点为图形在 x 方向上的坐标值。
  82053. * width - {number} 表示图形的宽度(特别注意:点的宽度始终为 0,而不是其直径)。
  82054. */
  82055. }, {
  82056. key: "calculateXShapeInfo",
  82057. value: function calculateXShapeInfo() {
  82058. var dvb = this.dataViewBox; // 数据视图框
  82059. var sets = this.setting; // 图表配置对象
  82060. var fvc = this.dataValues.length; // 数组值个数
  82061. if (fvc < 1) {
  82062. return null;
  82063. }
  82064. var xBlank; // x 轴空白间隔参数
  82065. var xShapePositions = []; // x 轴上图形的位置
  82066. var xShapeWidth = 0; // x 轴上图形宽度(自适应)
  82067. var dvbWidth = this.DVBWidth; // 数据视图框宽度
  82068. // x 轴空白间隔参数处理
  82069. if (sets.xShapeBlank && sets.xShapeBlank.length && sets.xShapeBlank.length == 3) {
  82070. xBlank = sets.xShapeBlank;
  82071. var xsLen = dvbWidth - (xBlank[0] + xBlank[2] + (fvc - 1) * xBlank[1]);
  82072. if (xsLen <= fvc) {
  82073. return null;
  82074. }
  82075. xShapeWidth = xsLen / fvc;
  82076. } else {
  82077. // 默认使用等距离空白间隔,空白间隔为图形宽度
  82078. xShapeWidth = dvbWidth / (2 * fvc + 1);
  82079. xBlank = [xShapeWidth, xShapeWidth, xShapeWidth];
  82080. }
  82081. // 图形 x 轴上的位置计算
  82082. var xOffset = 0;
  82083. for (var i = 0; i < fvc; i++) {
  82084. if (i == 0) {
  82085. xOffset = xBlank[0] + xShapeWidth / 2;
  82086. } else {
  82087. xOffset += xShapeWidth + xBlank[1];
  82088. }
  82089. xShapePositions.push(dvb[0] + xOffset);
  82090. }
  82091. return {
  82092. "xPositions": xShapePositions,
  82093. "width": xShapeWidth
  82094. };
  82095. }
  82096. }]);
  82097. return Bar3D;
  82098. }(Graph);
  82099. ;// CONCATENATED MODULE: ./src/common/overlay/RankSymbol.js
  82100. function RankSymbol_typeof(obj) { "@babel/helpers - typeof"; return RankSymbol_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, RankSymbol_typeof(obj); }
  82101. function RankSymbol_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  82102. function RankSymbol_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  82103. function RankSymbol_createClass(Constructor, protoProps, staticProps) { if (protoProps) RankSymbol_defineProperties(Constructor.prototype, protoProps); if (staticProps) RankSymbol_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  82104. function RankSymbol_get() { if (typeof Reflect !== "undefined" && Reflect.get) { RankSymbol_get = Reflect.get.bind(); } else { RankSymbol_get = function _get(target, property, receiver) { var base = RankSymbol_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return RankSymbol_get.apply(this, arguments); }
  82105. function RankSymbol_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = RankSymbol_getPrototypeOf(object); if (object === null) break; } return object; }
  82106. function RankSymbol_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) RankSymbol_setPrototypeOf(subClass, superClass); }
  82107. function RankSymbol_setPrototypeOf(o, p) { RankSymbol_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return RankSymbol_setPrototypeOf(o, p); }
  82108. function RankSymbol_createSuper(Derived) { var hasNativeReflectConstruct = RankSymbol_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = RankSymbol_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = RankSymbol_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return RankSymbol_possibleConstructorReturn(this, result); }; }
  82109. function RankSymbol_possibleConstructorReturn(self, call) { if (call && (RankSymbol_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return RankSymbol_assertThisInitialized(self); }
  82110. function RankSymbol_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  82111. function RankSymbol_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  82112. function RankSymbol_getPrototypeOf(o) { RankSymbol_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return RankSymbol_getPrototypeOf(o); }
  82113. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  82114. * This program are made available under the terms of the Apache License, Version 2.0
  82115. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  82116. /**
  82117. * @class FeatureThemeRankSymbol
  82118. * @aliasclass Feature.Theme.RankSymbol
  82119. * @deprecatedclass SuperMap.Feature.Theme.RankSymbol
  82120. * @category Visualization Theme
  82121. * @classdesc 符号专题要素基类。此类定义了符号专题要素基础模型,具体的图表模型通过继承此类,在子类中实现 assembleShapes 方法。
  82122. * 符号专题要素模型采用了可视化图形大小自适应策略,用较少的参数控制着图表诸多图形,图表配置对象 <FeatureThemeRankSymbol.setting> 的基础属性只有 5 个,
  82123. * 它们控制着图表结构、值域范围、数据小数位等基础图表形态。构成图表的图形必须在图表结构里自适应大小。
  82124. * 此类不可实例化,此类的可实例化子类必须实现 assembleShapes() 方法。
  82125. * @param {FeatureVector} data - 用户数据。
  82126. * @param {SuperMap.Layer.RankSymbol} layer - 此专题要素所在图层。
  82127. * @param {Array.<string>} fields - data 中的参与此图表生成的字段名称。
  82128. * @param {LonLat} [lonlat] - 专题要素地理位置。默认为 data 指代的地理要素 Bounds 中心。
  82129. * @param {Object} setting - 图表配置对象。除了以下 5 个基础属性,此对象的可设属性在不同子类中有较大差异,不同子类中对同一属性的解释也可能不同,请在此类的子类中查看 setting 对象的可设属性和属性含义。
  82130. * @param {Array.<number>} setting.codomain - 值域,长度为 2 的一维数组,第一个元素表示值域下限,第二个元素表示值域上限。
  82131. * @param {number} [setting.XOffset] - 专题要素(图表)在 X 方向上的偏移值,单位像素。
  82132. * @param {number} [setting.YOffset] - 专题要素(图表)在 Y 方向上的偏移值,单位像素。
  82133. * @param {Array.<number>} [setting.dataViewBoxParameter] - 数据视图框 dataViewBox 参数,它是指图表框 chartBox (由图表位置、图表宽度、图表高度构成的图表范围框)在左、下,右,上四个方向上的内偏距值。
  82134. * @param {number} [setting.decimalNumber] - 数据值数组 dataValues 元素值小数位数,数据的小数位处理参数,取值范围:[0, 16]。如果不设置此参数,在取数据值时不对数据做小数位处理。
  82135. * @extends FeatureThemeGraph
  82136. * @usage
  82137. */
  82138. var RankSymbol = /*#__PURE__*/function (_Graph) {
  82139. RankSymbol_inherits(RankSymbol, _Graph);
  82140. var _super = RankSymbol_createSuper(RankSymbol);
  82141. function RankSymbol(data, layer, fields, setting, lonlat, options) {
  82142. var _this;
  82143. RankSymbol_classCallCheck(this, RankSymbol);
  82144. _this = _super.call(this, data, layer, fields, setting, lonlat, options);
  82145. /**
  82146. * @member {Object} FeatureThemeRankSymbol.prototype.setting
  82147. * @description 符号配置对象,该对象控制着图表的可视化显示。
  82148. */
  82149. _this.setting = null;
  82150. // 配置项检测与赋值
  82151. if (setting && setting.codomain) {
  82152. _this.setting = setting;
  82153. _this.DVBCodomain = _this.setting.codomain;
  82154. }
  82155. _this.CLASS_NAME = "SuperMap.Feature.Theme.RankSymbol";
  82156. return _this;
  82157. }
  82158. /**
  82159. * @function FeatureThemeRankSymbol.prototype.destroy
  82160. * @description 销毁专题要素。
  82161. */
  82162. RankSymbol_createClass(RankSymbol, [{
  82163. key: "destroy",
  82164. value: function destroy() {
  82165. this.setting = null;
  82166. RankSymbol_get(RankSymbol_getPrototypeOf(RankSymbol.prototype), "destroy", this).call(this);
  82167. }
  82168. /**
  82169. * @function FeatureThemeRankSymbol.prototype.initBaseParameter
  82170. * @description 初始化专题要素(图形)基础参数。
  82171. * 在调用此方法前,此类的图表模型相关属性都是不可用的 ,此方法在 assembleShapes 函数中调用。
  82172. * 调用此函数关系到 setting 对象的以下属性。
  82173. * @param {Array.<number>} codomain - 值域,长度为 2 的一维数组,第一个元素表示值域下限,第二个元素表示值域上限。
  82174. * @param {number} [XOffset] - 专题要素(图形)在 X 方向上的偏移值,单位像素。
  82175. * @param {number} [YOffset] - 专题要素(图形)在 Y 方向上的偏移值,单位像素。
  82176. * @param {Array.<number>} [dataViewBoxParameter] - 数据视图框 dataViewBox 参数,它是指图形框 chartBox (由图表位置、图表宽度、图表高度构成的图表范围框)在左、下,右,上四个方向上的内偏距值。
  82177. * @param {number} [decimalNumber] - 数据值数组 dataValues 元素值小数位数,数据的小数位处理参数,取值范围:[0, 16]。如果不设置此参数,在取数据值时不对数据做小数位处理。
  82178. * @returns {boolean} 初始化参数是否成功。
  82179. */
  82180. }, {
  82181. key: "initBaseParameter",
  82182. value: function initBaseParameter() {
  82183. // 参数初始化是否成功
  82184. var isSuccess = true;
  82185. // setting 属性是否已成功赋值
  82186. if (!this.setting) {
  82187. return false;
  82188. }
  82189. var sets = this.setting;
  82190. // 图表偏移
  82191. if (sets.XOffset) {
  82192. this.XOffset = sets.XOffset;
  82193. }
  82194. if (sets.YOffset) {
  82195. this.YOffset = sets.YOffset;
  82196. }
  82197. this.XOffset = sets.XOffset ? sets.XOffset : 0;
  82198. this.YOffset = sets.YOffset ? sets.YOffset : 0;
  82199. // 其他默认值
  82200. this.origonPoint = [];
  82201. this.chartBox = [];
  82202. this.dataViewBox = [];
  82203. this.DVBParameter = sets.dataViewBoxParameter ? sets.dataViewBoxParameter : [0, 0, 0, 0];
  82204. this.DVBOrigonPoint = [];
  82205. this.DVBCenterPoint = [];
  82206. this.origonPointOffset = [];
  82207. // 图表位置
  82208. this.resetLocation();
  82209. // 专题要素宽度 w
  82210. var w = this.width;
  82211. // 专题要素高度 h
  82212. var h = this.height;
  82213. // 专题要素像素位置 loc
  82214. var loc = this.location;
  82215. // 专题要素像素位置 loc
  82216. this.origonPoint = [loc[0] - w / 2, loc[1] - h / 2];
  82217. // 专题要素原点(左上角)
  82218. var op = this.origonPoint;
  82219. // 图表框([left, bottom, right, top])
  82220. this.chartBox = [op[0], op[1] + h, op[0] + w, op[1]];
  82221. // 图表框
  82222. var cb = this.chartBox;
  82223. // 数据视图框参数,它是图表框各方向对应的内偏距
  82224. var dbbP = this.DVBParameter;
  82225. // 数据视图框 ([left, bottom, right, top])
  82226. this.dataViewBox = [cb[0] + dbbP[0], cb[1] - dbbP[1], cb[2] - dbbP[2], cb[3] + dbbP[3]];
  82227. // 数据视图框
  82228. var dvb = this.dataViewBox;
  82229. //检查数据视图框是否合法
  82230. if (dvb[0] >= dvb[2] || dvb[1] <= dvb[3]) {
  82231. return false;
  82232. }
  82233. // 数据视图框原点
  82234. this.DVBOrigonPoint = [dvb[0], dvb[3]];
  82235. // 数据视图框宽度
  82236. this.DVBWidth = Math.abs(dvb[2] - dvb[0]);
  82237. // 数据视图框高度
  82238. this.DVBHeight = Math.abs(dvb[1] - dvb[3]);
  82239. // 数据视图框中心点
  82240. this.DVBCenterPoint = [this.DVBOrigonPoint[0] + this.DVBWidth / 2, this.DVBOrigonPoint[1] + this.DVBHeight / 2];
  82241. // 数据视图框原点与图表框的原点偏移量
  82242. this.origonPointOffset = [this.DVBOrigonPoint[0] - op[0], this.DVBOrigonPoint[1] - op[1]];
  82243. return isSuccess;
  82244. }
  82245. }]);
  82246. return RankSymbol;
  82247. }(Graph);
  82248. ;// CONCATENATED MODULE: ./src/common/overlay/Circle.js
  82249. function overlay_Circle_typeof(obj) { "@babel/helpers - typeof"; return overlay_Circle_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, overlay_Circle_typeof(obj); }
  82250. function overlay_Circle_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  82251. function overlay_Circle_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  82252. function overlay_Circle_createClass(Constructor, protoProps, staticProps) { if (protoProps) overlay_Circle_defineProperties(Constructor.prototype, protoProps); if (staticProps) overlay_Circle_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  82253. function overlay_Circle_get() { if (typeof Reflect !== "undefined" && Reflect.get) { overlay_Circle_get = Reflect.get.bind(); } else { overlay_Circle_get = function _get(target, property, receiver) { var base = overlay_Circle_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return overlay_Circle_get.apply(this, arguments); }
  82254. function overlay_Circle_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = overlay_Circle_getPrototypeOf(object); if (object === null) break; } return object; }
  82255. function overlay_Circle_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) overlay_Circle_setPrototypeOf(subClass, superClass); }
  82256. function overlay_Circle_setPrototypeOf(o, p) { overlay_Circle_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return overlay_Circle_setPrototypeOf(o, p); }
  82257. function overlay_Circle_createSuper(Derived) { var hasNativeReflectConstruct = overlay_Circle_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = overlay_Circle_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = overlay_Circle_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return overlay_Circle_possibleConstructorReturn(this, result); }; }
  82258. function overlay_Circle_possibleConstructorReturn(self, call) { if (call && (overlay_Circle_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return overlay_Circle_assertThisInitialized(self); }
  82259. function overlay_Circle_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  82260. function overlay_Circle_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  82261. function overlay_Circle_getPrototypeOf(o) { overlay_Circle_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return overlay_Circle_getPrototypeOf(o); }
  82262. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  82263. * This program are made available under the terms of the Apache License, Version 2.0
  82264. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  82265. /**
  82266. * @class FeatureThemeCircle
  82267. * @aliasclass Feature.Theme.Circle
  82268. * @deprecatedclass SuperMap.Feature.Theme.Circle
  82269. * @classdesc 圆类。
  82270. * @category Visualization Theme
  82271. * @extends FeatureThemeRankSymbol
  82272. * @param {FeatureVector} data - 用户数据。
  82273. * @param {SuperMap.Layer.RankSymbol} layer - 此专题要素所在图层。
  82274. * @param {Array.<string>} fields - data 中的参与此图表生成的字段名称。
  82275. * @param {FeatureThemeCircle.setting} setting - 图表配置对象。
  82276. * @param {LonLat} [lonlat] - 专题要素地理位置,默认为 data 指代的地理要素 Bounds 中心。
  82277. * @usage
  82278. * @private
  82279. */
  82280. var Circle = /*#__PURE__*/function (_RankSymbol) {
  82281. overlay_Circle_inherits(Circle, _RankSymbol);
  82282. var _super = overlay_Circle_createSuper(Circle);
  82283. function Circle(data, layer, fields, setting, lonlat) {
  82284. var _this;
  82285. overlay_Circle_classCallCheck(this, Circle);
  82286. _this = _super.call(this, data, layer, fields, setting, lonlat);
  82287. _this.CLASS_NAME = "SuperMap.Feature.Theme.Circle";
  82288. return _this;
  82289. }
  82290. /**
  82291. * @function FeatureThemeCircle.prototype.destroy
  82292. * @override
  82293. */
  82294. overlay_Circle_createClass(Circle, [{
  82295. key: "destroy",
  82296. value: function destroy() {
  82297. overlay_Circle_get(overlay_Circle_getPrototypeOf(Circle.prototype), "destroy", this).call(this);
  82298. }
  82299. /**
  82300. * @function FeatureThemeCircle.prototype.assembleShapes
  82301. * @description 装配图形(扩展接口)。
  82302. */
  82303. }, {
  82304. key: "assembleShapes",
  82305. value: function assembleShapes() {
  82306. //默认填充颜色
  82307. var defaultFillColor = "#ff9277";
  82308. // setting 属性是否已成功赋值
  82309. if (!this.setting) {
  82310. return false;
  82311. }
  82312. var sets = this.setting;
  82313. // 检测 setting 的必设参数
  82314. if (!sets.codomain) {
  82315. return false;
  82316. }
  82317. // 数据
  82318. var decimalNumber = typeof sets.decimalNumber !== "undefined" && !isNaN(sets.decimalNumber) ? sets.decimalNumber : -1;
  82319. var dataEffective = Theme_Theme.getDataValues(this.data, this.fields, decimalNumber);
  82320. this.dataValues = dataEffective ? dataEffective : [];
  82321. // 数据值数组
  82322. var fv = this.dataValues;
  82323. //if(fv.length != 1) return; // 没有数据 或者数据不唯一
  82324. //if(fv[0] < 0) return; //数据为负值
  82325. //用户应该定义最大 最小半径 默认最大半径MaxR:100 最小半径MinR:0;
  82326. if (!sets.maxR) {
  82327. sets.maxR = 100;
  82328. }
  82329. if (!sets.minR) {
  82330. sets.minR = 0;
  82331. }
  82332. // 值域范围
  82333. var codomain = this.DVBCodomain;
  82334. // 重要步骤:定义Circle数据视图框中单位值的含义,单位值:1所代表的长度
  82335. // 用户定义了值域范围
  82336. if (codomain && codomain[1] - codomain[0] > 0) {
  82337. this.DVBUnitValue = sets.maxR / (codomain[1] - codomain[0]);
  82338. } else {
  82339. //this.DVBUnitValue = sets.maxR / maxValue;
  82340. this.DVBUnitValue = sets.maxR;
  82341. }
  82342. var uv = this.DVBUnitValue;
  82343. //圆半径
  82344. var r = fv[0] * uv + sets.minR;
  82345. this.width = 2 * r;
  82346. this.height = 2 * r;
  82347. // 重要步骤:初始化参数
  82348. if (!this.initBaseParameter()) {
  82349. return;
  82350. }
  82351. //假如用户设置了值域范围 没有在值域范围直接返回
  82352. if (codomain) {
  82353. if (fv[0] < codomain[0] || fv[0] > codomain[1]) {
  82354. return;
  82355. }
  82356. }
  82357. var dvbCenter = this.DVBCenterPoint; // 数据视图框中心作为圆心
  82358. //圆形对象参数
  82359. var circleSP = new Circle_Circle(dvbCenter[0], dvbCenter[1], r);
  82360. //circleSP.sytle 初始化
  82361. circleSP.style = ShapeFactory.ShapeStyleTool(null, sets.circleStyle, null, null, 0);
  82362. //图形的填充颜色
  82363. if (typeof sets.fillColor !== "undefined") {
  82364. //用户自定义
  82365. circleSP.style.fillColor = sets.fillColor;
  82366. } else {
  82367. //当前默认
  82368. circleSP.style.fillColor = defaultFillColor;
  82369. }
  82370. //圆形 Hover样式
  82371. circleSP.highlightStyle = ShapeFactory.ShapeStyleTool(null, sets.circleHoverStyle);
  82372. //圆形 Hover 与 click 设置
  82373. if (typeof sets.circleHoverAble !== "undefined") {
  82374. circleSP.hoverable = sets.circleHoverAble;
  82375. }
  82376. if (typeof sets.circleClickAble !== "undefined") {
  82377. circleSP.clickable = sets.circleClickAble;
  82378. }
  82379. //图形携带的数据信息
  82380. circleSP.refDataID = this.data.id;
  82381. circleSP.dataInfo = {
  82382. field: this.fields[0],
  82383. r: r,
  82384. value: fv[0]
  82385. };
  82386. // 创建扇形并把此扇形添加到图表图形数组
  82387. this.shapes.push(this.shapeFactory.createShape(circleSP));
  82388. // 重要步骤:将图形转为由相对坐标表示的图形,以便在地图平移缩放过程中快速重绘图形
  82389. // (统计专题图模块从结构上要求使用相对坐标,assembleShapes() 函数必须在图形装配完成后调用 shapesConvertToRelativeCoordinate() 函数)
  82390. this.shapesConvertToRelativeCoordinate();
  82391. }
  82392. }]);
  82393. return Circle;
  82394. }(RankSymbol);
  82395. ;// CONCATENATED MODULE: ./src/common/overlay/Line.js
  82396. function overlay_Line_typeof(obj) { "@babel/helpers - typeof"; return overlay_Line_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, overlay_Line_typeof(obj); }
  82397. function overlay_Line_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  82398. function overlay_Line_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  82399. function overlay_Line_createClass(Constructor, protoProps, staticProps) { if (protoProps) overlay_Line_defineProperties(Constructor.prototype, protoProps); if (staticProps) overlay_Line_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  82400. function overlay_Line_get() { if (typeof Reflect !== "undefined" && Reflect.get) { overlay_Line_get = Reflect.get.bind(); } else { overlay_Line_get = function _get(target, property, receiver) { var base = overlay_Line_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return overlay_Line_get.apply(this, arguments); }
  82401. function overlay_Line_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = overlay_Line_getPrototypeOf(object); if (object === null) break; } return object; }
  82402. function overlay_Line_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) overlay_Line_setPrototypeOf(subClass, superClass); }
  82403. function overlay_Line_setPrototypeOf(o, p) { overlay_Line_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return overlay_Line_setPrototypeOf(o, p); }
  82404. function overlay_Line_createSuper(Derived) { var hasNativeReflectConstruct = overlay_Line_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = overlay_Line_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = overlay_Line_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return overlay_Line_possibleConstructorReturn(this, result); }; }
  82405. function overlay_Line_possibleConstructorReturn(self, call) { if (call && (overlay_Line_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return overlay_Line_assertThisInitialized(self); }
  82406. function overlay_Line_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  82407. function overlay_Line_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  82408. function overlay_Line_getPrototypeOf(o) { overlay_Line_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return overlay_Line_getPrototypeOf(o); }
  82409. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  82410. * This program are made available under the terms of the Apache License, Version 2.0
  82411. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  82412. /**
  82413. * @class FeatureThemeLine
  82414. * @aliasclass Feature.Theme.Line
  82415. * @deprecatedclass SuperMap.Feature.Theme.Line
  82416. * @classdesc 折线图。
  82417. * @category Visualization Theme
  82418. * @example
  82419. * // pointStyleByCodomain 参数用法示例
  82420. * // pointStyleByCodomain 的每个元素是个包含值域信息和与值域对应样式信息的对象,该对象(必须)有三个属性:
  82421. * // start: 值域值下限(包含);
  82422. * // end: 值域值上限(不包含);
  82423. * // style: 数据可视化图形的 style,这个样式对象的可设属性: <Point.style> 。
  82424. * // pointStyleByCodomain 数组形如:
  82425. * [
  82426. * {
  82427. * start:0,
  82428. * end:250,
  82429. * style:{
  82430. * fillColor:"#00CD00"
  82431. * }
  82432. * },
  82433. * {
  82434. * start:250,
  82435. * end:500,
  82436. * style:{
  82437. * fillColor:"#00EE00"
  82438. * }
  82439. * },
  82440. * {
  82441. * start:500,
  82442. * end:750,
  82443. * style:{
  82444. * fillColor:"#00FF7F"
  82445. * }
  82446. * },
  82447. * {
  82448. * start:750,
  82449. * end:1500,
  82450. * style:{
  82451. * fillColor:"#00FF00"
  82452. * }
  82453. * }
  82454. * ]
  82455. *
  82456. * @extends FeatureThemeGraph
  82457. * @param {FeatureVector} data - 用户数据。
  82458. * @param {SuperMap.Layer.Graph} layer - 此专题要素所在图层。
  82459. * @param {Array.<string>} fields - data 中的参与此图表生成的字段名称。
  82460. * @param {FeatureThemeLine.setting} setting - 图表配置对象。
  82461. * @param {LonLat} [lonlat] - 专题要素地理位置。默认为 data 指代的地理要素 Bounds 中心。
  82462. * @usage
  82463. * @private
  82464. */
  82465. var Line = /*#__PURE__*/function (_Graph) {
  82466. overlay_Line_inherits(Line, _Graph);
  82467. var _super = overlay_Line_createSuper(Line);
  82468. function Line(data, layer, fields, setting, lonlat, options) {
  82469. var _this;
  82470. overlay_Line_classCallCheck(this, Line);
  82471. _this = _super.call(this, data, layer, fields, setting, lonlat, options);
  82472. _this.CLASS_NAME = "SuperMap.Feature.Theme.Line";
  82473. return _this;
  82474. }
  82475. /**
  82476. * @function FeatureThemeLine.prototype.destroy
  82477. * @override
  82478. */
  82479. overlay_Line_createClass(Line, [{
  82480. key: "destroy",
  82481. value: function destroy() {
  82482. overlay_Line_get(overlay_Line_getPrototypeOf(Line.prototype), "destroy", this).call(this);
  82483. }
  82484. /**
  82485. * @function FeatureThemeLine.prototype.assembleShapes
  82486. * @description 装配图形(扩展接口)。
  82487. */
  82488. }, {
  82489. key: "assembleShapes",
  82490. value: function assembleShapes() {
  82491. // 图表配置对象
  82492. var sets = this.setting;
  82493. // 默认数据视图框
  82494. if (!sets.dataViewBoxParameter) {
  82495. if (typeof sets.useAxis === "undefined" || sets.useAxis) {
  82496. sets.dataViewBoxParameter = [45, 15, 15, 15];
  82497. } else {
  82498. sets.dataViewBoxParameter = [5, 5, 5, 5];
  82499. }
  82500. }
  82501. // 重要步骤:初始化参数
  82502. if (!this.initBaseParameter()) {
  82503. return;
  82504. }
  82505. var dvb = this.dataViewBox;
  82506. // 值域
  82507. var codomain = this.DVBCodomain;
  82508. // 重要步骤:定义图表 FeatureThemeBar 数据视图框中单位值的含义
  82509. this.DVBUnitValue = (codomain[1] - codomain[0]) / this.DVBHeight;
  82510. var uv = this.DVBUnitValue;
  82511. // 数据值数组
  82512. var fv = this.dataValues;
  82513. if (fv.length < 1) {
  82514. return;
  82515. } // 没有数据
  82516. // 获取 x 轴上的图形信息
  82517. var xShapeInfo = this.calculateXShapeInfo();
  82518. if (!xShapeInfo) {
  82519. return;
  82520. }
  82521. // 折线每个节点的 x 位置
  82522. var xsLoc = xShapeInfo.xPositions;
  82523. // 背景框,默认启用
  82524. if (typeof sets.useBackground === "undefined" || sets.useBackground) {
  82525. // 将背景框图形添加到模型的 shapes 数组,注意添加顺序,后添加的图形在先添加的图形之上。
  82526. this.shapes.push(ShapeFactory.Background(this.shapeFactory, this.chartBox, sets));
  82527. }
  82528. // 折线图必须使用坐标轴
  82529. this.shapes = this.shapes.concat(ShapeFactory.GraphAxis(this.shapeFactory, dvb, sets, xShapeInfo));
  82530. // var isDataEffective = true;
  82531. var xPx; // 折线节点 x 坐标
  82532. var yPx; // 折线节点 y 坐标
  82533. var poiLists = []; // 折线节点数组
  82534. var shapePois = []; // 折线节点图形数组
  82535. for (var i = 0, len = fv.length; i < len; i++) {
  82536. // 数据溢出值域检查
  82537. if (fv[i] < codomain[0] || fv[i] > codomain[1]) {
  82538. // isDataEffective = false;
  82539. return null;
  82540. }
  82541. xPx = xsLoc[i];
  82542. yPx = dvb[1] - (fv[i] - codomain[0]) / uv;
  82543. // 折线节点参数对象
  82544. var poiSP = new Point_Point(xPx, yPx);
  82545. // 折线节点 style
  82546. poiSP.style = ShapeFactory.ShapeStyleTool({
  82547. fillColor: "#ee9900"
  82548. }, sets.pointStyle, sets.pointStyleByFields, sets.pointStyleByCodomain, i, fv[i]);
  82549. // 折线节点 hover 样式
  82550. poiSP.highlightStyle = ShapeFactory.ShapeStyleTool(null, sets.pointHoverStyle);
  82551. // 折线节点 hover click
  82552. if (typeof sets.pointHoverAble !== "undefined") {
  82553. poiSP.hoverable = sets.pointHoverAble;
  82554. }
  82555. if (typeof sets.pointClickAble !== "undefined") {
  82556. poiSP.clickable = sets.pointClickAble;
  82557. }
  82558. // 图形携带的数据信息
  82559. poiSP.refDataID = this.data.id;
  82560. poiSP.dataInfo = {
  82561. field: this.fields[i],
  82562. value: fv[i]
  82563. };
  82564. // 创建图形并把此图形添加到折线节点图形数组
  82565. shapePois.push(this.shapeFactory.createShape(poiSP));
  82566. // 添加折线节点到折线节点数组
  82567. var poi = [xPx, yPx];
  82568. poiLists.push(poi);
  82569. }
  82570. // 折线参数对象
  82571. var lineSP = new Line_Line(poiLists);
  82572. lineSP.style = ShapeFactory.ShapeStyleTool({
  82573. strokeColor: "#ee9900"
  82574. }, sets.lineStyle);
  82575. // 禁止事件响应
  82576. lineSP.clickable = false;
  82577. lineSP.hoverable = false;
  82578. var shapeLine = this.shapeFactory.createShape(lineSP);
  82579. this.shapes.push(shapeLine);
  82580. // 添加节点到图表图形数组
  82581. this.shapes = this.shapes.concat(shapePois);
  82582. // // 数据范围检测未通过,清空图形
  82583. // if (isDataEffective === false) {
  82584. // this.shapes = [];
  82585. // }
  82586. // 重要步骤:将图形转为由相对坐标表示的图形,以便在地图平移缩放过程中快速重绘图形
  82587. // (统计专题图模块从结构上要求使用相对坐标,assembleShapes() 函数必须在图形装配完成后调用 shapesConvertToRelativeCoordinate() 函数)
  82588. this.shapesConvertToRelativeCoordinate();
  82589. }
  82590. /**
  82591. * @function FeatureThemeLine.prototype.calculateXShapeInfo
  82592. * @description 计算 X 轴方向上的图形信息,此信息是一个对象,包含两个属性,
  82593. * 属性 xPositions 是一个一维数组,该数组元素表示图形在 x 轴方向上的像素坐标值,
  82594. * 如果图形在 x 方向上有一定宽度,通常取图形在 x 方向上的中心点为图形在 x 方向上的坐标值。
  82595. * width 表示图形的宽度(特别注意:点的宽度始终为 0,而不是其直径)。
  82596. * 本函数中图形配置对象 setting 可设属性:<br>
  82597. * xShapeBlank - {Array.<number>} 水平方向上的图形空白间隔参数。
  82598. * 长度为 2 的数组,第一元素表示第折线左端点与数据视图框左端的空白间距,第二个元素表示折线右端点右端与数据视图框右端端的空白间距 。
  82599. * @returns {Object} 如果计算失败,返回 null;如果计算成功,返回 X 轴方向上的图形信息,此信息是一个对象,包含以下两个属性:<br>
  82600. * xPositions - {Array.<number>} 表示图形在 x 轴方向上的像素坐标值,如果图形在 x 方向上有一定宽度,通常取图形在 x 方向上的中心点为图形在 x 方向上的坐标值。<br>
  82601. * width - {number} 表示图形的宽度(特别注意:点的宽度始终为 0,而不是其直径)。
  82602. */
  82603. }, {
  82604. key: "calculateXShapeInfo",
  82605. value: function calculateXShapeInfo() {
  82606. var dvb = this.dataViewBox; // 数据视图框
  82607. var sets = this.setting; // 图表配置对象
  82608. var fvc = this.dataValues.length; // 数组值个数
  82609. if (fvc < 1) {
  82610. return null;
  82611. }
  82612. var xBlank; // x 轴空白间隔参数
  82613. var xShapePositions = []; // x 轴上图形的位置
  82614. var xShapeWidth = 0; // x 轴上图形宽度(自适应)
  82615. var dvbWidth = this.DVBWidth; // 数据视图框宽度
  82616. var unitOffset = 0; // 单位偏移量
  82617. // x 轴空白间隔参数处理
  82618. if (sets.xShapeBlank && sets.xShapeBlank.length && sets.xShapeBlank.length == 2) {
  82619. xBlank = sets.xShapeBlank;
  82620. var xsLen = dvbWidth - (xBlank[0] + xBlank[1]);
  82621. if (xsLen <= fvc) {
  82622. return null;
  82623. }
  82624. unitOffset = xsLen / (fvc - 1);
  82625. } else {
  82626. // 默认使用等距离空白间隔,空白间隔为图形宽度
  82627. unitOffset = dvbWidth / (fvc + 1);
  82628. xBlank = [unitOffset, unitOffset, unitOffset];
  82629. }
  82630. // 图形 x 轴上的位置计算
  82631. var xOffset = 0;
  82632. for (var i = 0; i < fvc; i++) {
  82633. if (i == 0) {
  82634. xOffset = xBlank[0];
  82635. } else {
  82636. xOffset += unitOffset;
  82637. }
  82638. xShapePositions.push(dvb[0] + xOffset);
  82639. }
  82640. return {
  82641. "xPositions": xShapePositions,
  82642. "width": xShapeWidth
  82643. };
  82644. }
  82645. }]);
  82646. return Line;
  82647. }(Graph);
  82648. ;// CONCATENATED MODULE: ./src/common/overlay/Pie.js
  82649. function Pie_typeof(obj) { "@babel/helpers - typeof"; return Pie_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, Pie_typeof(obj); }
  82650. function Pie_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  82651. function Pie_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  82652. function Pie_createClass(Constructor, protoProps, staticProps) { if (protoProps) Pie_defineProperties(Constructor.prototype, protoProps); if (staticProps) Pie_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  82653. function Pie_get() { if (typeof Reflect !== "undefined" && Reflect.get) { Pie_get = Reflect.get.bind(); } else { Pie_get = function _get(target, property, receiver) { var base = Pie_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return Pie_get.apply(this, arguments); }
  82654. function Pie_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Pie_getPrototypeOf(object); if (object === null) break; } return object; }
  82655. function Pie_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) Pie_setPrototypeOf(subClass, superClass); }
  82656. function Pie_setPrototypeOf(o, p) { Pie_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Pie_setPrototypeOf(o, p); }
  82657. function Pie_createSuper(Derived) { var hasNativeReflectConstruct = Pie_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Pie_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Pie_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Pie_possibleConstructorReturn(this, result); }; }
  82658. function Pie_possibleConstructorReturn(self, call) { if (call && (Pie_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return Pie_assertThisInitialized(self); }
  82659. function Pie_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  82660. function Pie_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  82661. function Pie_getPrototypeOf(o) { Pie_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Pie_getPrototypeOf(o); }
  82662. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  82663. * This program are made available under the terms of the Apache License, Version 2.0
  82664. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  82665. /**
  82666. * @class FeatureThemePie
  82667. * @aliasclass Feature.Theme.Pie
  82668. * @deprecatedclass SuperMap.Feature.Theme.Pie
  82669. * @classdesc 饼图。
  82670. * @category Visualization Theme
  82671. * @param {FeatureVector} data - 用户数据。
  82672. * @param {SuperMap.Layer.Graph} layer - 此专题要素所在图层。
  82673. * @param {Array.<string>} fields - data 中的参与此图表生成的字段名称。
  82674. * @param {FeatureThemePoint.setting} setting - 图表配置对象。
  82675. * @param {LonLat} [lonlat] - 专题要素地理位置。默认为 data 指代的地理要素 Bounds 中心。
  82676. * @extends FeatureThemeGraph
  82677. * @example
  82678. * // sectorStyleByCodomain 的每个元素是个包含值域信息和与值域对应样式信息的对象,该对象(必须)有三个属性:
  82679. * // start: 值域值下限(包含);
  82680. * // end: 值域值上限(不包含);
  82681. * // style: 数据可视化图形的 style,这个样式对象的可设属性: <ShapeParametersSector.style> 。
  82682. * // sectorStyleByCodomain 数组形如:
  82683. * [
  82684. * {
  82685. * start:0,
  82686. * end:250,
  82687. * style:{
  82688. * fillColor:"#00CD00"
  82689. * }
  82690. * },
  82691. * {
  82692. * start:250,
  82693. * end:500,
  82694. * style:{
  82695. * fillColor:"#00EE00"
  82696. * }
  82697. * },
  82698. * {
  82699. * start:500,
  82700. * end:750,
  82701. * style:{
  82702. * fillColor:"#00FF7F"
  82703. * }
  82704. * },
  82705. * {
  82706. * start:750,
  82707. * end:1500,
  82708. * style:{
  82709. * fillColor:"#00FF00"
  82710. * }
  82711. * }
  82712. * ]
  82713. * @usage
  82714. * @private
  82715. */
  82716. var Pie = /*#__PURE__*/function (_Graph) {
  82717. Pie_inherits(Pie, _Graph);
  82718. var _super = Pie_createSuper(Pie);
  82719. function Pie(data, layer, fields, setting, lonlat) {
  82720. var _this;
  82721. Pie_classCallCheck(this, Pie);
  82722. _this = _super.call(this, data, layer, fields, setting, lonlat);
  82723. _this.CLASS_NAME = "SuperMap.Feature.Theme.Pie";
  82724. return _this;
  82725. }
  82726. /**
  82727. * @function FeatureThemePie.prototype.destroy
  82728. * @description 销毁此专题要素。调用 destroy 后此对象所以属性置为 null。
  82729. */
  82730. Pie_createClass(Pie, [{
  82731. key: "destroy",
  82732. value: function destroy() {
  82733. Pie_get(Pie_getPrototypeOf(Pie.prototype), "destroy", this).call(this);
  82734. }
  82735. /**
  82736. * @function FeatureThemePie.prototype.assembleShapes
  82737. * @description 装配图形(扩展接口)。
  82738. */
  82739. }, {
  82740. key: "assembleShapes",
  82741. value: function assembleShapes() {
  82742. // 图表配置对象
  82743. var sets = this.setting;
  82744. // 一个默认 style 组
  82745. var defaultStyleGroup = [{
  82746. fillColor: "#ff9277"
  82747. }, {
  82748. fillColor: "#dddd00"
  82749. }, {
  82750. fillColor: "#ffc877"
  82751. }, {
  82752. fillColor: "#bbe3ff"
  82753. }, {
  82754. fillColor: "#d5ffbb"
  82755. }, {
  82756. fillColor: "#bbbbff"
  82757. }, {
  82758. fillColor: "#ddb000"
  82759. }, {
  82760. fillColor: "#b0dd00"
  82761. }, {
  82762. fillColor: "#e2bbff"
  82763. }, {
  82764. fillColor: "#ffbbe3"
  82765. }, {
  82766. fillColor: "#ff7777"
  82767. }, {
  82768. fillColor: "#ff9900"
  82769. }, {
  82770. fillColor: "#83dd00"
  82771. }, {
  82772. fillColor: "#77e3ff"
  82773. }, {
  82774. fillColor: "#778fff"
  82775. }, {
  82776. fillColor: "#c877ff"
  82777. }, {
  82778. fillColor: "#ff77ab"
  82779. }, {
  82780. fillColor: "#ff6600"
  82781. }, {
  82782. fillColor: "#aa8800"
  82783. }, {
  82784. fillColor: "#77c7ff"
  82785. }, {
  82786. fillColor: "#ad77ff"
  82787. }, {
  82788. fillColor: "#ff77ff"
  82789. }, {
  82790. fillColor: "#dd0083"
  82791. }, {
  82792. fillColor: "#777700"
  82793. }, {
  82794. fillColor: "#00aa00"
  82795. }, {
  82796. fillColor: "#0088aa"
  82797. }, {
  82798. fillColor: "#8400dd"
  82799. }, {
  82800. fillColor: "#aa0088"
  82801. }, {
  82802. fillColor: "#dd0000"
  82803. }, {
  82804. fillColor: "#772e00"
  82805. }];
  82806. // 重要步骤:初始化参数
  82807. if (!this.initBaseParameter()) {
  82808. return;
  82809. }
  82810. // 背景框,默认不启用
  82811. if (sets.useBackground) {
  82812. this.shapes.push(ShapeFactory.Background(this.shapeFactory, this.chartBox, sets));
  82813. }
  82814. // 数据值数组
  82815. var fv = this.dataValues;
  82816. if (fv.length < 1) {
  82817. return;
  82818. } // 没有数据
  82819. // 值域范围
  82820. var codomain = this.DVBCodomain;
  82821. // 值域范围检测
  82822. for (var _i2 = 0; _i2 < fv.length; _i2++) {
  82823. if (fv[_i2] < codomain[0] || fv[_i2] > codomain[1]) {
  82824. return;
  82825. }
  82826. }
  82827. // 值的绝对值总和
  82828. var valueSum = 0;
  82829. for (var _i4 = 0; _i4 < fv.length; _i4++) {
  82830. valueSum += Math.abs(fv[_i4]);
  82831. }
  82832. // 重要步骤:定义图表 FeatureThemePie 数据视图框中单位值的含义,单位值:每度代表的数值
  82833. this.DVBUnitValue = 360 / valueSum;
  82834. var uv = this.DVBUnitValue;
  82835. var dvbCenter = this.DVBCenterPoint; // 数据视图框中心作为扇心
  82836. var startAngle = 0; // 扇形起始边角度
  82837. var endAngle = 0; // 扇形终止边角度
  82838. var startAngleTmp = startAngle; // 扇形临时起始边角度
  82839. // 扇形(自适应)半径
  82840. var r = this.DVBHeight < this.DVBWidth ? this.DVBHeight / 2 : this.DVBWidth / 2;
  82841. for (var i = 0; i < fv.length; i++) {
  82842. var fvi = Math.abs(fv[i]);
  82843. //计算终止角
  82844. if (i === 0) {
  82845. endAngle = startAngle + fvi * uv;
  82846. } else if (i === fvi.length - 1) {
  82847. endAngle = startAngleTmp;
  82848. } else {
  82849. endAngle = startAngle + fvi * uv;
  82850. }
  82851. //矫正误差计算
  82852. if (endAngle - startAngle >= 360) {
  82853. endAngle = 359.9999999;
  82854. }
  82855. // 扇形参数对象
  82856. var sectorSP = new Sector(dvbCenter[0], dvbCenter[1], r, startAngle, endAngle);
  82857. // 扇形样式
  82858. if (typeof sets.sectorStyleByFields === "undefined") {
  82859. // 使用默认 style 组
  82860. var colorIndex = i % defaultStyleGroup.length;
  82861. sectorSP.style = ShapeFactory.ShapeStyleTool(null, sets.sectorStyle, defaultStyleGroup, null, colorIndex);
  82862. } else {
  82863. sectorSP.style = ShapeFactory.ShapeStyleTool(null, sets.sectorStyle, sets.sectorStyleByFields, sets.sectorStyleByCodomain, i, fv[i]);
  82864. }
  82865. // 扇形 hover 样式
  82866. sectorSP.highlightStyle = ShapeFactory.ShapeStyleTool(null, sets.sectorHoverStyle);
  82867. // 扇形 hover 与 click 设置
  82868. if (typeof sets.sectorHoverAble !== "undefined") {
  82869. sectorSP.hoverable = sets.sectorHoverAble;
  82870. }
  82871. if (typeof sets.sectorClickAble !== "undefined") {
  82872. sectorSP.clickable = sets.sectorClickAble;
  82873. }
  82874. // 图形携带的数据信息
  82875. sectorSP.refDataID = this.data.id;
  82876. sectorSP.dataInfo = {
  82877. field: this.fields[i],
  82878. value: fv[i]
  82879. };
  82880. // 创建扇形并把此扇形添加到图表图形数组
  82881. this.shapes.push(this.shapeFactory.createShape(sectorSP));
  82882. // 把上一次的结束角度作为下一次的起始角度
  82883. startAngle = endAngle;
  82884. }
  82885. // 重要步骤:将图形转为由相对坐标表示的图形,以便在地图平移缩放过程中快速重绘图形
  82886. // (统计专题图模块从结构上要求使用相对坐标,assembleShapes() 函数必须在图形装配完成后调用 shapesConvertToRelativeCoordinate() 函数)
  82887. this.shapesConvertToRelativeCoordinate();
  82888. }
  82889. }]);
  82890. return Pie;
  82891. }(Graph);
  82892. ;// CONCATENATED MODULE: ./src/common/overlay/Point.js
  82893. function overlay_Point_typeof(obj) { "@babel/helpers - typeof"; return overlay_Point_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, overlay_Point_typeof(obj); }
  82894. function overlay_Point_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  82895. function overlay_Point_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  82896. function overlay_Point_createClass(Constructor, protoProps, staticProps) { if (protoProps) overlay_Point_defineProperties(Constructor.prototype, protoProps); if (staticProps) overlay_Point_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  82897. function overlay_Point_get() { if (typeof Reflect !== "undefined" && Reflect.get) { overlay_Point_get = Reflect.get.bind(); } else { overlay_Point_get = function _get(target, property, receiver) { var base = overlay_Point_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return overlay_Point_get.apply(this, arguments); }
  82898. function overlay_Point_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = overlay_Point_getPrototypeOf(object); if (object === null) break; } return object; }
  82899. function overlay_Point_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) overlay_Point_setPrototypeOf(subClass, superClass); }
  82900. function overlay_Point_setPrototypeOf(o, p) { overlay_Point_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return overlay_Point_setPrototypeOf(o, p); }
  82901. function overlay_Point_createSuper(Derived) { var hasNativeReflectConstruct = overlay_Point_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = overlay_Point_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = overlay_Point_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return overlay_Point_possibleConstructorReturn(this, result); }; }
  82902. function overlay_Point_possibleConstructorReturn(self, call) { if (call && (overlay_Point_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return overlay_Point_assertThisInitialized(self); }
  82903. function overlay_Point_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  82904. function overlay_Point_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  82905. function overlay_Point_getPrototypeOf(o) { overlay_Point_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return overlay_Point_getPrototypeOf(o); }
  82906. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  82907. * This program are made available under the terms of the Apache License, Version 2.0
  82908. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  82909. /**
  82910. * @class FeatureThemePoint
  82911. * @aliasclass Feature.Theme.Point
  82912. * @deprecatedclass SuperMap.Feature.Theme.Point
  82913. * @classdesc 点状图。
  82914. * @category Visualization Theme
  82915. * @param {FeatureVector} data - 用户数据。
  82916. * @param {SuperMap.Layer.Graph} layer - 此专题要素所在图层。
  82917. * @param {Array.<string>} fields - data 中的参与此图表生成的字段名称。
  82918. * @param {FeatureThemePoint.setting} setting - 图表配置对象。
  82919. * @param {LonLat} [lonlat] - 专题要素地理位置。默认为 data 指代的地理要素 Bounds 中心。
  82920. * @example
  82921. * // pointStyleByCodomain 的每个元素是个包含值域信息和与值域对应样式信息的对象,该对象(必须)有三个属性:
  82922. * // start: 值域值下限(包含);
  82923. * // end: 值域值上限(不包含);
  82924. * // style: 数据可视化图形的 style,这个样式对象的可设属性: <Point.style> 。
  82925. * // pointStyleByCodomain 数组形如:
  82926. * [
  82927. * {
  82928. * start:0,
  82929. * end:250,
  82930. * style:{
  82931. * fillColor:"#00CD00"
  82932. * }
  82933. * },
  82934. * {
  82935. * start:250,
  82936. * end:500,
  82937. * style:{
  82938. * fillColor:"#00EE00"
  82939. * }
  82940. * },
  82941. * {
  82942. * start:500,
  82943. * end:750,
  82944. * style:{
  82945. * fillColor:"#00FF7F"
  82946. * }
  82947. * },
  82948. * {
  82949. * start:750,
  82950. * end:1500,
  82951. * style:{
  82952. * fillColor:"#00FF00"
  82953. * }
  82954. * }
  82955. * ]
  82956. * @extends FeatureThemeGraph
  82957. * @usage
  82958. * @private
  82959. */
  82960. var overlay_Point_Point = /*#__PURE__*/function (_Graph) {
  82961. overlay_Point_inherits(Point, _Graph);
  82962. var _super = overlay_Point_createSuper(Point);
  82963. function Point(data, layer, fields, setting, lonlat, options) {
  82964. var _this;
  82965. overlay_Point_classCallCheck(this, Point);
  82966. _this = _super.call(this, data, layer, fields, setting, lonlat, options);
  82967. _this.CLASS_NAME = "SuperMap.Feature.Theme.Point";
  82968. return _this;
  82969. }
  82970. /**
  82971. * @function FeatureThemePoint.prototype.destroy
  82972. * @description 销毁此专题要素。调用 destroy 后此对象所以属性置为 null。
  82973. */
  82974. overlay_Point_createClass(Point, [{
  82975. key: "destroy",
  82976. value: function destroy() {
  82977. overlay_Point_get(overlay_Point_getPrototypeOf(Point.prototype), "destroy", this).call(this);
  82978. }
  82979. /**
  82980. * @function FeatureThemePoint.prototype.Point.assembleShapes
  82981. * @description 装配图形(扩展接口)。
  82982. */
  82983. }, {
  82984. key: "assembleShapes",
  82985. value: function assembleShapes() {
  82986. // 图表配置对象
  82987. var sets = this.setting;
  82988. // 默认数据视图框
  82989. if (!sets.dataViewBoxParameter) {
  82990. if (typeof sets.useAxis === "undefined" || sets.useAxis) {
  82991. sets.dataViewBoxParameter = [45, 15, 15, 15];
  82992. } else {
  82993. sets.dataViewBoxParameter = [5, 5, 5, 5];
  82994. }
  82995. }
  82996. // 重要步骤:初始化参数
  82997. if (!this.initBaseParameter()) {
  82998. return;
  82999. }
  83000. var dvb = this.dataViewBox;
  83001. // 值域
  83002. var codomain = this.DVBCodomain;
  83003. // 重要步骤:定义图表 FeatureThemeBar 数据视图框中单位值的含义
  83004. this.DVBUnitValue = (codomain[1] - codomain[0]) / this.DVBHeight;
  83005. var uv = this.DVBUnitValue;
  83006. var fv = this.dataValues;
  83007. // 获取 x 轴上的图形信息
  83008. var xShapeInfo = this.calculateXShapeInfo();
  83009. if (!xShapeInfo) {
  83010. return;
  83011. }
  83012. // 折线每个节点的 x 位置
  83013. var xsLoc = xShapeInfo.xPositions;
  83014. // 背景框,默认启用
  83015. if (typeof sets.useBackground === "undefined" || sets.useBackground) {
  83016. // 将背景框图形添加到模型的 shapes 数组,注意添加顺序,后添加的图形在先添加的图形之上。
  83017. this.shapes.push(ShapeFactory.Background(this.shapeFactory, this.chartBox, sets));
  83018. }
  83019. // 点状图必须使用坐标轴
  83020. this.shapes = this.shapes.concat(ShapeFactory.GraphAxis(this.shapeFactory, dvb, sets, xShapeInfo));
  83021. var xPx; // 图形点 x 坐标
  83022. var yPx; // 图形点 y 坐标
  83023. for (var i = 0, len = fv.length; i < len; i++) {
  83024. // 数据溢出值域检查
  83025. if (fv[i] < codomain[0] || fv[i] > codomain[1]) {
  83026. //isDataEffective = false;
  83027. return null;
  83028. }
  83029. xPx = xsLoc[i];
  83030. yPx = dvb[1] - (fv[i] - codomain[0]) / uv;
  83031. // 图形点参数对象
  83032. var poiSP = new Point_Point(xPx, yPx);
  83033. // 图形点 style
  83034. poiSP.style = ShapeFactory.ShapeStyleTool({
  83035. fillColor: "#ee9900"
  83036. }, sets.pointStyle, sets.pointStyleByFields, sets.pointStyleByCodomain, i, fv[i]);
  83037. // 图形点 hover 样式
  83038. poiSP.highlightStyle = ShapeFactory.ShapeStyleTool(null, sets.pointHoverStyle);
  83039. // 图形点 hover click
  83040. if (typeof sets.pointHoverAble !== "undefined") {
  83041. poiSP.hoverable = sets.pointHoverAble;
  83042. }
  83043. if (typeof sets.pointClickAble !== "undefined") {
  83044. poiSP.clickable = sets.pointClickAble;
  83045. }
  83046. // 图形携带的数据信息
  83047. poiSP.refDataID = this.data.id;
  83048. poiSP.dataInfo = {
  83049. field: this.fields[i],
  83050. value: fv[i]
  83051. };
  83052. // 创建图形点并把此图形添加到图表图形数组
  83053. this.shapes.push(this.shapeFactory.createShape(poiSP));
  83054. }
  83055. // 数据范围检测未通过,清空图形
  83056. // if (isDataEffective === false) {
  83057. // this.shapes = [];
  83058. // }
  83059. // 重要步骤:将图形转为由相对坐标表示的图形,以便在地图平移缩放过程中快速重绘图形
  83060. // (统计专题图模块从结构上要求使用相对坐标,assembleShapes() 函数必须在图形装配完成后调用 shapesConvertToRelativeCoordinate() 函数)
  83061. this.shapesConvertToRelativeCoordinate();
  83062. }
  83063. /**
  83064. * @function FeatureThemePoint.prototype.calculateXShapeInfo
  83065. * @description 计算 X 轴方向上的图形信息,此信息是一个对象,包含两个属性,
  83066. * 属性 xPositions 是一个一维数组,该数组元素表示图形在 x 轴方向上的像素坐标值,
  83067. * 如果图形在 x 方向上有一定宽度,通常取图形在 x 方向上的中心点为图形在 x 方向上的坐标值。
  83068. * width 表示图形的宽度(特别注意:点的宽度始终为 0,而不是其直径)。
  83069. * 本函数中图形配置对象 setting 可设属性:<br>
  83070. * xShapeBlank - {Array.<number>} 水平方向上的图形空白间隔参数。
  83071. * 长度为 2 的数组,第一元素表示第折线左端点与数据视图框左端的空白间距,第二个元素表示折线右端点右端与数据视图框右端端的空白间距 。
  83072. * @returns {Object} 如果计算失败,返回 null;如果计算成功,返回 X 轴方向上的图形信息,此信息是一个对象,包含以下两个属性:<br>
  83073. * xPositions - {Array.<number>} 表示图形在 x 轴方向上的像素坐标值,如果图形在 x 方向上有一定宽度,通常取图形在 x 方向上的中心点为图形在 x 方向上的坐标值。
  83074. * width - {number}表示图形的宽度(特别注意:点的宽度始终为 0,而不是其直径)。
  83075. */
  83076. }, {
  83077. key: "calculateXShapeInfo",
  83078. value: function calculateXShapeInfo() {
  83079. var dvb = this.dataViewBox; // 数据视图框
  83080. var sets = this.setting; // 图表配置对象
  83081. var fvc = this.dataValues.length; // 数组值个数
  83082. if (fvc < 1) {
  83083. return null;
  83084. }
  83085. var xBlank; // x 轴空白间隔参数
  83086. var xShapePositions = []; // x 轴上图形的位置
  83087. var xShapeWidth = 0; // x 轴上图形宽度(自适应)
  83088. var dvbWidth = this.DVBWidth; // 数据视图框宽度
  83089. var unitOffset = 0; // 单位偏移量
  83090. // x 轴空白间隔参数处理
  83091. if (sets.xShapeBlank && sets.xShapeBlank.length && sets.xShapeBlank.length == 2) {
  83092. xBlank = sets.xShapeBlank;
  83093. var xsLen = dvbWidth - (xBlank[0] + xBlank[1]);
  83094. if (xsLen <= fvc) {
  83095. return null;
  83096. }
  83097. unitOffset = xsLen / (fvc - 1);
  83098. } else {
  83099. // 默认使用等距离空白间隔,空白间隔为图形宽度
  83100. unitOffset = dvbWidth / (fvc + 1);
  83101. xBlank = [unitOffset, unitOffset, unitOffset];
  83102. }
  83103. // 图形 x 轴上的位置计算
  83104. var xOffset = 0;
  83105. for (var i = 0; i < fvc; i++) {
  83106. if (i == 0) {
  83107. xOffset = xBlank[0];
  83108. } else {
  83109. xOffset += unitOffset;
  83110. }
  83111. xShapePositions.push(dvb[0] + xOffset);
  83112. }
  83113. return {
  83114. "xPositions": xShapePositions,
  83115. "width": xShapeWidth
  83116. };
  83117. }
  83118. }]);
  83119. return Point;
  83120. }(Graph);
  83121. ;// CONCATENATED MODULE: ./src/common/overlay/Ring.js
  83122. function Ring_typeof(obj) { "@babel/helpers - typeof"; return Ring_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, Ring_typeof(obj); }
  83123. function Ring_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  83124. function Ring_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  83125. function Ring_createClass(Constructor, protoProps, staticProps) { if (protoProps) Ring_defineProperties(Constructor.prototype, protoProps); if (staticProps) Ring_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  83126. function Ring_get() { if (typeof Reflect !== "undefined" && Reflect.get) { Ring_get = Reflect.get.bind(); } else { Ring_get = function _get(target, property, receiver) { var base = Ring_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return Ring_get.apply(this, arguments); }
  83127. function Ring_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Ring_getPrototypeOf(object); if (object === null) break; } return object; }
  83128. function Ring_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) Ring_setPrototypeOf(subClass, superClass); }
  83129. function Ring_setPrototypeOf(o, p) { Ring_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Ring_setPrototypeOf(o, p); }
  83130. function Ring_createSuper(Derived) { var hasNativeReflectConstruct = Ring_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Ring_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Ring_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Ring_possibleConstructorReturn(this, result); }; }
  83131. function Ring_possibleConstructorReturn(self, call) { if (call && (Ring_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return Ring_assertThisInitialized(self); }
  83132. function Ring_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  83133. function Ring_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  83134. function Ring_getPrototypeOf(o) { Ring_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Ring_getPrototypeOf(o); }
  83135. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  83136. * This program are made available under the terms of the Apache License, Version 2.0
  83137. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  83138. /**
  83139. * @class FeatureThemeRing
  83140. * @aliasclass Feature.Theme.Ring
  83141. * @deprecatedclass SuperMap.Feature.Theme.Ring
  83142. * @classdesc 环状图。
  83143. * @category Visualization Theme
  83144. * @description 基于路由对象计算指定点 M 值操作的参数类。通过该类提供参数信息。
  83145. * @param {FeatureVector} data - 用户数据。
  83146. * @param {SuperMap.Layer.Graph} layer - 此专题要素所在图层。
  83147. * @param {Array.<string>} fields - data 中的参与此图表生成的字段名称。
  83148. * @param {FeatureThemeRing.setting} setting - 图表配置对象。
  83149. * @param {LonLat} [lonlat] - 专题要素地理位置。默认为 data 指代的地理要素 Bounds 中心。
  83150. * @example
  83151. * // sectorStyleByCodomain 的每个元素是个包含值域信息和与值域对应样式信息的对象,该对象(必须)有三个属性:
  83152. * // start: 值域值下限(包含);
  83153. * // end: 值域值上限(不包含);
  83154. * // style: 数据可视化图形的 style,这个样式对象的可设属性: <ShapeParametersSector.style> 。
  83155. * // sectorStyleByCodomain 数组形如:
  83156. * [
  83157. * {
  83158. * start:0,
  83159. * end:250,
  83160. * style:{
  83161. * fillColor:"#00CD00"
  83162. * }
  83163. * },
  83164. * {
  83165. * start:250,
  83166. * end:500,
  83167. * style:{
  83168. * fillColor:"#00EE00"
  83169. * }
  83170. * },
  83171. * {
  83172. * start:500,
  83173. * end:750,
  83174. * style:{
  83175. * fillColor:"#00FF7F"
  83176. * }
  83177. * },
  83178. * {
  83179. * start:750,
  83180. * end:1500,
  83181. * style:{
  83182. * fillColor:"#00FF00"
  83183. * }
  83184. * }
  83185. * ]
  83186. * @param {Object} [sectorHoverStyle=true] - 环状图扇形 hover 状态时的样式,sectorHoverAble 为 true 时有效。
  83187. * @param {boolean} [sectorHoverAble=true] - 是否允许环状图扇形使用 hover 状态。同时设置 sectorHoverAble 和 sectorClickAble 为 false,可以直接屏蔽环状图扇形对专题图层事件的响应。
  83188. * @param {boolean} [sectorClickAble=true] - 是否允许环状图扇形被点击。同时设置 sectorHoverAble 和 sectorClickAble 为 false,可以直接屏蔽环状图扇形对专题图层事件的响应。
  83189. *
  83190. * @extends FeatureThemeGraph
  83191. * @usage
  83192. * @private
  83193. */
  83194. var Ring = /*#__PURE__*/function (_Graph) {
  83195. Ring_inherits(Ring, _Graph);
  83196. var _super = Ring_createSuper(Ring);
  83197. function Ring(data, layer, fields, setting, lonlat) {
  83198. var _this;
  83199. Ring_classCallCheck(this, Ring);
  83200. _this = _super.call(this, data, layer, fields, setting, lonlat);
  83201. _this.CLASS_NAME = "SuperMap.Feature.Theme.Ring";
  83202. return _this;
  83203. }
  83204. /**
  83205. * @function FeatureThemeRing.prototype.destroy
  83206. * @description 销毁此专题要素。调用 destroy 后此对象所以属性置为 null。
  83207. */
  83208. Ring_createClass(Ring, [{
  83209. key: "destroy",
  83210. value: function destroy() {
  83211. Ring_get(Ring_getPrototypeOf(Ring.prototype), "destroy", this).call(this);
  83212. }
  83213. /**
  83214. * @function FeatureThemeRing.prototype.assembleShapes
  83215. * @description 装配图形(扩展接口)。
  83216. */
  83217. }, {
  83218. key: "assembleShapes",
  83219. value: function assembleShapes() {
  83220. // 重要步骤:初始化参数
  83221. if (!this.initBaseParameter()) {
  83222. return;
  83223. }
  83224. // 一个默认 style 组
  83225. var defaultStyleGroup = [{
  83226. fillColor: "#ff9277"
  83227. }, {
  83228. fillColor: "#dddd00"
  83229. }, {
  83230. fillColor: "#ffc877"
  83231. }, {
  83232. fillColor: "#bbe3ff"
  83233. }, {
  83234. fillColor: "#d5ffbb"
  83235. }, {
  83236. fillColor: "#bbbbff"
  83237. }, {
  83238. fillColor: "#ddb000"
  83239. }, {
  83240. fillColor: "#b0dd00"
  83241. }, {
  83242. fillColor: "#e2bbff"
  83243. }, {
  83244. fillColor: "#ffbbe3"
  83245. }, {
  83246. fillColor: "#ff7777"
  83247. }, {
  83248. fillColor: "#ff9900"
  83249. }, {
  83250. fillColor: "#83dd00"
  83251. }, {
  83252. fillColor: "#77e3ff"
  83253. }, {
  83254. fillColor: "#778fff"
  83255. }, {
  83256. fillColor: "#c877ff"
  83257. }, {
  83258. fillColor: "#ff77ab"
  83259. }, {
  83260. fillColor: "#ff6600"
  83261. }, {
  83262. fillColor: "#aa8800"
  83263. }, {
  83264. fillColor: "#77c7ff"
  83265. }, {
  83266. fillColor: "#ad77ff"
  83267. }, {
  83268. fillColor: "#ff77ff"
  83269. }, {
  83270. fillColor: "#dd0083"
  83271. }, {
  83272. fillColor: "#777700"
  83273. }, {
  83274. fillColor: "#00aa00"
  83275. }, {
  83276. fillColor: "#0088aa"
  83277. }, {
  83278. fillColor: "#8400dd"
  83279. }, {
  83280. fillColor: "#aa0088"
  83281. }, {
  83282. fillColor: "#dd0000"
  83283. }, {
  83284. fillColor: "#772e00"
  83285. }];
  83286. // 图表配置对象
  83287. var sets = this.setting;
  83288. // 背景框,默认不启用
  83289. if (sets.useBackground) {
  83290. this.shapes.push(ShapeFactory.Background(this.shapeFactory, this.chartBox, sets));
  83291. }
  83292. // 数据值数组
  83293. var fv = this.dataValues;
  83294. if (fv.length < 1) {
  83295. return;
  83296. } // 没有数据
  83297. // 值域范围
  83298. var codomain = this.DVBCodomain;
  83299. // 值域范围检测
  83300. for (var _i2 = 0; _i2 < fv.length; _i2++) {
  83301. if (fv[_i2] < codomain[0] || fv[_i2] > codomain[1]) {
  83302. return;
  83303. }
  83304. }
  83305. // 值的绝对值总和
  83306. var valueSum = 0;
  83307. for (var _i4 = 0; _i4 < fv.length; _i4++) {
  83308. valueSum += Math.abs(fv[_i4]);
  83309. }
  83310. // 重要步骤:定义图表 FeatureThemeRing 数据视图框中单位值的含义,单位值:每度代表的数值
  83311. this.DVBUnitValue = 360 / valueSum;
  83312. var uv = this.DVBUnitValue;
  83313. var dvbCenter = this.DVBCenterPoint; // 数据视图框中心作为扇心
  83314. var startAngle = 0; // 扇形起始边角度
  83315. var endAngle = 0; // 扇形终止边角度
  83316. var startAngleTmp = startAngle; // 扇形临时起始边角度
  83317. // 扇形外环(自适应)半径
  83318. var r = this.DVBHeight < this.DVBWidth ? this.DVBHeight / 2 : this.DVBWidth / 2;
  83319. // 扇形内环(自适应)半径
  83320. var isInRange = sets.innerRingRadius >= 0 && sets.innerRingRadius < r;
  83321. var r0 = typeof sets.innerRingRadius !== "undefined" && !isNaN(sets.innerRingRadius) && isInRange ? sets.innerRingRadius : 0;
  83322. for (var i = 0; i < fv.length; i++) {
  83323. var fvi = Math.abs(fv[i]);
  83324. // 计算结束角度
  83325. if (i === 0) {
  83326. endAngle = startAngle + fvi * uv;
  83327. } else if (i === fvi.length - 1) {
  83328. endAngle = startAngleTmp;
  83329. } else {
  83330. endAngle = startAngle + fvi * uv;
  83331. }
  83332. // 扇形参数对象
  83333. var sectorSP = new Sector(dvbCenter[0], dvbCenter[1], r, startAngle, endAngle, r0);
  83334. // 扇形样式
  83335. if (typeof sets.sectorStyleByFields === "undefined") {
  83336. // 使用默认 style 组
  83337. var colorIndex = i % defaultStyleGroup.length;
  83338. sectorSP.style = ShapeFactory.ShapeStyleTool(null, sets.sectorStyle, defaultStyleGroup, null, colorIndex);
  83339. } else {
  83340. sectorSP.style = ShapeFactory.ShapeStyleTool(null, sets.sectorStyle, sets.sectorStyleByFields, sets.sectorStyleByCodomain, i, fv[i]);
  83341. }
  83342. // 扇形 hover 样式
  83343. sectorSP.highlightStyle = ShapeFactory.ShapeStyleTool(null, sets.sectorHoverStyle);
  83344. // 扇形 hover 与 click 设置
  83345. if (typeof sets.sectorHoverAble !== "undefined") {
  83346. sectorSP.hoverable = sets.sectorHoverAble;
  83347. }
  83348. if (typeof sets.sectorClickAble !== "undefined") {
  83349. sectorSP.clickable = sets.sectorClickAble;
  83350. }
  83351. // 图形携带的数据信息
  83352. sectorSP.refDataID = this.data.id;
  83353. sectorSP.dataInfo = {
  83354. field: this.fields[i],
  83355. value: fv[i]
  83356. };
  83357. // 创建扇形并把此扇形添加到图表图形数组
  83358. this.shapes.push(this.shapeFactory.createShape(sectorSP));
  83359. // 把上一次的结束角度作为下一次的起始角度
  83360. startAngle = endAngle;
  83361. }
  83362. // 重要步骤:将图形转为由相对坐标表示的图形,以便在地图平移缩放过程中快速重绘图形
  83363. // (统计专题图模块从结构上要求使用相对坐标,assembleShapes() 函数必须在图形装配完成后调用 shapesConvertToRelativeCoordinate() 函数)
  83364. this.shapesConvertToRelativeCoordinate();
  83365. }
  83366. }]);
  83367. return Ring;
  83368. }(Graph);
  83369. ;// CONCATENATED MODULE: ./src/common/overlay/ThemeVector.js
  83370. function ThemeVector_typeof(obj) { "@babel/helpers - typeof"; return ThemeVector_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, ThemeVector_typeof(obj); }
  83371. function ThemeVector_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  83372. function ThemeVector_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  83373. function ThemeVector_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeVector_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeVector_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  83374. function ThemeVector_get() { if (typeof Reflect !== "undefined" && Reflect.get) { ThemeVector_get = Reflect.get.bind(); } else { ThemeVector_get = function _get(target, property, receiver) { var base = ThemeVector_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return ThemeVector_get.apply(this, arguments); }
  83375. function ThemeVector_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ThemeVector_getPrototypeOf(object); if (object === null) break; } return object; }
  83376. function ThemeVector_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) ThemeVector_setPrototypeOf(subClass, superClass); }
  83377. function ThemeVector_setPrototypeOf(o, p) { ThemeVector_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ThemeVector_setPrototypeOf(o, p); }
  83378. function ThemeVector_createSuper(Derived) { var hasNativeReflectConstruct = ThemeVector_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = ThemeVector_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = ThemeVector_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return ThemeVector_possibleConstructorReturn(this, result); }; }
  83379. function ThemeVector_possibleConstructorReturn(self, call) { if (call && (ThemeVector_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return ThemeVector_assertThisInitialized(self); }
  83380. function ThemeVector_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  83381. function ThemeVector_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  83382. function ThemeVector_getPrototypeOf(o) { ThemeVector_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ThemeVector_getPrototypeOf(o); }
  83383. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  83384. * This program are made available under the terms of the Apache License, Version 2.0
  83385. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  83386. /**
  83387. * @class FeatureThemeVector
  83388. * @aliasclass Feature.Theme.ThemeVector
  83389. * @deprecatedclass SuperMap.Feature.Theme.ThemeVector
  83390. * @classdesc 矢量专题要素类。
  83391. * @category Visualization Theme
  83392. * @extends FeatureTheme
  83393. * @param {FeatureVector} data - 用户数据,的类型为矢量数据 feature。
  83394. * @param {SuperMap.Layer} layer - 此专题要素所在图层。
  83395. * @param {Object} style - 样式。
  83396. * @param {Object} options - 创建专题要素时的可选参数。
  83397. * @param {number} [options.nodesClipPixel=2] - 节点抽稀像素距离,单位:像素。
  83398. * @param {boolean} [options.isHoverAble=true] - 图形是否可 hover。
  83399. * @param {boolean} [options.isMultiHover=true] - 是否使用多图形高亮,isHoverAble 为 true 时生效。
  83400. * @param {boolean} [options.isClickAble=true] - 图形是否可点击。
  83401. * @param {Object} [options.highlightStyle] - 高亮样式。
  83402. * @usage
  83403. */
  83404. var ThemeVector = /*#__PURE__*/function (_Theme) {
  83405. ThemeVector_inherits(ThemeVector, _Theme);
  83406. var _super = ThemeVector_createSuper(ThemeVector);
  83407. function ThemeVector(data, layer, style, options, shapeOptions) {
  83408. var _this;
  83409. ThemeVector_classCallCheck(this, ThemeVector);
  83410. _this = _super.call(this, data, layer);
  83411. //数据的 geometry 属性必须存在且类型是 Geometry 或其子类的类型
  83412. if (!data.geometry) {
  83413. return ThemeVector_possibleConstructorReturn(_this);
  83414. }
  83415. if (!(data.geometry instanceof Geometry_Geometry)) {
  83416. return ThemeVector_possibleConstructorReturn(_this);
  83417. }
  83418. /**
  83419. * @member {Bounds} [FeatureThemeVector.prototype.dataBounds]
  83420. * @description 用户数据的(feature.geometry)地理范围。
  83421. */
  83422. _this.dataBounds = data.geometry.getBounds();
  83423. /**
  83424. * @member {number} [FeatureThemeVector.prototype.nodesClipPixel=2]
  83425. * @description 节点抽稀像素距离。
  83426. */
  83427. _this.nodesClipPixel = 2;
  83428. /**
  83429. * @member {boolean} [FeatureThemeVector.prototype.isHoverAble=true]
  83430. * @description 图形是否可 hover。
  83431. */
  83432. _this.isHoverAble = true;
  83433. /**
  83434. * @member {boolean} [FeatureThemeVector.prototype.isMultiHover=true]
  83435. * @description 是否使用多图形高亮,isHoverAble 为 true 时生效。
  83436. */
  83437. _this.isMultiHover = true;
  83438. /**
  83439. * @member {boolean} [FeatureThemeVector.prototype.isClickAble=true]
  83440. * @description 图形是否可点击。
  83441. */
  83442. _this.isClickAble = true;
  83443. /**
  83444. * @member {Object} [FeatureThemeVector.prototype.highlightStyle]
  83445. * @description 高亮样式。
  83446. */
  83447. _this.highlightStyle = null;
  83448. /**
  83449. * @member {Object} [FeatureThemeVector.prototype.shapeOptions]
  83450. * @description 添加到渲染器前修改 shape 的一些属性,非特殊情况通常不允许这么做。
  83451. */
  83452. _this.shapeOptions = {};
  83453. /**
  83454. * @member {Object} [FeatureThemeVector.prototype.style]
  83455. * @description 可视化图形的 style。在子类中规定其对象结构和默认属性值。
  83456. */
  83457. _this.style = style || {};
  83458. _this.CLASS_NAME = "SuperMap.Feature.Theme.Vector";
  83459. _this.style = style ? style : {};
  83460. if (options) {
  83461. Util_Util.copyAttributesWithClip(ThemeVector_assertThisInitialized(_this), options, ["shapeOptions", "dataBounds"]);
  83462. }
  83463. if (shapeOptions) {
  83464. Util_Util.copyAttributesWithClip(_this.shapeOptions, shapeOptions);
  83465. }
  83466. //设置基础参数 dataBounds、lonlat、location
  83467. var geometry = data.geometry;
  83468. _this.lonlat = _this.dataBounds.getCenterLonLat();
  83469. _this.location = _this.getLocalXY(_this.lonlat);
  83470. //将地理要素转为专题要素
  83471. if (geometry instanceof LinearRing_LinearRing) {
  83472. _this.lineToTF(geometry);
  83473. } else if (geometry instanceof LineString) {
  83474. _this.lineToTF(geometry);
  83475. } else if (geometry instanceof Curve) {
  83476. //独立几何体
  83477. } else if (geometry instanceof MultiPoint) {
  83478. _this.multiPointToTF(geometry);
  83479. } else if (geometry instanceof MultiLineString) {
  83480. _this.multiLineStringToTF(geometry);
  83481. } else if (geometry instanceof MultiPolygon) {
  83482. _this.multiPolygonToTF(geometry);
  83483. } else if (geometry instanceof Polygon_Polygon) {
  83484. _this.polygonToTF(geometry);
  83485. } else if (geometry instanceof Collection) {
  83486. //独立几何体
  83487. } else if (geometry instanceof Point) {
  83488. _this.pointToTF(geometry);
  83489. } else if (geometry instanceof Rectangle) {
  83490. _this.rectangleToTF(geometry);
  83491. } else if (geometry instanceof GeoText) {
  83492. _this.geoTextToTF(geometry);
  83493. }
  83494. return _this;
  83495. }
  83496. /**
  83497. * @function FeatureThemeVector.prototype.destroy
  83498. * @override
  83499. */
  83500. ThemeVector_createClass(ThemeVector, [{
  83501. key: "destroy",
  83502. value: function destroy() {
  83503. this.style = null;
  83504. this.dataBounds = null;
  83505. this.nodesClipPixel = null;
  83506. this.isHoverAble = null;
  83507. this.isMultiHover = null;
  83508. this.isClickAble = null;
  83509. this.highlightStyle = null;
  83510. this.shapeOptions = null;
  83511. ThemeVector_get(ThemeVector_getPrototypeOf(ThemeVector.prototype), "destroy", this).call(this);
  83512. }
  83513. /**
  83514. * @function FeatureThemeVector.prototype.lineToTF
  83515. * @description 转换线和线环要素。
  83516. * @param {Geometry} geometry - 用户数据几何地理信息,这里必须是 GeometryLineString 或 GeometryLineRing。
  83517. */
  83518. }, {
  83519. key: "lineToTF",
  83520. value: function lineToTF(geometry) {
  83521. var components = geometry.components;
  83522. //节点像素坐标
  83523. var localLX = [];
  83524. //参考位置,参考中心为
  83525. var refLocal = [];
  83526. var location = this.location;
  83527. var pointList = [];
  83528. //节点抽稀距离
  83529. var nCPx = this.nodesClipPixel;
  83530. for (var i = 0; i < components.length; i++) {
  83531. var components_i = components[i];
  83532. refLocal = [];
  83533. localLX = this.getLocalXY(components_i);
  83534. refLocal[0] = localLX[0] - location[0];
  83535. refLocal[1] = localLX[1] - location[1];
  83536. //抽稀 - 2 px
  83537. if (pointList.length > 0) {
  83538. var lastLocalXY = pointList[pointList.length - 1];
  83539. if (Math.abs(lastLocalXY[0] - refLocal[0]) <= nCPx && Math.abs(lastLocalXY[1] - refLocal[1]) <= nCPx) {
  83540. continue;
  83541. }
  83542. }
  83543. //使用参考点
  83544. pointList.push(refLocal);
  83545. }
  83546. if (pointList.length < 2) {
  83547. return null;
  83548. }
  83549. //赋 style
  83550. var style = new Object();
  83551. style = Util_Util.copyAttributesWithClip(style, this.style, ['pointList']);
  83552. style.pointList = pointList;
  83553. //创建图形
  83554. var shape = new SmicBrokenLine({
  83555. style: style,
  83556. clickable: this.isClickAble,
  83557. hoverable: this.isHoverAble
  83558. });
  83559. //设置高亮样式
  83560. if (this.highlightStyle) {
  83561. shape.highlightStyle = this.highlightStyle;
  83562. }
  83563. //设置参考中心,指定图形位置
  83564. shape.refOriginalPosition = this.location;
  83565. //储存数据 id 属性,用于事件
  83566. shape.refDataID = this.data.id;
  83567. //储存数据 id 属性,用于事件-多图形同时高亮
  83568. shape.isHoverByRefDataID = this.isMultiHover;
  83569. //添加到渲染器前修改 shape 的一些属性,非特殊情况通常不允许这么做
  83570. if (this.shapeOptions) {
  83571. Util_Util.copyAttributesWithClip(shape, this.shapeOptions);
  83572. }
  83573. this.shapes.push(shape);
  83574. }
  83575. /**
  83576. * @function FeatureThemeVector.prototype.multiPointToTF
  83577. * @description 转多点要素。
  83578. * @param {Geometry} geometry - 用户数据几何地理信息,这里必须是 MultiPoint。
  83579. */
  83580. }, {
  83581. key: "multiPointToTF",
  83582. value: function multiPointToTF(geometry) {
  83583. /* //-- 不抽稀
  83584. var components = geometry.components;
  83585. for(var i = 0; i < components.length; i++){
  83586. var components_i = components[i];
  83587. this.pointToTF(components_i);
  83588. }
  83589. */
  83590. var components = geometry.components;
  83591. //节点像素坐标
  83592. var localLX = [];
  83593. //参考位置,参考中心为
  83594. var refLocal = [];
  83595. var location = this.location;
  83596. var pointList = [];
  83597. //节点抽稀距离
  83598. var nCPx = this.nodesClipPixel;
  83599. for (var i = 0; i < components.length; i++) {
  83600. var components_i = components[i];
  83601. refLocal = [];
  83602. localLX = this.getLocalXY(components_i);
  83603. refLocal[0] = localLX[0] - location[0];
  83604. refLocal[1] = localLX[1] - location[1];
  83605. //抽稀
  83606. if (pointList.length > 0) {
  83607. var lastLocalXY = pointList[pointList.length - 1];
  83608. if (Math.abs(lastLocalXY[0] - refLocal[0]) <= nCPx && Math.abs(lastLocalXY[1] - refLocal[1]) <= nCPx) {
  83609. continue;
  83610. }
  83611. }
  83612. //使用参考点
  83613. pointList.push(refLocal);
  83614. //赋 style
  83615. var style = new Object();
  83616. style.r = 6; //防止漏设此参数,默认 6 像素
  83617. style = Util_Util.copyAttributesWithClip(style, this.style);
  83618. style.x = refLocal[0];
  83619. style.y = refLocal[1];
  83620. //创建图形
  83621. var shape = new SmicPoint({
  83622. style: style,
  83623. clickable: this.isClickAble,
  83624. hoverable: this.isHoverAble
  83625. });
  83626. //设置高亮样式
  83627. if (this.highlightStyle) {
  83628. shape.highlightStyle = this.highlightStyle;
  83629. }
  83630. //设置参考中心,指定图形位置
  83631. shape.refOriginalPosition = location;
  83632. //储存数据 id 属性,用于事件
  83633. shape.refDataID = this.data.id;
  83634. //储存数据 id 属性,用于事件-多图形同时高亮
  83635. shape.isHoverByRefDataID = this.isMultiHover;
  83636. //修改一些 shape 可选属性,通常不需要这么做
  83637. if (this.shapeOptions) {
  83638. Util_Util.copyAttributesWithClip(shape, this.shapeOptions);
  83639. }
  83640. this.shapes.push(shape);
  83641. }
  83642. }
  83643. /**
  83644. * @function FeatureThemeVector.prototype.multiLineStringToTF
  83645. * @description 转换多线要素。
  83646. * @param {Geometry} geometry - 用户数据几何地理信息,这里必须是 MultiLineString。
  83647. */
  83648. }, {
  83649. key: "multiLineStringToTF",
  83650. value: function multiLineStringToTF(geometry) {
  83651. var components = geometry.components;
  83652. for (var i = 0; i < components.length; i++) {
  83653. var components_i = components[i];
  83654. this.lineToTF(components_i);
  83655. }
  83656. }
  83657. /**
  83658. * @function FeatureThemeVector.prototype.multiPolygonToTF
  83659. * @description 转换多面要素。
  83660. * @param {Geometry} geometry - 用户数据几何地理信息,这里必须是 MultiPolygon。
  83661. */
  83662. }, {
  83663. key: "multiPolygonToTF",
  83664. value: function multiPolygonToTF(geometry) {
  83665. var components = geometry.components;
  83666. for (var i = 0; i < components.length; i++) {
  83667. var components_i = components[i];
  83668. this.polygonToTF(components_i);
  83669. }
  83670. }
  83671. /**
  83672. * @function FeatureThemeVector.prototype.pointToTF
  83673. * @description 转换点要素。
  83674. * @param {Geometry} geometry - 用户数据几何地理信息,这里必须是 Point。
  83675. */
  83676. }, {
  83677. key: "pointToTF",
  83678. value: function pointToTF(geometry) {
  83679. //参考位置,参考中心为
  83680. var location = this.location;
  83681. //geometry 像素坐标
  83682. var localLX = this.getLocalXY(geometry);
  83683. //赋 style
  83684. var style = new Object();
  83685. style.r = 6; //防止漏设此参数,默认 6 像素
  83686. style = Util_Util.copyAttributesWithClip(style, this.style);
  83687. style.x = localLX[0] - location[0];
  83688. style.y = localLX[1] - location[1];
  83689. //创建图形
  83690. var shape = new SmicPoint({
  83691. style: style,
  83692. clickable: this.isClickAble,
  83693. hoverable: this.isHoverAble
  83694. });
  83695. //设置高亮样式
  83696. if (this.highlightStyle) {
  83697. shape.highlightStyle = this.highlightStyle;
  83698. }
  83699. //设置参考中心,指定图形位置
  83700. shape.refOriginalPosition = location;
  83701. //储存数据 id 属性,用于事件
  83702. shape.refDataID = this.data.id;
  83703. //储存数据 id 属性,用于事件-多图形同时高亮
  83704. shape.isHoverByRefDataID = this.isMultiHover;
  83705. //修改一些 shape 可选属性,通常不需要这么做
  83706. if (this.shapeOptions) {
  83707. Util_Util.copyAttributesWithClip(shape, this.shapeOptions);
  83708. }
  83709. this.shapes.push(shape);
  83710. }
  83711. /**
  83712. * @function FeatureThemeVector.prototype.polygonToThemeFeature
  83713. * @description 转换面要素。
  83714. * @param {Geometry} geometry - 用户数据几何地理信息,这里必须是 Polygon。
  83715. */
  83716. }, {
  83717. key: "polygonToTF",
  83718. value: function polygonToTF(geometry) {
  83719. var components = geometry.components;
  83720. //节点像素坐标
  83721. var localLX = [];
  83722. //参考位置,参考中心为
  83723. var refLocal = [];
  83724. var location = this.location;
  83725. var pointList = [];
  83726. //岛洞
  83727. var holePolygonPointList = [];
  83728. var holePolygonPointLists = [];
  83729. //节点抽稀距离
  83730. var nCPx = this.nodesClipPixel;
  83731. for (var i = 0; i < components.length; i++) {
  83732. var components_i = components[i].components;
  83733. if (i === 0) {
  83734. // 第一个 component 正常绘制
  83735. pointList = [];
  83736. for (var j = 0; j < components_i.length; j++) {
  83737. refLocal = [];
  83738. localLX = this.getLocalXY(components_i[j]);
  83739. refLocal[0] = localLX[0] - location[0];
  83740. refLocal[1] = localLX[1] - location[1];
  83741. //抽稀 - 2 px
  83742. if (pointList.length > 0) {
  83743. var lastLocalXY = pointList[pointList.length - 1];
  83744. if (Math.abs(lastLocalXY[0] - refLocal[0]) <= nCPx && Math.abs(lastLocalXY[1] - refLocal[1]) <= nCPx) {
  83745. continue;
  83746. }
  83747. }
  83748. //使用参考点
  83749. pointList.push(refLocal);
  83750. }
  83751. } else {
  83752. // 其它 component 作为岛洞
  83753. holePolygonPointList = [];
  83754. for (var k = 0; k < components_i.length; k++) {
  83755. refLocal = [];
  83756. localLX = this.getLocalXY(components_i[k]);
  83757. refLocal[0] = localLX[0] - location[0];
  83758. refLocal[1] = localLX[1] - location[1];
  83759. //抽稀 - 2 px
  83760. if (holePolygonPointList.length > 0) {
  83761. var lastXY = holePolygonPointList[holePolygonPointList.length - 1];
  83762. if (Math.abs(lastXY[0] - refLocal[0]) <= nCPx && Math.abs(lastXY[1] - refLocal[1]) <= nCPx) {
  83763. continue;
  83764. }
  83765. }
  83766. //使用参考点
  83767. holePolygonPointList.push(refLocal);
  83768. }
  83769. }
  83770. if (holePolygonPointList.length < 2) {
  83771. continue;
  83772. }
  83773. holePolygonPointLists.push(holePolygonPointList);
  83774. }
  83775. if (pointList.length < 2) {
  83776. return;
  83777. }
  83778. //赋 style
  83779. var style = {};
  83780. style = Util_Util.copyAttributesWithClip(style, this.style, ['pointList']);
  83781. style.pointList = pointList;
  83782. //创建图形
  83783. var shape = new SmicPolygon({
  83784. style: style,
  83785. clickable: this.isClickAble,
  83786. hoverable: this.isHoverAble
  83787. });
  83788. //设置高亮样式
  83789. if (this.highlightStyle) {
  83790. shape.highlightStyle = this.highlightStyle;
  83791. }
  83792. //设置参考中心,指定图形位置
  83793. shape.refOriginalPosition = this.location;
  83794. //储存数据 id 属性,用于事件
  83795. shape.refDataID = this.data.id;
  83796. //储存数据 id 属性,用于事件-多图形同时高亮
  83797. shape.isHoverByRefDataID = this.isMultiHover;
  83798. //岛洞面
  83799. if (holePolygonPointLists.length > 0) {
  83800. shape.holePolygonPointLists = holePolygonPointLists;
  83801. }
  83802. //修改一些 shape 可选属性,通常不需要这么做
  83803. if (this.shapeOptions) {
  83804. Util_Util.copyAttributesWithClip(shape, this.shapeOptions);
  83805. }
  83806. this.shapes.push(shape);
  83807. }
  83808. /**
  83809. * @function FeatureThemeVector.prototype.rectangleToTF
  83810. * @description 转换矩形要素。
  83811. * @param {Geometry} geometry - 用户数据几何地理信息,这里必须是 Rectangle。
  83812. */
  83813. }, {
  83814. key: "rectangleToTF",
  83815. value: function rectangleToTF(geometry) {
  83816. //参考位置,参考中心为
  83817. var location = this.location;
  83818. var ll = new LonLat(geometry.x, geometry.y);
  83819. //地图分辨率
  83820. var res = this.layer.map.getResolution();
  83821. //geometry 像素坐标
  83822. var localLX = this.getLocalXY(ll);
  83823. //赋 style
  83824. var style = new Object();
  83825. style.r = 6; //防止漏设此参数,默认 6 像素
  83826. style = Util_Util.copyAttributesWithClip(style, this.style);
  83827. style.x = localLX[0] - location[0];
  83828. // Rectangle 使用左下角定位, SmicRectangle 使用左上角定位,需要转换
  83829. style.y = localLX[1] - location[1] - 2 * geometry.width / res;
  83830. style.width = geometry.width / res;
  83831. style.height = geometry.height / res;
  83832. //创建图形
  83833. var shape = new SmicRectangle({
  83834. style: style,
  83835. clickable: this.isClickAble,
  83836. hoverable: this.isHoverAble
  83837. });
  83838. //设置高亮样式
  83839. if (this.highlightStyle) {
  83840. shape.highlightStyle = this.highlightStyle;
  83841. }
  83842. //设置参考中心,指定图形位置
  83843. shape.refOriginalPosition = location;
  83844. //储存数据 id 属性,用于事件
  83845. shape.refDataID = this.data.id;
  83846. //储存数据 id 属性,用于事件-多图形同时高亮
  83847. shape.isHoverByRefDataID = this.isMultiHover;
  83848. //修改一些 shape 可选属性,通常不需要这么做
  83849. if (this.shapeOptions) {
  83850. Util_Util.copyAttributesWithClip(shape, this.shapeOptions);
  83851. }
  83852. this.shapes.push(shape);
  83853. }
  83854. /**
  83855. * @function FeatureThemeVector.prototype.geoTextToTF
  83856. * @description 转换文本要素。
  83857. * @param {Geometry} geometry - 用户数据几何地理信息,这里必须是 GeoText。
  83858. */
  83859. }, {
  83860. key: "geoTextToTF",
  83861. value: function geoTextToTF(geometry) {
  83862. //参考位置,参考中心为
  83863. var location = this.location;
  83864. //geometry 像素坐标
  83865. var localLX = this.getLocalXY(geometry);
  83866. //赋 style
  83867. var style = new Object();
  83868. style.r = 6; //防止漏设此参数,默认 6 像素
  83869. style = Util_Util.copyAttributesWithClip(style, this.style, ["x", "y", "text"]);
  83870. style.x = localLX[0] - location[0];
  83871. style.y = localLX[1] - location[1];
  83872. style.text = geometry.text;
  83873. //创建图形
  83874. var shape = new SmicText({
  83875. style: style,
  83876. clickable: this.isClickAble,
  83877. hoverable: this.isHoverAble
  83878. });
  83879. //设置高亮样式
  83880. if (this.highlightStyle) {
  83881. shape.highlightStyle = this.highlightStyle;
  83882. }
  83883. //设置参考中心,指定图形位置
  83884. shape.refOriginalPosition = location;
  83885. //储存数据 id 属性,用于事件
  83886. shape.refDataID = this.data.id;
  83887. //储存数据 id 属性,用于事件-多图形同时高亮
  83888. shape.isHoverByRefDataID = this.isMultiHover;
  83889. //修改一些 shape 可选属性,通常不需要这么做
  83890. if (this.shapeOptions) {
  83891. Util_Util.copyAttributesWithClip(shape, this.shapeOptions);
  83892. }
  83893. this.shapes.push(shape);
  83894. }
  83895. /**
  83896. * @function FeatureThemeVector.prototype.updateAndAddShapes
  83897. * @description 修改位置,针对地图平移操作,地图漫游操作后调用此函数。
  83898. */
  83899. }, {
  83900. key: "updateAndAddShapes",
  83901. value: function updateAndAddShapes() {
  83902. var newLocalLX = this.getLocalXY(this.lonlat);
  83903. this.location = newLocalLX;
  83904. var render = this.layer.renderer;
  83905. for (var i = 0, len = this.shapes.length; i < len; i++) {
  83906. var shape = this.shapes[i];
  83907. //设置参考中心,指定图形位置
  83908. shape.refOriginalPosition = newLocalLX;
  83909. render.addShape(shape);
  83910. }
  83911. }
  83912. /**
  83913. * @function FeatureThemeVector.prototype.getShapesCount
  83914. * @description 获得专题要素中可视化图形的数量。
  83915. * @returns {number} 可视化图形的数量。
  83916. */
  83917. }, {
  83918. key: "getShapesCount",
  83919. value: function getShapesCount() {
  83920. return this.shapes.length;
  83921. }
  83922. /**
  83923. * @function FeatureThemeVector.prototype.getLocalXY
  83924. * @description 地理坐标转为像素坐标。
  83925. * @param {LonLat} lonlat - 专题要素地理位置。
  83926. */
  83927. }, {
  83928. key: "getLocalXY",
  83929. value: function getLocalXY(lonlat) {
  83930. return this.layer.getLocalXY(lonlat);
  83931. }
  83932. }]);
  83933. return ThemeVector;
  83934. }(Theme_Theme);
  83935. ;// CONCATENATED MODULE: ./src/common/overlay/feature/index.js
  83936. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  83937. * This program are made available under the terms of the Apache License, Version 2.0
  83938. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  83939. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Group.js
  83940. function Group_typeof(obj) { "@babel/helpers - typeof"; return Group_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, Group_typeof(obj); }
  83941. function Group_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  83942. function Group_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  83943. function Group_createClass(Constructor, protoProps, staticProps) { if (protoProps) Group_defineProperties(Constructor.prototype, protoProps); if (staticProps) Group_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  83944. function Group_get() { if (typeof Reflect !== "undefined" && Reflect.get) { Group_get = Reflect.get.bind(); } else { Group_get = function _get(target, property, receiver) { var base = Group_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return Group_get.apply(this, arguments); }
  83945. function Group_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Group_getPrototypeOf(object); if (object === null) break; } return object; }
  83946. function Group_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) Group_setPrototypeOf(subClass, superClass); }
  83947. function Group_setPrototypeOf(o, p) { Group_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Group_setPrototypeOf(o, p); }
  83948. function Group_createSuper(Derived) { var hasNativeReflectConstruct = Group_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Group_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Group_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Group_possibleConstructorReturn(this, result); }; }
  83949. function Group_possibleConstructorReturn(self, call) { if (call && (Group_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return Group_assertThisInitialized(self); }
  83950. function Group_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  83951. function Group_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  83952. function Group_getPrototypeOf(o) { Group_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Group_getPrototypeOf(o); }
  83953. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  83954. * This program are made available under the terms of the Apache License, Version 2.0
  83955. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  83956. /**
  83957. * @class LevelRenderer.Group
  83958. * @category Visualization Theme
  83959. * @private
  83960. * @classdesc Group 是一个容器,可以插入子节点,Group 的变换也会被应用到子节点上。
  83961. * @extends {LevelRenderer.Transformable}
  83962. * (code)
  83963. * var g = new LevelRenderer.Group();
  83964. * var Circle = new LevelRenderer.Shape.Circle();
  83965. * g.position[0] = 100;
  83966. * g.position[1] = 100;
  83967. * g.addChild(new Circle({
  83968. * style: {
  83969. * x: 100,
  83970. * y: 100,
  83971. * r: 20,
  83972. * brushType: 'fill'
  83973. * }
  83974. * }));
  83975. * LR.addGroup(g);
  83976. * (end)
  83977. * @param {Array} options - Group 的配置(options)项,可以是 Group 的自有属性,也可以是自定义的属性。
  83978. */
  83979. var Group = /*#__PURE__*/function (_mixin) {
  83980. Group_inherits(Group, _mixin);
  83981. var _super = Group_createSuper(Group);
  83982. function Group(options) {
  83983. var _this;
  83984. Group_classCallCheck(this, Group);
  83985. _this = _super.call(this, options);
  83986. options = options || {};
  83987. /**
  83988. * @member {string} LevelRenderer.Group.prototype.id
  83989. * @description Group 的唯一标识。
  83990. */
  83991. _this.id = null;
  83992. /**
  83993. * @readonly
  83994. * @member {string} [LevelRenderer.Group.prototype.type='group']
  83995. * @description 类型。
  83996. */
  83997. _this.type = 'group';
  83998. //http://www.w3.org/TR/2dcontext/#clipping-region
  83999. /**
  84000. * @member {string} LevelRenderer.Group.prototype.clipShape
  84001. * @description 用于裁剪的图形(shape),所有 Group 内的图形在绘制时都会被这个图形裁剪,该图形会继承 Group 的变换。
  84002. */
  84003. _this.clipShape = null;
  84004. /**
  84005. * @member {Array} LevelRenderer.Group.prototype._children
  84006. * @description _children。
  84007. */
  84008. _this._children = [];
  84009. /**
  84010. * @member {Array} LevelRenderer.Group.prototype._storage
  84011. * @description _storage。
  84012. */
  84013. _this._storage = null;
  84014. /**
  84015. * @member {boolean} [LevelRenderer.Group.prototype.__dirty=true]
  84016. * @description __dirty。
  84017. */
  84018. _this.__dirty = true;
  84019. /**
  84020. * @member {boolean} [LevelRenderer.Group.prototype.ignore=false]
  84021. * @description 是否忽略该 Group 及其所有子节点。
  84022. */
  84023. _this.ignore = false;
  84024. Util_Util.extend(Group_assertThisInitialized(_this), options);
  84025. _this.id = _this.id || Util_Util.createUniqueID("smShapeGroup_");
  84026. _this.CLASS_NAME = "SuperMap.LevelRenderer.Group";
  84027. return _this;
  84028. }
  84029. /**
  84030. * @function LevelRenderer.Group.prototype.destroy
  84031. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  84032. */
  84033. Group_createClass(Group, [{
  84034. key: "destroy",
  84035. value: function destroy() {
  84036. this.id = null;
  84037. this.type = null;
  84038. this.clipShape = null;
  84039. this._children = null;
  84040. this._storage = null;
  84041. this.__dirty = null;
  84042. this.ignore = null;
  84043. Group_get(Group_getPrototypeOf(Group.prototype), "destroy", this).call(this);
  84044. }
  84045. /**
  84046. * @function LevelRenderer.Group.prototype.children
  84047. * @description 复制并返回一份新的包含所有儿子节点的数组。
  84048. * @returns {Array.<LevelRenderer.Shape>} 图形数组。
  84049. */
  84050. }, {
  84051. key: "children",
  84052. value: function children() {
  84053. return this._children.slice();
  84054. }
  84055. /**
  84056. * @function LevelRenderer.Group.prototype.childAt
  84057. * @description 获取指定 index 的儿子节点
  84058. * @param {number} idx - 节点索引。
  84059. * @returns {LevelRenderer.Shape} 图形。
  84060. */
  84061. }, {
  84062. key: "childAt",
  84063. value: function childAt(idx) {
  84064. return this._children[idx];
  84065. }
  84066. /**
  84067. * @function LevelRenderer.Group.prototype.addChild
  84068. * @description 添加子节点,可以是 Shape 或者 Group。
  84069. * @param {(LevelRenderer.Shape|LevelRenderer.Group)} child - 节点图形。
  84070. */
  84071. // TODO Type Check
  84072. }, {
  84073. key: "addChild",
  84074. value: function addChild(child) {
  84075. if (child == this) {
  84076. return;
  84077. }
  84078. if (child.parent == this) {
  84079. return;
  84080. }
  84081. if (child.parent) {
  84082. child.parent.removeChild(child);
  84083. }
  84084. this._children.push(child);
  84085. child.parent = this;
  84086. if (this._storage && this._storage !== child._storage) {
  84087. this._storage.addToMap(child);
  84088. if (child instanceof Group) {
  84089. child.addChildrenToStorage(this._storage);
  84090. }
  84091. }
  84092. }
  84093. /**
  84094. * @function LevelRenderer.Group.prototype.removeChild
  84095. * @description 移除子节点。
  84096. * @param {LevelRenderer.Shape} child - 需要移除的子节点图形。
  84097. */
  84098. }, {
  84099. key: "removeChild",
  84100. value: function removeChild(child) {
  84101. var idx = Util_Util.indexOf(this._children, child);
  84102. this._children.splice(idx, 1);
  84103. child.parent = null;
  84104. if (this._storage) {
  84105. this._storage.delFromMap(child.id);
  84106. if (child instanceof Group) {
  84107. child.delChildrenFromStorage(this._storage);
  84108. }
  84109. }
  84110. }
  84111. /**
  84112. * @function LevelRenderer.Group.prototype.eachChild
  84113. * @description 遍历所有子节点。
  84114. * @param {function} cb - 回调函数。
  84115. * @param {Object} context - 上下文。
  84116. */
  84117. }, {
  84118. key: "eachChild",
  84119. value: function eachChild(cb, context) {
  84120. var haveContext = !!context;
  84121. for (var i = 0; i < this._children.length; i++) {
  84122. var child = this._children[i];
  84123. if (haveContext) {
  84124. cb.call(context, child);
  84125. } else {
  84126. cb(child);
  84127. }
  84128. }
  84129. }
  84130. /**
  84131. * @function LevelRenderer.Group.prototype.traverse
  84132. * @description 深度优先遍历所有子孙节点。
  84133. * @param {function} cb - 回调函数。
  84134. * @param {Object} context - 上下文。
  84135. */
  84136. }, {
  84137. key: "traverse",
  84138. value: function traverse(cb, context) {
  84139. var haveContext = !!context;
  84140. for (var i = 0; i < this._children.length; i++) {
  84141. var child = this._children[i];
  84142. if (haveContext) {
  84143. cb.call(context, child);
  84144. } else {
  84145. cb(child);
  84146. }
  84147. if (child.type === 'group') {
  84148. child.traverse(cb, context);
  84149. }
  84150. }
  84151. }
  84152. /**
  84153. * @function LevelRenderer.Group.prototype.addChildrenToStorage
  84154. * @description 把子图形添加到仓库。
  84155. * @param {LevelRenderer.Storage} storage - 图形仓库。
  84156. */
  84157. }, {
  84158. key: "addChildrenToStorage",
  84159. value: function addChildrenToStorage(storage) {
  84160. for (var i = 0; i < this._children.length; i++) {
  84161. var child = this._children[i];
  84162. storage.addToMap(child);
  84163. if (child.type === 'group') {
  84164. child.addChildrenToStorage(storage);
  84165. }
  84166. }
  84167. }
  84168. /**
  84169. * @function LevelRenderer.Group.prototype.delChildrenFromStorage
  84170. * @description 从仓库把子图形删除。
  84171. * @param {LevelRenderer.Storage} storage - 图形仓库。
  84172. */
  84173. }, {
  84174. key: "delChildrenFromStorage",
  84175. value: function delChildrenFromStorage(storage) {
  84176. for (var i = 0; i < this._children.length; i++) {
  84177. var child = this._children[i];
  84178. storage.delFromMap(child.id);
  84179. if (child.type === 'group') {
  84180. child.delChildrenFromStorage(storage);
  84181. }
  84182. }
  84183. }
  84184. /**
  84185. * @function LevelRenderer.Group.prototype.modSelf
  84186. * @description 是否修改。
  84187. */
  84188. }, {
  84189. key: "modSelf",
  84190. value: function modSelf() {
  84191. this.__dirty = true;
  84192. }
  84193. }]);
  84194. return Group;
  84195. }(mixinExt(Eventful, Transformable));
  84196. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Storage.js
  84197. function Storage_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  84198. function Storage_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  84199. function Storage_createClass(Constructor, protoProps, staticProps) { if (protoProps) Storage_defineProperties(Constructor.prototype, protoProps); if (staticProps) Storage_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  84200. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  84201. * This program are made available under the terms of the Apache License, Version 2.0
  84202. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  84203. /**
  84204. * @private
  84205. * @class LevelRenderer.Storage
  84206. * @category Visualization Theme
  84207. * @classdesc 内容(图像)仓库 (M) 。
  84208. */
  84209. var Storage = /*#__PURE__*/function () {
  84210. function Storage() {
  84211. Storage_classCallCheck(this, Storage);
  84212. /**
  84213. * @member {Object} LevelRenderer.Storage.prototype._elements
  84214. * @description 所有常规形状,id 索引的 map。
  84215. */
  84216. this._elements = {};
  84217. /**
  84218. * @member {Array} LevelRenderer.Storage.prototype._hoverElements
  84219. * @description 高亮层形状,不稳定,动态增删,数组位置也是 z 轴方向,靠前显示在下方。
  84220. *
  84221. */
  84222. this._hoverElements = [];
  84223. /**
  84224. * @member {Array} LevelRenderer.Storage.prototype._roots
  84225. * @description _roots。
  84226. *
  84227. */
  84228. this._roots = [];
  84229. /**
  84230. * @member {Array} LevelRenderer.Storage.prototype._shapeList
  84231. * @description _shapeList。
  84232. *
  84233. */
  84234. this._shapeList = [];
  84235. /**
  84236. * @member {number} LevelRenderer.Storage.prototype._shapeListOffset
  84237. * @description _shapeListOffset。默认值:0。
  84238. *
  84239. */
  84240. this._shapeListOffset = 0;
  84241. this.CLASS_NAME = "SuperMap.LevelRenderer.Storage";
  84242. }
  84243. /**
  84244. * @function LevelRenderer.Storage.prototype.destroy
  84245. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  84246. */
  84247. Storage_createClass(Storage, [{
  84248. key: "destroy",
  84249. value: function destroy() {
  84250. this.dispose();
  84251. this._shapeList = null;
  84252. this._shapeListOffset = null;
  84253. }
  84254. /**
  84255. * @function LevelRenderer.Storage.prototype.iterShape
  84256. * @description 遍历迭代器。
  84257. *
  84258. * @param {function} fun - 迭代回调函数,return true终止迭代。
  84259. * @param {Object} option - 迭代参数,缺省为仅降序遍历普通层图形。
  84260. * @param {boolean} [hover=true] - 是否是高亮层图形。
  84261. * @param {string} [normal='down'] - 是否是普通层图形,迭代时是否指定及z轴顺序。可设值:'down' ,'up'。
  84262. * @param {boolean} [update=false] - 是否在迭代前更新形状列表。
  84263. * @return {LevelRenderer.Storage} this。
  84264. */
  84265. }, {
  84266. key: "iterShape",
  84267. value: function iterShape(fun, option) {
  84268. if (!option) {
  84269. var defaultIterateOption = {
  84270. hover: false,
  84271. normal: 'down',
  84272. update: false
  84273. };
  84274. option = defaultIterateOption;
  84275. }
  84276. if (option.hover) {
  84277. // 高亮层数据遍历
  84278. for (var i = 0, l = this._hoverElements.length; i < l; i++) {
  84279. var el = this._hoverElements[i];
  84280. el.updateTransform();
  84281. if (fun(el)) {
  84282. return this;
  84283. }
  84284. }
  84285. }
  84286. if (option.update) {
  84287. this.updateShapeList();
  84288. }
  84289. // 遍历: 'down' | 'up'
  84290. switch (option.normal) {
  84291. case 'down':
  84292. {
  84293. // 降序遍历,高层优先
  84294. var _l = this._shapeList.length;
  84295. while (_l--) {
  84296. if (fun(this._shapeList[_l])) {
  84297. return this;
  84298. }
  84299. }
  84300. break;
  84301. }
  84302. // case 'up':
  84303. default:
  84304. {
  84305. // 升序遍历,底层优先
  84306. for (var _i2 = 0, _l3 = this._shapeList.length; _i2 < _l3; _i2++) {
  84307. if (fun(this._shapeList[_i2])) {
  84308. return this;
  84309. }
  84310. }
  84311. break;
  84312. }
  84313. }
  84314. return this;
  84315. }
  84316. /**
  84317. * @function LevelRenderer.Storage.prototype.getHoverShapes
  84318. * @param {boolean} [update=false] - 是否在返回前更新图形的变换。
  84319. * @return {Array.<LevelRenderer.Shape>} 图形数组。
  84320. */
  84321. }, {
  84322. key: "getHoverShapes",
  84323. value: function getHoverShapes(update) {
  84324. // hoverConnect
  84325. var hoverElements = [],
  84326. len = this._hoverElements.length;
  84327. for (var i = 0; i < len; i++) {
  84328. hoverElements.push(this._hoverElements[i]);
  84329. var target = this._hoverElements[i].hoverConnect;
  84330. if (target) {
  84331. var shape;
  84332. target = target instanceof Array ? target : [target];
  84333. for (var j = 0, k = target.length; j < k; j++) {
  84334. shape = target[j].id ? target[j] : this.get(target[j]);
  84335. if (shape) {
  84336. hoverElements.push(shape);
  84337. }
  84338. }
  84339. }
  84340. }
  84341. hoverElements.sort(Storage.shapeCompareFunc);
  84342. if (update) {
  84343. for (var _i4 = 0, l = hoverElements.length; _i4 < l; _i4++) {
  84344. hoverElements[_i4].updateTransform();
  84345. }
  84346. }
  84347. return hoverElements;
  84348. }
  84349. /**
  84350. * @function LevelRenderer.Storage.prototype.getShapeList
  84351. * @description 返回所有图形的绘制队列。
  84352. *
  84353. * @param {boolean} [update=false] - 是否在返回前更新该数组。详见:<LevelRenderer.Shape> updateShapeList。
  84354. * @return {LevelRenderer.Shape} 图形。
  84355. */
  84356. }, {
  84357. key: "getShapeList",
  84358. value: function getShapeList(update) {
  84359. if (update) {
  84360. this.updateShapeList();
  84361. }
  84362. return this._shapeList;
  84363. }
  84364. /**
  84365. * @function LevelRenderer.Storage.prototype.updateShapeList
  84366. * @description 更新图形的绘制队列。每次绘制前都会调用,该方法会先深度优先遍历整个树,更新所有Group和Shape的变换并且把所有可见的Shape保存到数组中,最后根据绘制的优先级(zlevel > z > 插入顺序)排序得到绘制队列。
  84367. */
  84368. }, {
  84369. key: "updateShapeList",
  84370. value: function updateShapeList() {
  84371. this._shapeListOffset = 0;
  84372. var rootsLen = this._roots.length;
  84373. for (var i = 0; i < rootsLen; i++) {
  84374. var root = this._roots[i];
  84375. this._updateAndAddShape(root);
  84376. }
  84377. this._shapeList.length = this._shapeListOffset;
  84378. var shapeListLen = this._shapeList.length;
  84379. for (var _i6 = 0; _i6 < shapeListLen; _i6++) {
  84380. this._shapeList[_i6].__renderidx = _i6;
  84381. }
  84382. this._shapeList.sort(Storage.shapeCompareFunc);
  84383. }
  84384. /**
  84385. * @function LevelRenderer.Storage.prototype._updateAndAddShape
  84386. * @description 更新并添加图形。
  84387. *
  84388. */
  84389. }, {
  84390. key: "_updateAndAddShape",
  84391. value: function _updateAndAddShape(el, clipShapes) {
  84392. if (el.ignore) {
  84393. return;
  84394. }
  84395. el.updateTransform();
  84396. if (el.type == 'group') {
  84397. if (el.clipShape) {
  84398. // clipShape 的变换是基于 group 的变换
  84399. el.clipShape.parent = el;
  84400. el.clipShape.updateTransform();
  84401. // PENDING 效率影响
  84402. if (clipShapes) {
  84403. clipShapes = clipShapes.slice();
  84404. clipShapes.push(el.clipShape);
  84405. } else {
  84406. clipShapes = [el.clipShape];
  84407. }
  84408. }
  84409. for (var i = 0; i < el._children.length; i++) {
  84410. var child = el._children[i];
  84411. // Force to mark as dirty if group is dirty
  84412. child.__dirty = el.__dirty || child.__dirty;
  84413. this._updateAndAddShape(child, clipShapes);
  84414. }
  84415. // Mark group clean here
  84416. el.__dirty = false;
  84417. } else {
  84418. el.__clipShapes = clipShapes;
  84419. this._shapeList[this._shapeListOffset++] = el;
  84420. }
  84421. }
  84422. /**
  84423. * @function LevelRenderer.Storage.prototype.mod
  84424. * @description 修改图形(Shape)或者组(Group)。
  84425. *
  84426. * @param {string} elId - 唯一标识。
  84427. * @param {Object} params - 参数。
  84428. * @return {LevelRenderer.Storage} this。
  84429. */
  84430. }, {
  84431. key: "mod",
  84432. value: function mod(elId, params) {
  84433. var el = this._elements[elId];
  84434. if (el) {
  84435. el.modSelf();
  84436. if (params) {
  84437. // 如果第二个参数直接使用 shape
  84438. // parent, _storage, __startClip 三个属性会有循环引用
  84439. // 主要为了向 1.x 版本兼容,2.x 版本不建议使用第二个参数
  84440. if (params.parent || params._storage || params.__startClip) {
  84441. var target = {};
  84442. for (var name in params) {
  84443. if (name == 'parent' || name == '_storage' || name == '__startClip') {
  84444. continue;
  84445. }
  84446. if (params.hasOwnProperty(name)) {
  84447. target[name] = params[name];
  84448. }
  84449. }
  84450. new levelRenderer_Util_Util().merge(el, target, true);
  84451. } else {
  84452. new levelRenderer_Util_Util().merge(el, params, true);
  84453. }
  84454. }
  84455. }
  84456. return this;
  84457. }
  84458. /**
  84459. * @function LevelRenderer.Storage.prototype.drift
  84460. * @description 移动指定的图形(Shape)的位置。
  84461. * @param {string} shapeId - 唯一标识。
  84462. * @param {number} dx
  84463. * @param {number} dy
  84464. * @return {LevelRenderer.Storage} this。
  84465. */
  84466. }, {
  84467. key: "drift",
  84468. value: function drift(shapeId, dx, dy) {
  84469. var shape = this._elements[shapeId];
  84470. if (shape) {
  84471. shape.needTransform = true;
  84472. if (shape.draggable === 'horizontal') {
  84473. dy = 0;
  84474. } else if (shape.draggable === 'vertical') {
  84475. dx = 0;
  84476. }
  84477. if (!shape.ondrift // ondrift
  84478. // 有onbrush并且调用执行返回false或undefined则继续
  84479. || shape.ondrift && !shape.ondrift(dx, dy)) {
  84480. shape.drift(dx, dy);
  84481. }
  84482. }
  84483. return this;
  84484. }
  84485. /**
  84486. * @function LevelRenderer.Storage.prototype.addHover
  84487. * @description 添加高亮层数据。
  84488. * @param {LevelRenderer.Shape} shape - 图形。
  84489. * @return {LevelRenderer.Storage} this。
  84490. */
  84491. }, {
  84492. key: "addHover",
  84493. value: function addHover(shape) {
  84494. shape.updateNeedTransform();
  84495. this._hoverElements.push(shape);
  84496. return this;
  84497. }
  84498. /**
  84499. * @function LevelRenderer.Storage.prototype.delHover
  84500. * @description 清空高亮层数据。
  84501. * @return {LevelRenderer.Storage} this。
  84502. */
  84503. }, {
  84504. key: "delHover",
  84505. value: function delHover() {
  84506. this._hoverElements = [];
  84507. return this;
  84508. }
  84509. /**
  84510. * @function LevelRenderer.Storage.prototype.hasHoverShape
  84511. * @description 是否有图形在高亮层里。
  84512. * @return {boolean} 是否有图形在高亮层里。
  84513. */
  84514. }, {
  84515. key: "hasHoverShape",
  84516. value: function hasHoverShape() {
  84517. return this._hoverElements.length > 0;
  84518. }
  84519. /**
  84520. * @function LevelRenderer.Storage.prototype.addRoot
  84521. * @description 添加图形(Shape)或者组(Group)到根节点。
  84522. *
  84523. * @param {(LevelRenderer.Shape/LevelRenderer.Group)} el - 图形。
  84524. *
  84525. */
  84526. }, {
  84527. key: "addRoot",
  84528. value: function addRoot(el) {
  84529. if (el instanceof Group) {
  84530. el.addChildrenToStorage(this);
  84531. }
  84532. this.addToMap(el);
  84533. this._roots.push(el);
  84534. }
  84535. /**
  84536. * @function LevelRenderer.Storage.prototype.delRoot
  84537. * @description 删除指定的图形(Shape)或者组(Group)。
  84538. *
  84539. * @param {Array.<string>} elId - 删除图形(Shape)或者组(Group)的 ID 数组。如果为空清空整个Storage。
  84540. *
  84541. */
  84542. }, {
  84543. key: "delRoot",
  84544. value: function delRoot(elId) {
  84545. if (typeof elId == 'undefined') {
  84546. // 不指定elId清空
  84547. for (var i = 0; i < this._roots.length; i++) {
  84548. var root = this._roots[i];
  84549. if (root instanceof Group) {
  84550. root.delChildrenFromStorage(this);
  84551. }
  84552. }
  84553. this._elements = {};
  84554. this._hoverElements = [];
  84555. this._roots = [];
  84556. return;
  84557. }
  84558. if (elId instanceof Array) {
  84559. var elIdLen = elId.length;
  84560. for (var _i8 = 0; _i8 < elIdLen; _i8++) {
  84561. this.delRoot(elId[_i8]);
  84562. }
  84563. return;
  84564. }
  84565. var el;
  84566. if (typeof elId == 'string') {
  84567. el = this._elements[elId];
  84568. } else {
  84569. el = elId;
  84570. }
  84571. var idx = new levelRenderer_Util_Util().indexOf(this._roots, el);
  84572. if (idx >= 0) {
  84573. this.delFromMap(el.id);
  84574. this._roots.splice(idx, 1);
  84575. if (el instanceof Group) {
  84576. el.delChildrenFromStorage(this);
  84577. }
  84578. }
  84579. }
  84580. /**
  84581. * @function LevelRenderer.Storage.prototype.addToMap
  84582. * @description 添加图形到 map。
  84583. *
  84584. * @param {LevelRenderer.Shape} el - 图形。
  84585. * @return {LevelRenderer.Storage} this。
  84586. */
  84587. }, {
  84588. key: "addToMap",
  84589. value: function addToMap(el) {
  84590. if (el instanceof Group) {
  84591. el._storage = this;
  84592. }
  84593. el.modSelf();
  84594. this._elements[el.id] = el;
  84595. return this;
  84596. }
  84597. /**
  84598. * @function LevelRenderer.Storage.prototype.get
  84599. * @description 获取指定图形。
  84600. *
  84601. * @param {string} elId - 图形 id。
  84602. * @return {LevelRenderer.Shape} 图形。
  84603. */
  84604. }, {
  84605. key: "get",
  84606. value: function get(elId) {
  84607. return this._elements[elId];
  84608. }
  84609. /**
  84610. * @function LevelRenderer.Storage.prototype.delFromMap
  84611. * @description 从 map 中删除指定图形。
  84612. *
  84613. * @param {string} elId - 图形id。
  84614. * @return {LevelRenderer.Storage} this。
  84615. */
  84616. }, {
  84617. key: "delFromMap",
  84618. value: function delFromMap(elId) {
  84619. var el = this._elements[elId];
  84620. if (el) {
  84621. delete this._elements[elId];
  84622. if (el instanceof Group) {
  84623. el._storage = null;
  84624. }
  84625. }
  84626. return this;
  84627. }
  84628. /**
  84629. * @function LevelRenderer.Storage.prototype.dispose
  84630. * @description 清空并且释放 Storage。
  84631. */
  84632. }, {
  84633. key: "dispose",
  84634. value: function dispose() {
  84635. this._elements = null;
  84636. // this._renderList = null;
  84637. this._roots = null;
  84638. this._hoverElements = null;
  84639. }
  84640. }], [{
  84641. key: "shapeCompareFunc",
  84642. value: function shapeCompareFunc(a, b) {
  84643. if (a.zlevel == b.zlevel) {
  84644. if (a.z == b.z) {
  84645. return a.__renderidx - b.__renderidx;
  84646. }
  84647. return a.z - b.z;
  84648. }
  84649. return a.zlevel - b.zlevel;
  84650. }
  84651. }]);
  84652. return Storage;
  84653. }();
  84654. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Painter.js
  84655. function Painter_typeof(obj) { "@babel/helpers - typeof"; return Painter_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, Painter_typeof(obj); }
  84656. function Painter_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) Painter_setPrototypeOf(subClass, superClass); }
  84657. function Painter_setPrototypeOf(o, p) { Painter_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Painter_setPrototypeOf(o, p); }
  84658. function Painter_createSuper(Derived) { var hasNativeReflectConstruct = Painter_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Painter_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Painter_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Painter_possibleConstructorReturn(this, result); }; }
  84659. function Painter_possibleConstructorReturn(self, call) { if (call && (Painter_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return Painter_assertThisInitialized(self); }
  84660. function Painter_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  84661. function Painter_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  84662. function Painter_getPrototypeOf(o) { Painter_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Painter_getPrototypeOf(o); }
  84663. function Painter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  84664. function Painter_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  84665. function Painter_createClass(Constructor, protoProps, staticProps) { if (protoProps) Painter_defineProperties(Constructor.prototype, protoProps); if (staticProps) Painter_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  84666. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  84667. * This program are made available under the terms of the Apache License, Version 2.0
  84668. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  84669. /**
  84670. * @private
  84671. * @class LevelRenderer.Painter
  84672. * @category Visualization Theme
  84673. * @classdesc Painter 绘图模块。
  84674. * @param {HTMLElement} root - 绘图区域(DIV)。
  84675. * @param {LevelRenderer.Storage} storage - Storage 实例。
  84676. */
  84677. var Painter = /*#__PURE__*/function () {
  84678. function Painter(root, storage) {
  84679. Painter_classCallCheck(this, Painter);
  84680. /**
  84681. * @member {HTMLElement} LevelRenderer.Painter.prototype.root
  84682. * @description 绘图容器。
  84683. *
  84684. */
  84685. this.root = root;
  84686. /**
  84687. * @member {Array} LevelRenderer.Painter.prototype.storage
  84688. * @description 图形仓库。
  84689. *
  84690. */
  84691. this.storage = storage;
  84692. /**
  84693. * @member {HTMLElement} LevelRenderer.Painter.prototype._domRoot
  84694. * @description 容器根 dom 对象。
  84695. *
  84696. */
  84697. this._domRoot = null;
  84698. /**
  84699. * @member {Object} LevelRenderer.Painter.prototype._layers
  84700. * @description 绘制层对象。
  84701. *
  84702. */
  84703. this._layers = {};
  84704. /**
  84705. * @member {Array} LevelRenderer.Painter.prototype._zlevelList
  84706. * @description 层列表。
  84707. *
  84708. */
  84709. this._zlevelList = [];
  84710. /**
  84711. * @member {Object} LevelRenderer.Painter.prototype._layerConfig
  84712. * @description 绘制层配置对象。
  84713. *
  84714. */
  84715. this._layerConfig = {};
  84716. /**
  84717. * @member {Object} LevelRenderer.Painter.prototype._bgDom
  84718. * @description 背景层 Canvas (Dom)。
  84719. *
  84720. */
  84721. this._bgDom = null;
  84722. /**
  84723. * @member {function} LevelRenderer.Painter.prototype.shapeToImage
  84724. * @description 形状转图像函数。
  84725. *
  84726. */
  84727. this.shapeToImage = null;
  84728. // retina 屏幕优化
  84729. Painter.devicePixelRatio = Math.max(window.devicePixelRatio || 1, 1);
  84730. this.CLASS_NAME = "SuperMap.LevelRenderer.Painter";
  84731. this.root.innerHTML = '';
  84732. this._width = this._getWidth(); // 宽,缓存记录
  84733. this._height = this._getHeight(); // 高,缓存记录
  84734. var domRoot = document.createElement('div');
  84735. this._domRoot = domRoot;
  84736. // domRoot.onselectstart = returnFalse; // 避免页面选中的尴尬
  84737. domRoot.style.position = 'relative';
  84738. domRoot.style.overflow = 'hidden';
  84739. domRoot.style.width = this._width + 'px';
  84740. domRoot.style.height = this._height + 'px';
  84741. this.root.appendChild(domRoot);
  84742. this.shapeToImage = this._createShapeToImageProcessor();
  84743. // 创建各层canvas
  84744. // 背景
  84745. //this._bgDom = Painter.createDom('bg', 'div', this);
  84746. this._bgDom = Painter.createDom(Util_Util.createUniqueID("SuperMap.Theme_background_"), 'div', this);
  84747. domRoot.appendChild(this._bgDom);
  84748. this._bgDom.onselectstart = returnFalse;
  84749. this._bgDom.style['-webkit-user-select'] = 'none';
  84750. this._bgDom.style['user-select'] = 'none';
  84751. this._bgDom.style['-webkit-touch-callout'] = 'none';
  84752. // 高亮
  84753. //var hoverLayer = new PaintLayer('_hoverLayer_', this);
  84754. var hoverLayer = new PaintLayer(Util_Util.createUniqueID("_highLightLayer_"), this);
  84755. this._layers['hover'] = hoverLayer;
  84756. domRoot.appendChild(hoverLayer.dom);
  84757. hoverLayer.initContext();
  84758. hoverLayer.dom.onselectstart = returnFalse;
  84759. hoverLayer.dom.style['-webkit-user-select'] = 'none';
  84760. hoverLayer.dom.style['user-select'] = 'none';
  84761. hoverLayer.dom.style['-webkit-touch-callout'] = 'none';
  84762. var me = this;
  84763. this.updatePainter = function (shapeList, callback) {
  84764. me.refreshShapes(shapeList, callback);
  84765. };
  84766. // 返回false的方法,用于避免页面被选中
  84767. function returnFalse() {
  84768. return false;
  84769. }
  84770. /* eslint-disable */
  84771. // 什么都不干的空方法
  84772. function doNothing() {//NOSONAR
  84773. }
  84774. /* eslint-enable */
  84775. }
  84776. /**
  84777. * @function LevelRenderer.Painter.prototype.destroy
  84778. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  84779. */
  84780. Painter_createClass(Painter, [{
  84781. key: "destroy",
  84782. value: function destroy() {
  84783. this.dispose();
  84784. this._zlevelList = null;
  84785. this._layerConfig = null;
  84786. this._bgDom = null;
  84787. this.shapeToImage = null;
  84788. }
  84789. /**
  84790. * @function LevelRenderer.Painter.prototype.render
  84791. * @description 渲染。首次绘图,创建各种 dom 和 context。
  84792. *
  84793. * @param {function} callback - 绘画结束后的回调函数。
  84794. * @return {LevelRenderer.Painter} this。
  84795. */
  84796. }, {
  84797. key: "render",
  84798. value: function render(callback) {
  84799. // TODO
  84800. this.refresh(callback, true);
  84801. return this;
  84802. }
  84803. /**
  84804. * @function LevelRenderer.Painter.prototype.refresh
  84805. * @description 刷新。
  84806. *
  84807. * @param {function} callback - 刷新结束后的回调函数。
  84808. * @param {boolean} paintAll - 强制绘制所有 shape。
  84809. * @return {LevelRenderer.Painter} this。
  84810. */
  84811. }, {
  84812. key: "refresh",
  84813. value: function refresh(callback, paintAll) {
  84814. var list = this.storage.getShapeList(true);
  84815. this._paintList(list, paintAll);
  84816. if (typeof callback == 'function') {
  84817. callback();
  84818. }
  84819. return this;
  84820. }
  84821. /**
  84822. * Method: _paintList
  84823. * 按列表绘制图形。
  84824. */
  84825. }, {
  84826. key: "_paintList",
  84827. value: function _paintList(list, paintAll) {
  84828. if (typeof paintAll == 'undefined') {
  84829. paintAll = false;
  84830. }
  84831. this._updateLayerStatus(list);
  84832. var currentLayer;
  84833. var currentZLevel;
  84834. var ctx;
  84835. for (var id in this._layers) {
  84836. if (id !== 'hover') {
  84837. this._layers[id].unusedCount++;
  84838. this._layers[id].updateTransform();
  84839. }
  84840. }
  84841. var invTransform = [];
  84842. for (var i = 0, l = list.length; i < l; i++) {
  84843. var shape = list[i];
  84844. if (currentZLevel !== shape.zlevel) {
  84845. if (currentLayer && currentLayer.needTransform) {
  84846. ctx.restore();
  84847. }
  84848. currentLayer = this.getLayer(shape.zlevel);
  84849. ctx = currentLayer.ctx;
  84850. currentZLevel = shape.zlevel;
  84851. // Reset the count
  84852. currentLayer.unusedCount = 0;
  84853. if (currentLayer.dirty || paintAll) {
  84854. currentLayer.clear();
  84855. }
  84856. if (currentLayer.needTransform) {
  84857. ctx.save();
  84858. currentLayer.setTransform(ctx);
  84859. }
  84860. }
  84861. // Start group clipping
  84862. if (ctx && shape.__startClip) {
  84863. var clipShape = shape.__startClip;
  84864. ctx.save();
  84865. // Set transform
  84866. if (clipShape.needTransform) {
  84867. var m = clipShape.transform;
  84868. SUtil_SUtil.Util_matrix.invert(invTransform, m);
  84869. ctx.transform(m[0], m[1], m[2], m[3], m[4], m[5]);
  84870. }
  84871. ctx.beginPath();
  84872. clipShape.buildPath(ctx, clipShape.style);
  84873. ctx.clip();
  84874. // Transform back
  84875. if (clipShape.needTransform) {
  84876. var _m = invTransform;
  84877. ctx.transform(_m[0], _m[1], _m[2], _m[3], _m[4], _m[5]);
  84878. }
  84879. }
  84880. if ((currentLayer && currentLayer.dirty || paintAll) && !shape.invisible) {
  84881. if (!shape.onbrush || shape.onbrush && !shape.onbrush(ctx, false)) {
  84882. if (Config_Config.catchBrushException) {
  84883. try {
  84884. shape.brush(ctx, false, this.updatePainter);
  84885. } catch (error) {
  84886. SUtil_SUtil.Util_log(error, 'brush error of ' + shape.type, shape);
  84887. }
  84888. } else {
  84889. shape.brush(ctx, false, this.updatePainter);
  84890. }
  84891. }
  84892. }
  84893. // Stop group clipping
  84894. if (ctx && shape.__stopClip) {
  84895. ctx.restore();
  84896. }
  84897. shape.__dirty = false;
  84898. }
  84899. if (ctx && currentLayer && currentLayer.needTransform) {
  84900. ctx.restore();
  84901. }
  84902. for (var _id2 in this._layers) {
  84903. if (_id2 !== 'hover') {
  84904. var layer = this._layers[_id2];
  84905. layer.dirty = false;
  84906. // 删除过期的层
  84907. // PENDING
  84908. // if (layer.unusedCount >= 500) {
  84909. // this.delLayer(id);
  84910. // }
  84911. if (layer.unusedCount == 1) {
  84912. layer.clear();
  84913. }
  84914. }
  84915. }
  84916. }
  84917. /**
  84918. * @function LevelRenderer.Painter.prototype.getLayer
  84919. * @description 获取 zlevel 所在层,如果不存在则会创建一个新的层。
  84920. *
  84921. * @param {number} zlevel - zlevel。
  84922. * @return {LevelRenderer.Painter} this。
  84923. */
  84924. }, {
  84925. key: "getLayer",
  84926. value: function getLayer(zlevel) {
  84927. // Change draw layer
  84928. var currentLayer = this._layers[zlevel];
  84929. if (!currentLayer) {
  84930. var len = this._zlevelList.length;
  84931. var prevLayer = null;
  84932. var i = -1;
  84933. if (len > 0 && zlevel > this._zlevelList[0]) {
  84934. for (i = 0; i < len - 1; i++) {
  84935. if (this._zlevelList[i] < zlevel && this._zlevelList[i + 1] > zlevel) {
  84936. break;
  84937. }
  84938. }
  84939. prevLayer = this._layers[this._zlevelList[i]];
  84940. }
  84941. this._zlevelList.splice(i + 1, 0, zlevel);
  84942. // Create a new layer
  84943. //currentLayer = new PaintLayer(zlevel, this);
  84944. currentLayer = new PaintLayer(Util_Util.createUniqueID("_levelLayer_" + zlevel), this);
  84945. var prevDom = prevLayer ? prevLayer.dom : this._bgDom;
  84946. if (prevDom.nextSibling) {
  84947. prevDom.parentNode.insertBefore(currentLayer.dom, prevDom.nextSibling);
  84948. } else {
  84949. prevDom.parentNode.appendChild(currentLayer.dom);
  84950. }
  84951. currentLayer.initContext();
  84952. this._layers[zlevel] = currentLayer;
  84953. if (this._layerConfig[zlevel]) {
  84954. new levelRenderer_Util_Util().merge(currentLayer, this._layerConfig[zlevel], true);
  84955. }
  84956. currentLayer.updateTransform();
  84957. }
  84958. return currentLayer;
  84959. }
  84960. /**
  84961. * @function LevelRenderer.Painter.prototype.getLayers
  84962. * @description 获取所有已创建的层。
  84963. * @return {Array.<Painter.Layer>} 已创建的层
  84964. */
  84965. }, {
  84966. key: "getLayers",
  84967. value: function getLayers() {
  84968. return this._layers;
  84969. }
  84970. /**
  84971. * Method: _updateLayerStatus
  84972. * 更新绘制层状态。
  84973. */
  84974. }, {
  84975. key: "_updateLayerStatus",
  84976. value: function _updateLayerStatus(list) {
  84977. var layers = this._layers;
  84978. var elCounts = {};
  84979. for (var z in layers) {
  84980. if (z !== 'hover') {
  84981. elCounts[z] = layers[z].elCount;
  84982. layers[z].elCount = 0;
  84983. }
  84984. }
  84985. for (var i = 0; i < list.length; i++) {
  84986. var shape = list[i];
  84987. var zlevel = shape.zlevel;
  84988. var layer = layers[zlevel];
  84989. if (layer) {
  84990. layer.elCount++;
  84991. // 已经被标记为需要刷新
  84992. if (layer.dirty) {
  84993. continue;
  84994. }
  84995. layer.dirty = shape.__dirty;
  84996. }
  84997. }
  84998. // 层中的元素数量有发生变化
  84999. for (var _z2 in layers) {
  85000. if (_z2 !== 'hover') {
  85001. if (elCounts[_z2] !== layers[_z2].elCount) {
  85002. layers[_z2].dirty = true;
  85003. }
  85004. }
  85005. }
  85006. }
  85007. /**
  85008. * @function LevelRenderer.Painter.prototype.refreshShapes
  85009. * @description 更新的图形元素列表。
  85010. *
  85011. * @param {number} shapeList - 需要更新的图形元素列表。
  85012. * @param {number} callback - 视图更新后回调函数。
  85013. * @return {LevelRenderer.Painter} this。
  85014. */
  85015. }, {
  85016. key: "refreshShapes",
  85017. value: function refreshShapes(shapeList, callback) {
  85018. for (var i = 0, l = shapeList.length; i < l; i++) {
  85019. var shape = shapeList[i];
  85020. this.storage.mod(shape.id);
  85021. }
  85022. this.refresh(callback);
  85023. return this;
  85024. }
  85025. /**
  85026. * @function LevelRenderer.Painter.prototype.clear
  85027. * @description 清除 hover 层外所有内容。
  85028. * @return {LevelRenderer.Painter} this。
  85029. */
  85030. }, {
  85031. key: "clear",
  85032. value: function clear() {
  85033. for (var k in this._layers) {
  85034. if (k == 'hover') {
  85035. continue;
  85036. }
  85037. this._layers[k].clear();
  85038. }
  85039. return this;
  85040. }
  85041. /**
  85042. * @function LevelRenderer.Painter.prototype.modLayer
  85043. * @description 修改指定 zlevel 的绘制参数。
  85044. *
  85045. * @param {string} zlevel - zlevel。
  85046. * @param {Object} config - 配置对象。
  85047. * @param {string} [config.clearColor=0] - 每次清空画布的颜色。
  85048. * @param {boolean} [config.motionBlur=false] - 是否开启动态模糊。
  85049. * @param {number} [config.lastFrameAlpha=0.7] - 在开启动态模糊的时候使用,与上一帧混合的alpha值,值越大尾迹越明显。默认值:0.7。
  85050. * @param {Array.<number>} config.position - 层的平移。
  85051. * @param {Array.<number>} config.rotation - 层的旋转。
  85052. * @param {Array.<number>} config.scale - 层的缩放。
  85053. * @param {boolean} config.zoomable - 层是否支持鼠标缩放操作。默认值:false。
  85054. * @param {boolean} config.panable - 层是否支持鼠标平移操作。默认值:false。
  85055. *
  85056. */
  85057. }, {
  85058. key: "modLayer",
  85059. value: function modLayer(zlevel, config) {
  85060. if (config) {
  85061. if (!this._layerConfig[zlevel]) {
  85062. this._layerConfig[zlevel] = config;
  85063. } else {
  85064. new levelRenderer_Util_Util().merge(this._layerConfig[zlevel], config, true);
  85065. }
  85066. var layer = this._layers[zlevel];
  85067. if (layer) {
  85068. new levelRenderer_Util_Util().merge(layer, this._layerConfig[zlevel], true);
  85069. }
  85070. }
  85071. }
  85072. /**
  85073. * @function LevelRenderer.Painter.prototype.delLayer
  85074. * @description 删除指定层。
  85075. *
  85076. * @param {string} zlevel - 层所在的 zlevel。
  85077. */
  85078. }, {
  85079. key: "delLayer",
  85080. value: function delLayer(zlevel) {
  85081. var layer = this._layers[zlevel];
  85082. if (!layer) {
  85083. return;
  85084. }
  85085. // Save config
  85086. this.modLayer(zlevel, {
  85087. position: layer.position,
  85088. rotation: layer.rotation,
  85089. scale: layer.scale
  85090. });
  85091. layer.dom.parentNode.removeChild(layer.dom);
  85092. delete this._layers[zlevel];
  85093. this._zlevelList.splice(new levelRenderer_Util_Util().indexOf(this._zlevelList, zlevel), 1);
  85094. }
  85095. /**
  85096. * @function LevelRenderer.Painter.prototype.refreshHover
  85097. * @description 刷新 hover 层。
  85098. * @return {LevelRenderer.Painter} this。
  85099. */
  85100. }, {
  85101. key: "refreshHover",
  85102. value: function refreshHover() {
  85103. this.clearHover();
  85104. var list = this.storage.getHoverShapes(true);
  85105. for (var i = 0, l = list.length; i < l; i++) {
  85106. this._brushHover(list[i]);
  85107. }
  85108. this.storage.delHover();
  85109. return this;
  85110. }
  85111. /**
  85112. * @function LevelRenderer.Painter.prototype.clearHover
  85113. * @description 清除 hover 层所有内容。
  85114. * @return {LevelRenderer.Painter} this。
  85115. */
  85116. }, {
  85117. key: "clearHover",
  85118. value: function clearHover() {
  85119. var hover = this._layers.hover;
  85120. hover && hover.clear();
  85121. return this;
  85122. }
  85123. /**
  85124. * @function LevelRenderer.Painter.prototype.resize
  85125. * @description 区域大小变化后重绘。
  85126. * @return {LevelRenderer.Painter} this。
  85127. */
  85128. }, {
  85129. key: "resize",
  85130. value: function resize() {
  85131. var domRoot = this._domRoot;
  85132. domRoot.style.display = 'none';
  85133. var width = this._getWidth();
  85134. var height = this._getHeight();
  85135. domRoot.style.display = '';
  85136. // 优化没有实际改变的resize
  85137. if (this._width != width || height != this._height) {
  85138. this._width = width;
  85139. this._height = height;
  85140. domRoot.style.width = width + 'px';
  85141. domRoot.style.height = height + 'px';
  85142. for (var id in this._layers) {
  85143. this._layers[id].resize(width, height);
  85144. }
  85145. this.refresh(null, true);
  85146. }
  85147. return this;
  85148. }
  85149. /**
  85150. * @function LevelRenderer.Painter.prototype.clearLayer
  85151. * @description 清除指定的一个层。
  85152. * @param {number} zLevel - 层。
  85153. */
  85154. }, {
  85155. key: "clearLayer",
  85156. value: function clearLayer(zLevel) {
  85157. var layer = this._layers[zLevel];
  85158. if (layer) {
  85159. layer.clear();
  85160. }
  85161. }
  85162. /**
  85163. * @function LevelRenderer.Painter.prototype.dispose
  85164. * @description 释放。
  85165. *
  85166. */
  85167. }, {
  85168. key: "dispose",
  85169. value: function dispose() {
  85170. this.root.innerHTML = '';
  85171. this.root = null;
  85172. this.storage = null;
  85173. this._domRoot = null;
  85174. this._layers = null;
  85175. }
  85176. /**
  85177. * @function LevelRenderer.Painter.prototype.getDomHover
  85178. * @description 获取 Hover 层的 Dom。
  85179. */
  85180. }, {
  85181. key: "getDomHover",
  85182. value: function getDomHover() {
  85183. return this._layers.hover.dom;
  85184. }
  85185. /**
  85186. * @function LevelRenderer.Painter.prototype.toDataURL
  85187. * @description 图像导出。
  85188. * @param {string} type - 图片类型。
  85189. * @param {string} backgroundColor - 背景色。默认值:'#fff'。
  85190. * @param {Object} args
  85191. * @return {string} 图片的Base64 url。
  85192. */
  85193. }, {
  85194. key: "toDataURL",
  85195. value: function toDataURL(type, backgroundColor, args) {
  85196. //var imageDom = Painter.createDom('image', 'canvas', this);
  85197. var imageDom = Painter.createDom(Util_Util.createUniqueID("SuperMap.Theme.image_"), 'canvas', this);
  85198. this._bgDom.appendChild(imageDom);
  85199. var ctx = imageDom.getContext('2d');
  85200. Painter.devicePixelRatio != 1 && ctx.scale(Painter.devicePixelRatio, Painter.devicePixelRatio);
  85201. ctx.fillStyle = backgroundColor || '#fff';
  85202. ctx.rect(0, 0, this._width * Painter.devicePixelRatio, this._height * Painter.devicePixelRatio);
  85203. ctx.fill();
  85204. var self = this;
  85205. // 升序遍历,shape上的zlevel指定绘画图层的z轴层叠
  85206. this.storage.iterShape(function (shape) {
  85207. if (!shape.invisible) {
  85208. if (!shape.onbrush // 没有onbrush
  85209. // 有onbrush并且调用执行返回false或undefined则继续粉刷
  85210. || shape.onbrush && !shape.onbrush(ctx, false)) {
  85211. if (Config_Config.catchBrushException) {
  85212. try {
  85213. shape.brush(ctx, false, self.updatePainter);
  85214. } catch (error) {
  85215. SUtil_SUtil.Util_log(error, 'brush error of ' + shape.type, shape);
  85216. }
  85217. } else {
  85218. shape.brush(ctx, false, self.updatePainter);
  85219. }
  85220. }
  85221. }
  85222. }, {
  85223. normal: 'up',
  85224. update: true
  85225. });
  85226. var image = imageDom.toDataURL(type, args);
  85227. ctx = null;
  85228. this._bgDom.removeChild(imageDom);
  85229. return image;
  85230. }
  85231. /**
  85232. * @function LevelRenderer.Painter.prototype.getWidth
  85233. * @description 获取绘图区域宽度。
  85234. * @return {number} 绘图区域宽度。
  85235. */
  85236. }, {
  85237. key: "getWidth",
  85238. value: function getWidth() {
  85239. return this._width;
  85240. }
  85241. /**
  85242. * @function LevelRenderer.Painter.prototype.getHeight
  85243. * @description 获取绘图区域高度。
  85244. * @return {number} 绘图区域高度。
  85245. */
  85246. }, {
  85247. key: "getHeight",
  85248. value: function getHeight() {
  85249. return this._height;
  85250. }
  85251. /**
  85252. * Method: _getWidth
  85253. *
  85254. */
  85255. }, {
  85256. key: "_getWidth",
  85257. value: function _getWidth() {
  85258. var root = this.root;
  85259. var stl = root.currentStyle || document.defaultView.getComputedStyle(root);
  85260. return ((root.clientWidth || parseInt(stl.width, 10)) - parseInt(stl.paddingLeft, 10) // 请原谅我这比较粗暴
  85261. - parseInt(stl.paddingRight, 10)).toFixed(0) - 0;
  85262. }
  85263. /**
  85264. * Method: _getHeight
  85265. *
  85266. */
  85267. }, {
  85268. key: "_getHeight",
  85269. value: function _getHeight() {
  85270. var root = this.root;
  85271. var stl = root.currentStyle || document.defaultView.getComputedStyle(root);
  85272. return ((root.clientHeight || parseInt(stl.height, 10)) - parseInt(stl.paddingTop, 10) // 请原谅我这比较粗暴
  85273. - parseInt(stl.paddingBottom, 10)).toFixed(0) - 0;
  85274. }
  85275. /**
  85276. * Method: _brushHover
  85277. *
  85278. */
  85279. }, {
  85280. key: "_brushHover",
  85281. value: function _brushHover(shape) {
  85282. var ctx = this._layers.hover.ctx;
  85283. if (!shape.onbrush // 没有onbrush
  85284. // 有onbrush并且调用执行返回false或undefined则继续粉刷
  85285. || shape.onbrush && !shape.onbrush(ctx, true)) {
  85286. var layer = this.getLayer(shape.zlevel);
  85287. if (layer.needTransform) {
  85288. ctx.save();
  85289. layer.setTransform(ctx);
  85290. }
  85291. // Retina 优化
  85292. if (Config_Config.catchBrushException) {
  85293. try {
  85294. shape.brush(ctx, true, this.updatePainter);
  85295. } catch (error) {
  85296. SUtil_SUtil.Util_log(error, 'hoverBrush error of ' + shape.type, shape);
  85297. }
  85298. } else {
  85299. shape.brush(ctx, true, this.updatePainter);
  85300. }
  85301. if (layer.needTransform) {
  85302. ctx.restore();
  85303. }
  85304. }
  85305. }
  85306. /**
  85307. * Method: _shapeToImage
  85308. *
  85309. */
  85310. }, {
  85311. key: "_shapeToImage",
  85312. value: function _shapeToImage(id, shape, width, height, devicePixelRatio) {
  85313. var canvas = document.createElement('canvas');
  85314. var ctx = canvas.getContext('2d');
  85315. var _devicePixelRatio = devicePixelRatio || window.devicePixelRatio || 1;
  85316. canvas.style.width = width + 'px';
  85317. canvas.style.height = height + 'px';
  85318. canvas.setAttribute('width', width * _devicePixelRatio);
  85319. canvas.setAttribute('height', height * _devicePixelRatio);
  85320. ctx.clearRect(0, 0, width * _devicePixelRatio, height * _devicePixelRatio);
  85321. var shapeTransform = {
  85322. position: shape.position,
  85323. rotation: shape.rotation,
  85324. scale: shape.scale
  85325. };
  85326. shape.position = [0, 0, 0];
  85327. shape.rotation = 0;
  85328. shape.scale = [1, 1];
  85329. if (shape) {
  85330. shape.brush(ctx, false);
  85331. }
  85332. var imgShape = new SmicImage({
  85333. id: id,
  85334. style: {
  85335. x: 0,
  85336. y: 0,
  85337. image: canvas
  85338. }
  85339. });
  85340. if (shapeTransform.position != null) {
  85341. imgShape.position = shape.position = shapeTransform.position;
  85342. }
  85343. if (shapeTransform.rotation != null) {
  85344. imgShape.rotation = shape.rotation = shapeTransform.rotation;
  85345. }
  85346. if (shapeTransform.scale != null) {
  85347. imgShape.scale = shape.scale = shapeTransform.scale;
  85348. }
  85349. return imgShape;
  85350. }
  85351. /**
  85352. * Method: _createShapeToImageProcessor
  85353. *
  85354. */
  85355. }, {
  85356. key: "_createShapeToImageProcessor",
  85357. value: function _createShapeToImageProcessor() {
  85358. var me = this;
  85359. return function (id, e, width, height) {
  85360. return me._shapeToImage(id, e, width, height, Painter.devicePixelRatio);
  85361. };
  85362. }
  85363. // SMIC-方法扩展 - start
  85364. /**
  85365. * @function LevelRenderer.Painter.prototype.updateHoverLayer
  85366. * @description 更新设置显示高亮图层。
  85367. * @param {Array} shapes - 图形数组。
  85368. */
  85369. }, {
  85370. key: "updateHoverLayer",
  85371. value: function updateHoverLayer(shapes) {
  85372. if (!(shapes instanceof Array)) {
  85373. return this;
  85374. }
  85375. //清除高亮
  85376. this.clearHover();
  85377. this.storage.delHover();
  85378. for (var i = 0; i < shapes.length; i++) {
  85379. this.storage.addHover(shapes[i]);
  85380. this._brushHover(shapes[i]);
  85381. }
  85382. }
  85383. /**
  85384. * @function LevelRenderer.Painter.prototype.createDom
  85385. * @description 创建 Dom。
  85386. *
  85387. * @param {string} id - Dom id
  85388. * @param {string} type - Dom type
  85389. * @param {LevelRenderer.Painter} painter - Painter 实例。
  85390. * @return {Object} Dom
  85391. */
  85392. }], [{
  85393. key: "createDom",
  85394. value: function createDom(id, type, painter) {
  85395. var newDom = document.createElement(type);
  85396. var width = painter._width;
  85397. var height = painter._height;
  85398. // 没append呢,请原谅我这样写,清晰~
  85399. newDom.style.position = 'absolute';
  85400. newDom.style.left = 0;
  85401. newDom.style.top = 0;
  85402. newDom.style.width = width + 'px';
  85403. newDom.style.height = height + 'px';
  85404. newDom.setAttribute('width', width * Painter.devicePixelRatio);
  85405. newDom.setAttribute('height', height * Painter.devicePixelRatio);
  85406. // id不作为索引用,避免可能造成的重名,定义为私有属性
  85407. //newDom.setAttribute('data-zr-dom-id', id);
  85408. newDom.setAttribute('id', id);
  85409. return newDom;
  85410. }
  85411. }]);
  85412. return Painter;
  85413. }();
  85414. /**
  85415. * @private
  85416. * @class Painter.Layer
  85417. * @classdesc 绘制层类。
  85418. * @extends LevelRenderer.Transformable
  85419. */
  85420. var PaintLayer = /*#__PURE__*/function (_Transformable) {
  85421. Painter_inherits(PaintLayer, _Transformable);
  85422. var _super = Painter_createSuper(PaintLayer);
  85423. /**
  85424. * @function Painter.Layer.constructor
  85425. * @description 构造函数。
  85426. *
  85427. * @param {string} id - id。
  85428. * @param {LevelRenderer.Painter} painter - Painter 实例。
  85429. *
  85430. */
  85431. function PaintLayer(id, painter) {
  85432. var _this;
  85433. Painter_classCallCheck(this, PaintLayer);
  85434. _this = _super.call(this, id, painter);
  85435. /**
  85436. * @member {Object} Painter.Layer.prototype.dom
  85437. * @description dom。
  85438. */
  85439. _this.dom = null;
  85440. /**
  85441. * @member {Object} Painter.Layer.prototype.domBack
  85442. * @description domBack。
  85443. */
  85444. _this.domBack = null;
  85445. /**
  85446. * @member {Object} Painter.Layer.prototype.ctxBack
  85447. * @description ctxBack。
  85448. */
  85449. _this.ctxBack = null;
  85450. /**
  85451. * @member {LevelRenderer.Painter} Painter.Layer.prototype.painter
  85452. * @description painter。
  85453. */
  85454. _this.painter = painter;
  85455. /**
  85456. * @member {number} Painter.Layer.prototype.unusedCount
  85457. * @description unusedCount。
  85458. */
  85459. _this.unusedCount = 0;
  85460. /**
  85461. * @member {Object} Painter.Layer.prototype.config
  85462. * @description config。
  85463. */
  85464. _this.config = null;
  85465. /**
  85466. * @member {boolean} Painter.Layer.prototype.dirty
  85467. * @description dirty。
  85468. */
  85469. _this.dirty = true;
  85470. /**
  85471. * @member {number} Painter.Layer.prototype.elCount
  85472. * @description elCount。
  85473. */
  85474. _this.elCount = 0;
  85475. // Configs
  85476. /**
  85477. * @member {string} Painter.Layer.prototype.clearColor
  85478. * @description 每次清空画布的颜色。默认值:0;
  85479. */
  85480. _this.clearColor = 0;
  85481. /**
  85482. * @member {boolean} Painter.Layer.prototype.motionBlur
  85483. * @description 是否开启动态模糊。默认值:false;
  85484. */
  85485. _this.motionBlur = false;
  85486. /**
  85487. * @member {number} Painter.Layer.prototype.lastFrameAlpha
  85488. * @description 在开启动态模糊的时候使用,与上一帧混合的alpha值,值越大尾迹越明显
  85489. */
  85490. _this.lastFrameAlpha = 0.7;
  85491. /**
  85492. * @member {boolean} Painter.Layer.prototype.zoomable
  85493. * @description 层是否支持鼠标平移操作。默认值:false;
  85494. */
  85495. _this.zoomable = false;
  85496. /**
  85497. * @member {boolean} Painter.Layer.prototype.panable
  85498. * @description 层是否支持鼠标缩放操作。默认值:false;
  85499. */
  85500. _this.panable = false;
  85501. /**
  85502. * @member {number} Painter.Layer.prototype.maxZoom
  85503. * @description maxZoom。默认值:Infinity。
  85504. */
  85505. _this.maxZoom = Infinity;
  85506. /**
  85507. * @member {number} Painter.Layer.prototype.minZoom
  85508. * @description minZoom。默认值:0。
  85509. */
  85510. _this.minZoom = 0;
  85511. /**
  85512. * @member {number} Painter.Layer.prototype.ctx
  85513. * @description Canvas 上下文。
  85514. */
  85515. _this.ctx = null;
  85516. _this.dom = Painter.createDom(Util_Util.createUniqueID("SuperMap.Theme" + id), 'canvas', painter);
  85517. _this.dom.onselectstart = returnFalse; // 避免页面选中的尴尬
  85518. _this.dom.style['-webkit-user-select'] = 'none';
  85519. _this.dom.style['user-select'] = 'none';
  85520. _this.dom.style['-webkit-touch-callout'] = 'none';
  85521. // Function
  85522. // 返回false的方法,用于避免页面被选中
  85523. function returnFalse() {
  85524. return false;
  85525. }
  85526. _this.CLASS_NAME = "SuperMap.LevelRenderer.Painter.Layer";
  85527. return _this;
  85528. }
  85529. /**
  85530. * @function Painter.Layer.prototype.destroy
  85531. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  85532. */
  85533. Painter_createClass(PaintLayer, [{
  85534. key: "destroy",
  85535. value: function destroy() {
  85536. this.dom = null;
  85537. this.domBack = null;
  85538. this.ctxBack = null;
  85539. this.painter = null;
  85540. this.unusedCount = null;
  85541. this.config = null;
  85542. this.dirty = null;
  85543. this.elCount = null;
  85544. this.clearColor = null;
  85545. this.motionBlur = null;
  85546. this.lastFrameAlpha = null;
  85547. this.zoomable = null;
  85548. this.panable = null;
  85549. this.maxZoom = null;
  85550. this.minZoom = null;
  85551. this.ctx = null;
  85552. Transformable.destroy.apply(this, arguments);
  85553. }
  85554. /**
  85555. * @function Painter.Layer.prototype.initContext
  85556. * @description 初始化 Canvan 2D 上下文。
  85557. */
  85558. }, {
  85559. key: "initContext",
  85560. value: function initContext() {
  85561. this.ctx = this.dom.getContext('2d');
  85562. if (Painter.devicePixelRatio != 1) {
  85563. this.ctx.scale(Painter.devicePixelRatio, Painter.devicePixelRatio);
  85564. }
  85565. }
  85566. /**
  85567. * @function Painter.Layer.prototype.createBackBuffer
  85568. * @description 创建备份缓冲。
  85569. */
  85570. }, {
  85571. key: "createBackBuffer",
  85572. value: function createBackBuffer() {
  85573. this.domBack = Painter.createDom(Util_Util.createUniqueID("SuperMap.Theme.back-" + this.id), 'canvas', this.painter);
  85574. this.ctxBack = this.domBack.getContext('2d');
  85575. if (Painter.devicePixelRatio != 1) {
  85576. this.ctxBack.scale(Painter.devicePixelRatio, Painter.devicePixelRatio);
  85577. }
  85578. }
  85579. /**
  85580. * @function Painter.Layer.prototype.resize
  85581. * @description 改变大小。
  85582. *
  85583. * @param {number} width - 宽。
  85584. * @param {number} height - 高。
  85585. */
  85586. }, {
  85587. key: "resize",
  85588. value: function resize(width, height) {
  85589. this.dom.style.width = width + 'px';
  85590. this.dom.style.height = height + 'px';
  85591. this.dom.setAttribute('width', width * Painter.devicePixelRatio);
  85592. this.dom.setAttribute('height', height * Painter.devicePixelRatio);
  85593. if (Painter.devicePixelRatio != 1) {
  85594. this.ctx.scale(Painter.devicePixelRatio, Painter.devicePixelRatio);
  85595. }
  85596. if (this.domBack) {
  85597. this.domBack.setAttribute('width', width * Painter.devicePixelRatio);
  85598. this.domBack.setAttribute('height', height * Painter.devicePixelRatio);
  85599. if (Painter.devicePixelRatio != 1) {
  85600. this.ctxBack.scale(Painter.devicePixelRatio, Painter.devicePixelRatio);
  85601. }
  85602. }
  85603. }
  85604. /**
  85605. * @function Painter.Layer.prototype.clear
  85606. * @description 清空该层画布。
  85607. */
  85608. }, {
  85609. key: "clear",
  85610. value: function clear() {
  85611. var dom = this.dom;
  85612. var ctx = this.ctx;
  85613. var width = dom.width;
  85614. var height = dom.height;
  85615. var haveClearColor = this.clearColor;
  85616. var haveMotionBLur = this.motionBlur;
  85617. var lastFrameAlpha = this.lastFrameAlpha;
  85618. if (haveMotionBLur) {
  85619. if (!this.domBack) {
  85620. this.createBackBuffer();
  85621. }
  85622. this.ctxBack.globalCompositeOperation = 'copy';
  85623. this.ctxBack.drawImage(dom, 0, 0, width / Painter.devicePixelRatio, height / Painter.devicePixelRatio);
  85624. }
  85625. if (haveClearColor) {
  85626. ctx.save();
  85627. ctx.fillStyle = this.config.clearColor;
  85628. ctx.fillRect(0, 0, width / Painter.devicePixelRatio, height / Painter.devicePixelRatio);
  85629. ctx.restore();
  85630. } else {
  85631. ctx.clearRect(0, 0, width / Painter.devicePixelRatio, height / Painter.devicePixelRatio);
  85632. }
  85633. if (haveMotionBLur) {
  85634. var domBack = this.domBack;
  85635. ctx.save();
  85636. ctx.globalAlpha = lastFrameAlpha;
  85637. ctx.drawImage(domBack, 0, 0, width / Painter.devicePixelRatio, height / Painter.devicePixelRatio);
  85638. ctx.restore();
  85639. }
  85640. }
  85641. }]);
  85642. return PaintLayer;
  85643. }(Transformable);
  85644. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Handler.js
  85645. function Handler_typeof(obj) { "@babel/helpers - typeof"; return Handler_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, Handler_typeof(obj); }
  85646. function Handler_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  85647. function Handler_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  85648. function Handler_createClass(Constructor, protoProps, staticProps) { if (protoProps) Handler_defineProperties(Constructor.prototype, protoProps); if (staticProps) Handler_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  85649. function Handler_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) Handler_setPrototypeOf(subClass, superClass); }
  85650. function Handler_setPrototypeOf(o, p) { Handler_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Handler_setPrototypeOf(o, p); }
  85651. function Handler_createSuper(Derived) { var hasNativeReflectConstruct = Handler_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Handler_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Handler_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Handler_possibleConstructorReturn(this, result); }; }
  85652. function Handler_possibleConstructorReturn(self, call) { if (call && (Handler_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return Handler_assertThisInitialized(self); }
  85653. function Handler_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  85654. function Handler_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  85655. function Handler_getPrototypeOf(o) { Handler_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Handler_getPrototypeOf(o); }
  85656. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  85657. * This program are made available under the terms of the Apache License, Version 2.0
  85658. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  85659. /**
  85660. * @private
  85661. * @class LevelRenderer.Handler
  85662. * @category Visualization Theme
  85663. * @classdesc Handler控制模块。
  85664. * @extends {LevelRenderer.Eventful}
  85665. * @param {HTMLElement} root - 绘图区域。
  85666. * @param {LevelRenderer.Storage} storage - Storage 实例。
  85667. * @param {LevelRenderer.Painter} painter - Painter 实例。
  85668. */
  85669. var Handler = /*#__PURE__*/function (_Eventful) {
  85670. Handler_inherits(Handler, _Eventful);
  85671. var _super = Handler_createSuper(Handler);
  85672. function Handler(root, storage, painter) {
  85673. var _this;
  85674. Handler_classCallCheck(this, Handler);
  85675. _this = _super.call(this, root, storage, painter);
  85676. /**
  85677. * @member {HTMLElement} LevelRenderer.Handler.prototype.root
  85678. * @description 绘图区域
  85679. */
  85680. _this.root = root;
  85681. /**
  85682. * @member {LevelRenderer.Storage} LevelRenderer.Handler.prototype.storage
  85683. * @description Storage 实例
  85684. */
  85685. _this.storage = storage;
  85686. /**
  85687. * @member {LevelRenderer.Painter} LevelRenderer.Handler.prototype.Painter
  85688. * @description Painter 实例
  85689. */
  85690. _this.painter = painter;
  85691. /**
  85692. * @member {number} [LevelRenderer.Handler.prototype._lastX=0]
  85693. * @description 上一次鼠标位置x坐标值
  85694. */
  85695. _this._lastX = 0;
  85696. /**
  85697. * @member {number} [LevelRenderer.Handler.prototype._lastY=0]
  85698. * @description 上一次鼠标位置y坐标值
  85699. */
  85700. _this._lastY = 0;
  85701. /**
  85702. * @member {number} [LevelRenderer.Handler.prototype._mouseX=0]
  85703. * @description 当前鼠标位置x坐标值
  85704. */
  85705. _this._mouseX = 0;
  85706. /**
  85707. * @member {number} [LevelRenderer.Handler.prototype._mouseY=0]
  85708. * @description 当前鼠标位置y坐标值
  85709. */
  85710. _this._mouseY = 0;
  85711. /**
  85712. * @member {function} LevelRenderer.Handler.prototype._findHover
  85713. * @description 查找 Hover 图形
  85714. */
  85715. _this._findHover = null;
  85716. /**
  85717. * @member {Object} LevelRenderer.Handler.prototype._domHover
  85718. * @description 高亮 DOM
  85719. */
  85720. _this._domHover = null;
  85721. // 各种事件标识的私有变量
  85722. // this._hasfound = false; // 是否找到 hover 图形元素
  85723. // this._lastHover = null; // 最后一个 hover 图形元素
  85724. // this._mouseDownTarget = null;
  85725. // this._draggingTarget = null; // 当前被拖拽的图形元素
  85726. // this._isMouseDown = false;
  85727. // this._isDragging = false;
  85728. // this._lastMouseDownMoment;
  85729. // this._lastTouchMoment;
  85730. // this._lastDownButton;
  85731. _this._findHover = bind3Arg(findHover, Handler_assertThisInitialized(_this));
  85732. _this._domHover = painter.getDomHover();
  85733. _this.CLASS_NAME = "SuperMap.LevelRenderer.Handler";
  85734. var domHandlers = {
  85735. /**
  85736. * Method: resize
  85737. * 窗口大小改变响应函数。
  85738. *
  85739. * Parameters:
  85740. * event - {Event} event。
  85741. *
  85742. */
  85743. resize: function resize(event) {
  85744. event = event || window.event;
  85745. this._lastHover = null;
  85746. this._isMouseDown = 0;
  85747. // 分发SuperMap.LevelRenderer.Config.EVENT.RESIZE事件,global
  85748. this.dispatch(Config_Config.EVENT.RESIZE, event);
  85749. },
  85750. /**
  85751. * Method: click
  85752. * 点击响应函数。
  85753. *
  85754. * Parameters:
  85755. * event - {Event} event。
  85756. *
  85757. */
  85758. click: function click(event) {
  85759. event = this._zrenderEventFixed(event);
  85760. // 分发SuperMap.LevelRenderer.Config.EVENT.CLICK事件
  85761. var _lastHover = this._lastHover;
  85762. if (_lastHover && _lastHover.clickable || !_lastHover) {
  85763. // 判断没有发生拖拽才触发click事件
  85764. if (this._clickThreshold < 10) {
  85765. this._dispatchAgency(_lastHover, Config_Config.EVENT.CLICK, event);
  85766. }
  85767. }
  85768. this._mousemoveHandler(event);
  85769. },
  85770. /**
  85771. * Method: dblclick
  85772. * 双击响应函数。
  85773. *
  85774. * Parameters:
  85775. * event - {Event} event。
  85776. *
  85777. */
  85778. dblclick: function dblclick(event) {
  85779. event = event || window.event;
  85780. event = this._zrenderEventFixed(event);
  85781. // 分发SuperMap.LevelRenderer.Config.EVENT.DBLCLICK事件
  85782. var _lastHover = this._lastHover;
  85783. if (_lastHover && _lastHover.clickable || !_lastHover) {
  85784. // 判断没有发生拖拽才触发dblclick事件
  85785. if (this._clickThreshold < 5) {
  85786. this._dispatchAgency(_lastHover, Config_Config.EVENT.DBLCLICK, event);
  85787. }
  85788. }
  85789. this._mousemoveHandler(event);
  85790. },
  85791. /**
  85792. * Method: mousewheel
  85793. * 鼠标滚轮响应函数。
  85794. *
  85795. * Parameters:
  85796. * event - {Event} event。
  85797. *
  85798. */
  85799. mousewheel: function mousewheel(event) {
  85800. event = this._zrenderEventFixed(event);
  85801. // http://www.sitepoint.com/html5-javascript-mouse-wheel/
  85802. // https://developer.mozilla.org/en-US/docs/DOM/DOM_event_reference/mousewheel
  85803. var delta = event.wheelDelta // Webkit
  85804. || -event.detail; // Firefox
  85805. var scale = delta > 0 ? 1.1 : 1 / 1.1;
  85806. var layers = this.painter.getLayers();
  85807. var needsRefresh = false;
  85808. for (var z in layers) {
  85809. if (z !== 'hover') {
  85810. var layer = layers[z];
  85811. var pos = layer.position;
  85812. if (layer.zoomable) {
  85813. layer.__zoom = layer.__zoom || 1;
  85814. var newZoom = layer.__zoom;
  85815. newZoom *= scale;
  85816. newZoom = Math.max(Math.min(layer.maxZoom, newZoom), layer.minZoom);
  85817. scale = newZoom / layer.__zoom;
  85818. layer.__zoom = newZoom;
  85819. // Keep the mouse center when scaling
  85820. pos[0] -= (this._mouseX - pos[0]) * (scale - 1);
  85821. pos[1] -= (this._mouseY - pos[1]) * (scale - 1);
  85822. layer.scale[0] *= scale;
  85823. layer.scale[1] *= scale;
  85824. layer.dirty = true;
  85825. needsRefresh = true;
  85826. }
  85827. }
  85828. }
  85829. if (needsRefresh) {
  85830. this.painter.refresh();
  85831. }
  85832. // 分发SuperMap.LevelRenderer.Config.EVENT.MOUSEWHEEL事件
  85833. this._dispatchAgency(this._lastHover, Config_Config.EVENT.MOUSEWHEEL, event);
  85834. this._mousemoveHandler(event);
  85835. },
  85836. /**
  85837. * Method: mousemove
  85838. * 鼠标(手指)移动响应函数。
  85839. *
  85840. * Parameters:
  85841. * event - {Event} event。
  85842. *
  85843. */
  85844. mousemove: function mousemove(event) {
  85845. // 拖拽不触发click事件
  85846. this._clickThreshold++;
  85847. event = this._zrenderEventFixed(event);
  85848. this._lastX = this._mouseX;
  85849. this._lastY = this._mouseY;
  85850. this._mouseX = SUtil_SUtil.Util_event.getX(event);
  85851. this._mouseY = SUtil_SUtil.Util_event.getY(event);
  85852. var dx = this._mouseX - this._lastX;
  85853. var dy = this._mouseY - this._lastY;
  85854. // 可能出现SuperMap.LevelRenderer.Config.EVENT.DRAGSTART事件
  85855. // 避免手抖点击误认为拖拽
  85856. // if (this._mouseX - this._lastX > 1 || this._mouseY - this._lastY > 1) {
  85857. this._processDragStart(event);
  85858. // }
  85859. this._hasfound = 0;
  85860. this._event = event;
  85861. this._iterateAndFindHover();
  85862. // 找到的在迭代函数里做了处理,没找到得在迭代完后处理
  85863. if (!this._hasfound) {
  85864. // 过滤首次拖拽产生的mouseout和dragLeave
  85865. if (!this._draggingTarget || this._lastHover && this._lastHover != this._draggingTarget) {
  85866. // 可能出现SuperMap.LevelRenderer.Config.EVENT.MOUSEOUT事件
  85867. this._processOutShape(event);
  85868. // 可能出现SuperMap.LevelRenderer.Config.EVENT.DRAGLEAVE事件
  85869. this._processDragLeave(event);
  85870. }
  85871. this._lastHover = null;
  85872. this.storage.delHover();
  85873. this.painter.clearHover();
  85874. }
  85875. // set cursor for root element
  85876. var cursor = '';
  85877. // 如果存在拖拽中元素,被拖拽的图形元素最后addHover
  85878. if (this._draggingTarget) {
  85879. this.storage.drift(this._draggingTarget.id, dx, dy);
  85880. this._draggingTarget.modSelf();
  85881. this.storage.addHover(this._draggingTarget);
  85882. } else if (this._isMouseDown) {
  85883. // Layer dragging
  85884. var layers = this.painter.getLayers();
  85885. var needsRefresh = false;
  85886. for (var z in layers) {
  85887. if (z !== 'hover') {
  85888. var layer = layers[z];
  85889. if (layer.panable) {
  85890. // PENDING
  85891. cursor = 'move';
  85892. // Keep the mouse center when scaling
  85893. layer.position[0] += dx;
  85894. layer.position[1] += dy;
  85895. needsRefresh = true;
  85896. layer.dirty = true;
  85897. }
  85898. }
  85899. }
  85900. if (needsRefresh) {
  85901. this.painter.refresh();
  85902. }
  85903. }
  85904. if (this._draggingTarget || this._hasfound && this._lastHover.draggable) {
  85905. cursor = 'move';
  85906. } else if (this._hasfound && this._lastHover.clickable) {
  85907. cursor = 'pointer';
  85908. }
  85909. this.root.style.cursor = cursor;
  85910. // 分发SuperMap.LevelRenderer.Config.EVENT.MOUSEMOVE事件
  85911. this._dispatchAgency(this._lastHover, Config_Config.EVENT.MOUSEMOVE, event);
  85912. if (this._draggingTarget || this._hasfound || this.storage.hasHoverShape()) {
  85913. this.painter.refreshHover();
  85914. }
  85915. },
  85916. /**
  85917. * Method: mouseout
  85918. * 鼠标(手指)离开响应函数。
  85919. *
  85920. * Parameters:
  85921. * event - {Event} event。
  85922. *
  85923. */
  85924. mouseout: function mouseout(event) {
  85925. event = this._zrenderEventFixed(event);
  85926. var element = event.toElement || event.relatedTarget;
  85927. if (element != this.root) {
  85928. while (element && element.nodeType != 9) {
  85929. // 忽略包含在root中的dom引起的mouseOut
  85930. if (element == this.root) {
  85931. this._mousemoveHandler(event);
  85932. return;
  85933. }
  85934. element = element.parentNode;
  85935. }
  85936. }
  85937. event.zrenderX = this._lastX;
  85938. event.zrenderY = this._lastY;
  85939. this.root.style.cursor = '';
  85940. this._isMouseDown = 0;
  85941. this._processOutShape(event);
  85942. this._processDrop(event);
  85943. this._processDragEnd(event);
  85944. this.painter.refreshHover();
  85945. this.dispatch(Config_Config.EVENT.GLOBALOUT, event);
  85946. },
  85947. /**
  85948. * Method: mousedown
  85949. * 鼠标(手指)按下响应函数。
  85950. *
  85951. * Parameters:
  85952. * event - {Event} event。
  85953. *
  85954. */
  85955. mousedown: function mousedown(event) {
  85956. // 重置 clickThreshold
  85957. this._clickThreshold = 0;
  85958. if (this._lastDownButton == 2) {
  85959. this._lastDownButton = event.button;
  85960. this._mouseDownTarget = null;
  85961. // 仅作为关闭右键菜单使用
  85962. return;
  85963. }
  85964. this._lastMouseDownMoment = new Date();
  85965. event = this._zrenderEventFixed(event);
  85966. this._isMouseDown = 1;
  85967. // 分发SuperMap.LevelRenderer.Config.EVENT.MOUSEDOWN事件
  85968. this._mouseDownTarget = this._lastHover;
  85969. this._dispatchAgency(this._lastHover, Config_Config.EVENT.MOUSEDOWN, event);
  85970. this._lastDownButton = event.button;
  85971. },
  85972. /**
  85973. * Method: mouseup
  85974. * 鼠标(手指)抬起响应函数。
  85975. *
  85976. * Parameters:
  85977. * event - {Event} event。
  85978. *
  85979. */
  85980. mouseup: function mouseup(event) {
  85981. event = this._zrenderEventFixed(event);
  85982. this.root.style.cursor = '';
  85983. this._isMouseDown = 0;
  85984. this._mouseDownTarget = null;
  85985. // 分发SuperMap.LevelRenderer.Config.EVENT.MOUSEUP事件
  85986. this._dispatchAgency(this._lastHover, Config_Config.EVENT.MOUSEUP, event);
  85987. this._processDrop(event);
  85988. this._processDragEnd(event);
  85989. },
  85990. /**
  85991. * Method: touchstart
  85992. * Touch 开始响应函数。
  85993. *
  85994. * Parameters:
  85995. * event - {Event} event。
  85996. *
  85997. */
  85998. touchstart: function touchstart(event) {
  85999. // SUtil.Util_event.stop(event);// 阻止浏览器默认事件,重要
  86000. event = this._zrenderEventFixed(event, true);
  86001. this._lastTouchMoment = new Date();
  86002. // 平板补充一次findHover
  86003. this._mobildFindFixed(event);
  86004. this._mousedownHandler(event);
  86005. },
  86006. /**
  86007. * Method: touchmove
  86008. * Touch 移动响应函数。
  86009. *
  86010. * Parameters:
  86011. * event - {Event} event。
  86012. *
  86013. */
  86014. touchmove: function touchmove(event) {
  86015. event = this._zrenderEventFixed(event, true);
  86016. this._mousemoveHandler(event);
  86017. if (this._isDragging) {
  86018. SUtil_SUtil.Util_event.stop(event); // 阻止浏览器默认事件,重要
  86019. }
  86020. },
  86021. /**
  86022. * Method: touchend
  86023. * Touch 结束响应函数。
  86024. *
  86025. * Parameters:
  86026. * event - {Event} event。
  86027. *
  86028. */
  86029. touchend: function touchend(event) {
  86030. // SUtil.Util_event.stop(event);// 阻止浏览器默认事件,重要
  86031. event = this._zrenderEventFixed(event, true);
  86032. this._mouseupHandler(event);
  86033. var now = new Date();
  86034. if (now - this._lastTouchMoment < Config_Config.EVENT.touchClickDelay) {
  86035. this._mobildFindFixed(event);
  86036. this._clickHandler(event);
  86037. if (now - this._lastClickMoment < Config_Config.EVENT.touchClickDelay / 2) {
  86038. this._dblclickHandler(event);
  86039. if (this._lastHover && this._lastHover.clickable) {
  86040. SUtil_SUtil.Util_event.stop(event); // 阻止浏览器默认事件,重要
  86041. }
  86042. }
  86043. this._lastClickMoment = now;
  86044. }
  86045. this.painter.clearHover();
  86046. }
  86047. };
  86048. initDomHandler(Handler_assertThisInitialized(_this));
  86049. // 初始化,事件绑定,支持的所有事件都由如下原生事件计算得来
  86050. if (window.addEventListener) {
  86051. window.addEventListener('resize', _this._resizeHandler);
  86052. if (SUtil_SUtil.Util_env.os.tablet || SUtil_SUtil.Util_env.os.phone) {
  86053. // mobile支持
  86054. root.addEventListener('touchstart', _this._touchstartHandler);
  86055. root.addEventListener('touchmove', _this._touchmoveHandler);
  86056. root.addEventListener('touchend', _this._touchendHandler);
  86057. } else {
  86058. // mobile的click/move/up/down自己模拟
  86059. root.addEventListener('click', _this._clickHandler);
  86060. root.addEventListener('dblclick', _this._dblclickHandler);
  86061. root.addEventListener('mousewheel', _this._mousewheelHandler);
  86062. root.addEventListener('mousemove', _this._mousemoveHandler);
  86063. root.addEventListener('mousedown', _this._mousedownHandler);
  86064. root.addEventListener('mouseup', _this._mouseupHandler);
  86065. }
  86066. root.addEventListener('DOMMouseScroll', _this._mousewheelHandler);
  86067. root.addEventListener('mouseout', _this._mouseoutHandler);
  86068. } else {
  86069. window.attachEvent('onresize', _this._resizeHandler);
  86070. root.attachEvent('onclick', _this._clickHandler);
  86071. //root.attachEvent('ondblclick ', this._dblclickHandler);
  86072. root.ondblclick = _this._dblclickHandler;
  86073. root.attachEvent('onmousewheel', _this._mousewheelHandler);
  86074. root.attachEvent('onmousemove', _this._mousemoveHandler);
  86075. root.attachEvent('onmouseout', _this._mouseoutHandler);
  86076. root.attachEvent('onmousedown', _this._mousedownHandler);
  86077. root.attachEvent('onmouseup', _this._mouseupHandler);
  86078. }
  86079. // 辅助函数 start
  86080. /**
  86081. * Method: bind1Arg
  86082. * bind 一个参数的 function。
  86083. *
  86084. * Parameters:
  86085. * handler - {function} 要 bind 的 function。
  86086. * context - {Object} 运行时 this 环境。
  86087. *
  86088. * Returns:
  86089. * {function}
  86090. */
  86091. function bind1Arg(handler, context) {
  86092. return function (e) {
  86093. return handler.call(context, e);
  86094. };
  86095. }
  86096. /*
  86097. // bind 两个参数的 function
  86098. function bind2Arg(handler, context) {
  86099. return function (arg1, arg2) {
  86100. return handler.call(context, arg1, arg2);
  86101. };
  86102. }
  86103. */
  86104. // bind 三个参数的 function
  86105. function bind3Arg(handler, context) {
  86106. return function (arg1, arg2, arg3) {
  86107. return handler.call(context, arg1, arg2, arg3);
  86108. };
  86109. }
  86110. /**
  86111. * Method: initDomHandler
  86112. * 为控制类实例初始化 dom 事件处理函数。
  86113. *
  86114. * Parameters:
  86115. * instance - {<LevelRenderer.Handler>} 控制类实例 。
  86116. *
  86117. * Returns:
  86118. * {function}
  86119. */
  86120. function initDomHandler(instance) {
  86121. var domHandlerNames = ['resize', 'click', 'dblclick', 'mousewheel', 'mousemove', 'mouseout', 'mouseup', 'mousedown', 'touchstart', 'touchend', 'touchmove'];
  86122. var len = domHandlerNames.length;
  86123. while (len--) {
  86124. var name = domHandlerNames[len];
  86125. instance['_' + name + 'Handler'] = bind1Arg(domHandlers[name], instance);
  86126. }
  86127. }
  86128. /**
  86129. * Method: findHover
  86130. * 迭代函数,查找 hover 到的图形元素并即时做些事件分发。
  86131. *
  86132. * Parameters:
  86133. * shape - {Object} 图形。
  86134. * x - {number} 鼠标 x。
  86135. * y - {number} 鼠标 y。
  86136. *
  86137. * Returns:
  86138. * {boolean} 是否找到图形。
  86139. *
  86140. */
  86141. function findHover(shape, x, y) {
  86142. var me = this;
  86143. if (me._draggingTarget && me._draggingTarget.id == shape.id // 迭代到当前拖拽的图形上
  86144. || shape.isSilent() // 打酱油的路过,啥都不响应的shape~
  86145. ) {
  86146. return false;
  86147. }
  86148. var event = me._event;
  86149. if (shape.isCover(x, y)) {
  86150. if (shape.hoverable) {
  86151. // SMIC-修改 - start
  86152. if (shape.isHoverByRefDataID && shape.isHoverByRefDataID === true) {
  86153. if (shape.refDataID) {
  86154. var fid = shape.refDataID;
  86155. //me.painter.clearHover();
  86156. //me.storage.delHover();
  86157. var hoverGroup = null;
  86158. if (shape.refDataHoverGroup) {
  86159. hoverGroup = shape.refDataHoverGroup;
  86160. }
  86161. //查找同一个用户数据 feature 的所有图形
  86162. var shapeList = me.storage._shapeList;
  86163. for (var i = 0, len = shapeList.length; i < len; i++) {
  86164. var si = shapeList[i];
  86165. if (si.refDataID && fid === si.refDataID) {
  86166. if (hoverGroup) {
  86167. if (si.refDataHoverGroup && hoverGroup === si.refDataHoverGroup) {
  86168. me.storage.addHover(si);
  86169. }
  86170. } else {
  86171. me.storage.addHover(si);
  86172. }
  86173. }
  86174. }
  86175. }
  86176. } else {
  86177. me.storage.addHover(shape);
  86178. }
  86179. //初始代码:
  86180. // me.storage.addHover(shape);
  86181. // SMIC-修改 - end
  86182. }
  86183. // 查找是否在 clipShape 中
  86184. var p = shape.parent;
  86185. while (p) {
  86186. if (p.clipShape && !p.clipShape.isCover(me._mouseX, me._mouseY)) {
  86187. // 已经被祖先 clip 掉了
  86188. return false;
  86189. }
  86190. p = p.parent;
  86191. }
  86192. if (me._lastHover != shape) {
  86193. me._processOutShape(event);
  86194. // 可能出现SuperMap.LevelRenderer.Config.EVENT.DRAGLEAVE事件
  86195. me._processDragLeave(event);
  86196. me._lastHover = shape;
  86197. // 可能出现SuperMap.LevelRenderer.Config.EVENT.DRAGENTER事件
  86198. me._processDragEnter(event);
  86199. }
  86200. me._processOverShape(event);
  86201. // 可能出现SuperMap.LevelRenderer.Config.EVENT.DRAGOVER
  86202. me._processDragOver(event);
  86203. me._hasfound = 1;
  86204. return true; // 找到则中断迭代查找
  86205. }
  86206. return false;
  86207. }
  86208. // 辅助函数 end
  86209. return _this;
  86210. }
  86211. /**
  86212. * @function LevelRenderer.Handler.prototype.destroy
  86213. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为null。
  86214. */
  86215. Handler_createClass(Handler, [{
  86216. key: "destroy",
  86217. value: function destroy() {
  86218. this.dispose();
  86219. this._lastX = null;
  86220. this._lastY = null;
  86221. this._mouseX = null;
  86222. this._mouseY = null;
  86223. this._findHover = null;
  86224. Eventful.prototype.destroy.apply(this, arguments);
  86225. }
  86226. /**
  86227. * @function LevelRenderer.Handler.prototype.on
  86228. * @description 自定义事件绑定。
  86229. * @param {string} eventName - 事件名称,resize、hover、drag等。
  86230. * @param {function} handler - 响应函数。
  86231. * @returns {LevelRenderer.Handler} this。
  86232. */
  86233. }, {
  86234. key: "on",
  86235. value: function on(eventName, handler) {
  86236. this.bind(eventName, handler);
  86237. return this;
  86238. }
  86239. /**
  86240. * @function LevelRenderer.Handler.prototype.un
  86241. * @description 自定义事件解除绑定。
  86242. * @param {string} eventName - 事件名称,resize、hover、drag等。
  86243. * @param {function} handler - 响应函数。
  86244. * @returns {LevelRenderer.Handler} this。
  86245. */
  86246. }, {
  86247. key: "un",
  86248. value: function un(eventName, handler) {
  86249. this.unbind(eventName, handler);
  86250. return this;
  86251. }
  86252. /**
  86253. * @function LevelRenderer.Handler.prototype.trigger
  86254. * @description 事件触发。
  86255. * @param {string} eventName - 事件名称,resize、hover、drag等。
  86256. * @param {event} eventArgs - dom事件对象。
  86257. */
  86258. }, {
  86259. key: "trigger",
  86260. value: function trigger(eventName, eventArgs) {
  86261. var EVENT = Config_Config.EVENT;
  86262. switch (eventName) {
  86263. case EVENT.RESIZE:
  86264. case EVENT.CLICK:
  86265. case EVENT.DBLCLICK:
  86266. case EVENT.MOUSEWHEEL:
  86267. case EVENT.MOUSEMOVE:
  86268. case EVENT.MOUSEDOWN:
  86269. case EVENT.MOUSEUP:
  86270. case EVENT.MOUSEOUT:
  86271. this['_' + eventName + 'Handler'](eventArgs);
  86272. break;
  86273. }
  86274. }
  86275. /**
  86276. * @function LevelRenderer.Handler.prototype.dispose
  86277. * @description 释放,解绑所有事件。
  86278. */
  86279. }, {
  86280. key: "dispose",
  86281. value: function dispose() {
  86282. var root = this.root;
  86283. if (window.removeEventListener) {
  86284. window.removeEventListener('resize', this._resizeHandler);
  86285. if (SUtil_SUtil.Util_env.os.tablet || SUtil_SUtil.Util_env.os.phone) {
  86286. // mobile支持
  86287. root.removeEventListener('touchstart', this._touchstartHandler);
  86288. root.removeEventListener('touchmove', this._touchmoveHandler);
  86289. root.removeEventListener('touchend', this._touchendHandler);
  86290. } else {
  86291. // mobile的click自己模拟
  86292. root.removeEventListener('click', this._clickHandler);
  86293. root.removeEventListener('dblclick', this._dblclickHandler);
  86294. root.removeEventListener('mousewheel', this._mousewheelHandler);
  86295. root.removeEventListener('mousemove', this._mousemoveHandler);
  86296. root.removeEventListener('mousedown', this._mousedownHandler);
  86297. root.removeEventListener('mouseup', this._mouseupHandler);
  86298. }
  86299. root.removeEventListener('DOMMouseScroll', this._mousewheelHandler);
  86300. root.removeEventListener('mouseout', this._mouseoutHandler);
  86301. } else {
  86302. window.detachEvent('onresize', this._resizeHandler);
  86303. root.detachEvent('onclick', this._clickHandler);
  86304. root.detachEvent('dblclick', this._dblclickHandler);
  86305. root.detachEvent('onmousewheel', this._mousewheelHandler);
  86306. root.detachEvent('onmousemove', this._mousemoveHandler);
  86307. root.detachEvent('onmouseout', this._mouseoutHandler);
  86308. root.detachEvent('onmousedown', this._mousedownHandler);
  86309. root.detachEvent('onmouseup', this._mouseupHandler);
  86310. }
  86311. this.root = null;
  86312. this._domHover = null;
  86313. this.storage = null;
  86314. this.painter = null;
  86315. this.un();
  86316. }
  86317. /**
  86318. * Method: _processDragStart
  86319. * 拖拽开始。
  86320. *
  86321. * Parameters:
  86322. * event - {Object} 事件对象。
  86323. *
  86324. */
  86325. }, {
  86326. key: "_processDragStart",
  86327. value: function _processDragStart(event) {
  86328. var _lastHover = this._lastHover;
  86329. if (this._isMouseDown && _lastHover && _lastHover.draggable && !this._draggingTarget && this._mouseDownTarget == _lastHover) {
  86330. // 拖拽点击生效时长阀门,某些场景需要降低拖拽敏感度
  86331. if (_lastHover.dragEnableTime && new Date() - this._lastMouseDownMoment < _lastHover.dragEnableTime) {
  86332. return;
  86333. }
  86334. var _draggingTarget = _lastHover;
  86335. this._draggingTarget = _draggingTarget;
  86336. this._isDragging = 1;
  86337. _draggingTarget.invisible = true;
  86338. this.storage.mod(_draggingTarget.id);
  86339. // 分发 Config.EVENT.DRAGSTART事件
  86340. this._dispatchAgency(_draggingTarget, Config_Config.EVENT.DRAGSTART, event);
  86341. this.painter.refresh();
  86342. }
  86343. }
  86344. /**
  86345. * Method: _processDragEnter
  86346. * 拖拽进入目标元素。
  86347. *
  86348. * Parameters:
  86349. * event - {Object} 事件对象。
  86350. *
  86351. */
  86352. }, {
  86353. key: "_processDragEnter",
  86354. value: function _processDragEnter(event) {
  86355. if (this._draggingTarget) {
  86356. // 分发SuperMap.LevelRenderer.Config.EVENT.DRAGENTER事件
  86357. this._dispatchAgency(this._lastHover, Config_Config.EVENT.DRAGENTER, event, this._draggingTarget);
  86358. }
  86359. }
  86360. /**
  86361. * Method: _processDragOver
  86362. * 拖拽在目标元素上移动。
  86363. *
  86364. * Parameters:
  86365. * event - {Object} 事件对象。
  86366. *
  86367. */
  86368. }, {
  86369. key: "_processDragOver",
  86370. value: function _processDragOver(event) {
  86371. if (this._draggingTarget) {
  86372. // 分发SuperMap.LevelRenderer.Config.EVENT.DRAGOVER事件
  86373. this._dispatchAgency(this._lastHover, Config_Config.EVENT.DRAGOVER, event, this._draggingTarget);
  86374. }
  86375. }
  86376. /**
  86377. * Method: _processDragLeave
  86378. * 拖拽离开目标元素。
  86379. *
  86380. * Parameters:
  86381. * event - {Object} 事件对象。
  86382. *
  86383. */
  86384. }, {
  86385. key: "_processDragLeave",
  86386. value: function _processDragLeave(event) {
  86387. if (this._draggingTarget) {
  86388. // 分发SuperMap.LevelRenderer.Config.EVENT.DRAGLEAVE事件
  86389. this._dispatchAgency(this._lastHover, Config_Config.EVENT.DRAGLEAVE, event, this._draggingTarget);
  86390. }
  86391. }
  86392. /**
  86393. * Method: _processDrop
  86394. * 拖拽在目标元素上完成。
  86395. *
  86396. * Parameters:
  86397. * event - {Object} 事件对象。
  86398. *
  86399. */
  86400. }, {
  86401. key: "_processDrop",
  86402. value: function _processDrop(event) {
  86403. if (this._draggingTarget) {
  86404. this._draggingTarget.invisible = false;
  86405. this.storage.mod(this._draggingTarget.id);
  86406. this.painter.refresh();
  86407. // 分发SuperMap.LevelRenderer.Config.EVENT.DROP事件
  86408. this._dispatchAgency(this._lastHover, Config_Config.EVENT.DROP, event, this._draggingTarget);
  86409. }
  86410. }
  86411. /**
  86412. * Method: _processDragEnd
  86413. * 拖拽结束。
  86414. *
  86415. * Parameters:
  86416. * event - {Object} 事件对象。
  86417. *
  86418. */
  86419. }, {
  86420. key: "_processDragEnd",
  86421. value: function _processDragEnd(event) {
  86422. if (this._draggingTarget) {
  86423. // 分发SuperMap.LevelRenderer.Config.EVENT.DRAGEND事件
  86424. this._dispatchAgency(this._draggingTarget, Config_Config.EVENT.DRAGEND, event);
  86425. this._lastHover = null;
  86426. }
  86427. this._isDragging = 0;
  86428. this._draggingTarget = null;
  86429. }
  86430. /**
  86431. * Method: _processOverShape
  86432. * 鼠标在某个图形元素上移动。
  86433. *
  86434. * Parameters:
  86435. * event - {Object} 事件对象。
  86436. *
  86437. */
  86438. }, {
  86439. key: "_processOverShape",
  86440. value: function _processOverShape(event) {
  86441. // 分发SuperMap.LevelRenderer.Config.EVENT.MOUSEOVER事件
  86442. this._dispatchAgency(this._lastHover, Config_Config.EVENT.MOUSEOVER, event);
  86443. }
  86444. /**
  86445. * Method: _processOutShape
  86446. * 鼠标离开某个图形元素。
  86447. *
  86448. * Parameters:
  86449. * event - {Object} 事件对象。
  86450. *
  86451. */
  86452. }, {
  86453. key: "_processOutShape",
  86454. value: function _processOutShape(event) {
  86455. // 分发SuperMap.LevelRenderer.Config.EVENT.MOUSEOUT事件
  86456. this._dispatchAgency(this._lastHover, Config_Config.EVENT.MOUSEOUT, event);
  86457. }
  86458. /**
  86459. * Method: _dispatchAgency
  86460. * 鼠标离开某个图形元素。
  86461. *
  86462. * Parameters:
  86463. * targetShape - {Object} 目标图形元素。
  86464. * eventName - {Object} 事件名称。
  86465. * event - {Object} 事件对象。
  86466. * draggedShape - {Object} 拖拽事件特有,当前被拖拽图形元素。
  86467. *
  86468. */
  86469. }, {
  86470. key: "_dispatchAgency",
  86471. value: function _dispatchAgency(targetShape, eventName, event, draggedShape) {
  86472. var eventHandler = 'on' + eventName;
  86473. var eventPacket = {
  86474. type: eventName,
  86475. event: event,
  86476. target: targetShape,
  86477. cancelBubble: false
  86478. };
  86479. var el = targetShape;
  86480. if (draggedShape) {
  86481. eventPacket.dragged = draggedShape;
  86482. }
  86483. while (el) {
  86484. el[eventHandler] && (eventPacket.cancelBubble = el[eventHandler](eventPacket));
  86485. el.dispatch(eventName, eventPacket);
  86486. el = el.parent;
  86487. if (eventPacket.cancelBubble) {
  86488. break;
  86489. }
  86490. }
  86491. if (targetShape) {
  86492. // 冒泡到顶级 zrender 对象
  86493. if (!eventPacket.cancelBubble) {
  86494. this.dispatch(eventName, eventPacket);
  86495. }
  86496. } else if (!draggedShape) {
  86497. // 无hover目标,无拖拽对象,原生事件分发
  86498. this.dispatch(eventName, {
  86499. type: eventName,
  86500. event: event
  86501. });
  86502. }
  86503. }
  86504. /**
  86505. * Method: _iterateAndFindHover
  86506. * 迭代寻找 hover shape。
  86507. *
  86508. */
  86509. }, {
  86510. key: "_iterateAndFindHover",
  86511. value: function _iterateAndFindHover() {
  86512. var invTransform = SUtil_SUtil.Util_matrix.create();
  86513. var list = this.storage.getShapeList();
  86514. var currentZLevel;
  86515. var currentLayer;
  86516. var tmp = [0, 0];
  86517. for (var i = list.length - 1; i >= 0; i--) {
  86518. var shape = list[i];
  86519. if (currentZLevel !== shape.zlevel) {
  86520. currentLayer = this.painter.getLayer(shape.zlevel, currentLayer);
  86521. tmp[0] = this._mouseX;
  86522. tmp[1] = this._mouseY;
  86523. if (currentLayer.needTransform) {
  86524. SUtil_SUtil.Util_matrix.invert(invTransform, currentLayer.transform);
  86525. SUtil_SUtil.Util_vector.applyTransform(tmp, tmp, invTransform);
  86526. }
  86527. }
  86528. if (this._findHover(shape, tmp[0], tmp[1])) {
  86529. break;
  86530. }
  86531. }
  86532. }
  86533. /**
  86534. * Method: _mobildFindFixed
  86535. * touch 有指尖错觉,四向尝试,让touch上的点击更好触发事件。
  86536. *
  86537. * Parameters:
  86538. * event - {Object} 事件对象。
  86539. *
  86540. */
  86541. }, {
  86542. key: "_mobildFindFixed",
  86543. value: function _mobildFindFixed(event) {
  86544. // touch指尖错觉的尝试偏移量配置
  86545. var MOBILE_TOUCH_OFFSETS = [{
  86546. x: 10
  86547. }, {
  86548. x: -20
  86549. }, {
  86550. x: 10,
  86551. y: 10
  86552. }, {
  86553. y: -20
  86554. }];
  86555. this._lastHover = null;
  86556. this._mouseX = event.zrenderX;
  86557. this._mouseY = event.zrenderY;
  86558. this._event = event;
  86559. this._iterateAndFindHover();
  86560. for (var i = 0; !this._lastHover && i < MOBILE_TOUCH_OFFSETS.length; i++) {
  86561. var offset = MOBILE_TOUCH_OFFSETS[i];
  86562. offset.x && (this._mouseX += offset.x);
  86563. offset.y && (this._mouseX += offset.y);
  86564. this._iterateAndFindHover();
  86565. }
  86566. if (this._lastHover) {
  86567. event.zrenderX = this._mouseX;
  86568. event.zrenderY = this._mouseY;
  86569. }
  86570. }
  86571. /**
  86572. * Method: _zrenderEventFixed
  86573. * 如果存在第三方嵌入的一些dom触发的事件,或touch事件,需要转换一下事件坐标 。
  86574. *
  86575. * Parameters:
  86576. * event - {Object} 事件。
  86577. * isTouch - {boolean} 是否触摸。
  86578. *
  86579. */
  86580. }, {
  86581. key: "_zrenderEventFixed",
  86582. value: function _zrenderEventFixed(event, isTouch) {
  86583. if (event.zrenderFixed) {
  86584. return event;
  86585. }
  86586. if (!isTouch) {
  86587. event = event || window.event;
  86588. // 进入对象优先~
  86589. var target = event.toElement || event.relatedTarget || event.srcElement || event.target;
  86590. if (target && target != this._domHover) {
  86591. event.zrenderX = (typeof event.offsetX != 'undefined' ? event.offsetX : event.layerX) + target.offsetLeft;
  86592. event.zrenderY = (typeof event.offsetY != 'undefined' ? event.offsetY : event.layerY) + target.offsetTop;
  86593. }
  86594. } else {
  86595. var touch = event.type != 'touchend' ? event.targetTouches[0] : event.changedTouches[0];
  86596. if (touch) {
  86597. var rBounding = this.root.getBoundingClientRect();
  86598. // touch事件坐标是全屏的~
  86599. event.zrenderX = touch.clientX - rBounding.left;
  86600. event.zrenderY = touch.clientY - rBounding.top;
  86601. }
  86602. }
  86603. event.zrenderFixed = 1;
  86604. return event;
  86605. }
  86606. // SMIC-方法扩展 - start
  86607. /**
  86608. * @function LevelRenderer.Handler.prototype.getLastHoverOne
  86609. * @description 获取单个高亮图形
  86610. */
  86611. }, {
  86612. key: "getLastHoverOne",
  86613. value: function getLastHoverOne() {
  86614. if (this._lastHover) {
  86615. return this._lastHover;
  86616. }
  86617. return null;
  86618. }
  86619. // SMIC-方法扩展 - end
  86620. }]);
  86621. return Handler;
  86622. }(Eventful);
  86623. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Easing.js
  86624. function Easing_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  86625. function Easing_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  86626. function Easing_createClass(Constructor, protoProps, staticProps) { if (protoProps) Easing_defineProperties(Constructor.prototype, protoProps); if (staticProps) Easing_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  86627. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  86628. * This program are made available under the terms of the Apache License, Version 2.0
  86629. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  86630. /**
  86631. * @class LevelRenderer.Animation.easing
  86632. * @category Visualization Theme
  86633. * @classdesc 缓动
  86634. * @private
  86635. */
  86636. // 缓动代码来自 https://github.com/sole/tween.js/blob/master/src/Tween.js
  86637. // http://sole.github.io/tween.js/examples/03_graphs.html
  86638. var Easing = /*#__PURE__*/function () {
  86639. function Easing() {
  86640. Easing_classCallCheck(this, Easing);
  86641. this.CLASS_NAME = "SuperMap.LevelRenderer.Animation.easing";
  86642. }
  86643. /**
  86644. * @function LevelRenderer.Animation.easing.destroy
  86645. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  86646. */
  86647. Easing_createClass(Easing, [{
  86648. key: "destroy",
  86649. value: function destroy() {}
  86650. /**
  86651. * @function LevelRenderer.Animation.easing.Linear
  86652. * @description 线性缓动
  86653. * @param {number} k - 参数
  86654. * @return {number} 输入值
  86655. */
  86656. }, {
  86657. key: "Linear",
  86658. value: function Linear(k) {
  86659. return k;
  86660. }
  86661. /**
  86662. * @function LevelRenderer.Animation.easing.QuadraticIn
  86663. * @description 二次方的缓动(t^2)
  86664. * @param {number} k - 参数
  86665. * @return {number} 二次方的缓动的值
  86666. */
  86667. }, {
  86668. key: "QuadraticIn",
  86669. value: function QuadraticIn(k) {
  86670. return k * k;
  86671. }
  86672. /**
  86673. * @function LevelRenderer.Animation.easing.QuadraticOut
  86674. * @description 返回按二次方缓动退出的值
  86675. * @param {number} k - 参数
  86676. * @return {number} 按二次方缓动退出的值
  86677. */
  86678. }, {
  86679. key: "QuadraticOut",
  86680. value: function QuadraticOut(k) {
  86681. return k * (2 - k);
  86682. }
  86683. /**
  86684. * @function LevelRenderer.Animation.easing.QuadraticInOut
  86685. * @description 返回按二次方缓动进入和退出的值
  86686. * @param {number} k - 参数
  86687. * @return {number} 按二次方缓动进入和退出的值
  86688. */
  86689. }, {
  86690. key: "QuadraticInOut",
  86691. value: function QuadraticInOut(k) {
  86692. if ((k *= 2) < 1) {
  86693. return 0.5 * k * k;
  86694. }
  86695. return -0.5 * (--k * (k - 2) - 1);
  86696. }
  86697. /**
  86698. * @function LevelRenderer.Animation.easing.CubicIn
  86699. * @description 三次方的缓动(t^3)
  86700. * @param {number} k - 参数
  86701. * @return {number} 按三次方缓动的值
  86702. */
  86703. }, {
  86704. key: "CubicIn",
  86705. value: function CubicIn(k) {
  86706. return k * k * k;
  86707. }
  86708. /**
  86709. * @function LevelRenderer.Animation.easing.CubicOut
  86710. * @description 返回按三次方缓动退出的值
  86711. * @param {number} k - 参数
  86712. * @return {number} 按三次方缓动退出的值
  86713. */
  86714. }, {
  86715. key: "CubicOut",
  86716. value: function CubicOut(k) {
  86717. return --k * k * k + 1;
  86718. }
  86719. /**
  86720. * @function LevelRenderer.Animation.easing.CubicInOut
  86721. * @description 返回按三次方缓动进入退出的值
  86722. * @param {number} k - 参数
  86723. * @return {number} 按三次方缓动进入退出的值
  86724. */
  86725. }, {
  86726. key: "CubicInOut",
  86727. value: function CubicInOut(k) {
  86728. if ((k *= 2) < 1) {
  86729. return 0.5 * k * k * k;
  86730. }
  86731. return 0.5 * ((k -= 2) * k * k + 2);
  86732. }
  86733. /**
  86734. * @function LevelRenderer.Animation.easing.QuarticIn
  86735. * @description 返回按四次方缓动进入的值
  86736. * @param {number} k - 参数
  86737. * @return {number} 按四次方缓动进入的值
  86738. */
  86739. }, {
  86740. key: "QuarticIn",
  86741. value: function QuarticIn(k) {
  86742. return k * k * k * k;
  86743. }
  86744. /**
  86745. * @function LevelRenderer.Animation.easing.QuarticOut
  86746. * @description 返回按四次方缓动退出的值
  86747. * @param {number} k - 参数
  86748. * @return {number} 按四次方缓动退出的值
  86749. */
  86750. }, {
  86751. key: "QuarticOut",
  86752. value: function QuarticOut(k) {
  86753. return 1 - --k * k * k * k;
  86754. }
  86755. /**
  86756. * @function LevelRenderer.Animation.easing.QuarticInOut
  86757. * @description 返回按四次方缓动进入退出的值
  86758. * @param {number} k - 参数
  86759. * @return {number} 按四次方缓动进入退出的值
  86760. */
  86761. }, {
  86762. key: "QuarticInOut",
  86763. value: function QuarticInOut(k) {
  86764. if ((k *= 2) < 1) {
  86765. return 0.5 * k * k * k * k;
  86766. }
  86767. return -0.5 * ((k -= 2) * k * k * k - 2);
  86768. }
  86769. // 五次方的缓动(t^5)
  86770. /**
  86771. * @function LevelRenderer.Animation.easing.QuinticIn
  86772. * @description 返回按五次方缓动的值
  86773. * @param {number} k - 参数
  86774. * @return {number} 按五次方缓动的值
  86775. */
  86776. }, {
  86777. key: "QuinticIn",
  86778. value: function QuinticIn(k) {
  86779. return k * k * k * k * k;
  86780. }
  86781. /**
  86782. * @function LevelRenderer.Animation.easing.QuinticOut
  86783. * @description 返回按五次方缓动退出的值
  86784. * @param {number} k - 参数
  86785. * @return {number} 按五次方缓动退出的值
  86786. */
  86787. }, {
  86788. key: "QuinticOut",
  86789. value: function QuinticOut(k) {
  86790. return --k * k * k * k * k + 1;
  86791. }
  86792. /**
  86793. * @function LevelRenderer.Animation.easing.QuinticInOut
  86794. * @description 返回按五次方缓动进入退出的值
  86795. * @param {number} k - 参数
  86796. * @return {number} 按五次方缓动进入退出的值
  86797. */
  86798. }, {
  86799. key: "QuinticInOut",
  86800. value: function QuinticInOut(k) {
  86801. if ((k *= 2) < 1) {
  86802. return 0.5 * k * k * k * k * k;
  86803. }
  86804. return 0.5 * ((k -= 2) * k * k * k * k + 2);
  86805. }
  86806. // 正弦曲线的缓动(sin(t))
  86807. /**
  86808. * @function LevelRenderer.Animation.easing.SinusoidalIn
  86809. * @description 返回按正弦曲线的缓动进入的值
  86810. * @param {number} k - 参数
  86811. * @return {number} 按正弦曲线的缓动进入的值
  86812. */
  86813. }, {
  86814. key: "SinusoidalIn",
  86815. value: function SinusoidalIn(k) {
  86816. return 1 - Math.cos(k * Math.PI / 2);
  86817. }
  86818. /**
  86819. * @function LevelRenderer.Animation.easing.SinusoidalOut
  86820. * @description 返回按正弦曲线的缓动退出的值
  86821. * @param {number} k - 参数
  86822. * @return {number} 按正弦曲线的缓动退出的值
  86823. */
  86824. }, {
  86825. key: "SinusoidalOut",
  86826. value: function SinusoidalOut(k) {
  86827. return Math.sin(k * Math.PI / 2);
  86828. }
  86829. /**
  86830. * @function LevelRenderer.Animation.easing.SinusoidalInOut
  86831. * @description 返回按正弦曲线的缓动进入退出的值
  86832. * @param {number} k - 参数
  86833. * @return {number} 按正弦曲线的缓动进入退出的值
  86834. */
  86835. }, {
  86836. key: "SinusoidalInOut",
  86837. value: function SinusoidalInOut(k) {
  86838. return 0.5 * (1 - Math.cos(Math.PI * k));
  86839. }
  86840. // 指数曲线的缓动(2^t)
  86841. /**
  86842. * @function LevelRenderer.Animation.easing.ExponentialIn
  86843. * @description 返回按指数曲线的缓动进入的值
  86844. * @param {number} k - 参数
  86845. * @return {number} 按指数曲线的缓动进入的值
  86846. */
  86847. }, {
  86848. key: "ExponentialIn",
  86849. value: function ExponentialIn(k) {
  86850. return k === 0 ? 0 : Math.pow(1024, k - 1);
  86851. }
  86852. /**
  86853. * @function LevelRenderer.Animation.easing.ExponentialOut
  86854. * @description 返回按指数曲线的缓动退出的值
  86855. * @param {number} k - 参数
  86856. * @return {number} 按指数曲线的缓动退出的值
  86857. */
  86858. }, {
  86859. key: "ExponentialOut",
  86860. value: function ExponentialOut(k) {
  86861. return k === 1 ? 1 : 1 - Math.pow(2, -10 * k);
  86862. }
  86863. /**
  86864. * @function LevelRenderer.Animation.easing.ExponentialInOut
  86865. * @description 返回按指数曲线的缓动进入退出的值
  86866. * @param {number} k - 参数
  86867. * @return {number} 按指数曲线的缓动进入退出的值
  86868. */
  86869. }, {
  86870. key: "ExponentialInOut",
  86871. value: function ExponentialInOut(k) {
  86872. if (k === 0) {
  86873. return 0;
  86874. }
  86875. if (k === 1) {
  86876. return 1;
  86877. }
  86878. if ((k *= 2) < 1) {
  86879. return 0.5 * Math.pow(1024, k - 1);
  86880. }
  86881. return 0.5 * (-Math.pow(2, -10 * (k - 1)) + 2);
  86882. }
  86883. // 圆形曲线的缓动(sqrt(1-t^2))
  86884. /**
  86885. * @function LevelRenderer.Animation.easing.CircularIn
  86886. * @description 返回按圆形曲线的缓动进入的值
  86887. * @param {number} k - 参数
  86888. * @return {number} 按圆形曲线的缓动进入的值
  86889. */
  86890. }, {
  86891. key: "CircularIn",
  86892. value: function CircularIn(k) {
  86893. return 1 - Math.sqrt(1 - k * k);
  86894. }
  86895. /**
  86896. * @function LevelRenderer.Animation.easing.CircularOut
  86897. * @description 返回按圆形曲线的缓动退出的值
  86898. * @param {number} k - 参数
  86899. * @return {number} 按圆形曲线的缓动退出的值
  86900. */
  86901. }, {
  86902. key: "CircularOut",
  86903. value: function CircularOut(k) {
  86904. return Math.sqrt(1 - --k * k);
  86905. }
  86906. /**
  86907. * @function LevelRenderer.Animation.easing.CircularInOut
  86908. * @description 返回按圆形曲线的缓动进入退出的值
  86909. * @param {number} k - 参数
  86910. * @return {number} 按圆形曲线的缓动进入退出的值
  86911. */
  86912. }, {
  86913. key: "CircularInOut",
  86914. value: function CircularInOut(k) {
  86915. if ((k *= 2) < 1) {
  86916. return -0.5 * (Math.sqrt(1 - k * k) - 1);
  86917. }
  86918. return 0.5 * (Math.sqrt(1 - (k -= 2) * k) + 1);
  86919. }
  86920. // 创建类似于弹簧在停止前来回振荡的动画
  86921. /**
  86922. * @function LevelRenderer.Animation.easing.ElasticIn
  86923. * @description 返回按类似于弹簧在停止前来回振荡的动画的缓动进入的值
  86924. * @param {number} k - 参数
  86925. * @return {number} 按类似于弹簧在停止前来回振荡的动画的缓动进入的值
  86926. */
  86927. }, {
  86928. key: "ElasticIn",
  86929. value: function ElasticIn(k) {
  86930. var s;
  86931. var a = 0.1;
  86932. var p = 0.4;
  86933. if (k === 0) {
  86934. return 0;
  86935. }
  86936. if (k === 1) {
  86937. return 1;
  86938. }
  86939. if (a < 1) {
  86940. a = 1;
  86941. s = p / 4;
  86942. } else {
  86943. s = p * Math.asin(1 / a) / (2 * Math.PI);
  86944. }
  86945. return -(a * Math.pow(2, 10 * (k -= 1)) * Math.sin((k - s) * (2 * Math.PI) / p));
  86946. }
  86947. /**
  86948. * @function LevelRenderer.Animation.easing.ElasticOut
  86949. * @description 返回按类似于弹簧在停止前来回振荡的动画的缓动退出的值
  86950. * @param {number} k - 参数
  86951. * @return {number} 按类似于弹簧在停止前来回振荡的动画的缓动退出的值
  86952. */
  86953. }, {
  86954. key: "ElasticOut",
  86955. value: function ElasticOut(k) {
  86956. var s;
  86957. var a = 0.1;
  86958. var p = 0.4;
  86959. if (k === 0) {
  86960. return 0;
  86961. }
  86962. if (k === 1) {
  86963. return 1;
  86964. }
  86965. if (a < 1) {
  86966. a = 1;
  86967. s = p / 4;
  86968. } else {
  86969. s = p * Math.asin(1 / a) / (2 * Math.PI);
  86970. }
  86971. return a * Math.pow(2, -10 * k) * Math.sin((k - s) * (2 * Math.PI) / p) + 1;
  86972. }
  86973. /**
  86974. * @function LevelRenderer.Animation.easing.ElasticInOut
  86975. * @description 返回按类似于弹簧在停止前来回振荡的动画的缓动进入退出的值
  86976. * @param {number} k - 参数
  86977. * @return {number} 按类似于弹簧在停止前来回振荡的动画的缓动进入退出的值
  86978. */
  86979. }, {
  86980. key: "ElasticInOut",
  86981. value: function ElasticInOut(k) {
  86982. var s;
  86983. var a = 0.1;
  86984. var p = 0.4;
  86985. if (k === 0) {
  86986. return 0;
  86987. }
  86988. if (k === 1) {
  86989. return 1;
  86990. }
  86991. if (a < 1) {
  86992. a = 1;
  86993. s = p / 4;
  86994. } else {
  86995. s = p * Math.asin(1 / a) / (2 * Math.PI);
  86996. }
  86997. if ((k *= 2) < 1) {
  86998. return -0.5 * (a * Math.pow(2, 10 * (k -= 1)) * Math.sin((k - s) * (2 * Math.PI) / p));
  86999. }
  87000. return a * Math.pow(2, -10 * (k -= 1)) * Math.sin((k - s) * (2 * Math.PI) / p) * 0.5 + 1;
  87001. }
  87002. // 在某一动画开始沿指示的路径进行动画处理前稍稍收回该动画的移动
  87003. /**
  87004. * @function LevelRenderer.Animation.easing.BackIn
  87005. * @description 返回按在某一动画开始沿指示的路径进行动画处理前稍稍收回该动画的移动的缓动进入的值
  87006. * @param {number} k - 参数
  87007. * @return {number} 按在某一动画开始沿指示的路径进行动画处理前稍稍收回该动画的移动的缓动进入的值
  87008. */
  87009. }, {
  87010. key: "BackIn",
  87011. value: function BackIn(k) {
  87012. var s = 1.70158;
  87013. return k * k * ((s + 1) * k - s);
  87014. }
  87015. /**
  87016. * @function LevelRenderer.Animation.easing.BackOut
  87017. * @description 返回按在某一动画开始沿指示的路径进行动画处理前稍稍收回该动画的移动的缓动退出的值
  87018. * @param {number} k - 参数
  87019. * @return {number} 按在某一动画开始沿指示的路径进行动画处理前稍稍收回该动画的移动的缓动退出的值
  87020. */
  87021. }, {
  87022. key: "BackOut",
  87023. value: function BackOut(k) {
  87024. var s = 1.70158;
  87025. return --k * k * ((s + 1) * k + s) + 1;
  87026. }
  87027. /**
  87028. * @function LevelRenderer.Animation.easing.BackInOut
  87029. * @description 返回按在某一动画开始沿指示的路径进行动画处理前稍稍收回该动画的移动的缓动进入退出的值
  87030. * @param {number} k - 参数
  87031. * @return {number} 按在某一动画开始沿指示的路径进行动画处理前稍稍收回该动画的移动的缓动进入退出的值
  87032. */
  87033. }, {
  87034. key: "BackInOut",
  87035. value: function BackInOut(k) {
  87036. var s = 1.70158 * 1.525;
  87037. if ((k *= 2) < 1) {
  87038. return 0.5 * (k * k * ((s + 1) * k - s));
  87039. }
  87040. return 0.5 * ((k -= 2) * k * ((s + 1) * k + s) + 2);
  87041. }
  87042. // 创建弹跳效果
  87043. /**
  87044. * @function LevelRenderer.Animation.easing.BounceIn
  87045. * @description 返回按弹跳效果的缓动进入的值
  87046. * @param {number} k - 参数
  87047. * @return {number} 按弹跳效果的缓动进入的值
  87048. */
  87049. }, {
  87050. key: "BounceIn",
  87051. value: function BounceIn(k) {
  87052. return 1 - this.BounceOut(1 - k);
  87053. }
  87054. /**
  87055. * @function LevelRenderer.Animation.easing.BounceOut
  87056. * @description 返回按弹跳效果的缓动退出的值
  87057. * @param {number} k - 参数
  87058. * @return {number} 按弹跳效果的缓动退出的值
  87059. */
  87060. }, {
  87061. key: "BounceOut",
  87062. value: function BounceOut(k) {
  87063. if (k < 1 / 2.75) {
  87064. return 7.5625 * k * k;
  87065. } else if (k < 2 / 2.75) {
  87066. return 7.5625 * (k -= 1.5 / 2.75) * k + 0.75;
  87067. } else if (k < 2.5 / 2.75) {
  87068. return 7.5625 * (k -= 2.25 / 2.75) * k + 0.9375;
  87069. } else {
  87070. return 7.5625 * (k -= 2.625 / 2.75) * k + 0.984375;
  87071. }
  87072. }
  87073. /**
  87074. * @function LevelRenderer.Animation.easing.BounceInOut
  87075. * @description 返回按弹跳效果的缓动进入退出的值
  87076. * @param {number} k - 参数
  87077. * @return {number} 按弹跳效果的缓动进入退出的值
  87078. */
  87079. }, {
  87080. key: "BounceInOut",
  87081. value: function BounceInOut(k) {
  87082. if (k < 0.5) {
  87083. return this.BounceIn(k * 2) * 0.5;
  87084. }
  87085. return this.BounceOut(k * 2 - 1) * 0.5 + 0.5;
  87086. }
  87087. }]);
  87088. return Easing;
  87089. }();
  87090. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Clip.js
  87091. function Clip_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  87092. function Clip_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  87093. function Clip_createClass(Constructor, protoProps, staticProps) { if (protoProps) Clip_defineProperties(Constructor.prototype, protoProps); if (staticProps) Clip_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  87094. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  87095. * This program are made available under the terms of the Apache License, Version 2.0
  87096. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  87097. /**
  87098. * @class LevelRenderer.Animation.Clip
  87099. * @category Visualization Theme
  87100. * @classdesc 动画片段
  87101. * @param {Object} options - 参数。
  87102. * @param {Object} options.target - 动画对象,可以是数组,如果是数组的话会批量分发 onframe 等事件。
  87103. * @param {number} [options.life=1000] - 动画时长。
  87104. * @param {number} [options.delay=0] - 动画延迟时间。
  87105. * @param {boolean} [options.loop=true] - 是否循环。
  87106. * @param {number} [options.gap=0] - 循环的间隔时间。
  87107. * @param {Object} options.onframe - 帧。
  87108. * @param {boolean} options.easing - 是否消除。
  87109. * @param {boolean} options.ondestroy - 是否销毁。
  87110. * @param {boolean} options.onrestart - 是否重播。
  87111. * @private
  87112. */
  87113. var Clip = /*#__PURE__*/function () {
  87114. function Clip(options) {
  87115. Clip_classCallCheck(this, Clip);
  87116. this._targetPool = options.target || {};
  87117. if (!(this._targetPool instanceof Array)) {
  87118. this._targetPool = [this._targetPool];
  87119. }
  87120. // 生命周期
  87121. this._life = options.life || 1000;
  87122. // 延时
  87123. this._delay = options.delay || 0;
  87124. // 开始时间
  87125. this._startTime = new Date().getTime() + this._delay; // 单位毫秒
  87126. // 结束时间
  87127. this._endTime = this._startTime + this._life * 1000;
  87128. // 是否循环
  87129. this.loop = typeof options.loop == 'undefined' ? false : options.loop;
  87130. this.gap = options.gap || 0;
  87131. this.easing = options.easing || 'Linear';
  87132. this.onframe = options.onframe;
  87133. this.ondestroy = options.ondestroy;
  87134. this.onrestart = options.onrestart;
  87135. this.CLASS_NAME = "SuperMap.LevelRenderer.Animation.Clip";
  87136. }
  87137. /**
  87138. * @function LevelRenderer.Animation.Clip.prototype.destroy
  87139. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  87140. */
  87141. Clip_createClass(Clip, [{
  87142. key: "destroy",
  87143. value: function destroy() {}
  87144. }, {
  87145. key: "step",
  87146. value: function step(time) {
  87147. var easing = new Easing();
  87148. var percent = (time - this._startTime) / this._life;
  87149. // 还没开始
  87150. if (percent < 0) {
  87151. return;
  87152. }
  87153. percent = Math.min(percent, 1);
  87154. var easingFunc = typeof this.easing == 'string' ? easing[this.easing] : this.easing;
  87155. var schedule = typeof easingFunc === 'function' ? easingFunc(percent) : percent;
  87156. this.fire('frame', schedule);
  87157. // 结束
  87158. if (percent == 1) {
  87159. if (this.loop) {
  87160. this.restart();
  87161. // 重新开始周期
  87162. // 抛出而不是直接调用事件直到 stage.update 后再统一调用这些事件
  87163. return 'restart';
  87164. }
  87165. // 动画完成将这个控制器标识为待删除
  87166. // 在Animation.update中进行批量删除
  87167. this._needsRemove = true;
  87168. return 'destroy';
  87169. }
  87170. return null;
  87171. }
  87172. }, {
  87173. key: "restart",
  87174. value: function restart() {
  87175. var time = new Date().getTime();
  87176. var remainder = (time - this._startTime) % this._life;
  87177. this._startTime = new Date().getTime() - remainder + this.gap;
  87178. }
  87179. }, {
  87180. key: "fire",
  87181. value: function fire(eventType, arg) {
  87182. for (var i = 0, len = this._targetPool.length; i < len; i++) {
  87183. if (this['on' + eventType]) {
  87184. this['on' + eventType](this._targetPool[i], arg);
  87185. }
  87186. }
  87187. }
  87188. }]);
  87189. return Clip;
  87190. }();
  87191. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Animation.js
  87192. function Animation_typeof(obj) { "@babel/helpers - typeof"; return Animation_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, Animation_typeof(obj); }
  87193. function Animation_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  87194. function Animation_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  87195. function Animation_createClass(Constructor, protoProps, staticProps) { if (protoProps) Animation_defineProperties(Constructor.prototype, protoProps); if (staticProps) Animation_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  87196. function Animation_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) Animation_setPrototypeOf(subClass, superClass); }
  87197. function Animation_setPrototypeOf(o, p) { Animation_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Animation_setPrototypeOf(o, p); }
  87198. function Animation_createSuper(Derived) { var hasNativeReflectConstruct = Animation_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Animation_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Animation_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Animation_possibleConstructorReturn(this, result); }; }
  87199. function Animation_possibleConstructorReturn(self, call) { if (call && (Animation_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return Animation_assertThisInitialized(self); }
  87200. function Animation_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  87201. function Animation_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  87202. function Animation_getPrototypeOf(o) { Animation_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Animation_getPrototypeOf(o); }
  87203. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  87204. * This program are made available under the terms of the Apache License, Version 2.0
  87205. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  87206. /**
  87207. * @class LevelRenderer.Animation
  87208. * @classdesc 动画主类, 调度和管理所有动画控制器
  87209. * @category Visualization Theme
  87210. * @extends {LevelRenderer.Eventful}
  87211. * @param {Object} options - 动画参数。
  87212. * @param {Object} options.onframe - onframe。
  87213. * @param {Object} options.stage - stage。
  87214. * @example 例如:
  87215. * (start code)
  87216. * var animation = new LevelRenderer.Animation();
  87217. * var obj = {
  87218. * x: 100,
  87219. * y: 100
  87220. * };
  87221. * animation.animate(node.position)
  87222. * .when(1000, {
  87223. * x: 500,
  87224. * y: 500
  87225. * })
  87226. * .when(2000, {
  87227. * x: 100,
  87228. * y: 100
  87229. * })
  87230. * .start('spline');
  87231. * (end)
  87232. * @private
  87233. */
  87234. var Animation = /*#__PURE__*/function (_Eventful) {
  87235. Animation_inherits(Animation, _Eventful);
  87236. var _super = Animation_createSuper(Animation);
  87237. function Animation(options) {
  87238. var _this;
  87239. Animation_classCallCheck(this, Animation);
  87240. _this = _super.call(this, options);
  87241. options = options || {};
  87242. /**
  87243. * @member {Object} LevelRenderer.Animation.prototype.stage
  87244. * @description stage。
  87245. */
  87246. _this.stage = {};
  87247. /**
  87248. * @member {Object} LevelRenderer.Animation.prototype.onframe
  87249. * @description onframe。
  87250. */
  87251. _this.onframe = function () {};
  87252. /**
  87253. * @member {Array} LevelRenderer.Animation.prototype._clips
  87254. * @description _clips。
  87255. */
  87256. _this._clips = [];
  87257. /**
  87258. * @member {boolean} LevelRenderer.Animation.prototype._running
  87259. * @description _running。
  87260. */
  87261. _this._running = false;
  87262. /**
  87263. * @member {number} LevelRenderer.Animation.prototype._time
  87264. * @description _time。
  87265. */
  87266. _this._time = 0;
  87267. Util_Util.extend(Animation_assertThisInitialized(_this), options);
  87268. _this.CLASS_NAME = "SuperMap.LevelRenderer.Animation";
  87269. return _this;
  87270. }
  87271. /**
  87272. * @function LevelRenderer.Animation.prototype.add
  87273. * @description 添加动画片段。
  87274. * @param {LevelRenderer.Animation.Clip} clip - 动画片段。
  87275. */
  87276. Animation_createClass(Animation, [{
  87277. key: "add",
  87278. value: function add(clip) {
  87279. this._clips.push(clip);
  87280. }
  87281. /**
  87282. * @function LevelRenderer.Animation.prototype.remove
  87283. * @description 删除动画片段。
  87284. * @param {LevelRenderer.Animation.Clip} clip - 动画片段。
  87285. */
  87286. }, {
  87287. key: "remove",
  87288. value: function remove(clip) {
  87289. var idx = new levelRenderer_Util_Util().indexOf(this._clips, clip);
  87290. if (idx >= 0) {
  87291. this._clips.splice(idx, 1);
  87292. }
  87293. }
  87294. /**
  87295. * @function LevelRenderer.Animation.prototype.update
  87296. * @description 更新动画片段。
  87297. */
  87298. }, {
  87299. key: "_update",
  87300. value: function _update() {
  87301. var time = new Date().getTime();
  87302. var delta = time - this._time;
  87303. var clips = this._clips;
  87304. var len = clips.length;
  87305. var deferredEvents = [];
  87306. var deferredClips = [];
  87307. for (var i = 0; i < len; i++) {
  87308. var clip = clips[i];
  87309. var e = clip.step(time);
  87310. // Throw out the events need to be called after
  87311. // stage.update, like destroy
  87312. if (e) {
  87313. deferredEvents.push(e);
  87314. deferredClips.push(clip);
  87315. }
  87316. }
  87317. if (this.stage.update) {
  87318. this.stage.update();
  87319. }
  87320. // Remove the finished clip
  87321. for (var _i2 = 0; _i2 < len;) {
  87322. if (clips[_i2]._needsRemove) {
  87323. clips[_i2] = clips[len - 1];
  87324. clips.pop();
  87325. len--;
  87326. } else {
  87327. _i2++;
  87328. }
  87329. }
  87330. len = deferredEvents.length;
  87331. for (var _i4 = 0; _i4 < len; _i4++) {
  87332. deferredClips[_i4].fire(deferredEvents[_i4]);
  87333. }
  87334. this._time = time;
  87335. this.onframe(delta);
  87336. this.dispatch('frame', delta);
  87337. }
  87338. /**
  87339. * @function LevelRenderer.Animation.prototype.start
  87340. * @description 开始运行动画。
  87341. */
  87342. }, {
  87343. key: "start",
  87344. value: function start() {
  87345. var requestAnimationFrame = window.requestAnimationFrame || window.msRequestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || function (func) {
  87346. setTimeout(func, 16);
  87347. };
  87348. var self = this;
  87349. this._running = true;
  87350. function step() {
  87351. if (self._running) {
  87352. self._update();
  87353. requestAnimationFrame(step);
  87354. }
  87355. }
  87356. this._time = new Date().getTime();
  87357. requestAnimationFrame(step);
  87358. }
  87359. /**
  87360. * @function LevelRenderer.Animation.prototype.stop
  87361. * @description 停止运行动画。
  87362. */
  87363. }, {
  87364. key: "stop",
  87365. value: function stop() {
  87366. this._running = false;
  87367. }
  87368. /**
  87369. * @function LevelRenderer.Animation.prototype.clear
  87370. * @description 清除所有动画片段。
  87371. */
  87372. }, {
  87373. key: "clear",
  87374. value: function clear() {
  87375. this._clips = [];
  87376. }
  87377. /**
  87378. * @function LevelRenderer.Animation.prototype.animate
  87379. * @description 对一个目标创建一个animator对象,可以指定目标中的属性使用动画。
  87380. * @param {Object} target - 目标对象。
  87381. * @param {Object} options - 动画参数选项。
  87382. * @param {boolean} [options.loop=false] - 是否循环播放动画。
  87383. * @param {function} [options.getter] - 如果指定getter函数,会通过getter函数取属性值。
  87384. * @param {function} [options.setter] - 如果指定setter函数,会通过setter函数设置属性值。
  87385. * @returns {LevelRenderer.Animation.Animator} Animator。
  87386. */
  87387. }, {
  87388. key: "animate",
  87389. value: function animate(target, options) {
  87390. options = options || {};
  87391. var deferred = new Animator(target, options.loop, options.getter, options.setter);
  87392. deferred.animation = this;
  87393. return deferred;
  87394. }
  87395. }], [{
  87396. key: "_interpolateNumber",
  87397. value: function _interpolateNumber(p0, p1, percent) {
  87398. return (p1 - p0) * percent + p0;
  87399. }
  87400. }, {
  87401. key: "_interpolateArray",
  87402. value: function _interpolateArray(p0, p1, percent, out, arrDim) {
  87403. var len = p0.length;
  87404. if (arrDim == 1) {
  87405. for (var i = 0; i < len; i++) {
  87406. out[i] = Animation._interpolateNumber(p0[i], p1[i], percent);
  87407. }
  87408. } else {
  87409. var len2 = p0[0].length;
  87410. for (var _i6 = 0; _i6 < len; _i6++) {
  87411. for (var j = 0; j < len2; j++) {
  87412. out[_i6][j] = Animation._interpolateNumber(p0[_i6][j], p1[_i6][j], percent);
  87413. }
  87414. }
  87415. }
  87416. }
  87417. }, {
  87418. key: "_isArrayLike",
  87419. value: function _isArrayLike(data) {
  87420. switch (Animation_typeof(data)) {
  87421. case 'undefined':
  87422. case 'string':
  87423. return false;
  87424. }
  87425. return typeof data.length !== 'undefined';
  87426. }
  87427. }, {
  87428. key: "_catmullRomInterpolateArray",
  87429. value: function _catmullRomInterpolateArray(p0, p1, p2, p3, t, t2, t3, out, arrDim) {
  87430. var len = p0.length;
  87431. if (arrDim == 1) {
  87432. for (var i = 0; i < len; i++) {
  87433. out[i] = Animation._catmullRomInterpolate(p0[i], p1[i], p2[i], p3[i], t, t2, t3);
  87434. }
  87435. } else {
  87436. var len2 = p0[0].length;
  87437. for (var _i8 = 0; _i8 < len; _i8++) {
  87438. for (var j = 0; j < len2; j++) {
  87439. out[_i8][j] = Animation._catmullRomInterpolate(p0[_i8][j], p1[_i8][j], p2[_i8][j], p3[_i8][j], t, t2, t3);
  87440. }
  87441. }
  87442. }
  87443. }
  87444. }, {
  87445. key: "_catmullRomInterpolate",
  87446. value: function _catmullRomInterpolate(p0, p1, p2, p3, t, t2, t3) {
  87447. var v0 = (p2 - p0) * 0.5;
  87448. var v1 = (p3 - p1) * 0.5;
  87449. return (2 * (p1 - p2) + v0 + v1) * t3 + (-3 * (p1 - p2) - 2 * v0 - v1) * t2 + v0 * t + p1;
  87450. }
  87451. }, {
  87452. key: "_cloneValue",
  87453. value: function _cloneValue(value) {
  87454. var arraySlice = Array.prototype.slice;
  87455. if (Animation._isArrayLike(value)) {
  87456. var len = value.length;
  87457. if (Animation._isArrayLike(value[0])) {
  87458. var ret = [];
  87459. for (var i = 0; i < len; i++) {
  87460. ret.push(arraySlice.call(value[i]));
  87461. }
  87462. return ret;
  87463. } else {
  87464. return arraySlice.call(value);
  87465. }
  87466. } else {
  87467. return value;
  87468. }
  87469. }
  87470. }, {
  87471. key: "rgba2String",
  87472. value: function rgba2String(rgba) {
  87473. rgba[0] = Math.floor(rgba[0]);
  87474. rgba[1] = Math.floor(rgba[1]);
  87475. rgba[2] = Math.floor(rgba[2]);
  87476. return 'rgba(' + rgba.join(',') + ')';
  87477. }
  87478. }]);
  87479. return Animation;
  87480. }(Eventful);
  87481. /**
  87482. * @class LevelRenderer.Animation.Animator
  87483. */
  87484. var Animator = /*#__PURE__*/function () {
  87485. /**
  87486. * @function LevelRenderer.Animation.Animator.prototype.animate
  87487. * @description 构造函数
  87488. * @param {Object} target - 目标对象。
  87489. * @param {Object} options - 动画参数选项。
  87490. * @param {boolean} [loop=false] - 是否循环播放动画。
  87491. * @param {function} [getterl] - 如果指定getter函数,会通过getter函数取属性值。
  87492. * @param {function} [setter] - 如果指定setter函数,会通过setter函数设置属性值。
  87493. */
  87494. function Animator(target, loop, getter, setter) {
  87495. Animation_classCallCheck(this, Animator);
  87496. /**
  87497. * @member {Object} LevelRenderer.Animation.Animator.prototype._tracks
  87498. * @description _tracks。
  87499. */
  87500. this._tracks = {};
  87501. /**
  87502. * @member {Object} LevelRenderer.Animation.Animator.prototype._target
  87503. * @description _target。
  87504. */
  87505. this._target = target;
  87506. /**
  87507. * @member {boolean} LevelRenderer.Animation.Animator.prototype._loop
  87508. * @description _loop。
  87509. */
  87510. this._loop = loop || false;
  87511. /**
  87512. * @member {function} LevelRenderer.Animation.Animator.prototype._getter
  87513. * @description _getter。
  87514. */
  87515. this._getter = getter || _defaultGetter;
  87516. /**
  87517. * @member {function} LevelRenderer.Animation.Animator.prototype._setter
  87518. * @description _setter。
  87519. */
  87520. this._setter = setter || _defaultSetter;
  87521. /**
  87522. * @member {number} LevelRenderer.Animation.Animator.prototype._clipCount
  87523. * @description _clipCount。
  87524. */
  87525. this._clipCount = 0;
  87526. /**
  87527. * @member {number} LevelRenderer.Animation.Animator.prototype._delay
  87528. * @description _delay。
  87529. */
  87530. this._delay = 0;
  87531. /**
  87532. * @member {Array} LevelRenderer.Animation.Animator.prototype._doneList
  87533. * @description _doneList。
  87534. */
  87535. this._doneList = [];
  87536. /**
  87537. * @member {Array} LevelRenderer.Animation.Animator.prototype._onframeList
  87538. * @description _onframeList。
  87539. */
  87540. this._onframeList = [];
  87541. /**
  87542. * @member {Array} LevelRenderer.Animation.Animator.prototype._clipList
  87543. * @description _clipList。
  87544. */
  87545. this._clipList = [];
  87546. this.CLASS_NAME = "SuperMap.LevelRenderer.Animation.Animator";
  87547. //Function
  87548. function _defaultGetter(target, key) {
  87549. return target[key];
  87550. }
  87551. function _defaultSetter(target, key, value) {
  87552. target[key] = value;
  87553. }
  87554. }
  87555. /**
  87556. * @function LevelRenderer.Animation.Animator.prototype.when
  87557. * @description 设置动画关键帧
  87558. * @param {number} time - 关键帧时间,单位是ms
  87559. * @param {Object} props - 关键帧的属性值,key-value表示
  87560. * @returns {LevelRenderer.Animation.Animator} Animator
  87561. */
  87562. Animation_createClass(Animator, [{
  87563. key: "when",
  87564. value: function when(time /* ms */, props) {
  87565. for (var propName in props) {
  87566. if (!this._tracks[propName]) {
  87567. this._tracks[propName] = [];
  87568. // If time is 0
  87569. // Then props is given initialize value
  87570. // Else
  87571. // Initialize value from current prop value
  87572. if (time !== 0) {
  87573. this._tracks[propName].push({
  87574. time: 0,
  87575. value: Animation._cloneValue(this._getter(this._target, propName))
  87576. });
  87577. }
  87578. }
  87579. this._tracks[propName].push({
  87580. time: parseInt(time, 10),
  87581. value: props[propName]
  87582. });
  87583. }
  87584. return this;
  87585. }
  87586. /**
  87587. * @function LevelRenderer.Animation.Animator.prototype.during
  87588. * @description 添加动画每一帧的回调函数
  87589. * @param {RequestCallback} callback - 回调函数
  87590. * @returns {LevelRenderer.Animation.Animator} Animator
  87591. */
  87592. }, {
  87593. key: "during",
  87594. value: function during(callback) {
  87595. this._onframeList.push(callback);
  87596. return this;
  87597. }
  87598. /**
  87599. * @function LevelRenderer.Animation.Animator.prototype.start
  87600. * @description 开始执行动画
  87601. * @param {(string|function)} easing - 动画缓动函数。详见:<{@link LevelRenderer.Animation.easing}>。
  87602. * @returns {LevelRenderer.Animation.Animator} Animator
  87603. */
  87604. }, {
  87605. key: "start",
  87606. value: function start(easing) {
  87607. var self = this;
  87608. var setter = this._setter;
  87609. var getter = this._getter;
  87610. var onFrameListLen = self._onframeList.length;
  87611. var useSpline = easing === 'spline';
  87612. var ondestroy = function ondestroy() {
  87613. self._clipCount--;
  87614. if (self._clipCount === 0) {
  87615. // Clear all tracks
  87616. self._tracks = {};
  87617. var len = self._doneList.length;
  87618. for (var i = 0; i < len; i++) {
  87619. self._doneList[i].call(self);
  87620. }
  87621. }
  87622. };
  87623. var createTrackClip = function createTrackClip(keyframes, propName) {
  87624. var trackLen = keyframes.length;
  87625. if (!trackLen) {
  87626. return;
  87627. }
  87628. // Guess data type
  87629. var firstVal = keyframes[0].value;
  87630. var isValueArray = Animation._isArrayLike(firstVal);
  87631. var isValueColor = false;
  87632. // For vertices morphing
  87633. var arrDim = isValueArray && Animation._isArrayLike(firstVal[0]) ? 2 : 1;
  87634. // Sort keyframe as ascending
  87635. keyframes.sort(function (a, b) {
  87636. return a.time - b.time;
  87637. });
  87638. var trackMaxTime = keyframes[trackLen - 1].time;
  87639. // Percents of each keyframe
  87640. var kfPercents = [];
  87641. // Value of each keyframe
  87642. var kfValues = [];
  87643. for (var _i10 = 0; _i10 < trackLen; _i10++) {
  87644. kfPercents.push(keyframes[_i10].time / trackMaxTime);
  87645. // Assume value is a color when it is a string
  87646. var value = keyframes[_i10].value;
  87647. if (typeof value == 'string') {
  87648. value = SUtil_SUtil.Util_color.toArray(value);
  87649. if (value.length === 0) {
  87650. // Invalid color
  87651. value[0] = value[1] = value[2] = 0;
  87652. value[3] = 1;
  87653. }
  87654. isValueColor = true;
  87655. }
  87656. kfValues.push(value);
  87657. }
  87658. // Cache the key of last frame to speed up when
  87659. // animation playback is sequency
  87660. var cacheKey = 0;
  87661. var cachePercent = 0;
  87662. var start;
  87663. var i;
  87664. var w;
  87665. var p0;
  87666. var p1;
  87667. var p2;
  87668. var p3;
  87669. if (isValueColor) {
  87670. var rgba = [0, 0, 0, 0];
  87671. }
  87672. var onframe = function onframe(target, percent) {
  87673. // Find the range keyframes
  87674. // kf1-----kf2---------current--------kf3
  87675. // find kf2 and kf3 and do interpolation
  87676. if (percent < cachePercent) {
  87677. // Start from next key
  87678. start = Math.min(cacheKey + 1, trackLen - 1);
  87679. for (i = start; i >= 0; i--) {
  87680. if (kfPercents[i] <= percent) {
  87681. break;
  87682. }
  87683. }
  87684. i = Math.min(i, trackLen - 2);
  87685. } else {
  87686. for (i = cacheKey; i < trackLen; i++) {
  87687. if (kfPercents[i] > percent) {
  87688. break;
  87689. }
  87690. }
  87691. i = Math.min(i - 1, trackLen - 2);
  87692. }
  87693. cacheKey = i;
  87694. cachePercent = percent;
  87695. var range = kfPercents[i + 1] - kfPercents[i];
  87696. if (range === 0) {
  87697. return;
  87698. } else {
  87699. w = (percent - kfPercents[i]) / range;
  87700. }
  87701. if (useSpline) {
  87702. p1 = kfValues[i];
  87703. p0 = kfValues[i === 0 ? i : i - 1];
  87704. p2 = kfValues[i > trackLen - 2 ? trackLen - 1 : i + 1];
  87705. p3 = kfValues[i > trackLen - 3 ? trackLen - 1 : i + 2];
  87706. if (isValueArray) {
  87707. Animation._catmullRomInterpolateArray(p0, p1, p2, p3, w, w * w, w * w * w, getter(target, propName), arrDim);
  87708. } else {
  87709. var _value;
  87710. if (isValueColor) {
  87711. // value = LevelRenderer.Animation._catmullRomInterpolateArray(
  87712. // p0, p1, p2, p3, w, w * w, w * w * w,
  87713. // rgba, 1
  87714. // );
  87715. _value = Animation.rgba2String(rgba);
  87716. } else {
  87717. _value = Animation._catmullRomInterpolate(p0, p1, p2, p3, w, w * w, w * w * w);
  87718. }
  87719. setter(target, propName, _value);
  87720. }
  87721. } else {
  87722. if (isValueArray) {
  87723. Animation._interpolateArray(kfValues[i], kfValues[i + 1], w, getter(target, propName), arrDim);
  87724. } else {
  87725. var _value2;
  87726. if (isValueColor) {
  87727. Animation._interpolateArray(kfValues[i], kfValues[i + 1], w, rgba, 1);
  87728. _value2 = Animation.rgba2String(rgba);
  87729. } else {
  87730. _value2 = Animation._interpolateNumber(kfValues[i], kfValues[i + 1], w);
  87731. }
  87732. setter(target, propName, _value2);
  87733. }
  87734. }
  87735. for (i = 0; i < onFrameListLen; i++) {
  87736. self._onframeList[i](target, percent);
  87737. }
  87738. };
  87739. var clip = new Clip({
  87740. target: self._target,
  87741. life: trackMaxTime,
  87742. loop: self._loop,
  87743. delay: self._delay,
  87744. onframe: onframe,
  87745. ondestroy: ondestroy
  87746. });
  87747. if (easing && easing !== 'spline') {
  87748. clip.easing = easing;
  87749. }
  87750. self._clipList.push(clip);
  87751. self._clipCount++;
  87752. self.animation.add(clip);
  87753. };
  87754. for (var propName in this._tracks) {
  87755. createTrackClip(this._tracks[propName], propName);
  87756. }
  87757. return this;
  87758. }
  87759. /**
  87760. * @function LevelRenderer.Animation.Animator.prototype.stop
  87761. * @description 停止动画
  87762. */
  87763. }, {
  87764. key: "stop",
  87765. value: function stop() {
  87766. for (var i = 0; i < this._clipList.length; i++) {
  87767. var clip = this._clipList[i];
  87768. this.animation.remove(clip);
  87769. }
  87770. this._clipList = [];
  87771. }
  87772. /**
  87773. * @function LevelRenderer.Animation.Animator.prototype.delay
  87774. * @description 设置动画延迟开始的时间
  87775. * @param {number} time - 时间,单位ms
  87776. * @returns {LevelRenderer.Animation.Animator} Animator
  87777. */
  87778. }, {
  87779. key: "delay",
  87780. value: function delay(time) {
  87781. this._delay = time;
  87782. return this;
  87783. }
  87784. /**
  87785. * @function LevelRenderer.Animation.Animator.prototype.done
  87786. * @description 添加动画结束的回调
  87787. * @param {function} cb - Function
  87788. * @returns {LevelRenderer.Animation.Animator} Animator
  87789. */
  87790. }, {
  87791. key: "done",
  87792. value: function done(cb) {
  87793. if (cb) {
  87794. this._doneList.push(cb);
  87795. }
  87796. return this;
  87797. }
  87798. }]);
  87799. return Animator;
  87800. }();
  87801. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Render.js
  87802. function Render_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  87803. function Render_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  87804. function Render_createClass(Constructor, protoProps, staticProps) { if (protoProps) Render_defineProperties(Constructor.prototype, protoProps); if (staticProps) Render_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  87805. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  87806. * This program are made available under the terms of the Apache License, Version 2.0
  87807. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  87808. /**
  87809. * @private
  87810. * @class LevelRenderer.Render
  87811. * @category Visualization Theme
  87812. * @classdesc Render 接口类,对外可用的所有接口都在这里。内部使用非 get 接口统一返回 this 对象,支持链式调用。
  87813. * @param {string} id - 唯一标识。
  87814. * @param {HTMLElement} dom - Dom 对象。
  87815. */
  87816. var Render = /*#__PURE__*/function () {
  87817. function Render(id, dom) {
  87818. Render_classCallCheck(this, Render);
  87819. /**
  87820. * @member {string} LevelRenderer.Render.prototype.id
  87821. * @description 唯一标识。
  87822. */
  87823. this.id = id;
  87824. /**
  87825. * @member {LevelRenderer.Storage} LevelRenderer.Render.prototype.storage
  87826. * @description 图形仓库对象。
  87827. */
  87828. this.storage = new Storage();
  87829. /**
  87830. * @member {LevelRenderer.Painter} LevelRenderer.Render.prototype.painter
  87831. * @description 绘制器对象。
  87832. *
  87833. */
  87834. this.painter = new Painter(dom, this.storage);
  87835. /**
  87836. * @member {LevelRenderer.Handler} LevelRenderer.Render.prototype.handler
  87837. * @description 事件处理对象。
  87838. *
  87839. */
  87840. this.handler = new Handler(dom, this.storage, this.painter);
  87841. /**
  87842. * @member {Array} LevelRenderer.Render.prototype.animatingElements
  87843. * @description 动画控制数组。
  87844. *
  87845. */
  87846. this.animatingElements = [];
  87847. /**
  87848. * @member {LevelRenderer.animation.Animation} LevelRenderer.Render.prototype.animation
  87849. * @description 动画对象。
  87850. *
  87851. */
  87852. this.animation = new Animation({
  87853. stage: {
  87854. update: Render.getFrameCallback(this)
  87855. }
  87856. });
  87857. /**
  87858. * @member {boolean} LevelRenderer.Render.prototype._needsRefreshNextFrame
  87859. * @description 是否需要刷新下一帧。
  87860. *
  87861. */
  87862. this._needsRefreshNextFrame = false;
  87863. this.animation.start();
  87864. this.CLASS_NAME = "SuperMap.LevelRenderer.Render";
  87865. }
  87866. /**
  87867. * @function LevelRenderer.Render.prototype.destory
  87868. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  87869. */
  87870. Render_createClass(Render, [{
  87871. key: "destroy",
  87872. value: function destroy() {
  87873. this.id = null;
  87874. this.storage = null;
  87875. this.painter = null;
  87876. this.handler = null;
  87877. this.animatingElements = null;
  87878. this.animation = null;
  87879. this._needsRefreshNextFrame = null;
  87880. }
  87881. /**
  87882. * @function LevelRenderer.Render.prototype.getId
  87883. * @description 获取实例唯一标识。
  87884. * @return {string} 实例唯一标识。
  87885. */
  87886. }, {
  87887. key: "getId",
  87888. value: function getId() {
  87889. return this.id;
  87890. }
  87891. /**
  87892. * @function LevelRenderer.Render.prototype.addShape
  87893. * @description 添加图形形状到根节点。
  87894. *
  87895. * @param {LevelRenderer.Shape} shape - 图形对象,可用属性全集,详见各 shape。
  87896. * @return {LevelRenderer.Render} this。
  87897. */
  87898. }, {
  87899. key: "addShape",
  87900. value: function addShape(shape) {
  87901. this.storage.addRoot(shape);
  87902. return this;
  87903. }
  87904. /**
  87905. * @function LevelRenderer.Render.prototype.addGroup
  87906. * @description 添加组到根节点。
  87907. *
  87908. * (code)
  87909. * //添加组到根节点例子
  87910. * var render = new LevelRenderer.Render("Render",document.getElementById('lRendertest'));
  87911. * render.clear();
  87912. * var g = new LevelRenderer.Group();
  87913. * g.addChild(new LevelRenderer.Shape.Circle({
  87914. * style: {
  87915. * x: 100,
  87916. * y: 100,
  87917. * r: 20,
  87918. * brushType: 'fill'
  87919. * }
  87920. * }));
  87921. * render.addGroup(g);
  87922. * render.render();
  87923. * (end)
  87924. *
  87925. * @param {LevelRenderer.Group} group - 组对象。
  87926. * @return {LevelRenderer.Render} this。
  87927. */
  87928. }, {
  87929. key: "addGroup",
  87930. value: function addGroup(group) {
  87931. this.storage.addRoot(group);
  87932. return this;
  87933. }
  87934. /**
  87935. * @function LevelRenderer.Render.prototype.delShape
  87936. * @description 从根节点删除图形形状。
  87937. *
  87938. * @param {string} shapeId - 图形对象唯一标识。
  87939. * @return {LevelRenderer.Render} this。
  87940. */
  87941. }, {
  87942. key: "delShape",
  87943. value: function delShape(shapeId) {
  87944. this.storage.delRoot(shapeId);
  87945. return this;
  87946. }
  87947. /**
  87948. * @function LevelRenderer.Render.prototype.delGroup
  87949. * @description 从根节点删除组。
  87950. *
  87951. * @param {string} groupId - 组对象唯一标识。
  87952. * @return {LevelRenderer.Render} this。
  87953. */
  87954. }, {
  87955. key: "delGroup",
  87956. value: function delGroup(groupId) {
  87957. this.storage.delRoot(groupId);
  87958. return this;
  87959. }
  87960. /**
  87961. * @function LevelRenderer.Render.prototype.modShape
  87962. * @description 修改图形形状。
  87963. *
  87964. * @param {string} shapeId - 图形对象唯一标识。
  87965. * @param {LevelRenderer.Shape} shape - 图形对象。
  87966. * @return {LevelRenderer.Render} this。
  87967. */
  87968. }, {
  87969. key: "modShape",
  87970. value: function modShape(shapeId, shape) {
  87971. this.storage.mod(shapeId, shape);
  87972. return this;
  87973. }
  87974. /**
  87975. * @function LevelRenderer.Render.prototype.modGroup
  87976. * @description 修改组。
  87977. *
  87978. * @param {string} groupId - 组对象唯一标识。
  87979. * @param {LevelRenderer.Group} group - 组对象。
  87980. * @return {LevelRenderer.Render} this。
  87981. */
  87982. }, {
  87983. key: "modGroup",
  87984. value: function modGroup(groupId, group) {
  87985. this.storage.mod(groupId, group);
  87986. return this;
  87987. }
  87988. /**
  87989. * @function LevelRenderer.Render.prototype.modLayer
  87990. * @description 修改指定 zlevel 的绘制配置项。
  87991. *
  87992. * @param {string} zLevel - 组对象唯一标识。
  87993. * @param {Object} config - 配置对象。
  87994. * @param {string} clearColor - 每次清空画布的颜色。默认值:0。
  87995. * @param {noolean} motionBlur - 是否开启动态模糊。默认值:false。
  87996. * @param {number} lastFrameAlpha - 在开启动态模糊的时候使用,与上一帧混合的alpha值,值越大尾迹越明显。默认值:0.7。
  87997. * @param {Array.<number>} position - 层的平移。
  87998. * @param {Array.<number>} rotation - 层的旋转。
  87999. * @param {Array.<number>} scale - 层的缩放。
  88000. * @param {boolean} zoomable - 层是否支持鼠标缩放操作。默认值:false。
  88001. * @param {boolean} panable - 层是否支持鼠标平移操作。默认值:false。
  88002. * @return {LevelRenderer.Render} this。
  88003. */
  88004. }, {
  88005. key: "modLayer",
  88006. value: function modLayer(zLevel, config) {
  88007. this.painter.modLayer(zLevel, config);
  88008. return this;
  88009. }
  88010. /**
  88011. * @function LevelRenderer.Render.prototype.addHoverShape
  88012. * @description 添加额外高亮层显示,仅提供添加方法,每次刷新后高亮层图形均被清空。
  88013. *
  88014. * @param {LevelRenderer.Shape} shape - 图形对象。
  88015. * @return {LevelRenderer.Render} this。
  88016. */
  88017. }, {
  88018. key: "addHoverShape",
  88019. value: function addHoverShape(shape) {
  88020. this.storage.addHover(shape);
  88021. return this;
  88022. }
  88023. /**
  88024. * @function LevelRenderer.Render.prototype.render
  88025. * @description 渲染。
  88026. *
  88027. * @callback {function} callback - 渲染结束后回调函数。
  88028. * @return {LevelRenderer.Render} this。
  88029. */
  88030. }, {
  88031. key: "render",
  88032. value: function render(callback) {
  88033. this.painter.render(callback);
  88034. this._needsRefreshNextFrame = false;
  88035. return this;
  88036. }
  88037. /**
  88038. * @function LevelRenderer.Render.prototype.refresh
  88039. * @description 视图更新。
  88040. *
  88041. * @callback {function} callback - 视图更新后回调函数。
  88042. * @return {LevelRenderer.Render} this。
  88043. */
  88044. }, {
  88045. key: "refresh",
  88046. value: function refresh(callback) {
  88047. this.painter.refresh(callback);
  88048. this._needsRefreshNextFrame = false;
  88049. return this;
  88050. }
  88051. /**
  88052. * @function LevelRenderer.Render.prototype.refreshNextFrame
  88053. * @description 标记视图在浏览器下一帧需要绘制。
  88054. * @return {LevelRenderer.Render} this。
  88055. */
  88056. }, {
  88057. key: "refreshNextFrame",
  88058. value: function refreshNextFrame() {
  88059. this._needsRefreshNextFrame = true;
  88060. return this;
  88061. }
  88062. /**
  88063. * @function LevelRenderer.Render.prototype.refreshHover
  88064. * @description 绘制(视图更新)高亮层。
  88065. * @callback {function} callback - 视图更新后回调函数。
  88066. * @return {LevelRenderer.Render} this。
  88067. */
  88068. }, {
  88069. key: "refreshHover",
  88070. value: function refreshHover(callback) {
  88071. this.painter.refreshHover(callback);
  88072. return this;
  88073. }
  88074. /**
  88075. * @function LevelRenderer.Render.prototype.refreshShapes
  88076. * @description 视图更新。
  88077. *
  88078. * @param {Array.<LevelRenderer.Shape>} shapeList - 需要更新的图形列表。
  88079. * @callback {function} callback - 视图更新后回调函数。
  88080. * @return {LevelRenderer.Render} this。
  88081. */
  88082. }, {
  88083. key: "refreshShapes",
  88084. value: function refreshShapes(shapeList, callback) {
  88085. this.painter.refreshShapes(shapeList, callback);
  88086. return this;
  88087. }
  88088. /**
  88089. * @function LevelRenderer.Render.prototype.resize
  88090. * @description 调整视图大小。
  88091. * @return {LevelRenderer.Render} this。
  88092. */
  88093. }, {
  88094. key: "resize",
  88095. value: function resize() {
  88096. this.painter.resize();
  88097. return this;
  88098. }
  88099. /**
  88100. * @function LevelRenderer.Render.prototype.animate
  88101. * @description 动画。
  88102. *
  88103. * @example
  88104. * zr.animate(circle.id, 'style', false)
  88105. * .when(1000, {x: 10} )
  88106. * .done(function(){ // Animation done })
  88107. * .start()
  88108. *
  88109. *
  88110. * @param {Array.<(LevelRenderer.Shape/LevelRenderer.Group)>} el - 动画对象。
  88111. * @param {string} path - 需要添加动画的属性获取路径,可以通过 a.b.c 来获取深层的属性。若传入对象为<LevelRenderer.Group>,path需为空字符串。
  88112. * @param {function} loop - 动画是否循环。
  88113. * @return {LevelRenderer.animation.Animator} Animator。
  88114. */
  88115. }, {
  88116. key: "animate",
  88117. value: function animate(el, path, loop) {
  88118. if (typeof el === 'string') {
  88119. el = this.storage.get(el);
  88120. }
  88121. if (el) {
  88122. var target;
  88123. if (path) {
  88124. var pathSplitted = path.split('.');
  88125. var prop = el;
  88126. for (var i = 0, l = pathSplitted.length; i < l; i++) {
  88127. if (!prop) {
  88128. continue;
  88129. }
  88130. prop = prop[pathSplitted[i]];
  88131. }
  88132. if (prop) {
  88133. target = prop;
  88134. }
  88135. } else {
  88136. target = el;
  88137. }
  88138. if (!target) {
  88139. SUtil_SUtil.Util_log('Property "' + path + '" is not existed in element ' + el.id);
  88140. return;
  88141. }
  88142. var animatingElements = this.animatingElements;
  88143. if (typeof el.__aniCount === 'undefined') {
  88144. // 正在进行的动画记数
  88145. el.__aniCount = 0;
  88146. }
  88147. if (el.__aniCount === 0) {
  88148. animatingElements.push(el);
  88149. }
  88150. el.__aniCount++;
  88151. return this.animation.animate(target, {
  88152. loop: loop
  88153. }).done(function () {
  88154. el.__aniCount--;
  88155. if (el.__aniCount === 0) {
  88156. // 从animatingElements里移除
  88157. var idx = new levelRenderer_Util_Util().indexOf(animatingElements, el);
  88158. animatingElements.splice(idx, 1);
  88159. }
  88160. });
  88161. } else {
  88162. SUtil_SUtil.Util_log('Element not existed');
  88163. }
  88164. }
  88165. /**
  88166. * @function LevelRenderer.Render.prototype.clearAnimation
  88167. * @description 停止所有动画。
  88168. *
  88169. */
  88170. }, {
  88171. key: "clearAnimation",
  88172. value: function clearAnimation() {
  88173. this.animation.clear();
  88174. }
  88175. /**
  88176. * @function LevelRenderer.Render.prototype.getWidth
  88177. * @description 获取视图宽度。
  88178. * @return {number} 视图宽度。
  88179. */
  88180. }, {
  88181. key: "getWidth",
  88182. value: function getWidth() {
  88183. return this.painter.getWidth();
  88184. }
  88185. /**
  88186. * @function LevelRenderer.Render.prototype.getHeight
  88187. * @description 获取视图高度。
  88188. * @return {number} 视图高度。
  88189. */
  88190. }, {
  88191. key: "getHeight",
  88192. value: function getHeight() {
  88193. return this.painter.getHeight();
  88194. }
  88195. /**
  88196. * @function LevelRenderer.Render.prototype.toDataURL
  88197. * @description 图像导出。
  88198. *
  88199. * @param {string} type - 类型。
  88200. * @param {string} backgroundColor - 背景色,默认值:"#FFFFFF"。
  88201. * @param {string} args - 参数。
  88202. * @return {string} 图片的 Base64 url。
  88203. */
  88204. }, {
  88205. key: "toDataURL",
  88206. value: function toDataURL(type, backgroundColor, args) {
  88207. return this.painter.toDataURL(type, backgroundColor, args);
  88208. }
  88209. /**
  88210. * @function LevelRenderer.Render.prototype.shapeToImage
  88211. * @description 将常规 shape 转成 image shape。
  88212. *
  88213. * @param {LevelRenderer.Shape} e - 图形。
  88214. * @param {number} width - 宽度。
  88215. * @param {number} height - 高度。
  88216. * @return {Object} image shape。
  88217. */
  88218. }, {
  88219. key: "shapeToImage",
  88220. value: function shapeToImage(e, width, height) {
  88221. var id = Util_Util.createUniqueID("SuperMap.LevelRenderer.ToImage_");
  88222. return this.painter.shapeToImage(id, e, width, height);
  88223. }
  88224. /**
  88225. * @function LevelRenderer.Render.prototype.on
  88226. * @description 事件绑定。
  88227. *
  88228. * @param {string} eventName - 事件名称。
  88229. * @param {function} eventHandler - 响应函数。
  88230. * @return {LevelRenderer.Render} this。
  88231. */
  88232. }, {
  88233. key: "on",
  88234. value: function on(eventName, eventHandler) {
  88235. this.handler.on(eventName, eventHandler);
  88236. return this;
  88237. }
  88238. /**
  88239. * @function LevelRenderer.Render.prototype.un
  88240. * @description 事件解绑定,参数为空则解绑所有自定义事件。
  88241. *
  88242. * @param {string} eventName - 事件名称。
  88243. * @param {function} eventHandler - 响应函数。
  88244. * @return {LevelRenderer.Render} this。
  88245. */
  88246. }, {
  88247. key: "un",
  88248. value: function un(eventName, eventHandler) {
  88249. this.handler.un(eventName, eventHandler);
  88250. return this;
  88251. }
  88252. /**
  88253. * @function LevelRenderer.Render.prototype.trigger
  88254. * @description 事件触发。
  88255. *
  88256. * @param {string} eventName - 事件名称,resize,hover,drag,etc。
  88257. * @param {event} event - event dom事件对象。
  88258. * @return {LevelRenderer.Render} this。
  88259. */
  88260. }, {
  88261. key: "trigger",
  88262. value: function trigger(eventName, event) {
  88263. this.handler.trigger(eventName, event);
  88264. this.handler.dispatch(eventName, event);
  88265. return this;
  88266. }
  88267. /**
  88268. * @function LevelRenderer.Render.prototype.clear
  88269. * @description 清除当前 Render 下所有类图的数据和显示,clear 后 MVC 和已绑定事件均还存在在,Render 可用。
  88270. * @return {LevelRenderer.Render} this。
  88271. */
  88272. }, {
  88273. key: "clear",
  88274. value: function clear() {
  88275. this.storage.delRoot();
  88276. this.painter.clear();
  88277. return this;
  88278. }
  88279. /**
  88280. * @function LevelRenderer.Render.prototype.dispose
  88281. * @description 释放当前 Render 实例(删除包括 dom,数据、显示和事件绑定),dispose后 Render 不可用。
  88282. */
  88283. }, {
  88284. key: "dispose",
  88285. value: function dispose() {
  88286. this.animation.stop();
  88287. this.clear();
  88288. this.storage.dispose();
  88289. this.painter.dispose();
  88290. this.handler.dispose();
  88291. this.animation = null;
  88292. this.animatingElements = null;
  88293. this.storage = null;
  88294. this.painter = null;
  88295. this.handler = null;
  88296. // 释放后告诉全局删除对自己的索引,没想到啥好方法
  88297. // zrender.delInstance(this.id);
  88298. }
  88299. // SMIC-方法扩展 - start
  88300. /**
  88301. * @function LevelRenderer.Render.prototype.updateHoverShapes
  88302. * @description 更新设置显示高亮图层。
  88303. *
  88304. * @param {Array.<LevelRenderer.Shape>} shapes - 图形数组。
  88305. * @return {LevelRenderer.Render} this。
  88306. */
  88307. }, {
  88308. key: "updateHoverShapes",
  88309. value: function updateHoverShapes(shapes) {
  88310. this.painter.updateHoverLayer(shapes);
  88311. return this;
  88312. }
  88313. /**
  88314. * @function LevelRenderer.Render.prototype.getAllShapes
  88315. * @description 获取所有图形。
  88316. * @return {Array.<LevelRenderer.Shape>} 图形数组。
  88317. */
  88318. }, {
  88319. key: "getAllShapes",
  88320. value: function getAllShapes() {
  88321. return this.storage._shapeList;
  88322. }
  88323. /**
  88324. * @function LevelRenderer.Render.prototype.clearAll
  88325. * @description 清除高亮和图形图层。
  88326. * @return {LevelRenderer.Render} this。
  88327. */
  88328. }, {
  88329. key: "clearAll",
  88330. value: function clearAll() {
  88331. this.clear();
  88332. this.painter.clearHover();
  88333. return this;
  88334. }
  88335. /**
  88336. * @function LevelRenderer.Render.prototype.getHoverOne
  88337. * @description 获取单个高亮图形,当前鼠标对应。
  88338. * @return {LevelRenderer.Shape} 高亮图形。
  88339. */
  88340. }, {
  88341. key: "getHoverOne",
  88342. value: function getHoverOne() {
  88343. return this.handler.getLastHoverOne();
  88344. }
  88345. }], [{
  88346. key: "getFrameCallback",
  88347. value: function getFrameCallback(renderInstance) {
  88348. return function () {
  88349. var animatingElements = renderInstance.animatingElements;
  88350. //animatingElements instanceof Array 临时解决 destory 报错
  88351. if (animatingElements instanceof Array) {
  88352. for (var i = 0, l = animatingElements.length; i < l; i++) {
  88353. renderInstance.storage.mod(animatingElements[i].id);
  88354. }
  88355. if (animatingElements.length || renderInstance._needsRefreshNextFrame) {
  88356. renderInstance.refresh();
  88357. }
  88358. }
  88359. };
  88360. }
  88361. // SMIC-方法扩展 - end
  88362. }]);
  88363. return Render;
  88364. }();
  88365. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/LevelRenderer.js
  88366. function LevelRenderer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  88367. function LevelRenderer_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  88368. function LevelRenderer_createClass(Constructor, protoProps, staticProps) { if (protoProps) LevelRenderer_defineProperties(Constructor.prototype, protoProps); if (staticProps) LevelRenderer_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  88369. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  88370. * This program are made available under the terms of the Apache License, Version 2.0
  88371. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  88372. /**
  88373. * @class LevelRenderer
  88374. * @deprecatedclass SuperMap.LevelRenderer
  88375. * @category Visualization Theme
  88376. * @classdesc LevelRenderer 渲染器
  88377. * @example
  88378. * //在渲染器上加上图形
  88379. * var levelRenderer = new LevelRenderer();
  88380. * var zr = levelRenderer.init(document.getElementById('lRendertest'));
  88381. * zr.clear();
  88382. * zr.addShape(new LevelRenderer.Shape.Circle({
  88383. * style:{
  88384. * x : 100,
  88385. * y : 100,
  88386. * r : 50,
  88387. * brushType: 'fill'
  88388. * }
  88389. * }));
  88390. * zr.render();
  88391. * @private
  88392. */
  88393. var LevelRenderer = /*#__PURE__*/function () {
  88394. function LevelRenderer() {
  88395. LevelRenderer_classCallCheck(this, LevelRenderer);
  88396. /**
  88397. * @member {Object} LevelRenderer.prototype._instances
  88398. * @description LevelRenderer 实例 map 索引
  88399. */
  88400. LevelRenderer._instances = {};
  88401. // 工具
  88402. LevelRenderer.Tool = {};
  88403. /**
  88404. * @member {string} LevelRenderer.prototype.version
  88405. * @description 版本。zRender(Baidu)的版本号
  88406. * 记录当前 LevelRenderer 是在 zRender 的那个版本上构建而来。
  88407. * 在每次完整评判和实施由 zRender(Baidu)升级带来的 LevelRenderer 升级后修改。
  88408. */
  88409. this.version = '2.0.4';
  88410. this.CLASS_NAME = "SuperMap.LevelRenderer";
  88411. }
  88412. /**
  88413. * @function LevelRenderer.prototype.destroy
  88414. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为null。
  88415. */
  88416. LevelRenderer_createClass(LevelRenderer, [{
  88417. key: "destroy",
  88418. value: function destroy() {
  88419. this.dispose();
  88420. this.version = null;
  88421. }
  88422. /**
  88423. * @function LevelRenderer.prototype.init
  88424. * @description 创建 LevelRenderer 实例。
  88425. * @param {HTMLElement} dom - 绘图容器。
  88426. * @returns {LevelRenderer} LevelRenderer 实例。
  88427. */
  88428. }, {
  88429. key: "init",
  88430. value: function init(dom) {
  88431. var zr = new Render(Util_Util.createUniqueID("LRenderer_"), dom);
  88432. LevelRenderer._instances[zr.id] = zr;
  88433. return zr;
  88434. }
  88435. /**
  88436. * @function LevelRenderer.prototype.dispose
  88437. * @description LevelRenderer 实例销毁。
  88438. * 可以通过 zrender.dispose(zr) 销毁指定 LevelRenderer.Render 实例。
  88439. * 也可以通过 zr.dispose() 直接销毁
  88440. * @param {LevelRenderer.Render} zr - ZRender对象,不传此参数则销毁全部。
  88441. * @returns {LevelRenderer} this。
  88442. */
  88443. }, {
  88444. key: "dispose",
  88445. value: function dispose(zr) {
  88446. if (zr) {
  88447. zr.dispose();
  88448. this.delInstance(zr.id);
  88449. } else {
  88450. for (var key in LevelRenderer._instances) {
  88451. LevelRenderer._instances[key].dispose();
  88452. }
  88453. LevelRenderer._instances = {};
  88454. }
  88455. return this;
  88456. }
  88457. /**
  88458. * @function LevelRenderer.prototype.getInstance
  88459. * @description 获取 LevelRenderer.Render 实例。
  88460. * @param {string} id - ZRender对象索引。
  88461. * @returns {LevelRenderer.Render} LevelRenderer.Render 实例。
  88462. */
  88463. }, {
  88464. key: "getInstance",
  88465. value: function getInstance(id) {
  88466. return LevelRenderer._instances[id];
  88467. }
  88468. /**
  88469. * @function LevelRenderer.prototype.delInstance
  88470. * @description 删除 zrender 实例,LevelRenderer.Render 实例 dispose 时会调用,删除后 getInstance 则返回 undefined
  88471. * @param {string} id - ZRender对象索引。
  88472. * @param {string} id - LevelRenderer.Render 对象索引。
  88473. * @returns {LevelRenderer} this。
  88474. */
  88475. }, {
  88476. key: "delInstance",
  88477. value: function delInstance(id) {
  88478. delete LevelRenderer._instances[id];
  88479. return this;
  88480. }
  88481. }]);
  88482. return LevelRenderer;
  88483. }();
  88484. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/SmicEllipse.js
  88485. function SmicEllipse_typeof(obj) { "@babel/helpers - typeof"; return SmicEllipse_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, SmicEllipse_typeof(obj); }
  88486. function SmicEllipse_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  88487. function SmicEllipse_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  88488. function SmicEllipse_createClass(Constructor, protoProps, staticProps) { if (protoProps) SmicEllipse_defineProperties(Constructor.prototype, protoProps); if (staticProps) SmicEllipse_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  88489. function SmicEllipse_get() { if (typeof Reflect !== "undefined" && Reflect.get) { SmicEllipse_get = Reflect.get.bind(); } else { SmicEllipse_get = function _get(target, property, receiver) { var base = SmicEllipse_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return SmicEllipse_get.apply(this, arguments); }
  88490. function SmicEllipse_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SmicEllipse_getPrototypeOf(object); if (object === null) break; } return object; }
  88491. function SmicEllipse_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) SmicEllipse_setPrototypeOf(subClass, superClass); }
  88492. function SmicEllipse_setPrototypeOf(o, p) { SmicEllipse_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SmicEllipse_setPrototypeOf(o, p); }
  88493. function SmicEllipse_createSuper(Derived) { var hasNativeReflectConstruct = SmicEllipse_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = SmicEllipse_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = SmicEllipse_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return SmicEllipse_possibleConstructorReturn(this, result); }; }
  88494. function SmicEllipse_possibleConstructorReturn(self, call) { if (call && (SmicEllipse_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return SmicEllipse_assertThisInitialized(self); }
  88495. function SmicEllipse_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  88496. function SmicEllipse_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  88497. function SmicEllipse_getPrototypeOf(o) { SmicEllipse_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SmicEllipse_getPrototypeOf(o); }
  88498. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  88499. * This program are made available under the terms of the Apache License, Version 2.0
  88500. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  88501. /**
  88502. * @private
  88503. * @class LevelRenderer.Shape.SmicEllipse
  88504. * @category Visualization Theme
  88505. * @classdesc 椭圆。
  88506. * @extends LevelRenderer.Shape
  88507. * @example
  88508. * var shape = new LevelRenderer.Shape.SmicEllipse({
  88509. * style: {
  88510. * x: 100,
  88511. * y: 100,
  88512. * a: 40,
  88513. * b: 20,
  88514. * brushType: 'both',
  88515. * color: 'blue',
  88516. * strokeColor: 'red',
  88517. * lineWidth: 3,
  88518. * text: 'SmicEllipse'
  88519. * }
  88520. * });
  88521. * levelRenderer.addShape(shape);
  88522. * @param {Array} options - shape 的配置(options)项,可以是 shape 的自有属性,也可以是自定义的属性。
  88523. *
  88524. */
  88525. var SmicEllipse = /*#__PURE__*/(/* unused pure expression or super */ null && (function (_Shape) {
  88526. SmicEllipse_inherits(SmicEllipse, _Shape);
  88527. var _super = SmicEllipse_createSuper(SmicEllipse);
  88528. function SmicEllipse(options) {
  88529. var _this;
  88530. SmicEllipse_classCallCheck(this, SmicEllipse);
  88531. _this = _super.call(this, options);
  88532. /**
  88533. * @member {string} LevelRenderer.Shape.SmicEllipse.prototype.type
  88534. * @description 图形类型。
  88535. */
  88536. _this.type = 'smicellipse';
  88537. if (!_this.refOriginalPosition || _this.refOriginalPosition.length !== 2) {
  88538. _this.refOriginalPosition = [0, 0];
  88539. }
  88540. _this.CLASS_NAME = "SuperMap.LevelRenderer.Shape.SmicEllipse";
  88541. return _this;
  88542. }
  88543. /**
  88544. * @function LevelRenderer.Shape.SmicEllipse.prototype.destroy
  88545. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  88546. */
  88547. SmicEllipse_createClass(SmicEllipse, [{
  88548. key: "destroy",
  88549. value: function destroy() {
  88550. this.type = null;
  88551. SmicEllipse_get(SmicEllipse_getPrototypeOf(SmicEllipse.prototype), "destroy", this).call(this);
  88552. }
  88553. /**
  88554. * @function LevelRenderer.Shape.SmicEllipse.prototype.buildPath
  88555. * @description 构建椭圆的 Path。
  88556. *
  88557. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  88558. * @param {Object} style - style。
  88559. *
  88560. */
  88561. }, {
  88562. key: "buildPath",
  88563. value: function buildPath(ctx, style) {
  88564. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  88565. this.refOriginalPosition = [0, 0];
  88566. }
  88567. var __OP = this.refOriginalPosition;
  88568. var k = 0.5522848;
  88569. var x = style.x + __OP[0];
  88570. var y = style.y + __OP[1];
  88571. var a = style.a;
  88572. var b = style.b;
  88573. var ox = a * k; // 水平控制点偏移量
  88574. var oy = b * k; // 垂直控制点偏移量
  88575. // 从椭圆的左端点开始顺时针绘制四条三次贝塞尔曲线
  88576. ctx.moveTo(x - a, y);
  88577. ctx.bezierCurveTo(x - a, y - oy, x - ox, y - b, x, y - b);
  88578. ctx.bezierCurveTo(x + ox, y - b, x + a, y - oy, x + a, y);
  88579. ctx.bezierCurveTo(x + a, y + oy, x + ox, y + b, x, y + b);
  88580. ctx.bezierCurveTo(x - ox, y + b, x - a, y + oy, x - a, y);
  88581. ctx.closePath();
  88582. }
  88583. /**
  88584. * @function LevelRenderer.Shape.SmicEllipse.prototype.getRect
  88585. * @description 计算返回椭圆包围盒矩形
  88586. *
  88587. * @param {Object} style - style
  88588. * @return {Object} 边框对象。包含属性:x,y,width,height。
  88589. *
  88590. */
  88591. }, {
  88592. key: "getRect",
  88593. value: function getRect(style) {
  88594. if (style.__rect) {
  88595. return style.__rect;
  88596. }
  88597. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  88598. this.refOriginalPosition = [0, 0];
  88599. }
  88600. var __OP = this.refOriginalPosition;
  88601. var lineWidth;
  88602. if (style.brushType == 'stroke' || style.brushType == 'fill') {
  88603. lineWidth = style.lineWidth || 1;
  88604. } else {
  88605. lineWidth = 0;
  88606. }
  88607. style.__rect = {
  88608. x: Math.round(style.x + __OP[0] - style.a - lineWidth / 2),
  88609. y: Math.round(style.x + __OP[1] - style.b - lineWidth / 2),
  88610. width: style.a * 2 + lineWidth,
  88611. height: style.b * 2 + lineWidth
  88612. };
  88613. return style.__rect;
  88614. }
  88615. }]);
  88616. return SmicEllipse;
  88617. }(Shape)));
  88618. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/SmicIsogon.js
  88619. function SmicIsogon_typeof(obj) { "@babel/helpers - typeof"; return SmicIsogon_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, SmicIsogon_typeof(obj); }
  88620. function SmicIsogon_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  88621. function SmicIsogon_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  88622. function SmicIsogon_createClass(Constructor, protoProps, staticProps) { if (protoProps) SmicIsogon_defineProperties(Constructor.prototype, protoProps); if (staticProps) SmicIsogon_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  88623. function SmicIsogon_get() { if (typeof Reflect !== "undefined" && Reflect.get) { SmicIsogon_get = Reflect.get.bind(); } else { SmicIsogon_get = function _get(target, property, receiver) { var base = SmicIsogon_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return SmicIsogon_get.apply(this, arguments); }
  88624. function SmicIsogon_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SmicIsogon_getPrototypeOf(object); if (object === null) break; } return object; }
  88625. function SmicIsogon_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) SmicIsogon_setPrototypeOf(subClass, superClass); }
  88626. function SmicIsogon_setPrototypeOf(o, p) { SmicIsogon_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SmicIsogon_setPrototypeOf(o, p); }
  88627. function SmicIsogon_createSuper(Derived) { var hasNativeReflectConstruct = SmicIsogon_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = SmicIsogon_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = SmicIsogon_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return SmicIsogon_possibleConstructorReturn(this, result); }; }
  88628. function SmicIsogon_possibleConstructorReturn(self, call) { if (call && (SmicIsogon_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return SmicIsogon_assertThisInitialized(self); }
  88629. function SmicIsogon_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  88630. function SmicIsogon_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  88631. function SmicIsogon_getPrototypeOf(o) { SmicIsogon_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SmicIsogon_getPrototypeOf(o); }
  88632. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  88633. * This program are made available under the terms of the Apache License, Version 2.0
  88634. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  88635. /**
  88636. * @private
  88637. * @class LevelRenderer.Shape.SmicIsogon
  88638. * @category Visualization Theme
  88639. * @classdesc 正多边形。
  88640. * @extends LevelRenderer.Shape
  88641. * @param {Array} options - shape 的配置(options)项,可以是 shape 的自有属性,也可以是自定义的属性。
  88642. */
  88643. var SmicIsogon = /*#__PURE__*/(/* unused pure expression or super */ null && (function (_Shape) {
  88644. SmicIsogon_inherits(SmicIsogon, _Shape);
  88645. var _super = SmicIsogon_createSuper(SmicIsogon);
  88646. function SmicIsogon(options) {
  88647. var _this;
  88648. SmicIsogon_classCallCheck(this, SmicIsogon);
  88649. _this = _super.call(this, options);
  88650. /**
  88651. * @member {string} LevelRenderer.Shape.SmicIsogon.prototype.type
  88652. * @description 图形类型。
  88653. */
  88654. _this.type = 'smicisogon';
  88655. if (!_this.refOriginalPosition || _this.refOriginalPosition.length !== 2) {
  88656. _this.refOriginalPosition = [0, 0];
  88657. }
  88658. _this.CLASS_NAME = "SuperMap.LevelRenderer.Shape.SmicIsogon";
  88659. return _this;
  88660. }
  88661. /**
  88662. * @function LevelRenderer.Shape.SmicIsogon.prototype.destroy
  88663. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  88664. */
  88665. SmicIsogon_createClass(SmicIsogon, [{
  88666. key: "destroy",
  88667. value: function destroy() {
  88668. this.type = null;
  88669. SmicIsogon_get(SmicIsogon_getPrototypeOf(SmicIsogon.prototype), "destroy", this).call(this);
  88670. }
  88671. /**
  88672. * @function LevelRenderer.Shape.SmicIsogon.prototype.buildPath
  88673. * @description 创建n角星(n>=3)路径。
  88674. *
  88675. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  88676. * @param {Object} style - style。
  88677. *
  88678. */
  88679. }, {
  88680. key: "buildPath",
  88681. value: function buildPath(ctx, style) {
  88682. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  88683. this.refOriginalPosition = [0, 0];
  88684. }
  88685. var __OP = this.refOriginalPosition;
  88686. var sin = SUtil.Util_math.sin;
  88687. var cos = SUtil.Util_math.cos;
  88688. var PI = Math.PI;
  88689. var n = style.n;
  88690. if (!n || n < 2) {
  88691. return;
  88692. }
  88693. var x = style.x + __OP[0];
  88694. var y = style.y + __OP[1];
  88695. var r = style.r;
  88696. var dStep = 2 * PI / n;
  88697. var deg = -PI / 2;
  88698. var xStart = x + r * cos(deg);
  88699. var yStart = y + r * sin(deg);
  88700. deg += dStep;
  88701. // 记录边界点,用于判断insight
  88702. var pointList = style.pointList = [];
  88703. pointList.push([xStart, yStart]);
  88704. for (var i = 0, end = n - 1; i < end; i++) {
  88705. pointList.push([x + r * cos(deg), y + r * sin(deg)]);
  88706. deg += dStep;
  88707. }
  88708. pointList.push([xStart, yStart]);
  88709. // 绘制
  88710. ctx.moveTo(pointList[0][0], pointList[0][1]);
  88711. for (var _i2 = 0; _i2 < pointList.length; _i2++) {
  88712. ctx.lineTo(pointList[_i2][0], pointList[_i2][1]);
  88713. }
  88714. ctx.closePath();
  88715. return;
  88716. }
  88717. /**
  88718. * @function LevelRenderer.Shape.SmicIsogon.prototype.getRect
  88719. * @description 计算返回正多边形的包围盒矩形。
  88720. *
  88721. * @param {Object} style - style
  88722. * @return {Object} 边框对象。包含属性:x,y,width,height。
  88723. */
  88724. }, {
  88725. key: "getRect",
  88726. value: function getRect(style) {
  88727. if (style.__rect) {
  88728. return style.__rect;
  88729. }
  88730. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  88731. this.refOriginalPosition = [0, 0];
  88732. }
  88733. var __OP = this.refOriginalPosition;
  88734. var lineWidth;
  88735. if (style.brushType == 'stroke' || style.brushType == 'fill') {
  88736. lineWidth = style.lineWidth || 1;
  88737. } else {
  88738. lineWidth = 0;
  88739. }
  88740. style.__rect = {
  88741. x: Math.round(style.x + __OP[0] - style.r - lineWidth / 2),
  88742. y: Math.round(style.y + __OP[1] - style.r - lineWidth / 2),
  88743. width: style.r * 2 + lineWidth,
  88744. height: style.r * 2 + lineWidth
  88745. };
  88746. return style.__rect;
  88747. }
  88748. }]);
  88749. return SmicIsogon;
  88750. }(Shape)));
  88751. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/SmicRing.js
  88752. function SmicRing_typeof(obj) { "@babel/helpers - typeof"; return SmicRing_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, SmicRing_typeof(obj); }
  88753. function SmicRing_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  88754. function SmicRing_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  88755. function SmicRing_createClass(Constructor, protoProps, staticProps) { if (protoProps) SmicRing_defineProperties(Constructor.prototype, protoProps); if (staticProps) SmicRing_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  88756. function SmicRing_get() { if (typeof Reflect !== "undefined" && Reflect.get) { SmicRing_get = Reflect.get.bind(); } else { SmicRing_get = function _get(target, property, receiver) { var base = SmicRing_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return SmicRing_get.apply(this, arguments); }
  88757. function SmicRing_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SmicRing_getPrototypeOf(object); if (object === null) break; } return object; }
  88758. function SmicRing_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) SmicRing_setPrototypeOf(subClass, superClass); }
  88759. function SmicRing_setPrototypeOf(o, p) { SmicRing_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SmicRing_setPrototypeOf(o, p); }
  88760. function SmicRing_createSuper(Derived) { var hasNativeReflectConstruct = SmicRing_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = SmicRing_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = SmicRing_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return SmicRing_possibleConstructorReturn(this, result); }; }
  88761. function SmicRing_possibleConstructorReturn(self, call) { if (call && (SmicRing_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return SmicRing_assertThisInitialized(self); }
  88762. function SmicRing_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  88763. function SmicRing_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  88764. function SmicRing_getPrototypeOf(o) { SmicRing_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SmicRing_getPrototypeOf(o); }
  88765. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  88766. * This program are made available under the terms of the Apache License, Version 2.0
  88767. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  88768. /**
  88769. * @private
  88770. * @class LevelRenderer.Shape.SmicRing
  88771. * @category Visualization Theme
  88772. * @classdesc 圆环。
  88773. * @extends LevelRenderer.Shape
  88774. * @example
  88775. * var shape = new LevelRenderer.Shape.SmicRing({
  88776. * style: {
  88777. * x: 100,
  88778. * y: 100,
  88779. * r0: 30,
  88780. * r: 50
  88781. * }
  88782. * });
  88783. * levelRenderer.addShape(shape);
  88784. * @param {Array} options - shape 的配置(options)项,可以是 shape 的自有属性,也可以是自定义的属性。
  88785. */
  88786. var SmicRing = /*#__PURE__*/(/* unused pure expression or super */ null && (function (_Shape) {
  88787. SmicRing_inherits(SmicRing, _Shape);
  88788. var _super = SmicRing_createSuper(SmicRing);
  88789. function SmicRing(options) {
  88790. var _this;
  88791. SmicRing_classCallCheck(this, SmicRing);
  88792. _this = _super.call(this, options);
  88793. /**
  88794. * @member {string} LevelRenderer.Shape.SmicRing.prototype.type
  88795. * @description 图形类型。
  88796. */
  88797. _this.type = 'smicring';
  88798. if (!_this.refOriginalPosition || _this.refOriginalPosition.length !== 2) {
  88799. _this.refOriginalPosition = [0, 0];
  88800. }
  88801. _this.CLASS_NAME = "SuperMap.LevelRenderer.Shape.SmicRing";
  88802. return _this;
  88803. }
  88804. /**
  88805. * @function LevelRenderer.Shape.SmicRing.prototype.destroy
  88806. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  88807. */
  88808. SmicRing_createClass(SmicRing, [{
  88809. key: "destroy",
  88810. value: function destroy() {
  88811. this.type = null;
  88812. SmicRing_get(SmicRing_getPrototypeOf(SmicRing.prototype), "destroy", this).call(this);
  88813. }
  88814. /**
  88815. * @function LevelRenderer.Shape.SmicRing.prototype.buildPath
  88816. * @description 创建圆环路径。
  88817. *
  88818. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  88819. * @param {Object} style - style。
  88820. *
  88821. */
  88822. }, {
  88823. key: "buildPath",
  88824. value: function buildPath(ctx, style) {
  88825. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  88826. this.refOriginalPosition = [0, 0];
  88827. }
  88828. var __OP = this.refOriginalPosition;
  88829. // 非零环绕填充优化
  88830. ctx.arc(style.x + __OP[0], style.y + __OP[1], style.r, 0, Math.PI * 2, false);
  88831. ctx.moveTo(style.x + __OP[0] + style.r0, style.y + __OP[1]);
  88832. ctx.arc(style.x + __OP[0], style.y + __OP[1], style.r0, 0, Math.PI * 2, true);
  88833. return;
  88834. }
  88835. /**
  88836. * @function LevelRenderer.Shape.SmicRing.prototype.getRect
  88837. * @description 计算返回圆环包围盒矩阵
  88838. *
  88839. * @param {Object} style - style
  88840. * @return {Object} 边框对象。包含属性:x,y,width,height。
  88841. */
  88842. }, {
  88843. key: "getRect",
  88844. value: function getRect(style) {
  88845. if (style.__rect) {
  88846. return style.__rect;
  88847. }
  88848. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  88849. this.refOriginalPosition = [0, 0];
  88850. }
  88851. var __OP = this.refOriginalPosition;
  88852. var lineWidth;
  88853. if (style.brushType == 'stroke' || style.brushType == 'fill') {
  88854. lineWidth = style.lineWidth || 1;
  88855. } else {
  88856. lineWidth = 0;
  88857. }
  88858. style.__rect = {
  88859. x: Math.round(style.x + __OP[0] - style.r - lineWidth / 2),
  88860. y: Math.round(style.y + __OP[1] - style.r - lineWidth / 2),
  88861. width: style.r * 2 + lineWidth,
  88862. height: style.r * 2 + lineWidth
  88863. };
  88864. return style.__rect;
  88865. }
  88866. }]);
  88867. return SmicRing;
  88868. }(Shape)));
  88869. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/SmicStar.js
  88870. function SmicStar_typeof(obj) { "@babel/helpers - typeof"; return SmicStar_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, SmicStar_typeof(obj); }
  88871. function SmicStar_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  88872. function SmicStar_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  88873. function SmicStar_createClass(Constructor, protoProps, staticProps) { if (protoProps) SmicStar_defineProperties(Constructor.prototype, protoProps); if (staticProps) SmicStar_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  88874. function SmicStar_get() { if (typeof Reflect !== "undefined" && Reflect.get) { SmicStar_get = Reflect.get.bind(); } else { SmicStar_get = function _get(target, property, receiver) { var base = SmicStar_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return SmicStar_get.apply(this, arguments); }
  88875. function SmicStar_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SmicStar_getPrototypeOf(object); if (object === null) break; } return object; }
  88876. function SmicStar_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) SmicStar_setPrototypeOf(subClass, superClass); }
  88877. function SmicStar_setPrototypeOf(o, p) { SmicStar_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SmicStar_setPrototypeOf(o, p); }
  88878. function SmicStar_createSuper(Derived) { var hasNativeReflectConstruct = SmicStar_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = SmicStar_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = SmicStar_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return SmicStar_possibleConstructorReturn(this, result); }; }
  88879. function SmicStar_possibleConstructorReturn(self, call) { if (call && (SmicStar_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return SmicStar_assertThisInitialized(self); }
  88880. function SmicStar_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  88881. function SmicStar_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  88882. function SmicStar_getPrototypeOf(o) { SmicStar_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SmicStar_getPrototypeOf(o); }
  88883. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  88884. * This program are made available under the terms of the Apache License, Version 2.0
  88885. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  88886. /**
  88887. * @private
  88888. * @class LevelRenderer.Shape.SmicStar
  88889. * @category Visualization Theme
  88890. * @classdesc n 角星(n>3)。
  88891. * @extends LevelRenderer.Shape
  88892. * @example
  88893. * var shape = new LevelRenderer.Shape.SmicStar({
  88894. * style: {
  88895. * x: 200,
  88896. * y: 100,
  88897. * r: 150,
  88898. * n: 5,
  88899. * text: '五角星'
  88900. * }
  88901. * });
  88902. * levelRenderer.addShape(shape);
  88903. * @param {Array} options - shape 的配置(options)项,可以是 shape 的自有属性,也可以是自定义的属性。
  88904. *
  88905. */
  88906. var SmicStar = /*#__PURE__*/(/* unused pure expression or super */ null && (function (_Shape) {
  88907. SmicStar_inherits(SmicStar, _Shape);
  88908. var _super = SmicStar_createSuper(SmicStar);
  88909. function SmicStar(options) {
  88910. var _this;
  88911. SmicStar_classCallCheck(this, SmicStar);
  88912. _this = _super.call(this, options);
  88913. /**
  88914. * @member {string} LevelRenderer.Shape.SmicStar.prototype.type
  88915. * @description 图形类型。
  88916. */
  88917. _this.type = 'smicstar';
  88918. if (!_this.refOriginalPosition || _this.refOriginalPosition.length !== 2) {
  88919. _this.refOriginalPosition = [0, 0];
  88920. }
  88921. _this.CLASS_NAME = "SuperMap.LevelRenderer.Shape.SmicStar";
  88922. return _this;
  88923. }
  88924. /**
  88925. * @function LevelRenderer.Shape.SmicStar.prototype.destroy
  88926. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  88927. */
  88928. SmicStar_createClass(SmicStar, [{
  88929. key: "destroy",
  88930. value: function destroy() {
  88931. this.type = null;
  88932. SmicStar_get(SmicStar_getPrototypeOf(SmicStar.prototype), "destroy", this).call(this);
  88933. }
  88934. /**
  88935. * @function LevelRenderer.Shape.SmicStar.prototype.buildPath
  88936. * @description 创建n 角星(n>3)路径。
  88937. *
  88938. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  88939. * @param {Object} style - style。
  88940. *
  88941. */
  88942. }, {
  88943. key: "buildPath",
  88944. value: function buildPath(ctx, style) {
  88945. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  88946. this.refOriginalPosition = [0, 0];
  88947. }
  88948. var __OP = this.refOriginalPosition;
  88949. var n = style.n;
  88950. if (!n || n < 2) {
  88951. return;
  88952. }
  88953. var sin = SUtil.Util_math.sin;
  88954. var cos = SUtil.Util_math.cos;
  88955. var PI = Math.PI;
  88956. var x = style.x + __OP[0];
  88957. var y = style.y + __OP[1];
  88958. var r = style.r;
  88959. var r0 = style.r0;
  88960. // 如果未指定内部顶点外接圆半径,则自动计算
  88961. if (r0 == null) {
  88962. r0 = n > 4
  88963. // 相隔的外部顶点的连线的交点,
  88964. // 被取为内部交点,以此计算r0
  88965. ? r * cos(2 * PI / n) / cos(PI / n)
  88966. // 二三四角星的特殊处理
  88967. : r / 3;
  88968. }
  88969. var dStep = PI / n;
  88970. var deg = -PI / 2;
  88971. var xStart = x + r * cos(deg);
  88972. var yStart = y + r * sin(deg);
  88973. deg += dStep;
  88974. // 记录边界点,用于判断inside
  88975. var pointList = style.pointList = [];
  88976. pointList.push([xStart, yStart]);
  88977. for (var i = 0, end = n * 2 - 1, ri; i < end; i++) {
  88978. ri = i % 2 === 0 ? r0 : r;
  88979. pointList.push([x + ri * cos(deg), y + ri * sin(deg)]);
  88980. deg += dStep;
  88981. }
  88982. pointList.push([xStart, yStart]);
  88983. // 绘制
  88984. ctx.moveTo(pointList[0][0], pointList[0][1]);
  88985. for (var _i2 = 0; _i2 < pointList.length; _i2++) {
  88986. ctx.lineTo(pointList[_i2][0], pointList[_i2][1]);
  88987. }
  88988. ctx.closePath();
  88989. return;
  88990. }
  88991. /**
  88992. * @function LevelRenderer.Shape.SmicStar.prototype.getRect
  88993. * @description 返回 n 角星包围盒矩形。
  88994. *
  88995. * @param {Object} style - style
  88996. * @return {Object} 边框对象。包含属性:x,y,width,height。
  88997. */
  88998. }, {
  88999. key: "getRect",
  89000. value: function getRect(style) {
  89001. if (style.__rect) {
  89002. return style.__rect;
  89003. }
  89004. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  89005. this.refOriginalPosition = [0, 0];
  89006. }
  89007. var __OP = this.refOriginalPosition;
  89008. var lineWidth;
  89009. if (style.brushType == 'stroke' || style.brushType == 'fill') {
  89010. lineWidth = style.lineWidth || 1;
  89011. } else {
  89012. lineWidth = 0;
  89013. }
  89014. style.__rect = {
  89015. x: Math.round(style.x + __OP[0] - style.r - lineWidth / 2),
  89016. y: Math.round(style.y + __OP[1] - style.r - lineWidth / 2),
  89017. width: style.r * 2 + lineWidth,
  89018. height: style.r * 2 + lineWidth
  89019. };
  89020. return style.__rect;
  89021. }
  89022. }]);
  89023. return SmicStar;
  89024. }(Shape)));
  89025. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/index.js
  89026. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  89027. * This program are made available under the terms of the Apache License, Version 2.0
  89028. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  89029. ;// CONCATENATED MODULE: ./src/common/overlay/index.js
  89030. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  89031. * This program are made available under the terms of the Apache License, Version 2.0
  89032. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  89033. ;// CONCATENATED MODULE: ./src/common/components/CommonTypes.js
  89034. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  89035. * This program are made available under the terms of the Apache License, Version 2.0
  89036. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  89037. /**
  89038. * @description 该文件用于存储一些公用常量
  89039. * @private
  89040. */
  89041. var CommonTypes_FileTypes = {
  89042. EXCEL: "EXCEL",
  89043. CSV: "CSV",
  89044. ISERVER: "ISERVER",
  89045. GEOJSON: "GEOJSON",
  89046. JSON: 'JSON'
  89047. };
  89048. var CommonTypes_FileConfig = {
  89049. fileMaxSize: 10 * 1024 * 1024
  89050. };
  89051. ;// CONCATENATED MODULE: ./src/common/components/openfile/FileModel.js
  89052. function FileModel_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  89053. function FileModel_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  89054. function FileModel_createClass(Constructor, protoProps, staticProps) { if (protoProps) FileModel_defineProperties(Constructor.prototype, protoProps); if (staticProps) FileModel_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  89055. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  89056. * This program are made available under the terms of the Apache License, Version 2.0
  89057. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  89058. /**
  89059. * @class FileModel
  89060. * @deprecatedclass SuperMap.FileModel
  89061. * @description 文件数据组件数据模型,用于存储一些文件数据或状态,todo 结构待完善
  89062. * @category Components OpenFile
  89063. * @private
  89064. */
  89065. var FileModel = /*#__PURE__*/(/* unused pure expression or super */ null && (function () {
  89066. function FileModel(options) {
  89067. FileModel_classCallCheck(this, FileModel);
  89068. this.FileTypes = FileTypes;
  89069. this.FileConfig = FileConfig;
  89070. this.loadFileObject = options && options.loadFileObject ? options.loadFileObject : [];
  89071. }
  89072. /**
  89073. * @function FileModel.prototype.set
  89074. * @description 设置属性值
  89075. * @param {string} key - 属性名称
  89076. * @param {string|Object} value - 属性值
  89077. */
  89078. FileModel_createClass(FileModel, [{
  89079. key: "set",
  89080. value: function set(key, value) {
  89081. this[key] = value;
  89082. }
  89083. /**
  89084. * @function FileModel.prototype.get
  89085. * @description 获取数据值
  89086. * @param {string} key - 属性名称
  89087. * @returns {string|Object} value - 返回属性值
  89088. */
  89089. }, {
  89090. key: "get",
  89091. value: function get(key) {
  89092. return this[key];
  89093. }
  89094. }]);
  89095. return FileModel;
  89096. }()));
  89097. ;// CONCATENATED MODULE: ./src/common/components/messagebox/MessageBox.js
  89098. function MessageBox_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  89099. function MessageBox_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  89100. function MessageBox_createClass(Constructor, protoProps, staticProps) { if (protoProps) MessageBox_defineProperties(Constructor.prototype, protoProps); if (staticProps) MessageBox_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  89101. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  89102. * This program are made available under the terms of the Apache License, Version 2.0
  89103. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  89104. /**
  89105. * @class MessageBox
  89106. * @aliasclass Components.MessageBox
  89107. * @deprecatedclass SuperMap.Components.MessageBox
  89108. * @version 9.1.1
  89109. * @classdesc 组件信息提示框。
  89110. * @category Components Common
  89111. * @usage
  89112. */
  89113. var MessageBox = /*#__PURE__*/function () {
  89114. function MessageBox() {
  89115. MessageBox_classCallCheck(this, MessageBox);
  89116. this._initView();
  89117. }
  89118. MessageBox_createClass(MessageBox, [{
  89119. key: "_initView",
  89120. value: function _initView() {
  89121. //原生js形式
  89122. var messageBoxContainer = document.createElement("div");
  89123. messageBoxContainer.hidden = true;
  89124. messageBoxContainer.setAttribute("class", "component-messageboxcontainer component-border-bottom-orange");
  89125. //图标
  89126. var iconContainer = document.createElement("div");
  89127. iconContainer.setAttribute("class", "icon");
  89128. this.icon = document.createElement("span");
  89129. this.icon.setAttribute("class", "supermapol-icons-message-warning");
  89130. iconContainer.appendChild(this.icon);
  89131. messageBoxContainer.appendChild(iconContainer);
  89132. //内容:
  89133. var messageBox = document.createElement("div");
  89134. messageBox.setAttribute("class", "component-messagebox");
  89135. messageBox.innerHTML = "";
  89136. messageBoxContainer.appendChild(messageBox);
  89137. this.messageBox = messageBox;
  89138. //关闭按钮
  89139. var cancelContainer = document.createElement("div");
  89140. cancelContainer.setAttribute("class", "component-messagebox__cancelbtncontainer");
  89141. var cancelBtn = document.createElement("button");
  89142. cancelBtn.setAttribute("class", "component-messagebox__cancelBtn");
  89143. cancelBtn.innerHTML = "x";
  89144. cancelBtn.onclick = this.closeView.bind(this);
  89145. cancelContainer.appendChild(cancelBtn);
  89146. messageBoxContainer.appendChild(cancelContainer);
  89147. this.messageBoxContainer = messageBoxContainer;
  89148. document.body.appendChild(this.messageBoxContainer);
  89149. }
  89150. /**
  89151. * @function MessageBox.prototype.closeView
  89152. * @description 关闭提示框。
  89153. */
  89154. }, {
  89155. key: "closeView",
  89156. value: function closeView() {
  89157. this.messageBoxContainer.hidden = true;
  89158. }
  89159. /**
  89160. * @function MessageBox.prototype.showView
  89161. * @description 显示提示框。
  89162. * @param {string} message - 提示框显示内容。
  89163. * @param {string}[type="warring"] 提示框类型,如 "warring", "failure", "success"。
  89164. */
  89165. }, {
  89166. key: "showView",
  89167. value: function showView(message) {
  89168. var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'warring';
  89169. //设置提示框的样式:
  89170. if (type === "success") {
  89171. this.icon.setAttribute("class", "supermapol-icons-message-success");
  89172. this.messageBoxContainer.setAttribute("class", "component-messageboxcontainer component-border-bottom-green");
  89173. } else if (type === "failure") {
  89174. this.icon.setAttribute("class", "supermapol-icons-message-failure");
  89175. this.messageBoxContainer.setAttribute("class", "component-messageboxcontainer component-border-bottom-red");
  89176. } else if (type === "warring") {
  89177. this.icon.setAttribute("class", "supermapol-icons-message-warning");
  89178. this.messageBoxContainer.setAttribute("class", "component-messageboxcontainer component-border-bottom-orange");
  89179. }
  89180. this.messageBox.innerHTML = message;
  89181. this.messageBoxContainer.hidden = false;
  89182. }
  89183. }]);
  89184. return MessageBox;
  89185. }();
  89186. ;// CONCATENATED MODULE: external "function(){try{return echarts}catch(e){return {}}}()"
  89187. var external_function_try_return_echarts_catch_e_return_namespaceObject = function(){try{return echarts}catch(e){return {}}}();
  89188. ;// CONCATENATED MODULE: ./src/common/lang/locales/en-US.js
  89189. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  89190. * This program are made available under the terms of the Apache License, Version 2.0
  89191. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  89192. /**
  89193. * Namespace: SuperMap.Lang["en"]
  89194. * Dictionary for English. Keys for entries are used in calls to
  89195. * <SuperMap.Lang.translate>. Entry bodies are normal strings or
  89196. * strings formatted for use with <SuperMap.String.format> calls.
  89197. */
  89198. var en = {
  89199. 'title_dataFlowService': 'Data Flow Service',
  89200. 'title_distributedAnalysis': 'Distributed Analysis',
  89201. 'title_clientComputing': 'Client Computing',
  89202. 'title_dataServiceQuery': 'Data Service Query',
  89203. 'title_searchCity': 'Search city',
  89204. 'title_searchLayer': ' Search layer',
  89205. 'text_input_value_inputDataFlowUrl': 'Please enter the data stream service address such as: ws://{serviceRoot}/{dataFlowName}/dataflow/subscribe',
  89206. 'text_displayFeaturesInfo': 'Display feature information',
  89207. 'text_subscribe': 'subscribe',
  89208. 'text_cancelSubscribe': 'unsubscribe',
  89209. 'text_densityAnalysis': 'Density Analysis',
  89210. 'text_CalculateTheValuePerUnitArea': 'Calculate the value per unit area within the neighborhood shape',
  89211. 'text_option_selectDataset': 'Please select a dataset',
  89212. 'text_label_dataset': 'Dataset',
  89213. 'text_option_simplePointDensityAnalysis': 'Simple point density analysis',
  89214. 'text_option_nuclearDensityAnalysis': 'Nuclear density analysis',
  89215. 'text_label_analyticalMethod': 'Analytical method',
  89216. 'text_option_quadrilateral': 'Quadrilateral',
  89217. 'text_option_hexagon': 'hexagon',
  89218. 'text_label_meshType': 'Mesh type',
  89219. 'text_option_notSet': 'Not set',
  89220. 'text_label_weightField': 'Weight field',
  89221. 'text_label_gridSizeInMeters': 'Grid size',
  89222. 'text_label_searchRadius': 'Search radius',
  89223. 'text_label_queryRange': 'Scope of analysis',
  89224. 'text_label_areaUnit': 'Area unit',
  89225. 'text_option_equidistantSegmentation': 'Equidistant segmentation',
  89226. 'text_option_logarithm': 'Logarithm',
  89227. 'text_option_equalCountingSegment': 'Equal counting segment',
  89228. 'text_option_squareRootSegmentation': 'Square root segmentation',
  89229. 'text_label_thematicMapSegmentationMode': 'Thematic map segmentation mode',
  89230. 'text_label_thematicMapSegmentationParameters': 'Thematic map segmentation parameters',
  89231. 'text_option_greenOrangePurpleGradient': 'Green orange purple gradient',
  89232. 'text_option_greenOrangeRedGradient': 'Green orange red gradient',
  89233. 'text_option_rainbowGradient': 'Rainbow gradient',
  89234. 'text_option_spectralGradient': 'Spectral gradient',
  89235. 'text_option_terrainGradient': 'Terrain gradient',
  89236. 'text_label_thematicMapColorGradientMode': 'Thematic map color gradient mode',
  89237. 'text_label_resultLayerName': 'Result layer name',
  89238. 'text_chooseFile': 'Open File',
  89239. 'text_isoline': 'Isoline',
  89240. 'text_extractDiscreteValue': 'Extract discrete value generation curve',
  89241. 'text_buffer': 'Buffer',
  89242. 'text_specifyTheDistance': 'Specify the distance to create the surrounding area',
  89243. 'text_label_analysisLayer': 'Analysis layer',
  89244. 'text_label_extractField': 'Extract field',
  89245. 'text_label_extractedValue': 'Extracted value',
  89246. 'text_label_distanceAttenuation': 'Distance attenuation',
  89247. 'text_label_gridSize': 'gridSize',
  89248. 'text_label_bufferRadius': 'Buffer radius',
  89249. 'text_label_defaultkilometers': 'Default 10 kilometers',
  89250. 'text_label_kilometer': 'kilometer',
  89251. 'text_label_unit': 'unit',
  89252. 'text_retainOriginal': 'Retain original object field',
  89253. 'text_mergeBuffer': 'Merge buffer',
  89254. 'text_label_color': 'Color',
  89255. 'text_label_buffer': '[Buffer]',
  89256. 'text_label_isolines': '[Isolines]',
  89257. 'text_label_queryRangeTips': 'The default is the full range of input data. Example: -74.050, 40.650, -73.850, 40.850',
  89258. 'text_label_queryModel': 'Query mode',
  89259. 'text_label_IDArrayOfFeatures': 'ID array of features',
  89260. 'text_label_maxFeatures': 'The maximum number of features that can be returned',
  89261. 'text_label_bufferDistance': 'Buffer distance',
  89262. 'text_label_queryRange1': 'Query range',
  89263. 'text_label_spatialQueryMode': 'Spatial query mode',
  89264. 'text_label_featureFilter': 'Feature filter',
  89265. 'text_label_geometricObject': 'Geometric object',
  89266. 'text_label_queryMode': 'Query mode',
  89267. 'text_label_searchTips': 'Search for city locations or layer features',
  89268. 'text_label_chooseSearchLayers': 'Select a query layer',
  89269. 'text_loadSearchCriteria': 'Load search criteria',
  89270. 'text_saveSearchCriteria': 'Save search criteria',
  89271. "btn_analyze": "Analyze",
  89272. "btn_analyzing": "Analyzing",
  89273. "btn_emptyTheAnalysisLayer": "Empty the analysis layer",
  89274. "btn_cancelAnalysis": "Cancel",
  89275. "btn_query": "Query",
  89276. "btn_querying": "Querying",
  89277. "btn_emptyTheRresultLayer": "Clear all result layers",
  89278. 'msg_dataReturnedIsEmpty.': 'The request is successful and the data returned by the query is empty.',
  89279. 'msg_dataFlowServiceHasBeenSubscribed': 'The data stream service has been subscribed to.',
  89280. 'msg_inputDataFlowUrlFirst': 'Please enter the data stream service address first.',
  89281. 'msg_datasetOrMethodUnsupport': 'This dataset does not support this analysis type. Please reselect the dataset.',
  89282. 'msg_selectDataset': 'Please select a data set!',
  89283. 'msg_setTheWeightField': 'Please set the weight field!',
  89284. 'msg_theFieldNotSupportAnalysis': 'The field you currently select does not support analysis!',
  89285. 'msg_resultIsEmpty': 'The result of the analysis is empty!',
  89286. 'msg_openFileFail': 'Failed to open file!',
  89287. 'msg_fileTypeUnsupported': 'File format is not supported!',
  89288. 'msg_fileSizeExceeded': 'File size exceeded! The file size should not exceed 10M!',
  89289. 'msg_dataInWrongGeoJSONFormat': 'Wrong data format! Non standard GEOJSON format data!',
  89290. 'msg_dataInWrongFormat': 'Wrong data format! Non standard EXCEL, CSV or GEOJSON format data!',
  89291. 'msg_searchKeywords': "Search keywords cannot be empty. Please enter your search criteria.",
  89292. 'msg_searchGeocodeField': "Did not match the address matching service data!",
  89293. 'msg_cityGeocodeField': "The address matching service of the current city is not configured.",
  89294. 'msg_getFeatureField': "No related vector features found!",
  89295. 'msg_dataflowservicesubscribed': 'The data stream service has been subscribed to.',
  89296. 'msg_subscribesucceeded': 'The data stream service subscription was successful.',
  89297. 'msg_crsunsupport': 'Does not support the coordinate system of the current map',
  89298. 'msg_tilematrixsetunsupport': 'Incoming TileMatrixSet is not supported',
  89299. 'msg_jsonResolveFiled': 'JSON format parsing failure!',
  89300. 'msg_requestContentFiled': 'Failed to request data through iportal!',
  89301. 'msg_getdatafailed': 'Failed to get data!'
  89302. };
  89303. ;// CONCATENATED MODULE: ./src/common/lang/locales/zh-CN.js
  89304. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  89305. * This program are made available under the terms of the Apache License, Version 2.0
  89306. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  89307. /**
  89308. * Namespace: SuperMap.Lang["zh-CN"]
  89309. * Dictionary for Simplified Chinese. Keys for entries are used in calls to
  89310. * <SuperMap.Lang.translate>. Entry bodies are normal strings or
  89311. * strings formatted for use with <SuperMap.String.format> calls.
  89312. */
  89313. var zh = {
  89314. 'title_dataFlowService': '数据流服务',
  89315. 'title_distributedAnalysis': '分布式分析',
  89316. 'title_clientComputing': '客户端计算',
  89317. 'title_dataServiceQuery': '数据服务查询',
  89318. 'title_searchCity': '搜索城市',
  89319. 'title_searchLayer': '搜索图层',
  89320. 'text_input_value_inputDataFlowUrl': '请输入数据流服务地址如:ws://{serviceRoot}/{dataFlowName}/dataflow/subscribe',
  89321. 'text_displayFeaturesInfo': '显示要素信息',
  89322. 'text_subscribe': '订阅',
  89323. 'text_cancelSubscribe': '取消订阅',
  89324. 'text_densityAnalysis': '密度分析',
  89325. 'text_CalculateTheValuePerUnitArea': '计算点指定邻域形状内的每单位面积量值',
  89326. 'text_option_selectDataset': '请选择数据集',
  89327. 'text_label_dataset': '数据集',
  89328. 'text_option_simplePointDensityAnalysis': '简单点密度分析',
  89329. 'text_option_nuclearDensityAnalysis': '核密度分析',
  89330. 'text_label_analyticalMethod': '分析方法',
  89331. 'text_option_quadrilateral': '四边形',
  89332. 'text_option_hexagon': '六边形',
  89333. 'text_label_meshType': '网格面类型',
  89334. 'text_option_notSet': '未设置',
  89335. 'text_label_weightField': '权重字段',
  89336. 'text_label_gridSizeInMeters': '网格大小',
  89337. 'text_label_searchRadius': '搜索半径',
  89338. 'text_label_queryRange': '分析范围',
  89339. 'text_label_areaUnit': '面积单位',
  89340. 'text_option_equidistantSegmentation': '等距离分段',
  89341. 'text_option_logarithm': '对数',
  89342. 'text_option_equalCountingSegment': '等计数分段',
  89343. 'text_option_squareRootSegmentation': '平方根分段',
  89344. 'text_label_thematicMapSegmentationMode': '专题图分段模式',
  89345. 'text_label_thematicMapSegmentationParameters': '专题图分段参数',
  89346. 'text_option_greenOrangePurpleGradient': '绿橙紫渐变',
  89347. 'text_option_greenOrangeRedGradient': '绿橙红渐变',
  89348. 'text_option_rainbowGradient': '彩虹渐变',
  89349. 'text_option_spectralGradient': '光谱渐变',
  89350. 'text_option_terrainGradient': '地形渐变',
  89351. 'text_label_thematicMapColorGradientMode': '专题图颜色渐变模式',
  89352. 'text_label_resultLayerName': '结果图层名称',
  89353. 'text_chooseFile': '选择文件',
  89354. 'text_isoline': '等值线',
  89355. 'text_extractDiscreteValue': '提取离散值生成曲线',
  89356. 'text_buffer': '缓冲区',
  89357. 'text_specifyTheDistance': '指定距离创建周边区域',
  89358. 'text_label_analysisLayer': '分析图层',
  89359. 'text_label_extractField': '提取字段',
  89360. 'text_label_extractedValue': '提取值',
  89361. 'text_label_distanceAttenuation': '距离衰减',
  89362. 'text_label_gridSize': '栅格大小',
  89363. 'text_label_bufferRadius': '缓冲半径',
  89364. 'text_label_defaultkilometers': '默认10千米',
  89365. 'text_option_kilometer': '千米',
  89366. 'text_label_unit': '单位',
  89367. 'text_retainOriginal': '保留原对象字段属性',
  89368. 'text_mergeBuffer': '合并缓冲区',
  89369. 'text_label_color': '颜色',
  89370. 'text_label_buffer': '[缓冲区]',
  89371. 'text_label_isolines': '[等值线]',
  89372. 'text_label_queryRangeTips': '默认为输入数据的全幅范围。范例:-74.050,40.650,-73.850,40.850',
  89373. 'text_label_IDArrayOfFeatures': '要素 ID 数组',
  89374. 'text_label_maxFeatures': '最多可返回的要素数量',
  89375. 'text_label_bufferDistance': '缓冲区距离',
  89376. 'text_label_queryRange1': '查询范围',
  89377. 'text_label_spatialQueryMode': '空间查询模式',
  89378. 'text_label_featureFilter': '要素过滤器',
  89379. 'text_label_geometricObject': '几何对象',
  89380. 'text_label_queryMode': '查询模式',
  89381. 'text_label_searchTips': '搜索城市地点或图层要素',
  89382. 'text_label_chooseSearchLayers': '选择查询图层',
  89383. 'text_loadSearchCriteria': '加载搜索条件',
  89384. 'text_saveSearchCriteria': '保存搜索条件',
  89385. "btn_analyze": "分析",
  89386. "btn_analyzing": "分析中",
  89387. "btn_emptyTheAnalysisLayer": "清空分析图层",
  89388. "btn_cancelAnalysis": "取消",
  89389. "btn_query": "查询",
  89390. "btn_querying": "查询中",
  89391. "btn_emptyTheRresultLayer": "清除所有结果图层",
  89392. 'msg_dataFlowServiceHasBeenSubscribed': '已订阅该数据流服务。',
  89393. 'msg_inputDataFlowUrlFirst': '请先输入数据流服务地址。',
  89394. 'msg_datasetOrMethodUnsupport': '该数据集不支持本分析类型,请重新选择数据集',
  89395. 'msg_selectDataset': '请选择数据集!',
  89396. 'msg_setTheWeightField': '请设置权重字段!',
  89397. 'msg_theFieldNotSupportAnalysis': '您当前选择的字段不支持分析!',
  89398. 'msg_resultIsEmpty': '分析的结果为空!',
  89399. 'msg_dataReturnedIsEmpty': '请求成功,查询返回的数据为空。',
  89400. 'msg_openFileFail': '打开文件失败!',
  89401. 'msg_fileTypeUnsupported': '不支持该文件格式!',
  89402. 'msg_fileSizeExceeded': '文件大小超限!文件大小不得超过 10M!',
  89403. 'msg_dataInWrongGeoJSONFormat': '数据格式错误!非标准的 GEOJSON 格式数据!',
  89404. 'msg_dataInWrongFormat': '数据格式错误!非标准的 EXCEL, CSV 或 GEOJSON 格式数据!',
  89405. 'msg_searchKeywords': "搜索关键字不能为空,请输入搜索条件。",
  89406. 'msg_searchGeocodeField': "未匹配到地址匹配服务数据!",
  89407. 'msg_cityGeocodeField': "未配置当前城市的地址匹配服务。",
  89408. 'msg_getFeatureField': "未查找到相关矢量要素!",
  89409. 'msg_dataflowservicesubscribed': '已订阅该数据流服务。',
  89410. 'msg_subscribesucceeded': '数据流服务订阅成功。',
  89411. 'msg_crsunsupport': '不支持当前地图的坐标系',
  89412. 'msg_tilematrixsetunsupport': '不支持传入的TileMatrixSet',
  89413. 'msg_jsonResolveFiled': 'json格式解析失败!',
  89414. 'msg_requestContentFiled': '通过iportal请求数据失败!',
  89415. 'msg_getdatafailed': '获取数据失败!'
  89416. };
  89417. ;// CONCATENATED MODULE: ./src/common/lang/Lang.js
  89418. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  89419. * This program are made available under the terms of the Apache License, Version 2.0
  89420. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  89421. /**
  89422. * @name Lang
  89423. * @namespace
  89424. * @category BaseTypes Internationalization
  89425. * @description 国际化的命名空间,包含多种语言和方法库来设置和获取当前的语言。
  89426. * @usage
  89427. * ```
  89428. * // 浏览器
  89429. * <script type="text/javascript" src="{cdn}"></script>
  89430. * <script>
  89431. * const result = {namespace}.Lang.getCode();
  89432. *
  89433. * // 弃用的写法
  89434. * const result = SuperMap.Lang.getCode();
  89435. *
  89436. * </script>
  89437. *
  89438. * // ES6 Import
  89439. * import { Lang } from '{npm}';
  89440. *
  89441. * const result = Lang.getCode();
  89442. *
  89443. * ```
  89444. */
  89445. var Lang = {
  89446. 'en-US': en,
  89447. "zh-CN": zh,
  89448. /**
  89449. * @member {string} Lang.code
  89450. * @description 当前所使用的语言类型。
  89451. */
  89452. code: null,
  89453. /**
  89454. * @member {string} [Lang.defaultCode='en-US']
  89455. * @description 默认使用的语言类型。
  89456. */
  89457. defaultCode: "en-US",
  89458. /**
  89459. * @function Lang.getCode
  89460. * @description 获取当前的语言代码。
  89461. * @returns {string} 当前的语言代码。
  89462. */
  89463. getCode: function getCode() {
  89464. if (!Lang.code) {
  89465. Lang.setCode();
  89466. }
  89467. return Lang.code;
  89468. },
  89469. /**
  89470. * @function Lang.setCode
  89471. * @description 设置语言代码。
  89472. * @param {string} code - 此参数遵循IETF规范。
  89473. */
  89474. setCode: function setCode() {
  89475. var lang = this.getLanguageFromCookie();
  89476. if (!lang) {
  89477. lang = Lang.defaultCode;
  89478. if (navigator.appName === 'Netscape') {
  89479. lang = navigator.language;
  89480. } else {
  89481. lang = navigator.browserLanguage;
  89482. }
  89483. }
  89484. if (lang.indexOf('zh') === 0) {
  89485. lang = 'zh-CN';
  89486. }
  89487. if (lang.indexOf('en') === 0) {
  89488. lang = 'en-US';
  89489. }
  89490. Lang.code = lang;
  89491. },
  89492. /**
  89493. * @function Lang.getLanguageFromCookie
  89494. * @description 从 cookie 中获取语言类型。
  89495. */
  89496. getLanguageFromCookie: function getLanguageFromCookie() {
  89497. var name = 'language=';
  89498. var ca = document.cookie.split(';');
  89499. for (var i = 0; i < ca.length; i++) {
  89500. var c = ca[i];
  89501. while (c.charAt(0) === ' ') {
  89502. c = c.substring(1);
  89503. }
  89504. if (c.indexOf(name) !== -1) {
  89505. return c.substring(name.length, c.length);
  89506. }
  89507. }
  89508. return "";
  89509. },
  89510. /**
  89511. * @function Lang.i18n
  89512. * @description 从当前语言字符串的字典查找 key。
  89513. * @param {string} key - 字典中 i18n 字符串值的关键字。
  89514. * @returns {string} 国际化的字符串。
  89515. */
  89516. i18n: function i18n(key) {
  89517. var dictionary = Lang[Lang.getCode()];
  89518. var message = dictionary && dictionary[key];
  89519. if (!message) {
  89520. // Message not found, fall back to message key
  89521. message = key;
  89522. }
  89523. return message;
  89524. }
  89525. };
  89526. ;// CONCATENATED MODULE: external "function(){try{return XLSX}catch(e){return {}}}()"
  89527. var external_function_try_return_XLSX_catch_e_return_namespaceObject = function(){try{return XLSX}catch(e){return {}}}();
  89528. ;// CONCATENATED MODULE: ./src/common/components/util/FileReaderUtil.js
  89529. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  89530. * This program are made available under the terms of the Apache License, Version 2.0
  89531. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  89532. /**
  89533. * @name FileReaderUtil
  89534. * @namespace
  89535. * @category Components OpenFile
  89536. * @description 组件读取文件工具类。
  89537. * @version 9.1.1
  89538. * @type {{rABS: (boolean|*), rABF: (boolean|*), rAT: (boolean|*), readFile: (function(*, *=, *=, *=, *=)), readTextFile: (function(*, *=, *=, *=)), readXLSXFile: (function(*, *=, *=, *=)), processDataToGeoJson: (function(string, Object): GeoJSONObject), processExcelDataToGeoJson: (function(Object): GeoJSONObject), isXField: (function(*)), isYField: (function(*)), string2Csv: (function(*, *=))}}
  89539. * @usage
  89540. * ```
  89541. * // 浏览器
  89542. * <script type="text/javascript" src="{cdn}"></script>
  89543. * <script>
  89544. * const result = {namespace}.Components.FileReaderUtil.isXField(data);
  89545. *
  89546. * // 弃用的写法
  89547. * const result = SuperMap.Components.FileReaderUtil.isXField(data);
  89548. *
  89549. * </script>
  89550. *
  89551. * // ES6 Import
  89552. * import { FileReaderUtil } from '{npm}';
  89553. *
  89554. * const result = FileReaderUtil.isXField(data);
  89555. * ```
  89556. */
  89557. var FileReaderUtil = {
  89558. rABS: typeof FileReader !== 'undefined' && FileReader.prototype && FileReader.prototype.readAsBinaryString,
  89559. rABF: typeof FileReader !== 'undefined' && FileReader.prototype && FileReader.prototype.readAsArrayBuffer,
  89560. rAT: typeof FileReader !== 'undefined' && FileReader.prototype && FileReader.prototype.readAsText,
  89561. /**
  89562. * @function FileReaderUtil.prototype.readFile
  89563. * @description 读取文件。
  89564. * @param {string} fileType - 当前读取的文件类型。
  89565. *
  89566. * @param {Object} file - 读取回来的文件内容对象。
  89567. * @param {function} success - 读取文件成功回调函数。
  89568. * @param {function} failed - 读取文件失败回调函数。
  89569. * @param {Object} context - 回调重定向对象。
  89570. */
  89571. readFile: function readFile(fileType, file, success, failed, context) {
  89572. if (CommonTypes_FileTypes.JSON === fileType || CommonTypes_FileTypes.GEOJSON === fileType) {
  89573. this.readTextFile(file, success, failed, context);
  89574. } else if (CommonTypes_FileTypes.EXCEL === fileType || CommonTypes_FileTypes.CSV === fileType) {
  89575. this.readXLSXFile(file, success, failed, context);
  89576. }
  89577. },
  89578. /**
  89579. * @description 读取文本文件。
  89580. * @param {Object} file 文件内容对象。
  89581. * @param {function} success 读取文件成功回调函数。
  89582. * @param {function} failed 读取文件失败回调函数。
  89583. * @param {Object} context - 回调重定向对象。
  89584. */
  89585. readTextFile: function readTextFile(file, success, failed, context) {
  89586. var reader = new FileReader();
  89587. reader.onloadend = function (evt) {
  89588. success && success.call(context, evt.target.result);
  89589. };
  89590. reader.onerror = function (error) {
  89591. failed && failed.call(context, error);
  89592. };
  89593. this.rAT ? reader.readAsText(file.file, 'utf-8') : reader.readAsBinaryString(file.file);
  89594. },
  89595. /**
  89596. * @description 读取excel或csv文件。
  89597. * @param {Object} file 文件内容对象。
  89598. * @param {function} success 读取文件成功回调函数。
  89599. * @param {function} failed 读取文件失败回调函数。
  89600. * @param {Object} context - 回调重定向对象。
  89601. */
  89602. readXLSXFile: function readXLSXFile(file, success, failed, context) {
  89603. var reader = new FileReader();
  89604. reader.onloadend = function (evt) {
  89605. var xLSXData = new Uint8Array(evt.target.result);
  89606. var workbook = external_function_try_return_XLSX_catch_e_return_namespaceObject.read(xLSXData, {
  89607. type: "array"
  89608. });
  89609. try {
  89610. if (workbook && workbook.SheetNames && workbook.SheetNames.length > 0) {
  89611. //暂时只读取第一个sheets的内容
  89612. var sheetName = workbook.SheetNames[0];
  89613. var xLSXCSVString = external_function_try_return_XLSX_catch_e_return_namespaceObject.utils.sheet_to_csv(workbook.Sheets[sheetName]);
  89614. success && success.call(context, xLSXCSVString);
  89615. }
  89616. } catch (error) {
  89617. failed && failed.call(context, error);
  89618. }
  89619. };
  89620. reader.onerror = function (error) {
  89621. failed && failed.call(context, error);
  89622. };
  89623. this.rABF && reader.readAsArrayBuffer(file.file);
  89624. },
  89625. /**
  89626. * @function FileReaderUtil.prototype.processDataToGeoJson
  89627. * @description 将读取回来得数据统一处理为 GeoJSON 格式。
  89628. * @param {string} type - 文件类型。
  89629. * @param {Object} data - 读取返回的数据对象。
  89630. * @param {function} success - 数据处理成功的回调。
  89631. * @param {function} failed - 数据处理失败的回调。
  89632. * @param {Object} context - 回调重定向对象。
  89633. * @returns {GeoJSONObject} 返回标准 GeoJSON 规范格式数据。
  89634. * @private
  89635. */
  89636. processDataToGeoJson: function processDataToGeoJson(type, data, success, failed, context) {
  89637. var geojson = null;
  89638. if (type === "EXCEL" || type === "CSV") {
  89639. geojson = this.processExcelDataToGeoJson(data);
  89640. success && success.call(context, geojson);
  89641. } else if (type === 'JSON' || type === 'GEOJSON') {
  89642. var result = data;
  89643. //geojson、json未知,通过类容来判断
  89644. if (typeof result === "string") {
  89645. result = JSON.parse(result);
  89646. }
  89647. if (result.type === 'ISERVER') {
  89648. geojson = result.data.recordsets[0].features;
  89649. } else if (result.type === 'FeatureCollection') {
  89650. //geojson
  89651. geojson = result;
  89652. } else {
  89653. //不支持数据
  89654. failed && failed.call(context, Lang.i18n('msg_dataInWrongGeoJSONFormat'));
  89655. }
  89656. success && success.call(context, geojson);
  89657. } else {
  89658. failed && failed.call(context, Lang.i18n('msg_dataInWrongFormat'));
  89659. }
  89660. },
  89661. /**
  89662. * @function FileReaderUtil.prototype.processExcelDataToGeoJson
  89663. * @description 表格文件数据处理。
  89664. * @param {Object} data - 读取的表格文件数据。
  89665. * @returns {GeoJSONObject} 返回标准 GeoJSON 规范格式数据。
  89666. * @private
  89667. */
  89668. processExcelDataToGeoJson: function processExcelDataToGeoJson(data) {
  89669. //处理为对象格式转化
  89670. var dataContent = this.string2Csv(data);
  89671. var fieldCaptions = dataContent.colTitles;
  89672. //位置属性处理
  89673. var xfieldIndex = -1,
  89674. yfieldIndex = -1;
  89675. for (var i = 0, len = fieldCaptions.length; i < len; i++) {
  89676. if (this.isXField(fieldCaptions[i])) {
  89677. xfieldIndex = i;
  89678. }
  89679. if (this.isYField(fieldCaptions[i])) {
  89680. yfieldIndex = i;
  89681. }
  89682. }
  89683. // feature 构建后期支持坐标系 4326/3857
  89684. var features = [];
  89685. for (var _i2 = 0, _len2 = dataContent.rows.length; _i2 < _len2; _i2++) {
  89686. var row = dataContent.rows[_i2];
  89687. //if (featureFrom === "LonLat") {
  89688. var x = Number(row[xfieldIndex]),
  89689. y = Number(row[yfieldIndex]);
  89690. //属性信息
  89691. var attributes = {};
  89692. for (var index in dataContent.colTitles) {
  89693. var key = dataContent.colTitles[index];
  89694. attributes[key] = dataContent.rows[_i2][index];
  89695. }
  89696. //目前csv 只支持处理点,所以先生成点类型的 geojson
  89697. var feature = {
  89698. "type": "Feature",
  89699. "geometry": {
  89700. "type": "Point",
  89701. "coordinates": [x, y]
  89702. },
  89703. "properties": attributes
  89704. };
  89705. features.push(feature);
  89706. }
  89707. return features;
  89708. },
  89709. /**
  89710. * @description 判断是否地理X坐标。
  89711. * @param {string} data 字段名。
  89712. */
  89713. isXField: function isXField(data) {
  89714. var lowerdata = data.toLowerCase();
  89715. return lowerdata === "x" || lowerdata === "smx" || lowerdata === "jd" || lowerdata === "经度" || lowerdata === "东经" || lowerdata === "longitude" || lowerdata === "lot" || lowerdata === "lon" || lowerdata === "lng" || lowerdata === "x坐标";
  89716. },
  89717. /**
  89718. * @description 判断是否地理Y坐标。
  89719. * @param {string} data 字段名。
  89720. */
  89721. isYField: function isYField(data) {
  89722. var lowerdata = data.toLowerCase();
  89723. return lowerdata === "y" || lowerdata === "smy" || lowerdata === "wd" || lowerdata === "纬度" || lowerdata === "北纬" || lowerdata === "latitude" || lowerdata === "lat" || lowerdata === "y坐标";
  89724. },
  89725. /**
  89726. * @description 字符串转为dataEditor 支持的csv格式数据。
  89727. * @param {string} string 待转化的字符串。
  89728. * @param {boolean} withoutTitle 是否需要列标题。
  89729. */
  89730. string2Csv: function string2Csv(string, withoutTitle) {
  89731. // let rows = string.split('\r\n');
  89732. var rows = string.split('\n');
  89733. var result = {};
  89734. if (!withoutTitle) {
  89735. result["colTitles"] = rows[0].split(',');
  89736. } else {
  89737. result["colTitles"] = [];
  89738. }
  89739. result['rows'] = [];
  89740. for (var i = withoutTitle ? 0 : 1; i < rows.length; i++) {
  89741. rows[i] && result['rows'].push(rows[i].split(','));
  89742. }
  89743. return result;
  89744. }
  89745. };
  89746. ;// CONCATENATED MODULE: ./src/common/components/chart/ChartModel.js
  89747. function ChartModel_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  89748. function ChartModel_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  89749. function ChartModel_createClass(Constructor, protoProps, staticProps) { if (protoProps) ChartModel_defineProperties(Constructor.prototype, protoProps); if (staticProps) ChartModel_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  89750. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  89751. * This program are made available under the terms of the Apache License, Version 2.0
  89752. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  89753. /**
  89754. * @class ChartModel
  89755. * @classdesc 图表组件数据模型
  89756. * @private
  89757. * @param {Object} datasets - 数据来源。
  89758. * @category Components Chart
  89759. * @fires ChartModel#getdatafailed
  89760. */
  89761. var ChartModel = /*#__PURE__*/function () {
  89762. function ChartModel(datasets) {
  89763. ChartModel_classCallCheck(this, ChartModel);
  89764. this.datasets = datasets;
  89765. this.EVENT_TYPES = ['getdatafailed'];
  89766. this.events = new Events(this, null, this.EVENT_TYPES);
  89767. }
  89768. /**
  89769. * @private
  89770. * @function ChartModel.prototype.getDatasetInfo
  89771. * @description 获得数据集数据。
  89772. * @param {string} datasetUrl - 数据集资源地址。
  89773. */
  89774. ChartModel_createClass(ChartModel, [{
  89775. key: "getDatasetInfo",
  89776. value: function getDatasetInfo(success) {
  89777. var datasetUrl = this.datasets.url;
  89778. var me = this;
  89779. FetchRequest.get(datasetUrl).then(function (response) {
  89780. return response.json();
  89781. }).then(function (results) {
  89782. if (results.datasetInfo) {
  89783. var datasetInfo = results.datasetInfo;
  89784. me.datasetsInfo = {
  89785. dataSourceName: datasetInfo.dataSourceName,
  89786. datasetName: datasetInfo.name,
  89787. mapName: results.name
  89788. };
  89789. success({
  89790. result: me.datasetsInfo
  89791. });
  89792. }
  89793. })["catch"](function (error) {
  89794. console.log(error);
  89795. me._fireFailedEvent(error);
  89796. });
  89797. }
  89798. /**
  89799. * @private
  89800. * @function ChartModel.prototype.getDataFeatures
  89801. * @description 请求数据集的数据信息
  89802. * @param {Object} results - 数据集信息。
  89803. * @param {function} success - 成功回调函数。
  89804. */
  89805. }, {
  89806. key: "getDataFeatures",
  89807. value: function getDataFeatures(results, success) {
  89808. var datasetsInfo = results.result;
  89809. var getFeatureParam, getFeatureBySQLParams, getFeatureBySQLService;
  89810. var params = {
  89811. name: datasetsInfo.datasetName + '@' + datasetsInfo.dataSourceName
  89812. };
  89813. Object.assign(params, this.datasets.queryInfo);
  89814. getFeatureParam = new FilterParameter(params);
  89815. getFeatureBySQLParams = new GetFeaturesBySQLParameters({
  89816. queryParameter: getFeatureParam,
  89817. datasetNames: [datasetsInfo.dataSourceName + ':' + datasetsInfo.datasetName],
  89818. fromIndex: 0,
  89819. toIndex: 100000
  89820. });
  89821. getFeatureBySQLService = new GetFeaturesBySQLService(datasetsInfo.dataUrl, {
  89822. eventListeners: {
  89823. processCompleted: success,
  89824. processFailed: function processFailed() {}
  89825. }
  89826. });
  89827. getFeatureBySQLService.processAsync(getFeatureBySQLParams);
  89828. }
  89829. /**
  89830. * @private
  89831. * @function ChartModel.prototype.getLayerFeatures
  89832. * @description 请求图层要素的数据信息
  89833. * @param {Object} results - 数据集信息。
  89834. * @param {Callbacks} success - 成功回调函数。
  89835. */
  89836. }, {
  89837. key: "getLayerFeatures",
  89838. value: function getLayerFeatures(results, success) {
  89839. var datasetsInfo = results.result;
  89840. var queryParam, queryBySQLParams, queryBySQLService;
  89841. var params = {
  89842. name: datasetsInfo.mapName
  89843. };
  89844. Object.assign(params, this.datasets.queryInfo);
  89845. queryParam = new FilterParameter(params);
  89846. queryBySQLParams = new QueryBySQLParameters({
  89847. queryParams: [queryParam],
  89848. expectCount: 100000
  89849. });
  89850. queryBySQLService = new QueryBySQLService(datasetsInfo.dataUrl, {
  89851. eventListeners: {
  89852. processCompleted: success,
  89853. processFailed: function processFailed() {}
  89854. }
  89855. });
  89856. queryBySQLService.processAsync(queryBySQLParams);
  89857. }
  89858. /**
  89859. * @private
  89860. * @function ChartModel.prototype.getDataInfoByIptl
  89861. * @description 用dataId获取iportal的数据。
  89862. * @param {Callbacks} success - 成功回调函数。
  89863. *
  89864. */
  89865. }, {
  89866. key: "getDataInfoByIptl",
  89867. value: function getDataInfoByIptl(success) {
  89868. // success是chart的回调
  89869. this.getServiceInfo(this.datasets.url, success);
  89870. }
  89871. /**
  89872. * @private
  89873. * @function ChartModel.prototype.getServiceInfo
  89874. * @description 用iportal获取dataItemServices。
  89875. * @param {string} url
  89876. * @param {Callbacks} success - 成功回调函数。
  89877. * */
  89878. }, {
  89879. key: "getServiceInfo",
  89880. value: function getServiceInfo(url, success) {
  89881. var me = this;
  89882. FetchRequest.get(url, null, {
  89883. withCredentials: this.datasets.withCredentials
  89884. }).then(function (response) {
  89885. return response.json();
  89886. }).then(function (data) {
  89887. if (data.succeed === false) {
  89888. //请求失败
  89889. me._fireFailedEvent(data);
  89890. return;
  89891. }
  89892. // 是否有rest服务
  89893. if (data.dataItemServices && data.dataItemServices.length > 0) {
  89894. var dataItemServices = data.dataItemServices,
  89895. resultData;
  89896. dataItemServices.forEach(function (item) {
  89897. // 如果有restdata并且发布成功,就请求restdata服务
  89898. // 如果有restmap并且发布成功,就请求restmap服务
  89899. // 其他情况就请求iportal/content.json
  89900. if (item.serviceType === 'RESTDATA' && item.serviceStatus === 'PUBLISHED') {
  89901. resultData = item;
  89902. } else if (item.serviceType === 'RESTMAP' && item.serviceStatus === 'PUBLISHED') {
  89903. resultData = item;
  89904. } else {
  89905. me.getDatafromContent(url, success);
  89906. return;
  89907. }
  89908. });
  89909. // 如果有服务,获取数据源和数据集, 然后请求rest服务
  89910. resultData && me.getDatafromRest(resultData.serviceType, resultData.address, success);
  89911. } else {
  89912. me.getDatafromContent(url, success);
  89913. return;
  89914. }
  89915. })["catch"](function (error) {
  89916. console.log(error);
  89917. me._fireFailedEvent(error);
  89918. });
  89919. }
  89920. /**
  89921. * @private
  89922. * @function ChartModel.prototype.getDatafromURL
  89923. * @description 用iportal获取数据。(通过固定的url来请求,但是不能请求工作空间的数据)
  89924. * @param {string} url
  89925. * @param {Callbacks} success - 成功回调函数。
  89926. */
  89927. }, {
  89928. key: "getDatafromContent",
  89929. value: function getDatafromContent(url, success) {
  89930. var _this = this;
  89931. // 成功回调传入的results
  89932. var results = {
  89933. result: {}
  89934. },
  89935. me = this;
  89936. url += '/content.json?pageSize=9999999&currentPage=1';
  89937. // 获取图层数据
  89938. FetchRequest.get(url, null, {
  89939. withCredentials: this.datasets.withCredentials
  89940. }).then(function (response) {
  89941. return response.json();
  89942. }).then(function (data) {
  89943. if (data.succeed === false) {
  89944. //请求失败
  89945. me._fireFailedEvent(data);
  89946. return;
  89947. }
  89948. if (data.type) {
  89949. if (data.type === 'JSON' || data.type === 'GEOJSON') {
  89950. // 将字符串转换成json
  89951. data.content = JSON.parse(data.content.trim());
  89952. // 如果是json文件 data.content = {type:'fco', features},格式不固定
  89953. if (!data.content.features) {
  89954. //json格式解析失败
  89955. console.log(Lang.i18n('msg_jsonResolveFiled'));
  89956. return;
  89957. }
  89958. var features = _this._formatGeoJSON(data.content);
  89959. results.result.features = {
  89960. type: data.content.type,
  89961. features: features
  89962. };
  89963. } else if (data.type === 'EXCEL' || data.type === 'CSV') {
  89964. var _features = _this._excelData2Feature(data.content);
  89965. results.result.features = {
  89966. type: 'FeatureCollection',
  89967. features: _features
  89968. };
  89969. }
  89970. success(results, 'content');
  89971. }
  89972. }, this)["catch"](function (error) {
  89973. console.log(error);
  89974. me._fireFailedEvent(error);
  89975. });
  89976. }
  89977. /**
  89978. * @private
  89979. * @function ChartModel.prototype._getDataSource
  89980. * @description 获取数据源名和数据集名。
  89981. * @param {string} serviceType 服务类型
  89982. * @param {string} address 地址
  89983. * @param {Callbacks} success - 成功回调函数。
  89984. * @return {Array.<string>} ["数据源名:数据集名"]
  89985. * @return {string} 图层名
  89986. */
  89987. }, {
  89988. key: "getDatafromRest",
  89989. value: function getDatafromRest(serviceType, address, success) {
  89990. var me = this,
  89991. withCredentials = this.datasets.withCredentials;
  89992. if (serviceType === 'RESTDATA') {
  89993. var url = "".concat(address, "/data/datasources"),
  89994. sourceName,
  89995. datasetName;
  89996. // 请求获取数据源名
  89997. FetchRequest.get(url, null, {
  89998. withCredentials: withCredentials
  89999. }).then(function (response) {
  90000. return response.json();
  90001. }).then(function (data) {
  90002. sourceName = data.datasourceNames[0];
  90003. url = "".concat(address, "/data/datasources/").concat(sourceName, "/datasets");
  90004. // 请求获取数据集名
  90005. FetchRequest.get(url, null, {
  90006. withCredentials: withCredentials
  90007. }).then(function (response) {
  90008. return response.json();
  90009. }).then(function (data) {
  90010. datasetName = data.datasetNames[0];
  90011. // 请求restdata服务
  90012. me.getDatafromRestData("".concat(address, "/data"), [sourceName + ':' + datasetName], success);
  90013. return [sourceName + ':' + datasetName];
  90014. })["catch"](function (error) {
  90015. me._fireFailedEvent(error);
  90016. });
  90017. })["catch"](function (error) {
  90018. me._fireFailedEvent(error);
  90019. });
  90020. } else {
  90021. // 如果是地图服务
  90022. var _url = "".concat(address, "/maps"),
  90023. mapName,
  90024. layerName,
  90025. path;
  90026. // 请求获取地图名
  90027. FetchRequest.get(_url, null, {
  90028. withCredentials: withCredentials
  90029. }).then(function (response) {
  90030. return response.json();
  90031. }).then(function (data) {
  90032. mapName = data[0].name;
  90033. path = data[0].path;
  90034. _url = _url = "".concat(address, "/maps/").concat(mapName, "/layers");
  90035. // 请求获取图层名
  90036. FetchRequest.get(_url, null, {
  90037. withCredentials: withCredentials
  90038. }).then(function (response) {
  90039. return response.json();
  90040. }).then(function (data) {
  90041. layerName = data[0].subLayers.layers[0].caption;
  90042. // 请求restmap服务
  90043. me.getDatafromRestMap(layerName, path, success);
  90044. return layerName;
  90045. })["catch"](function (error) {
  90046. me._fireFailedEvent(error);
  90047. });
  90048. })["catch"](function (error) {
  90049. me._fireFailedEvent(error);
  90050. });
  90051. }
  90052. }
  90053. /**
  90054. * @private
  90055. * @function ChartModel.prototype.getDatafromRestData
  90056. * @description 请求restdata服务
  90057. * @param {string} url
  90058. * @param {Array<string>} dataSource [数据源名:数据集名]
  90059. * @param {Callbacks} success - 成功回调函数。
  90060. */
  90061. }, {
  90062. key: "getDatafromRestData",
  90063. value: function getDatafromRestData(url, dataSource, success) {
  90064. var me = this;
  90065. this.datasets.queryInfo.attributeFilter = this.datasets.queryInfo.attributeFilter || 'SmID>0';
  90066. this._getFeatureBySQL(url, dataSource, this.datasets.queryInfo, function (results) {
  90067. // 此时的features已经处理成geojson了
  90068. success(results, 'RESTDATA');
  90069. }, function (error) {
  90070. console.log(error);
  90071. me._fireFailedEvent(error);
  90072. });
  90073. }
  90074. /**
  90075. * @private
  90076. * @function ChartModel.prototype.getDatafromRestMap
  90077. * @description 请求restmap服务
  90078. * @param {string} dataSource layerName
  90079. * @param {string} path - map服务地址。
  90080. * @param {Callbacks} success - 成功回调函数。
  90081. */
  90082. }, {
  90083. key: "getDatafromRestMap",
  90084. value: function getDatafromRestMap(dataSource, path, success) {
  90085. var me = this;
  90086. this.datasets.queryInfo.attributeFilter = this.datasets.queryInfo.attributeFilter || 'smid=1';
  90087. this._queryFeatureBySQL(path, dataSource, this.datasets.queryInfo, null, null, function (results) {
  90088. // let features = result.result.recordsets[0].features;
  90089. success(results, 'RESTMAP');
  90090. }, function (error) {
  90091. console.log(error);
  90092. me._fireFailedEvent(error);
  90093. });
  90094. }
  90095. /**
  90096. * @private
  90097. * @function ChartModel.prototype._getFeatureBySQL
  90098. * @description 通过 sql 方式查询数据。
  90099. */
  90100. }, {
  90101. key: "_getFeatureBySQL",
  90102. value: function _getFeatureBySQL(url, datasetNames, queryInfo, _processCompleted, processFaild) {
  90103. var getFeatureParam, getFeatureBySQLService, getFeatureBySQLParams;
  90104. var params = {
  90105. name: datasetNames.join().replace(':', '@')
  90106. };
  90107. Object.assign(params, queryInfo);
  90108. getFeatureParam = new FilterParameter(params);
  90109. getFeatureBySQLParams = new GetFeaturesBySQLParameters({
  90110. queryParameter: getFeatureParam,
  90111. datasetNames: datasetNames,
  90112. fromIndex: 0,
  90113. toIndex: 100000,
  90114. returnContent: true
  90115. });
  90116. var options = {
  90117. eventListeners: {
  90118. processCompleted: function processCompleted(getFeaturesEventArgs) {
  90119. _processCompleted && _processCompleted(getFeaturesEventArgs);
  90120. },
  90121. processFailed: function processFailed(e) {
  90122. processFaild && processFaild(e);
  90123. }
  90124. }
  90125. };
  90126. getFeatureBySQLService = new GetFeaturesBySQLService(url, options);
  90127. getFeatureBySQLService.processAsync(getFeatureBySQLParams);
  90128. }
  90129. /**
  90130. * @private
  90131. * @function ChartModel.prototype._queryFeatureBySQL
  90132. * @description 通过 sql 方式查询数据。
  90133. */
  90134. }, {
  90135. key: "_queryFeatureBySQL",
  90136. value: function _queryFeatureBySQL(url, layerName, queryInfo, fields, epsgCode, processCompleted, processFaild, startRecord, recordLength, onlyAttribute) {
  90137. var queryParam, queryBySQLParams;
  90138. var filterParams = {
  90139. name: layerName
  90140. };
  90141. Object.assign(filterParams, queryInfo);
  90142. queryParam = new FilterParameter(filterParams);
  90143. if (fields) {
  90144. queryParam.fields = fields;
  90145. }
  90146. var params = {
  90147. queryParams: [queryParam]
  90148. };
  90149. if (onlyAttribute) {
  90150. params.queryOption = QueryOption.ATTRIBUTE;
  90151. }
  90152. startRecord && (params.startRecord = startRecord);
  90153. recordLength && (params.expectCount = recordLength);
  90154. if (epsgCode) {
  90155. params.prjCoordSys = {
  90156. epsgCode: epsgCode
  90157. };
  90158. }
  90159. queryBySQLParams = new QueryBySQLParameters(params);
  90160. this._queryBySQL(url, queryBySQLParams, function (data) {
  90161. data.type === 'processCompleted' ? processCompleted(data) : processFaild(data);
  90162. });
  90163. }
  90164. /**
  90165. * @function ChartModel.prototype._queryBySQL
  90166. * @description SQL 查询服务。
  90167. * @param {QueryBySQLParameters} params - SQL 查询相关参数类。
  90168. * @param {RequestCallback} callback - 回调函数。
  90169. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 结果类型。
  90170. */
  90171. }, {
  90172. key: "_queryBySQL",
  90173. value: function _queryBySQL(url, params, callback, resultFormat) {
  90174. var me = this;
  90175. var queryBySQLService = new QueryBySQLService(url, {
  90176. eventListeners: {
  90177. scope: me,
  90178. processCompleted: callback,
  90179. processFailed: callback
  90180. },
  90181. format: me._processFormat(resultFormat)
  90182. });
  90183. queryBySQLService.processAsync(params);
  90184. }
  90185. /**
  90186. * @function ChartModel.prototype._processFormat
  90187. * @description 将数据转换成geojson。
  90188. * @param {Object} resultFormat - 返回结果集。
  90189. * @return {Object} [resultFormat=DataFormat.GEOJSON] - 结果类型。
  90190. */
  90191. }, {
  90192. key: "_processFormat",
  90193. value: function _processFormat(resultFormat) {
  90194. return resultFormat ? resultFormat : DataFormat.GEOJSON;
  90195. }
  90196. /**
  90197. * @private
  90198. * @function ChartModel.prototype._formatGeoJSON
  90199. * @description 格式 GeoJSON。
  90200. * @param {GeoJSON} data - GeoJSON 数据。
  90201. */
  90202. }, {
  90203. key: "_formatGeoJSON",
  90204. value: function _formatGeoJSON(data) {
  90205. var features = data.features;
  90206. features.forEach(function (row, index) {
  90207. row.properties['index'] = index;
  90208. });
  90209. return features;
  90210. }
  90211. /**
  90212. * @private
  90213. * @description 将 csv 和 xls 文件内容转换成 geojson
  90214. * @function ChartModel.prototype._excelData2Feature
  90215. * @param content 文件内容
  90216. * @param layerInfo 图层信息
  90217. * @returns {Array} feature的数组集合
  90218. */
  90219. }, {
  90220. key: "_excelData2Feature",
  90221. value: function _excelData2Feature(dataContent) {
  90222. var fieldCaptions = dataContent.colTitles;
  90223. //位置属性处理
  90224. var xfieldIndex = -1,
  90225. yfieldIndex = -1;
  90226. for (var i = 0, len = fieldCaptions.length; i < len; i++) {
  90227. if (FileReaderUtil.isXField(fieldCaptions[i])) {
  90228. xfieldIndex = i;
  90229. }
  90230. if (FileReaderUtil.isYField(fieldCaptions[i])) {
  90231. yfieldIndex = i;
  90232. }
  90233. }
  90234. // feature 构建后期支持坐标系 4326/3857
  90235. var features = [];
  90236. for (var _i2 = 0, _len2 = dataContent.rows.length; _i2 < _len2; _i2++) {
  90237. var row = dataContent.rows[_i2];
  90238. var x = Number(row[xfieldIndex]),
  90239. y = Number(row[yfieldIndex]);
  90240. //属性信息
  90241. var attributes = {};
  90242. for (var index in dataContent.colTitles) {
  90243. var key = dataContent.colTitles[index];
  90244. attributes[key] = dataContent.rows[_i2][index];
  90245. }
  90246. attributes['index'] = _i2 + '';
  90247. //目前csv 只支持处理点,所以先生成点类型的 geojson
  90248. var feature = {
  90249. type: 'Feature',
  90250. geometry: {
  90251. type: 'Point',
  90252. coordinates: [x, y]
  90253. },
  90254. properties: attributes
  90255. };
  90256. features.push(feature);
  90257. }
  90258. return features;
  90259. }
  90260. /**
  90261. * @private
  90262. * @description 请求数据失败的事件
  90263. * @function ChartModel.prototype._fireFailedEvent
  90264. * @param {Object} error 错误信息
  90265. */
  90266. }, {
  90267. key: "_fireFailedEvent",
  90268. value: function _fireFailedEvent(error) {
  90269. var errorData = error ? {
  90270. error: error,
  90271. message: Lang.i18n('msg_getdatafailed')
  90272. } : {
  90273. message: Lang.i18n('msg_getdatafailed')
  90274. };
  90275. /**
  90276. * @event ChartModel#getdatafailed
  90277. * @description 监听到获取数据失败事件后触发
  90278. * @property {Object} error - 事件对象。
  90279. */
  90280. this.events.triggerEvent('getdatafailed', errorData);
  90281. }
  90282. }]);
  90283. return ChartModel;
  90284. }();
  90285. ;// CONCATENATED MODULE: ./src/common/components/chart/ChartViewModel.js
  90286. function ChartViewModel_createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = ChartViewModel_unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
  90287. function ChartViewModel_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return ChartViewModel_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return ChartViewModel_arrayLikeToArray(o, minLen); }
  90288. function ChartViewModel_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
  90289. function ChartViewModel_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  90290. function ChartViewModel_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  90291. function ChartViewModel_createClass(Constructor, protoProps, staticProps) { if (protoProps) ChartViewModel_defineProperties(Constructor.prototype, protoProps); if (staticProps) ChartViewModel_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  90292. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  90293. * This program are made available under the terms of the Apache License, Version 2.0
  90294. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  90295. /**
  90296. * @class ChartViewModel
  90297. * @aliasclass Components.ChartViewModel
  90298. * @deprecatedclass SuperMap.Components.ChartViewModel
  90299. * @classdesc 图表组件功能类。
  90300. * @category Components Chart
  90301. * @version 10.0.0
  90302. * @param {Object} options - 可选参数。
  90303. * @param {string} options.type - 图表类型。
  90304. * @param {ChartView.Datasets} options.datasets - 数据来源。
  90305. * @param {Array.<Object>} options.chartOptions - 图表可选配置。
  90306. * @param {Array.<Object>} options.chartOptions.xAxis - X轴可选参数。
  90307. * @param {string} options.chartOptions.xAxis.field - X轴字段名。
  90308. * @param {string} options.chartOptions.xAxis.name - X轴名称。
  90309. * @param {Array.<Object>} options.chartOptions.yAxis - Y轴可选参数。
  90310. * @param {string} options.chartOptions.yAxis.field - Y轴字段名。
  90311. * @param {string} options.chartOptions.yAxis.name - Y轴名称。
  90312. * @fires ChartViewModel#getdatafailed
  90313. * @usage
  90314. */
  90315. var ChartViewModel = /*#__PURE__*/function () {
  90316. function ChartViewModel(options) {
  90317. ChartViewModel_classCallCheck(this, ChartViewModel);
  90318. this.datasets = options.datasets;
  90319. this.xField = [];
  90320. this.yField = [];
  90321. this.grid = {
  90322. top: "50px",
  90323. bottom: "50px",
  90324. left: "50px",
  90325. right: "60px"
  90326. };
  90327. this.chartType = options.type || "bar";
  90328. this._initXYField(options.chartOptions);
  90329. this.EVENT_TYPES = ["getdatafailed"];
  90330. this.events = new Events(this, null, this.EVENT_TYPES);
  90331. }
  90332. /**
  90333. * @function ChartViewModel.prototype._initXYField
  90334. * @description 初始化XY字段。
  90335. * @private
  90336. * @param {Object} chartOptions - options里的图表参数。
  90337. */
  90338. ChartViewModel_createClass(ChartViewModel, [{
  90339. key: "_initXYField",
  90340. value: function _initXYField(chartOptions) {
  90341. var me = this;
  90342. if (chartOptions && chartOptions.length > 0) {
  90343. chartOptions.forEach(function (option) {
  90344. if (option.xAxis) {
  90345. me.xField.push({
  90346. field: option.xAxis.field,
  90347. name: option.xAxis.name
  90348. });
  90349. }
  90350. if (option.yAxis) {
  90351. me.yField.push({
  90352. field: option.yAxis.field,
  90353. name: option.yAxis.name
  90354. });
  90355. }
  90356. });
  90357. }
  90358. }
  90359. /**
  90360. * @function ChartViewModel.prototype.getDatasetInfo
  90361. * @description 获得数据集数据。
  90362. * @param {function} success - 成功回调函数。
  90363. */
  90364. }, {
  90365. key: "getDatasetInfo",
  90366. value: function getDatasetInfo(success) {
  90367. var _this = this;
  90368. this.createChart = success;
  90369. if (this.datasets && this._checkUrl(this.datasets.url)) {
  90370. this.chartModel = new ChartModel(this.datasets);
  90371. if (this.datasets.type === 'iServer') {
  90372. this.chartModel.getDatasetInfo(this._getDatasetInfoSuccess.bind(this));
  90373. } else if (this.datasets.type === 'iPortal') {
  90374. this.chartModel.getDataInfoByIptl(this._getDataInfoSuccess.bind(this));
  90375. }
  90376. /**
  90377. * @event ChartViewModel#getdatafailed
  90378. * @description 监听到获取数据失败事件后触发。
  90379. * @property {Object} error - 事件对象。
  90380. */
  90381. this.chartModel.events.on({
  90382. "getdatafailed": function getdatafailed(error) {
  90383. _this.events.triggerEvent("getdatafailed", error);
  90384. }
  90385. });
  90386. }
  90387. }
  90388. /**
  90389. * @function ChartViewModel.prototype._getDatasetInfoSuccess
  90390. * @description 成功回调函数。
  90391. * @private
  90392. * @param {Object} results - 数据集信息。
  90393. */
  90394. }, {
  90395. key: "_getDatasetInfoSuccess",
  90396. value: function _getDatasetInfoSuccess(results) {
  90397. var datasetUrl = this.datasets.url;
  90398. //判断服务为地图服务 或者 数据服务
  90399. var restIndex = datasetUrl.indexOf("rest");
  90400. if (restIndex > 0) {
  90401. var index = datasetUrl.indexOf("/", restIndex + 5);
  90402. var type = datasetUrl.substring(restIndex + 5, index);
  90403. var dataUrl = datasetUrl.substring(0, restIndex + 4) + "/data";
  90404. if (type === "maps") {
  90405. var mapIndex = datasetUrl.indexOf("/", index + 1);
  90406. var mapName = datasetUrl.substring(index + 1, mapIndex);
  90407. dataUrl = datasetUrl.substring(0, restIndex + 4) + "/maps/" + mapName;
  90408. results.result.dataUrl = dataUrl;
  90409. this._getLayerFeatures(results);
  90410. } else if (type === "data") {
  90411. results.result.dataUrl = dataUrl;
  90412. this._getDataFeatures(results);
  90413. }
  90414. }
  90415. }
  90416. /**
  90417. * @function ChartViewModel.prototype._getDataInfoSuccess
  90418. * @description 请求iportal数据成功之后的回调。
  90419. * @private
  90420. */
  90421. }, {
  90422. key: "_getDataInfoSuccess",
  90423. value: function _getDataInfoSuccess(results, type) {
  90424. var me = this;
  90425. if (type === 'RESTMAP') {
  90426. me._getChartDatasFromLayer(results);
  90427. } else {
  90428. me._getChartDatas(results);
  90429. }
  90430. }
  90431. /**
  90432. * @function ChartViewModel.prototype._getDataFeatures
  90433. * @description 请求数据集的数据信息
  90434. * @private
  90435. * @param {Object} results - 数据集信息
  90436. */
  90437. }, {
  90438. key: "_getDataFeatures",
  90439. value: function _getDataFeatures(results) {
  90440. this.chartModel.getDataFeatures(results, this._getChartDatas.bind(this));
  90441. }
  90442. /**
  90443. * @function ChartViewModel.prototype._getLayerFeatures
  90444. * @description 请求图层的数据信息。
  90445. * @private
  90446. * @param {Object} results - 数据集信息。
  90447. */
  90448. }, {
  90449. key: "_getLayerFeatures",
  90450. value: function _getLayerFeatures(results) {
  90451. this.chartModel.getLayerFeatures(results, this._getChartDatasFromLayer.bind(this));
  90452. }
  90453. /**
  90454. * @function ChartViewModel.prototype._getChartDatas
  90455. * @description 将请求回来的数据转换为图表所需的数据格式。
  90456. * @private
  90457. * @param {Object} results - 数据要素信息。
  90458. */
  90459. }, {
  90460. key: "_getChartDatas",
  90461. value: function _getChartDatas(results) {
  90462. if (results) {
  90463. // 数据来自restdata---results.result.features
  90464. this.features = results.result.features;
  90465. var features = this.features.features;
  90466. var data = {};
  90467. if (features.length) {
  90468. var feature = features[0];
  90469. var attrFields = [],
  90470. itemTypes = [];
  90471. for (var attr in feature.properties) {
  90472. attrFields.push(attr);
  90473. itemTypes.push(this._getDataType(feature.properties[attr]));
  90474. }
  90475. data = {
  90476. features: features,
  90477. fieldCaptions: attrFields,
  90478. fieldTypes: itemTypes,
  90479. fieldValues: []
  90480. };
  90481. for (var m in itemTypes) {
  90482. var fieldValue = [];
  90483. for (var j in features) {
  90484. var _feature = features[j];
  90485. var caption = data.fieldCaptions[m];
  90486. var value = _feature.properties[caption];
  90487. fieldValue.push(value);
  90488. }
  90489. data.fieldValues.push(fieldValue);
  90490. }
  90491. this.createChart(data);
  90492. }
  90493. }
  90494. }
  90495. /**
  90496. * @function ChartViewModel.prototype._getChartDatasFromLayer
  90497. * @description 将请求回来的数据转换为图表所需的数据格式。
  90498. * @private
  90499. * @param {Object} results - 图层数据要素信息。
  90500. */
  90501. }, {
  90502. key: "_getChartDatasFromLayer",
  90503. value: function _getChartDatasFromLayer(results) {
  90504. if (results.result.recordsets) {
  90505. var recordsets = results.result.recordsets[0];
  90506. var features = recordsets.features.features;
  90507. this.features = recordsets.features;
  90508. var data = {};
  90509. if (features.length) {
  90510. data = {
  90511. features: recordsets.features,
  90512. fieldCaptions: recordsets.fieldCaptions,
  90513. fieldTypes: recordsets.fieldTypes,
  90514. fieldValues: []
  90515. };
  90516. for (var m in data.fieldCaptions) {
  90517. var fieldValue = [];
  90518. for (var j in features) {
  90519. var feature = features[j];
  90520. var caption = data.fieldCaptions[m];
  90521. var value = feature.properties[caption];
  90522. fieldValue.push(value);
  90523. }
  90524. data.fieldValues.push(fieldValue);
  90525. }
  90526. this.createChart(data);
  90527. }
  90528. }
  90529. }
  90530. /**
  90531. * @function ChartViewModel.prototype._createChartOptions
  90532. * @description 创建图表所需参数。
  90533. * @private
  90534. * @param {Object} data - 图表数据。
  90535. */
  90536. }, {
  90537. key: "_createChartOptions",
  90538. value: function _createChartOptions(data) {
  90539. this.calculatedData = this._createChartDatas(data);
  90540. return this.updateChartOptions(this.chartType);
  90541. }
  90542. /**
  90543. * @function ChartViewModel.prototype.changeType
  90544. * @description 改变图表类型。
  90545. * @param {string} type - 图表类型。
  90546. */
  90547. }, {
  90548. key: "changeType",
  90549. value: function changeType(type) {
  90550. if (type !== this.chartType) {
  90551. this.chartType = type;
  90552. return this.updateChartOptions(this.chartType);
  90553. }
  90554. }
  90555. /**
  90556. * @function ChartViewModel.prototype.updateData
  90557. * @description 改变图表类型。
  90558. * @param {ChartView.Datasets} datasets - 数据来源。
  90559. * @param {function} success 成功回调函数。
  90560. */
  90561. }, {
  90562. key: "updateData",
  90563. value: function updateData(datasets, chartOption, success) {
  90564. this.updateChart = success;
  90565. this.xField = [];
  90566. this.yField = [];
  90567. this._initXYField(chartOption);
  90568. // type的设置默认值
  90569. datasets.type = datasets.type || 'iServer';
  90570. // withCredentials的设置默认值
  90571. datasets.withCredentials = datasets.withCredentials || false;
  90572. this.datasets = datasets;
  90573. this.getDatasetInfo(this._updateDataSuccess.bind(this));
  90574. }
  90575. /**
  90576. * @function ChartViewModel.prototype._updateDataSuccess
  90577. * @description 改变图表类型。
  90578. * @private
  90579. * @param {Object} data - 图表数据。
  90580. */
  90581. }, {
  90582. key: "_updateDataSuccess",
  90583. value: function _updateDataSuccess(data) {
  90584. var options = this._createChartOptions(data);
  90585. this.updateChart(options);
  90586. }
  90587. /**
  90588. * @function ChartViewModel.prototype.updateChartOptions
  90589. * @description 更新图表所需参数。
  90590. * @param {string} type - 图表类型。
  90591. * @param {Object} style - 图表样式。
  90592. */
  90593. }, {
  90594. key: "updateChartOptions",
  90595. value: function updateChartOptions(type, style) {
  90596. if (this.calculatedData) {
  90597. var grid = this.grid;
  90598. var series = this._createChartSeries(this.calculatedData, type);
  90599. var datas = [];
  90600. for (var i in this.calculatedData.XData) {
  90601. datas.push({
  90602. value: this.calculatedData.XData[i].fieldsData
  90603. });
  90604. }
  90605. var xAxis = {
  90606. type: "category",
  90607. name: this.xField[0].name || "X",
  90608. data: datas,
  90609. nameTextStyle: {
  90610. color: '#fff',
  90611. fontSize: 14
  90612. },
  90613. splitLine: {
  90614. show: false
  90615. },
  90616. axisLine: {
  90617. lineStyle: {
  90618. color: '#eee'
  90619. }
  90620. }
  90621. };
  90622. var yAxis = {
  90623. type: "value",
  90624. name: this.yFieldName || "Y",
  90625. data: {},
  90626. nameTextStyle: {
  90627. color: '#fff',
  90628. fontSize: 14
  90629. },
  90630. splitLine: {
  90631. show: false
  90632. },
  90633. axisLine: {
  90634. lineStyle: {
  90635. color: '#eee'
  90636. }
  90637. }
  90638. };
  90639. var tooltip = {
  90640. formatter: '{b0}: {c0}'
  90641. };
  90642. var backgroundColor = '#404a59';
  90643. if (style) {
  90644. if (style.grid) {
  90645. grid = style.grid;
  90646. }
  90647. if (style.tooltip) {
  90648. tooltip = style.tooltip;
  90649. }
  90650. if (style.backgroundColor) {
  90651. backgroundColor = style.backgroundColor;
  90652. }
  90653. }
  90654. return {
  90655. backgroundColor: backgroundColor,
  90656. grid: grid,
  90657. series: series,
  90658. xAxis: xAxis,
  90659. yAxis: yAxis,
  90660. tooltip: tooltip
  90661. };
  90662. }
  90663. }
  90664. /**
  90665. * @function ChartViewModel.prototype._createChartDatas
  90666. * @description 构建图表数据。
  90667. * @private
  90668. * @param {Object} data - 源数据。
  90669. */
  90670. }, {
  90671. key: "_createChartDatas",
  90672. value: function _createChartDatas(data) {
  90673. var fieldIndex = 0,
  90674. yfieldIndexs = [];
  90675. var fieldCaptions = data.fieldCaptions;
  90676. var me = this;
  90677. //X
  90678. fieldCaptions.forEach(function (field, index) {
  90679. if (me.xField[0] && field === me.xField[0].field) {
  90680. fieldIndex = index;
  90681. }
  90682. });
  90683. //Y
  90684. this.yFieldName = "";
  90685. this.yField.forEach(function (value, index) {
  90686. if (index !== 0) {
  90687. me.yFieldName = me.yFieldName + ",";
  90688. }
  90689. me.yFieldName = me.yFieldName + value.name;
  90690. fieldCaptions.forEach(function (field, index) {
  90691. if (field === value.field) {
  90692. yfieldIndexs.push(index);
  90693. }
  90694. });
  90695. });
  90696. var datas = this._getAttrData(data, fieldIndex);
  90697. var yDatas = [];
  90698. if (yfieldIndexs.length > 0) {
  90699. yfieldIndexs.forEach(function (yfieldIndex) {
  90700. var yData = [];
  90701. for (var i in data.fieldValues[yfieldIndex]) {
  90702. yData.push({
  90703. value: data.fieldValues[yfieldIndex][i]
  90704. });
  90705. }
  90706. yDatas.push(yData);
  90707. });
  90708. } else {
  90709. //未指定Y字段时,y轴计数
  90710. var YData = [],
  90711. XData = [],
  90712. len = datas.length;
  90713. //计算X轴,Y轴数据,并去重
  90714. for (var i = 0; i < len; i++) {
  90715. var isSame = false;
  90716. for (var j = 0, leng = XData.length; j < leng; j++) {
  90717. if (datas[i].fieldsData === XData[j].fieldsData) {
  90718. YData[j].value++;
  90719. XData[j].recordIndexs.push(i);
  90720. isSame = true;
  90721. break;
  90722. }
  90723. }
  90724. if (!isSame) {
  90725. if (datas[i].fieldsData) {
  90726. XData.push({
  90727. fieldsData: datas[i].fieldsData,
  90728. recordIndexs: [i]
  90729. });
  90730. YData.push({
  90731. value: 1
  90732. });
  90733. }
  90734. }
  90735. }
  90736. datas = XData;
  90737. yDatas = [YData];
  90738. }
  90739. return {
  90740. XData: datas,
  90741. YData: yDatas
  90742. };
  90743. }
  90744. /**
  90745. * @function ChartViewModel.prototype._getAttrData
  90746. * @description 选中字段数据。
  90747. * @private
  90748. * @param {Object} datacontent - 图表数据。
  90749. * @param {number} index - 字段索引。
  90750. */
  90751. }, {
  90752. key: "_getAttrData",
  90753. value: function _getAttrData(datacontent, index) {
  90754. if (index === 0) {
  90755. this.xField = [{
  90756. field: datacontent.fieldCaptions[index],
  90757. name: datacontent.fieldCaptions[index]
  90758. }];
  90759. }
  90760. var fieldsDatas = [];
  90761. for (var i = 0, len = datacontent.fieldValues[index].length; i < len; i++) {
  90762. var value = datacontent.fieldValues[index][i];
  90763. fieldsDatas.push({
  90764. recordIndexs: i,
  90765. fieldsData: value
  90766. });
  90767. }
  90768. return fieldsDatas;
  90769. }
  90770. /**
  90771. * @function ChartViewModel.prototype._createChartSeries
  90772. * @description 图表数据。
  90773. * @private
  90774. * @param {Object} calculatedData - 图表数据。
  90775. * @param {string} chartType - 图表类型。
  90776. */
  90777. }, {
  90778. key: "_createChartSeries",
  90779. value: function _createChartSeries(calculatedData, chartType) {
  90780. var series = [];
  90781. var yDatas = calculatedData.YData;
  90782. yDatas.forEach(function (yData) {
  90783. var value = 0;
  90784. var serieData = [];
  90785. var _iterator = ChartViewModel_createForOfIteratorHelper(yData),
  90786. _step;
  90787. try {
  90788. for (_iterator.s(); !(_step = _iterator.n()).done;) {
  90789. var data = _step.value;
  90790. value = data.value;
  90791. serieData.push({
  90792. value: value
  90793. });
  90794. }
  90795. } catch (err) {
  90796. _iterator.e(err);
  90797. } finally {
  90798. _iterator.f();
  90799. }
  90800. var serie = {
  90801. type: chartType,
  90802. data: serieData,
  90803. name: "y"
  90804. };
  90805. series.push(serie);
  90806. });
  90807. return series;
  90808. }
  90809. /**
  90810. * @function ChartViewModel.prototype._isDate
  90811. * @description 判断是否为日期。
  90812. * @private
  90813. * @param {string} data - 字符串。
  90814. */
  90815. }, {
  90816. key: "_isDate",
  90817. value: function _isDate(data) {
  90818. var reg = /((^((1[8-9]\d{2})|([2-9]\d{3}))([-\/\._])(10|12|0?[13578])([-\/\._])(3[01]|[12][0-9]|0?[1-9])$)|(^((1[8-9]\d{2})|([2-9]\d{3}))([-\/\._])(11|0?[469])([-\/\._])(30|[12][0-9]|0?[1-9])$)|(^((1[8-9]\d{2})|([2-9]\d{3}))([-\/\._])(0?2)([-\/\._])(2[0-8]|1[0-9]|0?[1-9])$)|(^([2468][048]00)([-\/\._])(0?2)([-\/\._])(29)$)|(^([3579][26]00)([-\/\._])(0?2)([-\/\._])(29)$)|(^([1][89][0][48])([-\/\._])(0?2)([-\/\._])(29)$)|(^([2-9][0-9][0][48])([-\/\._])(0?2)([-\/\._])(29)$)|(^([1][89][2468][048])([-\/\._])(0?2)([-\/\._])(29)$)|(^([2-9][0-9][2468][048])([-\/\._])(0?2)([-\/\._])(29)$)|(^([1][89][13579][26])([-\/\._])(0?2)([-\/\._])(29)$)|(^([2-9][0-9][13579][26])([-\/\._])(0?2)([-\/\._])(29)$))/ig;
  90819. return reg.test(data);
  90820. }
  90821. /**
  90822. * @function ChartViewModel.prototype._isNumber
  90823. * @description 判断是否为数值。
  90824. * @private
  90825. * @param {string} data - 字符串。
  90826. */
  90827. }, {
  90828. key: "_isNumber",
  90829. value: function _isNumber(data) {
  90830. var mdata = Number(data);
  90831. if (mdata === 0) {
  90832. return true;
  90833. }
  90834. return !isNaN(mdata);
  90835. }
  90836. /**
  90837. * @function ChartViewModel.prototype._getDataType
  90838. * @description 判断数据的类型。
  90839. * @private
  90840. * @param {string} data - 字符串。
  90841. */
  90842. }, {
  90843. key: "_getDataType",
  90844. value: function _getDataType(data) {
  90845. if (data !== null && data !== undefined && data !== '') {
  90846. if (this._isDate(data)) {
  90847. return "DATE";
  90848. }
  90849. if (this._isNumber(data)) {
  90850. return "NUMBER";
  90851. }
  90852. }
  90853. return "STRING";
  90854. }
  90855. /**
  90856. * @function ChartViewModel.prototype._checkUrl
  90857. * @description 检查url是否符合要求。
  90858. * @private
  90859. * @param {string} url。
  90860. */
  90861. }, {
  90862. key: "_checkUrl",
  90863. value: function _checkUrl(url) {
  90864. var match;
  90865. if (url === '' || !this._isMatchUrl(url)) {
  90866. match = false;
  90867. } else if (/^http[s]?:\/\/localhost/.test(url) || /^http[s]?:\/\/127.0.0.1/.test(url)) {
  90868. //不是实际域名
  90869. match = false;
  90870. } else {
  90871. match = true;
  90872. }
  90873. return match;
  90874. }
  90875. /**
  90876. * @function ChartViewModel.prototype._isMatchUrl
  90877. * @description 判断输入的地址是否符合地址格式。
  90878. * @private
  90879. * @param {string} str - url。
  90880. */
  90881. }, {
  90882. key: "_isMatchUrl",
  90883. value: function _isMatchUrl(str) {
  90884. var reg = new RegExp('(https?|http|file|ftp)://[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|]');
  90885. return reg.test(str);
  90886. }
  90887. /**
  90888. * @function ChartViewModel.prototype.getStyle
  90889. * @description 获取图表样式。
  90890. */
  90891. }, {
  90892. key: "getStyle",
  90893. value: function getStyle() {
  90894. var style = {
  90895. grid: this.grid,
  90896. tooltip: this.tooltip,
  90897. backgroundColor: this.backgroundColor
  90898. };
  90899. return style;
  90900. }
  90901. /**
  90902. * @function ChartViewModel.prototype.getFeatures
  90903. * @description 获取地图服务,数据服务请求返回的数据。
  90904. */
  90905. }, {
  90906. key: "getFeatures",
  90907. value: function getFeatures() {
  90908. return this.features;
  90909. }
  90910. /**
  90911. * @function ChartViewModel.prototype.setStyle
  90912. * @description 设置图表样式。
  90913. * @param {Object} style - 图表样式
  90914. */
  90915. }, {
  90916. key: "setStyle",
  90917. value: function setStyle(style) {
  90918. return this.updateChartOptions(this.chartType, style);
  90919. }
  90920. }]);
  90921. return ChartViewModel;
  90922. }();
  90923. ;// CONCATENATED MODULE: ./src/common/components/chart/ChartView.js
  90924. function ChartView_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  90925. function ChartView_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  90926. function ChartView_createClass(Constructor, protoProps, staticProps) { if (protoProps) ChartView_defineProperties(Constructor.prototype, protoProps); if (staticProps) ChartView_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  90927. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  90928. * This program are made available under the terms of the Apache License, Version 2.0
  90929. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  90930. /**
  90931. * @class ChartView
  90932. * @aliasclass Components.ChartView
  90933. * @deprecatedclass SuperMap.Components.Chart
  90934. * @classdesc 图表组件。
  90935. * @modulecategory Components
  90936. * @version 9.1.2
  90937. * @param {string} domID - 图表dom元素ID。
  90938. * @param {Object} options - 可选参数。
  90939. * @param {string} options.type - 图表类型。
  90940. * @param {ChartView.Datasets} options.datasets - 数据来源。
  90941. * @param {Array.<Object>} options.chartOptions - 图表可选参数。
  90942. * @param {Array.<Object>} options.chartOptions.xAxis - 图表X轴。
  90943. * @param {string} options.chartOptions.xAxis.field - 图表X轴字段名。
  90944. * @param {string} options.chartOptions.xAxis.name - 图表X轴名称。
  90945. * @param {Array.<Object>} options.chartOptions.yAxis - 图表Y轴。
  90946. * @param {string} options.chartOptions.yAxis.field - 图表Y轴字段名。
  90947. * @param {string} options.chartOptions.yAxis.name - 图表Y轴名称。
  90948. * @category Components Chart
  90949. * @usage
  90950. */
  90951. /**
  90952. * @typedef {Object} ChartView.Datasets - 数据来源。
  90953. * @property {string} [type = 'iServer'] - 服务类型 iServer, iPortal。
  90954. * @property {string} url - 服务地址。
  90955. * @property {boolean} [withCredentials = false] - 设置请求是否带cookie。
  90956. * @property {FilterParameter} queryInfo - 查询条件。
  90957. */
  90958. var ChartView = /*#__PURE__*/function () {
  90959. function ChartView(domID, options) {
  90960. ChartView_classCallCheck(this, ChartView);
  90961. this.domID = domID;
  90962. this.chartType = options.type || "bar";
  90963. // 设置options.datasets.type的默认值是iServer
  90964. options.datasets.type = options.datasets.type || 'iServer';
  90965. // 设置withCredentials的默认值为false
  90966. options.datasets.withCredentials = options.datasets.withCredentials || false;
  90967. this.viewModel = new ChartViewModel(options);
  90968. //添加控件。
  90969. this._fillDataToView();
  90970. }
  90971. /**
  90972. * @function ChartView.prototype.onAdd
  90973. * @description 创建图表之后成功回调。
  90974. * @param {function} addChart - 回调函数。
  90975. */
  90976. ChartView_createClass(ChartView, [{
  90977. key: "onAdd",
  90978. value: function onAdd(addChart) {
  90979. this.addChart = addChart;
  90980. }
  90981. /**
  90982. * @function ChartView.prototype._fillDataToView
  90983. * @description 填充数据到 view。
  90984. * @private
  90985. */
  90986. }, {
  90987. key: "_fillDataToView",
  90988. value: function _fillDataToView() {
  90989. var messageboxs = new MessageBox();
  90990. //iclient 绑定createChart事件成功回调
  90991. this.viewModel.getDatasetInfo(this._createChart.bind(this));
  90992. this.viewModel.events.on({
  90993. "getdatafailed": function getdatafailed(error) {
  90994. messageboxs.showView(error.message);
  90995. }
  90996. });
  90997. }
  90998. /**
  90999. * @function ChartView.prototype.getStyle
  91000. * @description 获取图表样式。
  91001. */
  91002. }, {
  91003. key: "getStyle",
  91004. value: function getStyle() {
  91005. return this.viewModel.getStyle();
  91006. }
  91007. /**
  91008. * @function ChartView.prototype.getFeatures
  91009. * @description 获取地图服务,数据服务请求返回的数据。
  91010. */
  91011. }, {
  91012. key: "getFeatures",
  91013. value: function getFeatures() {
  91014. return this.viewModel.getFeatures();
  91015. }
  91016. /**
  91017. * @function ChartView.prototype.setStyle
  91018. * @description 设置图表样式。
  91019. * @param {Object} style - 图表样式,参考Echarts-options样式设置。
  91020. */
  91021. }, {
  91022. key: "setStyle",
  91023. value: function setStyle(style) {
  91024. var newOptions = this.viewModel.setStyle(style);
  91025. this._updateChart(newOptions);
  91026. }
  91027. /**
  91028. * @function ChartView.prototype.changeType
  91029. * @description 改变图表类型。
  91030. * @param {string} type - 图表类型。
  91031. */
  91032. }, {
  91033. key: "changeType",
  91034. value: function changeType(type) {
  91035. if (this.chartType !== type) {
  91036. this.chartType = type;
  91037. var newOptions = this.viewModel.changeType(type);
  91038. this._updateChart(newOptions);
  91039. }
  91040. }
  91041. /**
  91042. * @function ChartView.prototype.updateData
  91043. * @description 更新图表数据。
  91044. * @param {ChartView.Datasets} datasets - 数据来源。
  91045. * @param {Object} chartOption - X,Y轴信息。
  91046. */
  91047. }, {
  91048. key: "updateData",
  91049. value: function updateData(datasets, chartOption) {
  91050. var me = this;
  91051. this.viewModel.updateData(datasets, chartOption, function (options) {
  91052. me._updateChart(options);
  91053. if (me.addChart) {
  91054. me.addChart();
  91055. }
  91056. });
  91057. }
  91058. /**
  91059. * @function ChartView.prototype._createChart
  91060. * @description 创建图表。
  91061. * @private
  91062. * @param {Object} data - 图表数据。
  91063. */
  91064. }, {
  91065. key: "_createChart",
  91066. value: function _createChart(data) {
  91067. this.echart = external_function_try_return_echarts_catch_e_return_namespaceObject.init(document.getElementById(this.domID), null, {
  91068. renderer: "canvas"
  91069. });
  91070. var options = this.viewModel._createChartOptions(data);
  91071. this.echart.setOption(options);
  91072. if (this.addChart) {
  91073. this.addChart();
  91074. }
  91075. }
  91076. /**
  91077. * @function ChartView.prototype._updateChart
  91078. * @description 更新图表。
  91079. * @private
  91080. * @param {Object} options - 图表参数。
  91081. */
  91082. }, {
  91083. key: "_updateChart",
  91084. value: function _updateChart(options) {
  91085. if (this.echart) {
  91086. this.echart.clear();
  91087. this.echart.setOption(options);
  91088. }
  91089. }
  91090. }]);
  91091. return ChartView;
  91092. }();
  91093. ;// CONCATENATED MODULE: ./src/common/components/templates/TemplateBase.js
  91094. function TemplateBase_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  91095. function TemplateBase_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  91096. function TemplateBase_createClass(Constructor, protoProps, staticProps) { if (protoProps) TemplateBase_defineProperties(Constructor.prototype, protoProps); if (staticProps) TemplateBase_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  91097. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  91098. * This program are made available under the terms of the Apache License, Version 2.0
  91099. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  91100. /**
  91101. * @class TemplateBase
  91102. * @aliasclass Components.TemplateBase
  91103. * @deprecatedclass SuperMap.Components.TemplateBase
  91104. * @classdesc 组件公用组件父类,用于约束统一封装的公用组件结构。
  91105. * @version 9.1.1
  91106. * @param {Object} options - 组件配置参数。
  91107. * @param {string} options.id - 组件 dom 元素 id。
  91108. * @category Components Common
  91109. * @usage
  91110. */
  91111. var TemplateBase = /*#__PURE__*/function () {
  91112. function TemplateBase(options) {
  91113. TemplateBase_classCallCheck(this, TemplateBase);
  91114. options = options ? options : {};
  91115. /**
  91116. * @member {string} [TemplateBase.prototype.id=null]
  91117. * @description 组件 dom 元素 id。
  91118. */
  91119. this.id = options.id ? options.id : null;
  91120. /**
  91121. * @member {HTMLElement} [TemplateBase.prototype.rootContainer=null]
  91122. * @description 组件 dom 元素对象。
  91123. */
  91124. this.rootContainer = null;
  91125. }
  91126. /**
  91127. * @function TemplateBase.prototype.getElement
  91128. * @description 获取当前组件元素对象。
  91129. * @return {HTMLElement} 组件 dom 元素对象
  91130. */
  91131. TemplateBase_createClass(TemplateBase, [{
  91132. key: "getElement",
  91133. value: function getElement() {
  91134. //todo 其实感觉再这里给组件设置不太合理
  91135. if (this.id) {
  91136. this.rootContainer.id = this.id;
  91137. }
  91138. return this.rootContainer;
  91139. }
  91140. /**
  91141. * @function TemplateBase.prototype._initView
  91142. * @private
  91143. * @description 初始化模板。
  91144. */
  91145. }, {
  91146. key: "_initView",
  91147. value: function _initView() {
  91148. //子类实现此方法
  91149. }
  91150. /**
  91151. * @function TemplateBase.prototype.showView
  91152. * @description 显示组件。
  91153. */
  91154. }, {
  91155. key: "showView",
  91156. value: function showView() {
  91157. this.rootContainer.hidden = false;
  91158. }
  91159. /**
  91160. * @function TemplateBase.prototype.closeView
  91161. * @description 隐藏组件。
  91162. */
  91163. }, {
  91164. key: "closeView",
  91165. value: function closeView() {
  91166. this.rootContainer.hidden = true;
  91167. }
  91168. }]);
  91169. return TemplateBase;
  91170. }();
  91171. ;// CONCATENATED MODULE: ./src/common/components/templates/CommonContainer.js
  91172. function CommonContainer_typeof(obj) { "@babel/helpers - typeof"; return CommonContainer_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, CommonContainer_typeof(obj); }
  91173. function CommonContainer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  91174. function CommonContainer_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  91175. function CommonContainer_createClass(Constructor, protoProps, staticProps) { if (protoProps) CommonContainer_defineProperties(Constructor.prototype, protoProps); if (staticProps) CommonContainer_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  91176. function CommonContainer_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) CommonContainer_setPrototypeOf(subClass, superClass); }
  91177. function CommonContainer_setPrototypeOf(o, p) { CommonContainer_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return CommonContainer_setPrototypeOf(o, p); }
  91178. function CommonContainer_createSuper(Derived) { var hasNativeReflectConstruct = CommonContainer_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = CommonContainer_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = CommonContainer_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return CommonContainer_possibleConstructorReturn(this, result); }; }
  91179. function CommonContainer_possibleConstructorReturn(self, call) { if (call && (CommonContainer_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return CommonContainer_assertThisInitialized(self); }
  91180. function CommonContainer_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  91181. function CommonContainer_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  91182. function CommonContainer_getPrototypeOf(o) { CommonContainer_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return CommonContainer_getPrototypeOf(o); }
  91183. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  91184. * This program are made available under the terms of the Apache License, Version 2.0
  91185. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  91186. /**
  91187. * @class CommonContainer
  91188. * @aliasclass Components.CommonContainer
  91189. * @deprecatedclass SuperMap.Components.CommonContainer
  91190. * @classdesc 组件统一外框。
  91191. * @version 9.1.1
  91192. * @param {Object} options - 组件配置参数。
  91193. * @param {string} options.id - 组件 dom 元素 id。
  91194. * @param {string} options.title - 标题。
  91195. * @category Components Common
  91196. * @extends {TemplateBase}
  91197. * @usage
  91198. */
  91199. var CommonContainer = /*#__PURE__*/function (_TemplateBase) {
  91200. CommonContainer_inherits(CommonContainer, _TemplateBase);
  91201. var _super = CommonContainer_createSuper(CommonContainer);
  91202. function CommonContainer(options) {
  91203. var _this;
  91204. CommonContainer_classCallCheck(this, CommonContainer);
  91205. _this = _super.call(this, options);
  91206. var title = options.title ? options.title : "";
  91207. _this._initView(title);
  91208. return _this;
  91209. }
  91210. /**
  91211. * @private
  91212. * @override
  91213. */
  91214. CommonContainer_createClass(CommonContainer, [{
  91215. key: "_initView",
  91216. value: function _initView(title) {
  91217. var container = document.createElement("div");
  91218. container.setAttribute("class", "component-container");
  91219. //title
  91220. var titleContainer = document.createElement("div");
  91221. titleContainer.setAttribute("class", "component-title");
  91222. var titleContent = document.createElement("div");
  91223. titleContent.innerHTML = title;
  91224. titleContainer.appendChild(titleContent);
  91225. container.appendChild(titleContainer);
  91226. //container
  91227. var componentContent = document.createElement("div");
  91228. componentContent.setAttribute("class", "component-content");
  91229. container.appendChild(componentContent);
  91230. this.content = componentContent;
  91231. this.rootContainer = container;
  91232. return container;
  91233. }
  91234. /**
  91235. * @function CommonContainer.prototype.getContentElement
  91236. * @description 获取内容元素容器。
  91237. */
  91238. }, {
  91239. key: "getContentElement",
  91240. value: function getContentElement() {
  91241. return this.content;
  91242. }
  91243. /**
  91244. * @function CommonContainer.prototype.appendContent
  91245. * @description 填充内容元素。
  91246. */
  91247. }, {
  91248. key: "appendContent",
  91249. value: function appendContent(element) {
  91250. this.content.appendChild(element);
  91251. }
  91252. }]);
  91253. return CommonContainer;
  91254. }(TemplateBase);
  91255. ;// CONCATENATED MODULE: ./src/common/components/templates/Select.js
  91256. function Select_typeof(obj) { "@babel/helpers - typeof"; return Select_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, Select_typeof(obj); }
  91257. function Select_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  91258. function Select_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  91259. function Select_createClass(Constructor, protoProps, staticProps) { if (protoProps) Select_defineProperties(Constructor.prototype, protoProps); if (staticProps) Select_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  91260. function Select_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) Select_setPrototypeOf(subClass, superClass); }
  91261. function Select_setPrototypeOf(o, p) { Select_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Select_setPrototypeOf(o, p); }
  91262. function Select_createSuper(Derived) { var hasNativeReflectConstruct = Select_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Select_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Select_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Select_possibleConstructorReturn(this, result); }; }
  91263. function Select_possibleConstructorReturn(self, call) { if (call && (Select_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return Select_assertThisInitialized(self); }
  91264. function Select_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  91265. function Select_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  91266. function Select_getPrototypeOf(o) { Select_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Select_getPrototypeOf(o); }
  91267. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  91268. * This program are made available under the terms of the Apache License, Version 2.0
  91269. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  91270. /**
  91271. * @class Select
  91272. * @aliasclass Components.Select
  91273. * @deprecatedclass SuperMap.Components.Select
  91274. * @classdesc 组件统一的文字下拉框。
  91275. * @version 9.1.1
  91276. * @param {Array.<string|Array>} options - 组件配置参数数组。
  91277. * @param {string} options.id - 组件 dom 元素 id。
  91278. * @param {string} [options.labelName] - label 名称。
  91279. * @param {Array.<string>} options.optionsArr - 需要创建的 option 数据数组。
  91280. * @param {function} [options.optionsClickCb] - option 点击事件回调函数。
  91281. * @extends {TemplateBase}
  91282. * @category Components Common
  91283. * @usage
  91284. */
  91285. var Select = /*#__PURE__*/function (_TemplateBase) {
  91286. Select_inherits(Select, _TemplateBase);
  91287. var _super = Select_createSuper(Select);
  91288. function Select(options) {
  91289. var _this;
  91290. Select_classCallCheck(this, Select);
  91291. _this = _super.call(this, options);
  91292. _this._initView(options);
  91293. return _this;
  91294. }
  91295. Select_createClass(Select, [{
  91296. key: "_initView",
  91297. value: function _initView(options) {
  91298. var selectTool = this._createElement('div', "component-selecttool");
  91299. if (options.labelName) {
  91300. var label = this._createElement('label', 'component-selecttool__lable--describe', selectTool);
  91301. label.innerHTML = options.labelName;
  91302. }
  91303. var chartSelect = this._createElement('div', 'component-selecttool--chart', selectTool);
  91304. chartSelect.setAttribute('tabindex', '1');
  91305. var selectName = this._createElement('div', "component-selecttool__name", chartSelect);
  91306. selectName.title = options.optionsArr[0];
  91307. selectName.innerHTML = options.optionsArr[0];
  91308. var chartTriangleBtn = this._createElement('div', 'component-selecttool__trianglebtn--chart', chartSelect);
  91309. var triangleBtn = this._createElement('div', 'component-triangle-down-img', chartTriangleBtn);
  91310. var selectContent = this._createElement('div', 'component-selecttool__content', chartSelect);
  91311. var scrollarea = this._createElement('div', 'component-selecttool__content--chart', selectContent);
  91312. var scrollareaContent = this._createElement('div', 'component-selecttool__scrollarea__content', scrollarea);
  91313. scrollareaContent.setAttribute('tabindex', '1');
  91314. this.createOptions(scrollareaContent, options.optionsArr);
  91315. this.optionClickEvent(scrollareaContent, selectName, options.optionsClickCb);
  91316. // 下拉框显示 & 隐藏事件
  91317. this._selectClickEvent(chartSelect, selectContent, triangleBtn);
  91318. this.rootContainer = selectTool;
  91319. }
  91320. /**
  91321. * @function Select.prototype.createOptions
  91322. * @description 创建所属下拉框选项。
  91323. */
  91324. }, {
  91325. key: "createOptions",
  91326. value: function createOptions(container, optionsArr) {
  91327. for (var i in optionsArr) {
  91328. var option = this._createElement('div', 'component-selecttool__option', container);
  91329. option.title = optionsArr[i];
  91330. option.innerHTML = optionsArr[i];
  91331. }
  91332. }
  91333. /**
  91334. * @function Select.prototype._selectClickEvent
  91335. * @description select 点击显示&隐藏事件。
  91336. * @private
  91337. */
  91338. }, {
  91339. key: "_selectClickEvent",
  91340. value: function _selectClickEvent(eventElement, contentElement, triangleBtn) {
  91341. eventElement.onclick = function (e) {
  91342. if (contentElement.style.display === "block") {
  91343. contentElement.style.display = "none";
  91344. triangleBtn.className = "component-triangle-down-img";
  91345. } else {
  91346. contentElement.style.display = "block";
  91347. triangleBtn.className = "triangle-up-img";
  91348. }
  91349. e.preventDefault();
  91350. e.stopPropagation();
  91351. };
  91352. eventElement.onmousedown = function (evt) {
  91353. //console.log('dropdownbox onmousedown '+evt.target.className);
  91354. if (evt.target !== this) {
  91355. this.focus();
  91356. evt.preventDefault();
  91357. evt.stopPropagation();
  91358. }
  91359. };
  91360. eventElement.onblur = function () {
  91361. contentElement.style.display = "none";
  91362. triangleBtn.className = "component-triangle-down-img";
  91363. };
  91364. }
  91365. /**
  91366. * @function Select.prototype._createElement
  91367. * @description 通用创建元素。
  91368. * @private
  91369. */
  91370. }, {
  91371. key: "_createElement",
  91372. value: function _createElement(tagName, className, parentEle) {
  91373. var ele = document.createElement(tagName || 'div');
  91374. className && (ele.className = className);
  91375. parentEle && parentEle.appendChild(ele);
  91376. return ele;
  91377. }
  91378. /**
  91379. * @function Select.prototype.optionClickEvent
  91380. * @description 下拉框的 option 的点击事件。
  91381. */
  91382. }, {
  91383. key: "optionClickEvent",
  91384. value: function optionClickEvent(optionEleArr, selectNameEle, optionsClickCb) {
  91385. var _loop = function _loop() {
  91386. var childEle = optionEleArr.children[i];
  91387. childEle.onclick = function () {
  91388. selectNameEle.innerHTML = childEle.innerHTML;
  91389. selectNameEle.title = childEle.title;
  91390. if (childEle.getAttribute('data-value')) {
  91391. selectNameEle.setAttribute('data-value', childEle.getAttribute('data-value'));
  91392. }
  91393. optionsClickCb && optionsClickCb(childEle);
  91394. };
  91395. };
  91396. for (var i = 0; i < optionEleArr.children.length; i++) {
  91397. _loop();
  91398. }
  91399. }
  91400. }]);
  91401. return Select;
  91402. }(TemplateBase);
  91403. ;// CONCATENATED MODULE: ./src/common/components/templates/DropDownBox.js
  91404. function DropDownBox_typeof(obj) { "@babel/helpers - typeof"; return DropDownBox_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, DropDownBox_typeof(obj); }
  91405. function DropDownBox_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  91406. function DropDownBox_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  91407. function DropDownBox_createClass(Constructor, protoProps, staticProps) { if (protoProps) DropDownBox_defineProperties(Constructor.prototype, protoProps); if (staticProps) DropDownBox_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  91408. function DropDownBox_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) DropDownBox_setPrototypeOf(subClass, superClass); }
  91409. function DropDownBox_setPrototypeOf(o, p) { DropDownBox_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return DropDownBox_setPrototypeOf(o, p); }
  91410. function DropDownBox_createSuper(Derived) { var hasNativeReflectConstruct = DropDownBox_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = DropDownBox_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = DropDownBox_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return DropDownBox_possibleConstructorReturn(this, result); }; }
  91411. function DropDownBox_possibleConstructorReturn(self, call) { if (call && (DropDownBox_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return DropDownBox_assertThisInitialized(self); }
  91412. function DropDownBox_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  91413. function DropDownBox_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  91414. function DropDownBox_getPrototypeOf(o) { DropDownBox_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return DropDownBox_getPrototypeOf(o); }
  91415. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  91416. * This program are made available under the terms of the Apache License, Version 2.0
  91417. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  91418. /**
  91419. * @class DropDownBox
  91420. * @aliasclass Components.DropDownBox
  91421. * @deprecatedclass SuperMap.Components.DropDownBox
  91422. * @classdesc 组件统一的图片下拉框。
  91423. * @version 9.1.1
  91424. * @param {Array.<Object>} options - 组件配置参数数组。
  91425. * @param {string} options.id - 组件 dom 元素 id。
  91426. * @param {string} options.title - 下拉框 title。
  91427. * @param {string} options.remark - 下拉框解释标记文本。
  91428. * @param {string} [options.dataValue] - 下拉框 attribute 名为 data-value 的值 。
  91429. * @param {string} [options.icon] - 下拉框图标。
  91430. * @param {string} [options.icon.className] - 下拉框图标类名。
  91431. * @param {string} [options.icon.background] - 下拉框图标背景 url。
  91432. * @category Components Common
  91433. * @extends {TemplateBase}
  91434. * @usage
  91435. */
  91436. var DropDownBox = /*#__PURE__*/function (_TemplateBase) {
  91437. DropDownBox_inherits(DropDownBox, _TemplateBase);
  91438. var _super = DropDownBox_createSuper(DropDownBox);
  91439. function DropDownBox(optionsArr) {
  91440. var _this;
  91441. DropDownBox_classCallCheck(this, DropDownBox);
  91442. _this = _super.call(this, optionsArr);
  91443. _this._initView(optionsArr);
  91444. return _this;
  91445. }
  91446. /**
  91447. * @function DropDownBox.prototype._initView
  91448. * @description 初始化下拉框。
  91449. * @private
  91450. * @override
  91451. */
  91452. DropDownBox_createClass(DropDownBox, [{
  91453. key: "_initView",
  91454. value: function _initView(optionsArr) {
  91455. var dropDownContainer = document.createElement('div');
  91456. dropDownContainer.className = 'component-dropdownbox--container';
  91457. var dropDownBox = document.createElement('div');
  91458. dropDownBox.setAttribute('tabindex', '1');
  91459. dropDownBox.className = "component-dropdownbox";
  91460. dropDownContainer.appendChild(dropDownBox);
  91461. var dropDownTopContainer = document.createElement('div');
  91462. dropDownBox.appendChild(dropDownTopContainer);
  91463. this._createDropDownOption(optionsArr[0], dropDownTopContainer);
  91464. var triangleBtnContainer = document.createElement('div');
  91465. triangleBtnContainer.className = 'component-dropdownbox__triangle-btn';
  91466. dropDownBox.appendChild(triangleBtnContainer);
  91467. var triangleBtn = document.createElement('div');
  91468. triangleBtn.className = 'component-triangle-down-img';
  91469. triangleBtnContainer.appendChild(triangleBtn);
  91470. var createDropDownBoxParam = {
  91471. "parentEle": dropDownBox,
  91472. "dropDownContent": ['component-dropdownbox__content component-dropdownbox__content--chart', 'dropDownContent'],
  91473. "scrollareaContent": 'component-selecttool__scrollarea__content',
  91474. "optionsArr": optionsArr,
  91475. "triangleBtn": triangleBtn,
  91476. "dropDownTopContainer": dropDownTopContainer
  91477. };
  91478. this._createDropDownBox(createDropDownBoxParam);
  91479. this.rootContainer = dropDownContainer;
  91480. }
  91481. /**
  91482. * @function DropDownBox.prototype._createDropDownBox
  91483. * @description 创建下拉框。
  91484. * @private
  91485. */
  91486. }, {
  91487. key: "_createDropDownBox",
  91488. value: function _createDropDownBox(createDropDownBoxParam) {
  91489. var dropDownBox = createDropDownBoxParam.parentEle;
  91490. var dropDownTopContainer = createDropDownBoxParam.dropDownTopContainer;
  91491. var dropDownContent = document.createElement('div');
  91492. dropDownContent.className = createDropDownBoxParam.dropDownContent[0];
  91493. dropDownBox.appendChild(dropDownContent);
  91494. var scrollareaContent = document.createElement('div');
  91495. scrollareaContent.className = createDropDownBoxParam.scrollareaContent;
  91496. dropDownContent.appendChild(scrollareaContent);
  91497. var optionsArr = createDropDownBoxParam.optionsArr;
  91498. for (var i = 0; i < optionsArr.length; i++) {
  91499. this._createDropDownOption(optionsArr[i], scrollareaContent);
  91500. }
  91501. // 下拉框显示 & 隐藏事件
  91502. var triangleBtn = createDropDownBoxParam.triangleBtn;
  91503. this._dropDownClickEvent(dropDownBox, dropDownContent, triangleBtn);
  91504. this._eleOnblur(dropDownBox, dropDownContent, triangleBtn);
  91505. // 下拉框 options 点击事件
  91506. var scrollareaOptions = scrollareaContent.children;
  91507. var _loop = function _loop(_i) {
  91508. scrollareaOptions[_i].onclick = function () {
  91509. dropDownTopContainer.innerHTML = scrollareaOptions[_i].outerHTML;
  91510. //evt.stopPropagation();
  91511. };
  91512. };
  91513. for (var _i2 = 0; _i2 < scrollareaOptions.length; _i2++) {
  91514. _loop(_i2);
  91515. }
  91516. }
  91517. /**
  91518. * @function DropDownBox.prototype._createDropDownOption
  91519. * @description 创建下拉框子元素。
  91520. * @private
  91521. */
  91522. }, {
  91523. key: "_createDropDownOption",
  91524. value: function _createDropDownOption(data, parentElement) {
  91525. var ele = document.createElement('div');
  91526. ele.className = 'component-dropdownbox__item';
  91527. var dataItem = data;
  91528. if (dataItem['dataValue']) {
  91529. ele.setAttribute('data-value', dataItem['dataValue']);
  91530. }
  91531. parentElement.appendChild(ele);
  91532. var imgContainer = document.createElement('div');
  91533. imgContainer.className = 'component-dropdownbox__item__img';
  91534. ele.appendChild(imgContainer);
  91535. var img = document.createElement('div');
  91536. if (dataItem.icon.className) {
  91537. img.className = dataItem.icon.className;
  91538. }
  91539. if (dataItem.icon.background) {
  91540. img.style.background = dataItem.icon.background;
  91541. }
  91542. imgContainer.appendChild(img);
  91543. var title = document.createElement('div');
  91544. title.className = 'component-dropdownbox__item__title';
  91545. title.title = dataItem.title;
  91546. title.innerHTML = dataItem.title;
  91547. ele.appendChild(title);
  91548. var remark = document.createElement('div');
  91549. remark.className = 'component-dropdownbox__item__remark';
  91550. remark.title = dataItem.remark;
  91551. remark.innerHTML = dataItem.remark;
  91552. ele.appendChild(remark);
  91553. }
  91554. /**
  91555. * @function DropDownBox.prototype._dropDownClickEvent
  91556. * @description 下拉框点击事件。
  91557. * @private
  91558. */
  91559. }, {
  91560. key: "_dropDownClickEvent",
  91561. value: function _dropDownClickEvent(eventElement, contentElement, triangleBtn) {
  91562. eventElement.onclick = function (e) {
  91563. if (contentElement.style.display === "block") {
  91564. contentElement.style.display = "none";
  91565. triangleBtn.className = "component-triangle-down-img";
  91566. } else {
  91567. contentElement.style.display = "block";
  91568. triangleBtn.className = "triangle-up-img";
  91569. }
  91570. e.preventDefault();
  91571. e.stopPropagation();
  91572. };
  91573. eventElement.onmousedown = function (evt) {
  91574. //console.log('dropdownbox onmousedown '+evt.target.className);
  91575. if (evt.target !== this) {
  91576. this.focus();
  91577. evt.preventDefault();
  91578. evt.stopPropagation();
  91579. }
  91580. };
  91581. }
  91582. /**
  91583. * @function DropDownBox.prototype._eleOnblur
  91584. * @description 下拉框失焦事件。
  91585. * @private
  91586. */
  91587. }, {
  91588. key: "_eleOnblur",
  91589. value: function _eleOnblur(eventElement, contentElement, triangleBtn) {
  91590. eventElement.onblur = function () {
  91591. contentElement.style.display = "none";
  91592. triangleBtn.className = "component-triangle-down-img";
  91593. };
  91594. }
  91595. /**
  91596. * @function DropDownBox.prototype._createElement
  91597. * @description 通用创建元素。
  91598. * @private
  91599. */
  91600. }, {
  91601. key: "_createElement",
  91602. value: function _createElement(tagName, className, parentEle) {
  91603. var ele = document.createElement(tagName || 'div');
  91604. className && (ele.className = className);
  91605. parentEle && parentEle.appendChild(ele);
  91606. return ele;
  91607. }
  91608. }]);
  91609. return DropDownBox;
  91610. }(TemplateBase);
  91611. ;// CONCATENATED MODULE: ./src/common/components/templates/PopContainer.js
  91612. function PopContainer_typeof(obj) { "@babel/helpers - typeof"; return PopContainer_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, PopContainer_typeof(obj); }
  91613. function PopContainer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  91614. function PopContainer_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  91615. function PopContainer_createClass(Constructor, protoProps, staticProps) { if (protoProps) PopContainer_defineProperties(Constructor.prototype, protoProps); if (staticProps) PopContainer_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  91616. function PopContainer_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) PopContainer_setPrototypeOf(subClass, superClass); }
  91617. function PopContainer_setPrototypeOf(o, p) { PopContainer_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return PopContainer_setPrototypeOf(o, p); }
  91618. function PopContainer_createSuper(Derived) { var hasNativeReflectConstruct = PopContainer_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = PopContainer_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = PopContainer_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return PopContainer_possibleConstructorReturn(this, result); }; }
  91619. function PopContainer_possibleConstructorReturn(self, call) { if (call && (PopContainer_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return PopContainer_assertThisInitialized(self); }
  91620. function PopContainer_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  91621. function PopContainer_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  91622. function PopContainer_getPrototypeOf(o) { PopContainer_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return PopContainer_getPrototypeOf(o); }
  91623. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  91624. * This program are made available under the terms of the Apache License, Version 2.0
  91625. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  91626. /**
  91627. * @class PopContainer
  91628. * @aliasclass Components.PopContainer
  91629. * @deprecatedclass SuperMap.Components.PopContainer
  91630. * @classdesc 弹框组件。
  91631. * @version 9.1.1
  91632. * @param {Object} options - 组件配置参数。
  91633. * @param {string} options.id - 组件 dom 元素 id。
  91634. * @param {string} options.title - 弹框组件名称。
  91635. * @extends {TemplateBase}
  91636. * @category Components Common
  91637. * @usage
  91638. */
  91639. var PopContainer = /*#__PURE__*/function (_TemplateBase) {
  91640. PopContainer_inherits(PopContainer, _TemplateBase);
  91641. var _super = PopContainer_createSuper(PopContainer);
  91642. function PopContainer(options) {
  91643. var _this;
  91644. PopContainer_classCallCheck(this, PopContainer);
  91645. options = options ? options : {};
  91646. _this = _super.call(this, options);
  91647. options.title = options.title ? options.title : "";
  91648. _this._initView(options.title);
  91649. return _this;
  91650. }
  91651. /**
  91652. * @private
  91653. * @override
  91654. */
  91655. PopContainer_createClass(PopContainer, [{
  91656. key: "_initView",
  91657. value: function _initView(titile) {
  91658. var container = document.createElement("div");
  91659. container.setAttribute("class", "component-popcontainer");
  91660. //header
  91661. var header = document.createElement("div");
  91662. header.setAttribute("class", "component-popcontainer__header");
  91663. var title = document.createElement("label");
  91664. title.setAttribute("class", "component-popcontainer__header__title");
  91665. title.innerHTML = titile;
  91666. header.appendChild(title);
  91667. var closeBtn = document.createElement("span");
  91668. closeBtn.setAttribute("class", "supermapol-icons-clear component-popcontainer__header__close");
  91669. closeBtn.onclick = this.closeView.bind(this);
  91670. container.appendChild(closeBtn);
  91671. container.appendChild(header);
  91672. //content
  91673. var content = document.createElement("div");
  91674. content.setAttribute("class", "component-popcontainer__content");
  91675. this.content = content;
  91676. container.appendChild(content);
  91677. this.rootContainer = container;
  91678. }
  91679. /**
  91680. * @function PopContainer.prototype.appendContent
  91681. * @description 追加内容。
  91682. * @param {HTMLElement} dom - 内容元素。
  91683. */
  91684. }, {
  91685. key: "appendContent",
  91686. value: function appendContent(dom) {
  91687. this.content.appendChild(dom);
  91688. }
  91689. }]);
  91690. return PopContainer;
  91691. }(TemplateBase);
  91692. ;// CONCATENATED MODULE: ./src/common/components/templates/AttributesPopContainer.js
  91693. function AttributesPopContainer_typeof(obj) { "@babel/helpers - typeof"; return AttributesPopContainer_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, AttributesPopContainer_typeof(obj); }
  91694. function AttributesPopContainer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  91695. function AttributesPopContainer_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  91696. function AttributesPopContainer_createClass(Constructor, protoProps, staticProps) { if (protoProps) AttributesPopContainer_defineProperties(Constructor.prototype, protoProps); if (staticProps) AttributesPopContainer_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  91697. function AttributesPopContainer_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) AttributesPopContainer_setPrototypeOf(subClass, superClass); }
  91698. function AttributesPopContainer_setPrototypeOf(o, p) { AttributesPopContainer_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return AttributesPopContainer_setPrototypeOf(o, p); }
  91699. function AttributesPopContainer_createSuper(Derived) { var hasNativeReflectConstruct = AttributesPopContainer_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = AttributesPopContainer_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = AttributesPopContainer_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return AttributesPopContainer_possibleConstructorReturn(this, result); }; }
  91700. function AttributesPopContainer_possibleConstructorReturn(self, call) { if (call && (AttributesPopContainer_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return AttributesPopContainer_assertThisInitialized(self); }
  91701. function AttributesPopContainer_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  91702. function AttributesPopContainer_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  91703. function AttributesPopContainer_getPrototypeOf(o) { AttributesPopContainer_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return AttributesPopContainer_getPrototypeOf(o); }
  91704. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  91705. * This program are made available under the terms of the Apache License, Version 2.0
  91706. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  91707. /**
  91708. * @class AttributesPopContainer
  91709. * @aliasclass Components.AttributesPopContainer
  91710. * @deprecatedclass SuperMap.Components.AttributesPopContainer
  91711. * @classdesc 属性弹框组件
  91712. * @version 9.1.1
  91713. * @param {Object} options - 组件配置参数。
  91714. * @param {string} options.id - 组件 dom 元素 id。
  91715. * @param {Object} options.title - 属性弹框组件名称。
  91716. * @param {Object} options.attributes - 组件需要显示的属性内容。
  91717. * @extends {PopContainer}
  91718. * @category Components Common
  91719. * @usage
  91720. */
  91721. var AttributesPopContainer = /*#__PURE__*/function (_PopContainer) {
  91722. AttributesPopContainer_inherits(AttributesPopContainer, _PopContainer);
  91723. var _super = AttributesPopContainer_createSuper(AttributesPopContainer);
  91724. function AttributesPopContainer(options) {
  91725. var _this;
  91726. AttributesPopContainer_classCallCheck(this, AttributesPopContainer);
  91727. //默认为属性:
  91728. options.title = options.title ? options.title : "属性";
  91729. _this = _super.call(this, options);
  91730. _this.rootContainer.firstChild.hidden = true;
  91731. options.attributes = options.attributes ? options.attributes : [];
  91732. _this._createAttributesTable(options.attributes);
  91733. return _this;
  91734. }
  91735. AttributesPopContainer_createClass(AttributesPopContainer, [{
  91736. key: "_createAttributesTable",
  91737. value: function _createAttributesTable(attributes) {
  91738. var table = document.createElement("table");
  91739. table.setAttribute("class", "component-popcontainer__content__table");
  91740. var tbody = document.createElement("tbody");
  91741. var single = true;
  91742. for (var name in attributes) {
  91743. var tr = document.createElement("tr");
  91744. if (single) {
  91745. tr.setAttribute("class", "component-popcontainer__content__td--color");
  91746. }
  91747. var title = document.createElement("td");
  91748. var titleSpan = document.createElement("Span");
  91749. titleSpan.innerHTML = name;
  91750. title.appendChild(titleSpan);
  91751. var value = document.createElement("td");
  91752. value.innerHTML = attributes[name];
  91753. tr.appendChild(title);
  91754. tr.appendChild(value);
  91755. tbody.appendChild(tr);
  91756. single = !single;
  91757. }
  91758. table.appendChild(tbody);
  91759. this.appendContent(table);
  91760. }
  91761. }]);
  91762. return AttributesPopContainer;
  91763. }(PopContainer);
  91764. ;// CONCATENATED MODULE: ./src/common/components/templates/IndexTabsPageContainer.js
  91765. function IndexTabsPageContainer_typeof(obj) { "@babel/helpers - typeof"; return IndexTabsPageContainer_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, IndexTabsPageContainer_typeof(obj); }
  91766. function IndexTabsPageContainer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  91767. function IndexTabsPageContainer_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  91768. function IndexTabsPageContainer_createClass(Constructor, protoProps, staticProps) { if (protoProps) IndexTabsPageContainer_defineProperties(Constructor.prototype, protoProps); if (staticProps) IndexTabsPageContainer_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  91769. function IndexTabsPageContainer_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) IndexTabsPageContainer_setPrototypeOf(subClass, superClass); }
  91770. function IndexTabsPageContainer_setPrototypeOf(o, p) { IndexTabsPageContainer_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return IndexTabsPageContainer_setPrototypeOf(o, p); }
  91771. function IndexTabsPageContainer_createSuper(Derived) { var hasNativeReflectConstruct = IndexTabsPageContainer_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = IndexTabsPageContainer_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = IndexTabsPageContainer_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return IndexTabsPageContainer_possibleConstructorReturn(this, result); }; }
  91772. function IndexTabsPageContainer_possibleConstructorReturn(self, call) { if (call && (IndexTabsPageContainer_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return IndexTabsPageContainer_assertThisInitialized(self); }
  91773. function IndexTabsPageContainer_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  91774. function IndexTabsPageContainer_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  91775. function IndexTabsPageContainer_getPrototypeOf(o) { IndexTabsPageContainer_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return IndexTabsPageContainer_getPrototypeOf(o); }
  91776. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  91777. * This program are made available under the terms of the Apache License, Version 2.0
  91778. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  91779. /**
  91780. * @class IndexTabsPageContainer
  91781. * @aliasclass Components.IndexTabsPageContainer
  91782. * @deprecatedclass SuperMap.Components.IndexTabsPageContainer
  91783. * @classdesc 标签索引组件。
  91784. * @version 9.1.1
  91785. * @param {Object} options - 组件配置参数。
  91786. * @param {string} options.id - 组件 dom 元素 id。
  91787. * @category Components Common
  91788. * @extends {TemplateBase}
  91789. * @usage
  91790. */
  91791. var IndexTabsPageContainer = /*#__PURE__*/function (_TemplateBase) {
  91792. IndexTabsPageContainer_inherits(IndexTabsPageContainer, _TemplateBase);
  91793. var _super = IndexTabsPageContainer_createSuper(IndexTabsPageContainer);
  91794. function IndexTabsPageContainer(options) {
  91795. var _this;
  91796. IndexTabsPageContainer_classCallCheck(this, IndexTabsPageContainer);
  91797. _this = _super.call(this, options);
  91798. _this._initView();
  91799. return _this;
  91800. }
  91801. /**
  91802. * @private
  91803. * @override
  91804. */
  91805. IndexTabsPageContainer_createClass(IndexTabsPageContainer, [{
  91806. key: "_initView",
  91807. value: function _initView() {
  91808. var container = document.createElement("div");
  91809. container.setAttribute("class", "component-tabpage");
  91810. var header = document.createElement("ul");
  91811. this.header = header;
  91812. var content = document.createElement("div");
  91813. content.setAttribute("class", "component-tabpage__content");
  91814. this.content = content;
  91815. container.appendChild(header);
  91816. container.appendChild(content);
  91817. this.rootContainer = container;
  91818. }
  91819. /**
  91820. * @function IndexTabsPageContainer.prototype.setTabs
  91821. * @description 设置标签元素。
  91822. * @param {Array.<HTMLElement>} tabs
  91823. */
  91824. }, {
  91825. key: "setTabs",
  91826. value: function setTabs(tabs) {
  91827. this.removeAllTabs();
  91828. this.appendTabs(tabs);
  91829. }
  91830. /**
  91831. * @function IndexTabsPageContainer.prototype.appendTabs
  91832. * @description 追加标签元素。
  91833. * @param {Array.<HTMLElement>} tabs
  91834. */
  91835. }, {
  91836. key: "appendTabs",
  91837. value: function appendTabs(tabs) {
  91838. for (var i = 0; i < tabs.length; i++) {
  91839. var title = document.createElement("span");
  91840. title.index = i;
  91841. title.appendChild(document.createTextNode(tabs[i].title));
  91842. //绑定标签切换对应页面:
  91843. title.onclick = this._changeTabsPage.bind(this);
  91844. var content = tabs[i].content;
  91845. content.index = i;
  91846. content.hidden = true;
  91847. this.header.appendChild(title);
  91848. this.content.appendChild(content);
  91849. }
  91850. //todo 确认是否两个子元素的 index 相互对应
  91851. //默认显示第一个标签对象
  91852. this.header.firstChild.setAttribute("class", "on");
  91853. this.content.firstChild.hidden = false;
  91854. }
  91855. /**
  91856. * @function IndexTabsPageContainer.prototype.removeTab
  91857. * @description 删除某个标签页面。
  91858. * @param {number} index - 标签索引号。
  91859. */
  91860. }, {
  91861. key: "removeTab",
  91862. value: function removeTab(index) {
  91863. this.header.removeChild(this.header.children[index]);
  91864. this.content.removeChild(this.content.children[index]);
  91865. }
  91866. /**
  91867. * @function IndexTabsPageContainer.prototype.removeAllTabs
  91868. * @description 删除所有标签。
  91869. */
  91870. }, {
  91871. key: "removeAllTabs",
  91872. value: function removeAllTabs() {
  91873. for (var i = this.header.children.length; i > 0; i--) {
  91874. this.header.removeChild(this.header.children[i]);
  91875. this.content.removeChild(this.content.children[i]);
  91876. }
  91877. }
  91878. }, {
  91879. key: "_changeTabsPage",
  91880. value: function _changeTabsPage(e) {
  91881. var index = e.target.index;
  91882. for (var i = 0; i < this.header.children.length; i++) {
  91883. this.header.children[i].setAttribute("class", "");
  91884. this.content.children[i].hidden = true;
  91885. if (i === index) {
  91886. this.header.children[i].setAttribute("class", "on");
  91887. this.content.children[i].hidden = false;
  91888. }
  91889. }
  91890. }
  91891. }]);
  91892. return IndexTabsPageContainer;
  91893. }(TemplateBase);
  91894. ;// CONCATENATED MODULE: ./src/common/components/templates/CityTabsPage.js
  91895. function CityTabsPage_typeof(obj) { "@babel/helpers - typeof"; return CityTabsPage_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, CityTabsPage_typeof(obj); }
  91896. function CityTabsPage_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  91897. function CityTabsPage_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  91898. function CityTabsPage_createClass(Constructor, protoProps, staticProps) { if (protoProps) CityTabsPage_defineProperties(Constructor.prototype, protoProps); if (staticProps) CityTabsPage_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  91899. function CityTabsPage_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) CityTabsPage_setPrototypeOf(subClass, superClass); }
  91900. function CityTabsPage_setPrototypeOf(o, p) { CityTabsPage_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return CityTabsPage_setPrototypeOf(o, p); }
  91901. function CityTabsPage_createSuper(Derived) { var hasNativeReflectConstruct = CityTabsPage_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = CityTabsPage_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = CityTabsPage_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return CityTabsPage_possibleConstructorReturn(this, result); }; }
  91902. function CityTabsPage_possibleConstructorReturn(self, call) { if (call && (CityTabsPage_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return CityTabsPage_assertThisInitialized(self); }
  91903. function CityTabsPage_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  91904. function CityTabsPage_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  91905. function CityTabsPage_getPrototypeOf(o) { CityTabsPage_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return CityTabsPage_getPrototypeOf(o); }
  91906. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  91907. * This program are made available under the terms of the Apache License, Version 2.0
  91908. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  91909. /**
  91910. * @class CityTabsPage
  91911. * @aliasclass Components.CityTabsPage
  91912. * @deprecatedclass SuperMap.Components.CityTabsPage
  91913. * @classdesc 城市地址匹配组件模板
  91914. * @version 9.1.1
  91915. * @param {Object} options - 组件配置参数。
  91916. * @param {string} options.id - 组件 dom 元素 id。
  91917. * @param {Object|Array.<string>} options.config - 城市名称配置列表,支持两种格式:{key1:{A:[],B:[]}, key2:{C:[],D:[]}} 或
  91918. * ["成都市","北京市"],用户可根据自己的项目需求进行配置
  91919. * @extends {IndexTabsPageContainer}
  91920. * @category Components Common
  91921. * @usage
  91922. */
  91923. var CityTabsPage = /*#__PURE__*/function (_IndexTabsPageContain) {
  91924. CityTabsPage_inherits(CityTabsPage, _IndexTabsPageContain);
  91925. var _super = CityTabsPage_createSuper(CityTabsPage);
  91926. function CityTabsPage(options) {
  91927. var _this;
  91928. CityTabsPage_classCallCheck(this, CityTabsPage);
  91929. _this = _super.call(this, options);
  91930. //去掉默认的边框阴影样式:
  91931. _this.rootContainer.classList.add("component-citytabpage--noneBoxShadow");
  91932. _this.config = options.config;
  91933. //header,若 config为城市名称数组,则直接加载内容
  91934. if (Util_Util.isArray(_this.config)) {
  91935. _this.header.hidden = true;
  91936. _this._createCityItem("城市", _this.config);
  91937. _this.content.style.border = "none";
  91938. } else {
  91939. _this._createTabs();
  91940. _this.header.onclick = function (e) {
  91941. //关闭所有元素 是否有更简化的写法?
  91942. for (var i = 0; i < _this.header.children.length; i++) {
  91943. _this.header.children[i].setAttribute("class", "");
  91944. }
  91945. //打开点击内容元素
  91946. e.target.setAttribute("class", "on");
  91947. _this._createCityContent(e.target.innerHTML);
  91948. };
  91949. }
  91950. return _this;
  91951. }
  91952. /**
  91953. * @function CityTabsPage.prototype._createTabs
  91954. * @description 创建 Tabs
  91955. * @private
  91956. */
  91957. CityTabsPage_createClass(CityTabsPage, [{
  91958. key: "_createTabs",
  91959. value: function _createTabs() {
  91960. //header
  91961. if (Util_Util.isArray(this.config)) {
  91962. for (var i = 0; i < this.config.length; i++) {
  91963. var innerHTML = "";
  91964. for (var key in this.config[i]) {
  91965. innerHTML += key;
  91966. }
  91967. var li = document.createElement("li");
  91968. li.innerHTML = innerHTML;
  91969. this.header.appendChild(li);
  91970. }
  91971. } else {
  91972. for (var _key2 in this.config) {
  91973. var _li = document.createElement("li");
  91974. _li.innerHTML = _key2;
  91975. this.header.appendChild(_li);
  91976. }
  91977. }
  91978. this.header.firstChild.setAttribute("class", "on");
  91979. this._createCityContent(this.header.firstChild.innerHTML);
  91980. }
  91981. /**
  91982. * @function CityTabsPage.prototype._createCityContent
  91983. * @description 创建列表容器
  91984. * @private
  91985. */
  91986. }, {
  91987. key: "_createCityContent",
  91988. value: function _createCityContent(keyName) {
  91989. //清除元素:
  91990. for (var i = this.content.children.length; i > 0; i--) {
  91991. this.content.removeChild(this.content.children[i - 1]);
  91992. }
  91993. //创建对应元素
  91994. var cities = this.config[keyName];
  91995. for (var key in cities) {
  91996. this._createCityItem(key, cities[key]);
  91997. }
  91998. }
  91999. /**
  92000. * @function CityTabsPage.prototype._createCityContent
  92001. * @description 创建列表容器
  92002. * @private
  92003. */
  92004. }, {
  92005. key: "_createCityItem",
  92006. value: function _createCityItem(key, cities) {
  92007. var city = document.createElement("div");
  92008. var cityClass = document.createElement("div");
  92009. cityClass.setAttribute("class", "component-citytabpag__py-key");
  92010. cityClass.innerHTML = key;
  92011. city.appendChild(cityClass);
  92012. var cityContent = document.createElement("div");
  92013. cityContent.setAttribute("class", "component-citytabpag__content");
  92014. for (var i = 0; i < cities.length; i++) {
  92015. var span = document.createElement("span");
  92016. span.innerHTML = cities[i];
  92017. cityContent.appendChild(span);
  92018. }
  92019. //HOT 元素长度单独微调:
  92020. if (key === "HOT") {
  92021. cityContent.style.width = "428px";
  92022. }
  92023. city.appendChild(cityContent);
  92024. this.content.appendChild(city);
  92025. }
  92026. }]);
  92027. return CityTabsPage;
  92028. }(IndexTabsPageContainer);
  92029. ;// CONCATENATED MODULE: ./src/common/components/templates/NavTabsPage.js
  92030. function NavTabsPage_typeof(obj) { "@babel/helpers - typeof"; return NavTabsPage_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, NavTabsPage_typeof(obj); }
  92031. function NavTabsPage_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  92032. function NavTabsPage_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  92033. function NavTabsPage_createClass(Constructor, protoProps, staticProps) { if (protoProps) NavTabsPage_defineProperties(Constructor.prototype, protoProps); if (staticProps) NavTabsPage_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  92034. function NavTabsPage_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) NavTabsPage_setPrototypeOf(subClass, superClass); }
  92035. function NavTabsPage_setPrototypeOf(o, p) { NavTabsPage_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return NavTabsPage_setPrototypeOf(o, p); }
  92036. function NavTabsPage_createSuper(Derived) { var hasNativeReflectConstruct = NavTabsPage_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = NavTabsPage_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = NavTabsPage_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return NavTabsPage_possibleConstructorReturn(this, result); }; }
  92037. function NavTabsPage_possibleConstructorReturn(self, call) { if (call && (NavTabsPage_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return NavTabsPage_assertThisInitialized(self); }
  92038. function NavTabsPage_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  92039. function NavTabsPage_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  92040. function NavTabsPage_getPrototypeOf(o) { NavTabsPage_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return NavTabsPage_getPrototypeOf(o); }
  92041. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  92042. * This program are made available under the terms of the Apache License, Version 2.0
  92043. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  92044. /**
  92045. * @class NavTabsPage
  92046. * @aliasclass Components.NavTabsPage
  92047. * @deprecatedclass SuperMap.Components.NavTabsPage
  92048. * @classdesc 标签页面组件。
  92049. * @version 9.1.1
  92050. * @param {Object} options - 组件配置参数。
  92051. * @param {string} options.id - 组件 dom 元素 id。
  92052. * @param {Array.<Object>} [options.tabs=[]] - 标签对象数组,形如:[{title: "",content: HTMLElement}],初始时,传入则创建页面。
  92053. * @extends {TemplateBase}
  92054. * @category Components Common
  92055. * @usage
  92056. */
  92057. // todo 思考拆分的控件应该以哪种方式使用
  92058. var NavTabsPage = /*#__PURE__*/function (_TemplateBase) {
  92059. NavTabsPage_inherits(NavTabsPage, _TemplateBase);
  92060. var _super = NavTabsPage_createSuper(NavTabsPage);
  92061. function NavTabsPage(options) {
  92062. var _this;
  92063. NavTabsPage_classCallCheck(this, NavTabsPage);
  92064. _this = _super.call(this, options);
  92065. _this.navTabsTitle = null;
  92066. _this.navTabsContent = null;
  92067. options.tabs = options.tabs ? options.tabs : [];
  92068. _this._initView(options.tabs);
  92069. return _this;
  92070. }
  92071. /**
  92072. * @override
  92073. * @private
  92074. */
  92075. NavTabsPage_createClass(NavTabsPage, [{
  92076. key: "_initView",
  92077. value: function _initView(tabs) {
  92078. var navTabsPage = document.createElement("div");
  92079. navTabsPage.setAttribute("class", "component-navtabspage");
  92080. //关闭按钮
  92081. var closeBtn = document.createElement("span");
  92082. closeBtn.setAttribute("class", "supermapol-icons-close");
  92083. closeBtn.onclick = this.closeView.bind(this);
  92084. navTabsPage.appendChild(closeBtn);
  92085. //标签
  92086. var navTabsTitle = document.createElement("div");
  92087. this.navTabsTitle = navTabsTitle;
  92088. navTabsTitle.setAttribute("class", "component-navtabspage__title");
  92089. navTabsPage.appendChild(navTabsTitle);
  92090. //内容
  92091. var navTabsContent = document.createElement("div");
  92092. this.navTabsContent = navTabsContent;
  92093. navTabsContent.setAttribute("class", "component-navtabspage__content");
  92094. navTabsPage.appendChild(navTabsContent);
  92095. //若 tabs 初始传入值,则
  92096. if (tabs.length > 0) {
  92097. this.appendTabs(tabs);
  92098. }
  92099. this.rootContainer = navTabsPage;
  92100. }
  92101. /**
  92102. * @function NavTabsPage.prototype.setTabs
  92103. * @description 设置标签。
  92104. * @param {Array.<Object>} tabs - 标签对象数组,形如:[{title: "",content: {}}]。
  92105. */
  92106. }, {
  92107. key: "setTabs",
  92108. value: function setTabs(tabs) {
  92109. this.removeAllTabs();
  92110. this.appendTabs(tabs);
  92111. }
  92112. /**
  92113. * @function NavTabsPage.prototype.appendTabs
  92114. * @description 添加标签页面。
  92115. * @param {Array.<Object>} tabs - 标签对象数组,形如:[{title: "",content: {}}]。
  92116. */
  92117. }, {
  92118. key: "appendTabs",
  92119. value: function appendTabs(tabs) {
  92120. for (var i = 0; i < tabs.length; i++) {
  92121. var title = document.createElement("span");
  92122. title.index = i;
  92123. title.appendChild(document.createTextNode(tabs[i].title));
  92124. //绑定标签切换对应页面:
  92125. title.onclick = this._changeTabsPage.bind(this);
  92126. var content = tabs[i].content;
  92127. content.index = i;
  92128. content.hidden = true;
  92129. this.navTabsTitle.appendChild(title);
  92130. this.navTabsContent.appendChild(content);
  92131. }
  92132. //todo 确认是否两个子元素的 index 相互对应
  92133. //默认显示第一个标签对象
  92134. this.navTabsTitle.firstChild.setAttribute("class", "component-navtabspage__tabs--select");
  92135. this.navTabsContent.firstChild.hidden = false;
  92136. }
  92137. /**
  92138. * @function NavTabsPage.prototype.removeTab
  92139. * @description 删除某个标签页面。
  92140. * @param {number} index - 标签索引号。
  92141. */
  92142. }, {
  92143. key: "removeTab",
  92144. value: function removeTab(index) {
  92145. this.navTabsTitle.removeChild(this.navTabsTitle.children[index]);
  92146. this.navTabsContent.removeChild(this.navTabsContent.children[index]);
  92147. }
  92148. /**
  92149. * @function NavTabsPage.prototype.removeAllTabs
  92150. * @description 删除所有标签。
  92151. */
  92152. }, {
  92153. key: "removeAllTabs",
  92154. value: function removeAllTabs() {
  92155. for (var i = this.navTabsTitle.children.length; i > 0; i--) {
  92156. this.navTabsTitle.removeChild(this.navTabsTitle.children[i]);
  92157. this.navTabsContent.removeChild(this.navTabsContent.children[i]);
  92158. }
  92159. }
  92160. }, {
  92161. key: "_changeTabsPage",
  92162. value: function _changeTabsPage(e) {
  92163. var index = e.target.index;
  92164. for (var i = 0; i < this.navTabsTitle.children.length; i++) {
  92165. this.navTabsTitle.children[i].setAttribute("class", "");
  92166. this.navTabsContent.children[i].hidden = true;
  92167. if (i === index) {
  92168. this.navTabsTitle.children[i].setAttribute("class", "component-navtabspage__tabs--select");
  92169. this.navTabsContent.children[i].hidden = false;
  92170. }
  92171. }
  92172. }
  92173. }]);
  92174. return NavTabsPage;
  92175. }(TemplateBase);
  92176. ;// CONCATENATED MODULE: ./src/common/components/templates/PaginationContainer.js
  92177. function PaginationContainer_typeof(obj) { "@babel/helpers - typeof"; return PaginationContainer_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, PaginationContainer_typeof(obj); }
  92178. function PaginationContainer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  92179. function PaginationContainer_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  92180. function PaginationContainer_createClass(Constructor, protoProps, staticProps) { if (protoProps) PaginationContainer_defineProperties(Constructor.prototype, protoProps); if (staticProps) PaginationContainer_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  92181. function PaginationContainer_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) PaginationContainer_setPrototypeOf(subClass, superClass); }
  92182. function PaginationContainer_setPrototypeOf(o, p) { PaginationContainer_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return PaginationContainer_setPrototypeOf(o, p); }
  92183. function PaginationContainer_createSuper(Derived) { var hasNativeReflectConstruct = PaginationContainer_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = PaginationContainer_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = PaginationContainer_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return PaginationContainer_possibleConstructorReturn(this, result); }; }
  92184. function PaginationContainer_possibleConstructorReturn(self, call) { if (call && (PaginationContainer_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return PaginationContainer_assertThisInitialized(self); }
  92185. function PaginationContainer_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  92186. function PaginationContainer_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  92187. function PaginationContainer_getPrototypeOf(o) { PaginationContainer_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return PaginationContainer_getPrototypeOf(o); }
  92188. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  92189. * This program are made available under the terms of the Apache License, Version 2.0
  92190. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  92191. /**
  92192. * @class PaginationContainer
  92193. * @aliasclass Components.PaginationContainer
  92194. * @deprecatedclass SuperMap.Components.PaginationContainer
  92195. * @classdesc 分页组件模板。
  92196. * @version 9.1.1
  92197. * @param {Object} options - 组件配置参数。
  92198. * @param {string} options.id - 组件 dom 元素 id。
  92199. * @param {HTMLElement} options.contents - 页面填充的 DOM 元素对象。
  92200. * @param {number} options.pageCounts - 页数。
  92201. * @extends {TemplateBase}
  92202. * @category Components Common
  92203. * @usage
  92204. */
  92205. var PaginationContainer = /*#__PURE__*/function (_TemplateBase) {
  92206. PaginationContainer_inherits(PaginationContainer, _TemplateBase);
  92207. var _super = PaginationContainer_createSuper(PaginationContainer);
  92208. function PaginationContainer(options) {
  92209. var _this;
  92210. PaginationContainer_classCallCheck(this, PaginationContainer);
  92211. options = options ? options : {};
  92212. _this = _super.call(this, options);
  92213. _this.currentPage = 0;
  92214. _this.pageNumberLis = [];
  92215. _this.currentPageNumberLis = [];
  92216. _this.linkageEvent = null;
  92217. options.contents = options.contents ? options.contents : null;
  92218. options.pageCounts = options.pageCounts ? options.pageCounts : 0;
  92219. _this._initView(options.contents, options.pageCounts);
  92220. return _this;
  92221. }
  92222. /**
  92223. * @function PaginationContainer.prototype.setLinkageEvent
  92224. * @description 设置页面联动方法。
  92225. * @param {function} linkageEvent - 联动方法,实现指定功能。
  92226. */
  92227. PaginationContainer_createClass(PaginationContainer, [{
  92228. key: "setLinkageEvent",
  92229. value: function setLinkageEvent(linkageEvent) {
  92230. this.linkageEvent = linkageEvent;
  92231. }
  92232. /**
  92233. * @private
  92234. * @override
  92235. */
  92236. }, {
  92237. key: "_initView",
  92238. value: function _initView(contents, pageCounts) {
  92239. var container = document.createElement("div");
  92240. container.setAttribute("class", "component-pagination");
  92241. //content
  92242. var content = document.createElement("div");
  92243. content.setAttribute("class", "component-pagination__content");
  92244. container.appendChild(content);
  92245. this.content = content;
  92246. //link
  92247. var link = document.createElement("ul");
  92248. link.setAttribute("class", "component-pagination__link");
  92249. link.onclick = this._changePageEvent.bind(this);
  92250. container.appendChild(link);
  92251. this._createLink(link);
  92252. this.link = link;
  92253. //填充内容:
  92254. if (contents) {
  92255. this.setContent(contents);
  92256. }
  92257. if (pageCounts !== 0) {
  92258. this.setPageLink(pageCounts);
  92259. }
  92260. this.rootContainer = container;
  92261. }
  92262. /**---------以下是页面相关操作 **/
  92263. /**
  92264. * @function PaginationContainer.prototype.setContent
  92265. * @description 设置页面内容。
  92266. * @param {HTMLElement} element - 页面内容元素。
  92267. */
  92268. }, {
  92269. key: "setContent",
  92270. value: function setContent(element) {
  92271. this.clearContent();
  92272. this.appendContent(element);
  92273. }
  92274. /**
  92275. * @function PaginationContainer.prototype.appendContent
  92276. * @description 追加内容。
  92277. * @param {HTMLElement} element - 页面内容元素。
  92278. */
  92279. }, {
  92280. key: "appendContent",
  92281. value: function appendContent(element) {
  92282. this.content.appendChild(element);
  92283. }
  92284. /**
  92285. * @function PaginationContainer.prototype.clearContent
  92286. * @description 清空内容元素。
  92287. */
  92288. }, {
  92289. key: "clearContent",
  92290. value: function clearContent() {
  92291. for (var i = this.content.children.length - 1; i >= 0; i--) {
  92292. this.content.removeChild(this.content.children[i]);
  92293. }
  92294. }
  92295. /** -----以下是页码相关的操作:**/
  92296. /**
  92297. * @function PaginationContainer.prototype.setPageLink
  92298. * @description 设置页码数。
  92299. * @param {number} pageNumber - 页码数。
  92300. */
  92301. }, {
  92302. key: "setPageLink",
  92303. value: function setPageLink(pageNumber) {
  92304. //清空当前页码
  92305. this.pageNumberLis = [];
  92306. this.currentPageNumberLis = [];
  92307. this.clearPageLink();
  92308. //创建页码
  92309. this._createPageLi(pageNumber);
  92310. //添加页码到页码列表
  92311. this._appendPageLink();
  92312. }
  92313. /**
  92314. * @description 创建页码。
  92315. * @param pageNumber
  92316. * @private
  92317. */
  92318. }, {
  92319. key: "_createPageLi",
  92320. value: function _createPageLi(pageNumber) {
  92321. for (var i = 0; i < pageNumber; i++) {
  92322. var pageLi = document.createElement("li");
  92323. pageLi.innerHTML = i + 1;
  92324. /*const liContent = document.createElement("span");
  92325. liContent.innerHTML = i + 1;*/
  92326. // pageLi.appendChild(liContent);
  92327. this.pageNumberLis.push(pageLi);
  92328. }
  92329. this.pageNumberLis[0].setAttribute("class", "active");
  92330. this.currentPage = 1;
  92331. if (pageNumber < 5) {
  92332. this.currentPageNumberLis = this.pageNumberLis;
  92333. } else {
  92334. for (var _i2 = 0; _i2 < 5; _i2++) {
  92335. this.currentPageNumberLis.push(this.pageNumberLis[_i2]);
  92336. }
  92337. }
  92338. }
  92339. /**
  92340. * @description 添加页码到页码列表。
  92341. * @private
  92342. */
  92343. }, {
  92344. key: "_appendPageLink",
  92345. value: function _appendPageLink() {
  92346. //todo 如何插入中间
  92347. for (var i = 0; i < this.currentPageNumberLis.length; i++) {
  92348. this.link.insertBefore(this.currentPageNumberLis[i], this.link.childNodes[this.link.children.length - 2]);
  92349. }
  92350. for (var _i4 = 0; _i4 < this.currentPageNumberLis.length; _i4++) {
  92351. //清空 active 状态
  92352. this.currentPageNumberLis[_i4].setAttribute("class", "");
  92353. //给当前选中的 li 赋值 active 状态
  92354. if (Number(this.currentPageNumberLis[_i4].innerHTML) === this.currentPage) {
  92355. this.currentPageNumberLis[_i4].setAttribute("class", "active");
  92356. }
  92357. }
  92358. //根据 currentPage 改变按钮状态
  92359. this._changeDisableState();
  92360. if (this.linkageEvent) {
  92361. this.linkageEvent(this.currentPage);
  92362. }
  92363. }
  92364. /**
  92365. * @function PaginationContainer.prototype.clearPageLink
  92366. * @description 清除页码列表。
  92367. */
  92368. }, {
  92369. key: "clearPageLink",
  92370. value: function clearPageLink() {
  92371. for (var i = this.link.children.length - 3; i > 1; i--) {
  92372. this.link.removeChild(this.link.children[i]);
  92373. }
  92374. }
  92375. /**
  92376. * @description 创建页码按钮。
  92377. * @param ul
  92378. * @private
  92379. */
  92380. }, {
  92381. key: "_createLink",
  92382. value: function _createLink(ul) {
  92383. for (var i = 0; i < 4; i++) {
  92384. var li = document.createElement("li");
  92385. li.setAttribute("class", "disable");
  92386. var liContent = document.createElement("span");
  92387. li.appendChild(liContent);
  92388. if (i === 0) {
  92389. liContent.id = "first";
  92390. liContent.setAttribute("class", "supermapol-icons-first");
  92391. } else if (i === 1) {
  92392. liContent.id = "prev";
  92393. liContent.setAttribute("class", "supermapol-icons-prev");
  92394. } else if (i === 2) {
  92395. liContent.id = "next";
  92396. liContent.setAttribute("class", "supermapol-icons-next");
  92397. } else if (i === 3) {
  92398. liContent.id = "last";
  92399. liContent.setAttribute("class", "supermapol-icons-last");
  92400. }
  92401. ul.appendChild(li);
  92402. }
  92403. }
  92404. /**
  92405. * @description 点击页码事件。
  92406. * @param e
  92407. * @private
  92408. */
  92409. }, {
  92410. key: "_changePageEvent",
  92411. value: function _changePageEvent(e) {
  92412. //todo
  92413. var trigger = e.target;
  92414. //若列表禁用,点击无效
  92415. if (trigger.parentElement.classList[0] === "disable") {
  92416. return;
  92417. }
  92418. var targetLi;
  92419. if (trigger.id) {
  92420. targetLi = trigger.id;
  92421. } else if (Number(trigger.innerHTML)) {
  92422. targetLi = Number(trigger.innerHTML);
  92423. } else {
  92424. return;
  92425. }
  92426. //页码预处理:
  92427. this._prePageNum(targetLi);
  92428. //根据 currentPageNumberLis 创建页码列表
  92429. this.clearPageLink();
  92430. this._appendPageLink();
  92431. }
  92432. /**
  92433. * @description 根据 currentPage 改变按钮状态。
  92434. * @private
  92435. */
  92436. }, {
  92437. key: "_changeDisableState",
  92438. value: function _changeDisableState() {
  92439. this.link.children[0].setAttribute("class", "");
  92440. this.link.children[1].setAttribute("class", "");
  92441. this.link.children[this.link.children.length - 1].setAttribute("class", "");
  92442. this.link.children[this.link.children.length - 2].setAttribute("class", "");
  92443. if (this.currentPage === 1) {
  92444. this.link.children[0].setAttribute("class", "disable");
  92445. this.link.children[1].setAttribute("class", "disable");
  92446. }
  92447. if (this.currentPage === this.pageNumberLis.length) {
  92448. this.link.children[this.link.children.length - 1].setAttribute("class", "disable");
  92449. this.link.children[this.link.children.length - 2].setAttribute("class", "disable");
  92450. }
  92451. }
  92452. /**
  92453. * @description 根据点击页码列表事件准备需展现的页码列表。
  92454. * @param {string|number} targetLi - 被点击的列表对象 id 或 被点击的页码值。
  92455. * @private
  92456. */
  92457. }, {
  92458. key: "_prePageNum",
  92459. value: function _prePageNum(targetLi) {
  92460. var currentPageNumberLis = [];
  92461. if (targetLi === "first") {
  92462. this.currentPage = 1;
  92463. } else if (targetLi === "last") {
  92464. this.currentPage = this.pageNumberLis.length;
  92465. } else if (targetLi === "prev") {
  92466. this.currentPage = this.currentPage - 1;
  92467. } else if (targetLi === "next") {
  92468. this.currentPage = this.currentPage + 1;
  92469. } else {
  92470. this.currentPage = targetLi;
  92471. }
  92472. if (this.pageNumberLis.length <= 5) {
  92473. for (var i = 0; i < this.pageNumberLis.length; i++) {
  92474. currentPageNumberLis.push(this.pageNumberLis[i]);
  92475. }
  92476. } else {
  92477. //当前点击前三,都取前五
  92478. if (this.currentPage <= 3) {
  92479. for (var _i6 = 0; _i6 < 5; _i6++) {
  92480. currentPageNumberLis.push(this.pageNumberLis[_i6]);
  92481. }
  92482. } else if (this.currentPage >= this.pageNumberLis.length - 3) {
  92483. //点击后三,都取后5
  92484. for (var _i8 = this.pageNumberLis.length - 5; _i8 < this.pageNumberLis.length; _i8++) {
  92485. currentPageNumberLis.push(this.pageNumberLis[_i8]);
  92486. }
  92487. } else {
  92488. //其他,取中间:
  92489. for (var _i10 = this.currentPage - 3; _i10 <= this.currentPage + 1; _i10++) {
  92490. currentPageNumberLis.push(this.pageNumberLis[_i10]);
  92491. }
  92492. }
  92493. }
  92494. if (currentPageNumberLis.length > 0) {
  92495. this.currentPageNumberLis = currentPageNumberLis;
  92496. }
  92497. }
  92498. }]);
  92499. return PaginationContainer;
  92500. }(TemplateBase);
  92501. ;// CONCATENATED MODULE: ./src/common/components/util/Util.js
  92502. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  92503. * This program are made available under the terms of the Apache License, Version 2.0
  92504. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  92505. /**
  92506. * @name ComponentsUtil
  92507. * @namespace
  92508. * @category BaseTypes Util
  92509. * @description 获取文件类型工具类。
  92510. * @usage
  92511. * ```
  92512. * // 浏览器
  92513. * <script type="text/javascript" src="{cdn}"></script>
  92514. * <script>
  92515. * const result = {namespace}.ComponentsUtil.getFileType(fileName);
  92516. *
  92517. * </script>
  92518. * // ES6 Import
  92519. * import { ComponentsUtil } from '{npm}';
  92520. *
  92521. * const result = ComponentsUtil.getFileType(fileName);
  92522. * ```
  92523. */
  92524. var ComponentsUtil = {
  92525. /**
  92526. * @function ComponentsUtil.getFileType
  92527. * @description 获取上传文件类型。
  92528. * @param {string} fileName - 文件名称。
  92529. */
  92530. getFileType: function getFileType(fileName) {
  92531. var regCSV = /^.*\.(?:csv)$/i;
  92532. var regExcel = /^.*\.(?:xls|xlsx)$/i; //文件名可以带空格
  92533. var regGeojson = /^.*\.(?:geojson|json)$/i;
  92534. if (regExcel.test(fileName)) {
  92535. //校验不通过
  92536. return CommonTypes_FileTypes.EXCEL;
  92537. } else if (regCSV.test(fileName)) {
  92538. return CommonTypes_FileTypes.CSV;
  92539. } else if (regGeojson.test(fileName)) {
  92540. return CommonTypes_FileTypes.GEOJSON;
  92541. }
  92542. return null;
  92543. }
  92544. };
  92545. ;// CONCATENATED MODULE: ./src/common/components/util/index.js
  92546. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  92547. * This program are made available under the terms of the Apache License, Version 2.0
  92548. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  92549. ;// CONCATENATED MODULE: ./src/common/components/index.js
  92550. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  92551. * This program are made available under the terms of the Apache License, Version 2.0
  92552. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  92553. //数据
  92554. //组件
  92555. //提示框组件
  92556. //图表组件
  92557. //公用模板:
  92558. //工具类
  92559. ;// CONCATENATED MODULE: ./src/common/lang/index.js
  92560. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  92561. * This program are made available under the terms of the Apache License, Version 2.0
  92562. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  92563. ;// CONCATENATED MODULE: ./src/common/index.common.js
  92564. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  92565. * This program are made available under the terms of the Apache License, Version 2.0
  92566. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  92567. ;// CONCATENATED MODULE: ./src/common/index.all.js
  92568. ;// CONCATENATED MODULE: ./src/common/namespace.js
  92569. function namespace_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
  92570. function namespace_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? namespace_ownKeys(Object(source), !0).forEach(function (key) { namespace_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : namespace_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
  92571. function namespace_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
  92572. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  92573. * This program are made available under the terms of the Apache License, Version 2.0
  92574. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  92575. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  92576. * This program are made available under the terms of the Apache License, Version 2.0
  92577. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  92578. // Lang
  92579. SuperMap.Lang = Lang;
  92580. SuperMap.i18n = SuperMap.Lang.i18n;
  92581. // CommonUtil
  92582. SuperMap.Util = namespace_objectSpread(namespace_objectSpread({}, SuperMap.Util), Util_Util);
  92583. SuperMap.Browser = Browser;
  92584. SuperMap.INCHES_PER_UNIT = INCHES_PER_UNIT;
  92585. SuperMap.METERS_PER_INCH = METERS_PER_INCH;
  92586. SuperMap.DOTS_PER_INCH = DOTS_PER_INCH;
  92587. SuperMap.IS_GECKO = IS_GECKO;
  92588. // FetchRequest
  92589. SuperMap.setCORS = setCORS;
  92590. SuperMap.isCORS = isCORS;
  92591. SuperMap.setRequestTimeout = setRequestTimeout;
  92592. SuperMap.getRequestTimeout = getRequestTimeout;
  92593. SuperMap.FetchRequest = FetchRequest;
  92594. // commontypes
  92595. SuperMap.inherit = inheritExt;
  92596. SuperMap.mixin = mixinExt;
  92597. SuperMap.String = StringExt;
  92598. SuperMap.Number = NumberExt;
  92599. SuperMap.Function = FunctionExt;
  92600. SuperMap.Array = ArrayExt;
  92601. SuperMap.Date = DateExt;
  92602. SuperMap.Event = Event;
  92603. SuperMap.Bounds = Bounds;
  92604. SuperMap.Credential = Credential;
  92605. SuperMap.Events = Events;
  92606. SuperMap.Feature = Feature_Feature;
  92607. SuperMap.Geometry = Geometry_Geometry;
  92608. SuperMap.Pixel = Pixel;
  92609. SuperMap.Size = Size;
  92610. SuperMap.Feature.Vector = Vector;
  92611. SuperMap.Geometry.Collection = Collection;
  92612. SuperMap.Geometry.Curve = Curve;
  92613. SuperMap.Geometry.GeoText = GeoText;
  92614. SuperMap.Geometry.LinearRing = LinearRing_LinearRing;
  92615. SuperMap.Geometry.LineString = LineString;
  92616. SuperMap.Geometry.MultiLineString = MultiLineString;
  92617. SuperMap.Geometry.MultiPoint = MultiPoint;
  92618. SuperMap.Geometry.MultiPolygon = MultiPolygon;
  92619. SuperMap.Geometry.Point = Point;
  92620. SuperMap.Geometry.Polygon = Polygon_Polygon;
  92621. SuperMap.Geometry.Rectangle = Rectangle;
  92622. // Components
  92623. SuperMap.Components.Chart = ChartView;
  92624. SuperMap.Components.ChartViewModel = ChartViewModel;
  92625. SuperMap.Components.MessageBox = MessageBox;
  92626. SuperMap.Components.AttributesPopContainer = AttributesPopContainer;
  92627. SuperMap.Components.CityTabsPage = CityTabsPage;
  92628. SuperMap.Components.CommonContainer = CommonContainer;
  92629. SuperMap.Components.DropDownBox = DropDownBox;
  92630. SuperMap.Components.IndexTabsPageContainer = IndexTabsPageContainer;
  92631. SuperMap.Components.NavTabsPage = NavTabsPage;
  92632. SuperMap.Components.PaginationContainer = PaginationContainer;
  92633. SuperMap.Components.PopContainer = PopContainer;
  92634. SuperMap.Components.Select = Select;
  92635. SuperMap.Components.TemplateBase = TemplateBase;
  92636. SuperMap.Components.FileReaderUtil = FileReaderUtil;
  92637. // control
  92638. SuperMap.TimeControlBase = TimeControlBase;
  92639. SuperMap.TimeFlowControl = TimeFlowControl;
  92640. // Format
  92641. SuperMap.Format = SuperMap.Format || Format;
  92642. SuperMap.Format.GeoJSON = GeoJSON;
  92643. SuperMap.Format.JSON = JSONFormat;
  92644. SuperMap.Format.WKT = WKT;
  92645. // iManager
  92646. SuperMap.iManager = IManager;
  92647. SuperMap.iManagerCreateNodeParam = IManagerCreateNodeParam;
  92648. SuperMap.iManagerServiceBase = IManagerServiceBase;
  92649. // iPortal
  92650. SuperMap.iPortal = IPortal;
  92651. SuperMap.iPortalAddDataParam = IPortalAddDataParam;
  92652. SuperMap.iPortalAddResourceParam = IPortalAddResourceParam;
  92653. SuperMap.iPortalDataConnectionInfoParam = IPortalDataConnectionInfoParam;
  92654. SuperMap.iPortalDataMetaInfoParam = IPortalDataMetaInfoParam;
  92655. SuperMap.iPortalDataStoreInfoParam = IPortalDataStoreInfoParam;
  92656. SuperMap.iPortalQueryParam = IPortalQueryParam;
  92657. SuperMap.iPortalQueryResult = IPortalQueryResult;
  92658. SuperMap.iPortalRegisterServiceParam = IPortalRegisterServiceParam;
  92659. SuperMap.iPortalResource = IPortalResource;
  92660. SuperMap.iPortalServiceBase = IPortalServiceBase;
  92661. SuperMap.iPortalShareEntity = IPortalShareEntity;
  92662. SuperMap.iPortalShareParam = IPortalShareParam;
  92663. SuperMap.iPortalUser = IPortalUser;
  92664. // iServer
  92665. SuperMap.AddressMatchService = AddressMatchService_AddressMatchService;
  92666. SuperMap.AggregationParameter = AggregationParameter;
  92667. SuperMap.AreaSolarRadiationParameters = AreaSolarRadiationParameters;
  92668. SuperMap.AreaSolarRadiationService = AreaSolarRadiationService;
  92669. SuperMap.BucketAggParameter = BucketAggParameter;
  92670. SuperMap.BufferAnalystParameters = BufferAnalystParameters;
  92671. SuperMap.BufferAnalystService = BufferAnalystService;
  92672. SuperMap.BufferDistance = BufferDistance;
  92673. SuperMap.BuffersAnalystJobsParameter = BuffersAnalystJobsParameter;
  92674. SuperMap.BuffersAnalystJobsService = BuffersAnalystJobsService;
  92675. SuperMap.BufferSetting = BufferSetting;
  92676. SuperMap.BurstPipelineAnalystParameters = BurstPipelineAnalystParameters;
  92677. SuperMap.BurstPipelineAnalystService = BurstPipelineAnalystService;
  92678. SuperMap.ChartFeatureInfoSpecsService = ChartFeatureInfoSpecsService;
  92679. SuperMap.ChartQueryFilterParameter = ChartQueryFilterParameter;
  92680. SuperMap.ChartQueryParameters = ChartQueryParameters;
  92681. SuperMap.ChartQueryService = ChartQueryService;
  92682. SuperMap.ClipParameter = ClipParameter;
  92683. SuperMap.ColorDictionary = ColorDictionary;
  92684. SuperMap.CommonServiceBase = CommonServiceBase;
  92685. SuperMap.ComputeWeightMatrixParameters = ComputeWeightMatrixParameters;
  92686. SuperMap.ComputeWeightMatrixService = ComputeWeightMatrixService;
  92687. SuperMap.CreateDatasetParameters = CreateDatasetParameters;
  92688. SuperMap.DataFlowService = DataFlowService_DataFlowService;
  92689. SuperMap.DataReturnOption = DataReturnOption;
  92690. SuperMap.DatasetBufferAnalystParameters = DatasetBufferAnalystParameters;
  92691. SuperMap.DatasetInfo = DatasetInfo;
  92692. SuperMap.DatasetOverlayAnalystParameters = DatasetOverlayAnalystParameters;
  92693. SuperMap.DatasetService = DatasetService_DatasetService;
  92694. SuperMap.DatasetSurfaceAnalystParameters = DatasetSurfaceAnalystParameters;
  92695. SuperMap.DatasetThiessenAnalystParameters = DatasetThiessenAnalystParameters;
  92696. SuperMap.DatasourceConnectionInfo = DatasourceConnectionInfo;
  92697. SuperMap.DatasourceService = DatasourceService_DatasourceService;
  92698. SuperMap.DensityAnalystService = DensityAnalystService;
  92699. SuperMap.DensityKernelAnalystParameters = DensityKernelAnalystParameters;
  92700. SuperMap.EditFeaturesParameters = EditFeaturesParameters;
  92701. SuperMap.EditFeaturesService = EditFeaturesService;
  92702. SuperMap.FacilityAnalyst3DParameters = FacilityAnalyst3DParameters;
  92703. SuperMap.FacilityAnalystSinks3DParameters = FacilityAnalystSinks3DParameters;
  92704. SuperMap.FacilityAnalystSinks3DService = FacilityAnalystSinks3DService;
  92705. SuperMap.FacilityAnalystSources3DParameters = FacilityAnalystSources3DParameters;
  92706. SuperMap.FacilityAnalystSources3DService = FacilityAnalystSources3DService;
  92707. SuperMap.FacilityAnalystStreamParameters = FacilityAnalystStreamParameters;
  92708. SuperMap.FacilityAnalystStreamService = FacilityAnalystStreamService;
  92709. SuperMap.FacilityAnalystTracedown3DParameters = FacilityAnalystTracedown3DParameters;
  92710. SuperMap.FacilityAnalystTracedown3DService = FacilityAnalystTracedown3DService;
  92711. SuperMap.FacilityAnalystTraceup3DParameters = FacilityAnalystTraceup3DParameters;
  92712. SuperMap.FacilityAnalystTraceup3DService = FacilityAnalystTraceup3DService;
  92713. SuperMap.FacilityAnalystUpstream3DParameters = FacilityAnalystUpstream3DParameters;
  92714. SuperMap.FacilityAnalystUpstream3DService = FacilityAnalystUpstream3DService;
  92715. SuperMap.FieldParameters = FieldParameters;
  92716. SuperMap.FieldsFilter = FieldsFilter;
  92717. SuperMap.FieldStatisticService = FieldStatisticService;
  92718. SuperMap.FieldStatisticsParameters = FieldStatisticsParameters;
  92719. SuperMap.FilterParameter = FilterParameter;
  92720. SuperMap.FindClosestFacilitiesParameters = FindClosestFacilitiesParameters;
  92721. SuperMap.FindClosestFacilitiesService = FindClosestFacilitiesService;
  92722. SuperMap.FindLocationParameters = FindLocationParameters;
  92723. SuperMap.FindLocationService = FindLocationService;
  92724. SuperMap.FindMTSPPathsParameters = FindMTSPPathsParameters;
  92725. SuperMap.FindMTSPPathsService = FindMTSPPathsService;
  92726. SuperMap.FindPathParameters = FindPathParameters;
  92727. SuperMap.FindPathService = FindPathService;
  92728. SuperMap.FindServiceAreasParameters = FindServiceAreasParameters;
  92729. SuperMap.FindServiceAreasService = FindServiceAreasService;
  92730. SuperMap.FindTSPPathsParameters = FindTSPPathsParameters;
  92731. SuperMap.FindTSPPathsService = FindTSPPathsService;
  92732. SuperMap.GenerateSpatialDataParameters = GenerateSpatialDataParameters;
  92733. SuperMap.GenerateSpatialDataService = GenerateSpatialDataService;
  92734. SuperMap.GeoCodingParameter = GeoCodingParameter;
  92735. SuperMap.GeoDecodingParameter = GeoDecodingParameter;
  92736. SuperMap.GeoHashGridAggParameter = GeoHashGridAggParameter;
  92737. SuperMap.GeometryBatchAnalystService = GeometryBatchAnalystService;
  92738. SuperMap.GeometryBufferAnalystParameters = GeometryBufferAnalystParameters;
  92739. SuperMap.GeometryOverlayAnalystParameters = GeometryOverlayAnalystParameters;
  92740. SuperMap.GeometrySurfaceAnalystParameters = GeometrySurfaceAnalystParameters;
  92741. SuperMap.GeometryThiessenAnalystParameters = GeometryThiessenAnalystParameters;
  92742. SuperMap.GeoprocessingService = GeoprocessingService_GeoprocessingService;
  92743. SuperMap.GeoRelationAnalystParameters = GeoRelationAnalystParameters;
  92744. SuperMap.GeoRelationAnalystService = GeoRelationAnalystService;
  92745. SuperMap.GetFeaturesByBoundsParameters = GetFeaturesByBoundsParameters;
  92746. SuperMap.GetFeaturesByBoundsService = GetFeaturesByBoundsService;
  92747. SuperMap.GetFeaturesByBufferParameters = GetFeaturesByBufferParameters;
  92748. SuperMap.GetFeaturesByBufferService = GetFeaturesByBufferService;
  92749. SuperMap.GetFeaturesByGeometryParameters = GetFeaturesByGeometryParameters;
  92750. SuperMap.GetFeaturesByGeometryService = GetFeaturesByGeometryService;
  92751. SuperMap.GetFeaturesByIDsParameters = GetFeaturesByIDsParameters;
  92752. SuperMap.GetFeaturesByIDsService = GetFeaturesByIDsService;
  92753. SuperMap.GetFeaturesBySQLParameters = GetFeaturesBySQLParameters;
  92754. SuperMap.GetFeaturesBySQLService = GetFeaturesBySQLService;
  92755. SuperMap.GetFeaturesParametersBase = GetFeaturesParametersBase;
  92756. SuperMap.GetFeaturesServiceBase = GetFeaturesServiceBase;
  92757. SuperMap.GetFieldsService = GetFieldsService;
  92758. SuperMap.GetGridCellInfosParameters = GetGridCellInfosParameters;
  92759. SuperMap.GetGridCellInfosService = GetGridCellInfosService;
  92760. SuperMap.GetLayersInfoService = GetLayersInfoService;
  92761. SuperMap.Grid = Grid;
  92762. SuperMap.HillshadeParameter = HillshadeParameter;
  92763. SuperMap.Image = UGCImage;
  92764. SuperMap.ImageCollectionService = ImageCollectionService_ImageCollectionService;
  92765. SuperMap.ImageGFAspect = ImageGFAspect;
  92766. SuperMap.ImageGFHillShade = ImageGFHillShade;
  92767. SuperMap.ImageGFOrtho = ImageGFOrtho;
  92768. SuperMap.ImageGFSlope = ImageGFSlope;
  92769. SuperMap.ImageRenderingRule = ImageRenderingRule;
  92770. SuperMap.ImageSearchParameter = ImageSearchParameter;
  92771. SuperMap.ImageService = ImageService_ImageService;
  92772. SuperMap.ImageStretchOption = ImageStretchOption;
  92773. SuperMap.InterpolationAnalystParameters = InterpolationAnalystParameters;
  92774. SuperMap.InterpolationAnalystService = InterpolationAnalystService;
  92775. SuperMap.InterpolationDensityAnalystParameters = InterpolationDensityAnalystParameters;
  92776. SuperMap.InterpolationIDWAnalystParameters = InterpolationIDWAnalystParameters;
  92777. SuperMap.InterpolationKrigingAnalystParameters = InterpolationKrigingAnalystParameters;
  92778. SuperMap.InterpolationRBFAnalystParameters = InterpolationRBFAnalystParameters;
  92779. SuperMap.JoinItem = JoinItem;
  92780. SuperMap.KernelDensityJobParameter = KernelDensityJobParameter;
  92781. SuperMap.KernelDensityJobsService = KernelDensityJobsService;
  92782. SuperMap.LabelImageCell = LabelImageCell;
  92783. SuperMap.LabelMatrixCell = LabelMatrixCell;
  92784. SuperMap.LabelMixedTextStyle = LabelMixedTextStyle;
  92785. SuperMap.LabelSymbolCell = LabelSymbolCell;
  92786. SuperMap.LabelThemeCell = LabelThemeCell;
  92787. SuperMap.LayerStatus = LayerStatus;
  92788. SuperMap.LinkItem = LinkItem;
  92789. SuperMap.MappingParameters = MappingParameters;
  92790. SuperMap.MapService = MapService_MapService;
  92791. SuperMap.MathExpressionAnalysisParameters = MathExpressionAnalysisParameters;
  92792. SuperMap.MathExpressionAnalysisService = MathExpressionAnalysisService;
  92793. SuperMap.MeasureParameters = MeasureParameters;
  92794. SuperMap.MeasureService = MeasureService_MeasureService;
  92795. SuperMap.MetricsAggParameter = MetricsAggParameter;
  92796. SuperMap.NDVIParameter = NDVIParameter;
  92797. SuperMap.NetworkAnalystServiceBase = NetworkAnalystServiceBase;
  92798. SuperMap.OutputSetting = OutputSetting;
  92799. SuperMap.OverlapDisplayedOptions = OverlapDisplayedOptions;
  92800. SuperMap.OverlayAnalystParameters = OverlayAnalystParameters;
  92801. SuperMap.OverlayAnalystService = OverlayAnalystService;
  92802. SuperMap.OverlayGeoJobParameter = OverlayGeoJobParameter;
  92803. SuperMap.OverlayGeoJobsService = OverlayGeoJobsService;
  92804. SuperMap.PointWithMeasure = PointWithMeasure;
  92805. SuperMap.ProcessingServiceBase = ProcessingServiceBase;
  92806. SuperMap.QueryByBoundsParameters = QueryByBoundsParameters;
  92807. SuperMap.QueryByBoundsService = QueryByBoundsService;
  92808. SuperMap.QueryByDistanceParameters = QueryByDistanceParameters;
  92809. SuperMap.QueryByDistanceService = QueryByDistanceService;
  92810. SuperMap.QueryByGeometryParameters = QueryByGeometryParameters;
  92811. SuperMap.QueryByGeometryService = QueryByGeometryService;
  92812. SuperMap.QueryBySQLParameters = QueryBySQLParameters;
  92813. SuperMap.QueryBySQLService = QueryBySQLService;
  92814. SuperMap.QueryParameters = QueryParameters;
  92815. SuperMap.QueryService = QueryService_QueryService;
  92816. SuperMap.RasterFunctionParameter = RasterFunctionParameter;
  92817. SuperMap.Route = Route;
  92818. SuperMap.RouteCalculateMeasureParameters = RouteCalculateMeasureParameters;
  92819. SuperMap.RouteCalculateMeasureService = RouteCalculateMeasureService;
  92820. SuperMap.RouteLocatorParameters = RouteLocatorParameters;
  92821. SuperMap.RouteLocatorService = RouteLocatorService;
  92822. SuperMap.ServerColor = ServerColor;
  92823. SuperMap.ServerFeature = ServerFeature;
  92824. SuperMap.ServerGeometry = ServerGeometry;
  92825. SuperMap.ServerStyle = ServerStyle;
  92826. SuperMap.ServerTextStyle = ServerTextStyle;
  92827. SuperMap.ServerTheme = ServerTheme;
  92828. SuperMap.SetDatasourceParameters = SetDatasourceParameters;
  92829. SuperMap.SetLayerInfoParameters = SetLayerInfoParameters;
  92830. SuperMap.SetLayerInfoService = SetLayerInfoService;
  92831. SuperMap.SetLayersInfoParameters = SetLayersInfoParameters;
  92832. SuperMap.SetLayersInfoService = SetLayersInfoService;
  92833. SuperMap.SetLayerStatusParameters = SetLayerStatusParameters;
  92834. SuperMap.SetLayerStatusService = SetLayerStatusService;
  92835. SuperMap.SingleObjectQueryJobsParameter = SingleObjectQueryJobsParameter;
  92836. SuperMap.SingleObjectQueryJobsService = SingleObjectQueryJobsService;
  92837. SuperMap.Sortby = Sortby;
  92838. SuperMap.SpatialAnalystBase = SpatialAnalystBase;
  92839. SuperMap.StopQueryParameters = StopQueryParameters;
  92840. SuperMap.StopQueryService = StopQueryService;
  92841. SuperMap.SummaryAttributesJobsParameter = SummaryAttributesJobsParameter;
  92842. SuperMap.SummaryAttributesJobsService = SummaryAttributesJobsService;
  92843. SuperMap.SummaryMeshJobParameter = SummaryMeshJobParameter;
  92844. SuperMap.SummaryMeshJobsService = SummaryMeshJobsService;
  92845. SuperMap.SummaryRegionJobParameter = SummaryRegionJobParameter;
  92846. SuperMap.SummaryRegionJobsService = SummaryRegionJobsService;
  92847. SuperMap.SupplyCenter = SupplyCenter;
  92848. SuperMap.SurfaceAnalystParameters = SurfaceAnalystParameters;
  92849. SuperMap.SurfaceAnalystParametersSetting = SurfaceAnalystParametersSetting;
  92850. SuperMap.SurfaceAnalystService = SurfaceAnalystService;
  92851. SuperMap.TerrainCurvatureCalculationParameters = TerrainCurvatureCalculationParameters;
  92852. SuperMap.TerrainCurvatureCalculationService = TerrainCurvatureCalculationService;
  92853. SuperMap.Theme = Theme;
  92854. SuperMap.ThemeDotDensity = ThemeDotDensity;
  92855. SuperMap.ThemeFlow = ThemeFlow;
  92856. SuperMap.ThemeGraduatedSymbol = ThemeGraduatedSymbol;
  92857. SuperMap.ThemeGraduatedSymbolStyle = ThemeGraduatedSymbolStyle;
  92858. SuperMap.ThemeGraph = ThemeGraph;
  92859. SuperMap.ThemeGraphAxes = ThemeGraphAxes;
  92860. SuperMap.ThemeGraphItem = ThemeGraphItem;
  92861. SuperMap.ThemeGraphSize = ThemeGraphSize;
  92862. SuperMap.ThemeGraphText = ThemeGraphText;
  92863. SuperMap.ThemeGridRange = ThemeGridRange;
  92864. SuperMap.ThemeGridRangeItem = ThemeGridRangeItem;
  92865. SuperMap.ThemeGridUnique = ThemeGridUnique;
  92866. SuperMap.ThemeGridUniqueItem = ThemeGridUniqueItem;
  92867. SuperMap.ThemeLabel = ThemeLabel;
  92868. SuperMap.ThemeLabelAlongLine = ThemeLabelAlongLine;
  92869. SuperMap.ThemeLabelBackground = ThemeLabelBackground;
  92870. SuperMap.ThemeLabelItem = ThemeLabelItem;
  92871. SuperMap.ThemeLabelText = ThemeLabelText;
  92872. SuperMap.ThemeLabelUniqueItem = ThemeLabelUniqueItem;
  92873. SuperMap.ThemeMemoryData = ThemeMemoryData;
  92874. SuperMap.ThemeOffset = ThemeOffset;
  92875. SuperMap.ThemeParameters = ThemeParameters;
  92876. SuperMap.ThemeRange = ThemeRange;
  92877. SuperMap.ThemeRangeItem = ThemeRangeItem;
  92878. SuperMap.ThemeService = ThemeService_ThemeService;
  92879. SuperMap.ThemeUnique = ThemeUnique;
  92880. SuperMap.ThemeUniqueItem = ThemeUniqueItem;
  92881. SuperMap.ThiessenAnalystParameters = ThiessenAnalystParameters;
  92882. SuperMap.ThiessenAnalystService = ThiessenAnalystService;
  92883. SuperMap.TilesetsService = TilesetsService;
  92884. SuperMap.TopologyValidatorJobsParameter = TopologyValidatorJobsParameter;
  92885. SuperMap.TopologyValidatorJobsService = TopologyValidatorJobsService;
  92886. SuperMap.TransferLine = TransferLine;
  92887. SuperMap.TransferPathParameters = TransferPathParameters;
  92888. SuperMap.TransferPathService = TransferPathService;
  92889. SuperMap.TransferSolutionParameters = TransferSolutionParameters;
  92890. SuperMap.TransferSolutionService = TransferSolutionService;
  92891. SuperMap.TransportationAnalystParameter = TransportationAnalystParameter;
  92892. SuperMap.TransportationAnalystResultSetting = TransportationAnalystResultSetting;
  92893. SuperMap.UGCLayer = UGCLayer;
  92894. SuperMap.UGCMapLayer = UGCMapLayer;
  92895. SuperMap.UGCSubLayer = UGCSubLayer;
  92896. SuperMap.UpdateDatasetParameters = UpdateDatasetParameters;
  92897. SuperMap.UpdateEdgeWeightParameters = UpdateEdgeWeightParameters;
  92898. SuperMap.UpdateEdgeWeightService = UpdateEdgeWeightService;
  92899. SuperMap.UpdateTurnNodeWeightParameters = UpdateTurnNodeWeightParameters;
  92900. SuperMap.UpdateTurnNodeWeightService = UpdateTurnNodeWeightService;
  92901. SuperMap.Vector = Vector_Vector;
  92902. SuperMap.VectorClipJobsParameter = VectorClipJobsParameter;
  92903. SuperMap.VectorClipJobsService = VectorClipJobsService;
  92904. SuperMap.WebPrintingJobContent = WebPrintingJobContent;
  92905. SuperMap.WebPrintingJobCustomItems = WebPrintingJobCustomItems;
  92906. SuperMap.WebPrintingJobExportOptions = WebPrintingJobExportOptions;
  92907. SuperMap.WebPrintingJobImage = WebPrintingJobImage;
  92908. SuperMap.WebPrintingJobLayers = WebPrintingJobLayers;
  92909. SuperMap.WebPrintingJobLayoutOptions = WebPrintingJobLayoutOptions;
  92910. SuperMap.WebPrintingJobLegendOptions = WebPrintingJobLegendOptions;
  92911. SuperMap.WebPrintingJobLittleMapOptions = WebPrintingJobLittleMapOptions;
  92912. SuperMap.WebPrintingJobNorthArrowOptions = WebPrintingJobNorthArrowOptions;
  92913. SuperMap.WebPrintingJobParameters = WebPrintingJobParameters;
  92914. SuperMap.WebPrintingJobScaleBarOptions = WebPrintingJobScaleBarOptions;
  92915. SuperMap.WebPrintingService = WebPrintingService;
  92916. //Online
  92917. SuperMap.Online = Online;
  92918. SuperMap.OnlineData = OnlineData;
  92919. SuperMap.OnlineQueryDatasParameter = OnlineQueryDatasParameter;
  92920. SuperMap.ServiceStatus = ServiceStatus;
  92921. // 包含online中的DataItemType数据类型
  92922. SuperMap.DataItemType = DataItemType;
  92923. SuperMap.DataItemOrderBy = DataItemOrderBy;
  92924. SuperMap.FilterField = FilterField;
  92925. SuperMap.OnlineServiceBase = OnlineServiceBase;
  92926. // overlay
  92927. SuperMap.Feature = SuperMap.Feature || {};
  92928. SuperMap.Feature.Theme = Theme_Theme;
  92929. SuperMap.Feature.Theme.Bar = Bar;
  92930. SuperMap.Feature.Theme.Bar3D = Bar3D;
  92931. SuperMap.Feature.Theme.Circle = Circle;
  92932. SuperMap.Feature.Theme.Graph = Graph;
  92933. SuperMap.Feature.Theme.Line = Line;
  92934. SuperMap.Feature.Theme.Pie = Pie;
  92935. SuperMap.Feature.Theme.Point = overlay_Point_Point;
  92936. SuperMap.Feature.Theme.RankSymbol = RankSymbol;
  92937. SuperMap.Feature.Theme.Ring = Ring;
  92938. SuperMap.Feature.Theme.ThemeVector = ThemeVector;
  92939. SuperMap.Feature.ShapeParameters = ShapeParameters;
  92940. SuperMap.Feature.ShapeParameters.Circle = Circle_Circle;
  92941. SuperMap.Feature.ShapeParameters.Image = Image_Image;
  92942. SuperMap.Feature.ShapeParameters.Label = Label;
  92943. SuperMap.Feature.ShapeParameters.Line = Line_Line;
  92944. SuperMap.Feature.ShapeParameters.Point = Point_Point;
  92945. SuperMap.Feature.ShapeParameters.Polygon = feature_Polygon_Polygon;
  92946. SuperMap.Feature.ShapeParameters.Rectangle = Rectangle_Rectangle;
  92947. SuperMap.Feature.ShapeParameters.Sector = Sector;
  92948. SuperMap.Feature.ShapeFactory = ShapeFactory;
  92949. // LevelRenderer
  92950. SuperMap.LevelRenderer = LevelRenderer;
  92951. // security
  92952. SuperMap.KeyServiceParameter = KeyServiceParameter;
  92953. SuperMap.SecurityManager = SecurityManager;
  92954. SuperMap.ServerInfo = ServerInfo;
  92955. SuperMap.TokenServiceParameter = TokenServiceParameter;
  92956. // style
  92957. SuperMap.ThemeStyle = ThemeStyle;
  92958. SuperMap.CartoCSS = CartoCSS;
  92959. // thirdparty
  92960. // SuperMap.BinaryClassification = BinaryClassification;
  92961. // SuperMap.LandcoverClassification = LandcoverClassification;
  92962. // SuperMap.ObjectDetection = ObjectDetection;
  92963. // SuperMap.WebMachineLearning = WebMachineLearning;
  92964. SuperMap.ElasticSearch = ElasticSearch;
  92965. // util
  92966. SuperMap.ArrayStatistic = ArrayStatistic;
  92967. SuperMap.ColorsPickerUtil = ColorsPickerUtil;
  92968. // REST
  92969. SuperMap.DataFormat = DataFormat;
  92970. SuperMap.ServerType = ServerType;
  92971. SuperMap.GeometryType = REST_GeometryType;
  92972. SuperMap.QueryOption = QueryOption;
  92973. SuperMap.JoinType = JoinType;
  92974. SuperMap.SpatialQueryMode = SpatialQueryMode;
  92975. SuperMap.SpatialRelationType = SpatialRelationType;
  92976. SuperMap.MeasureMode = MeasureMode;
  92977. SuperMap.Unit = Unit;
  92978. SuperMap.BufferRadiusUnit = BufferRadiusUnit;
  92979. SuperMap.EngineType = EngineType;
  92980. SuperMap.ThemeGraphTextFormat = ThemeGraphTextFormat;
  92981. SuperMap.ThemeGraphType = ThemeGraphType;
  92982. SuperMap.GraphAxesTextDisplayMode = GraphAxesTextDisplayMode;
  92983. SuperMap.GraduatedMode = GraduatedMode;
  92984. SuperMap.RangeMode = RangeMode;
  92985. SuperMap.ThemeType = ThemeType;
  92986. SuperMap.ColorGradientType = ColorGradientType;
  92987. SuperMap.TextAlignment = TextAlignment;
  92988. SuperMap.FillGradientMode = FillGradientMode;
  92989. SuperMap.AlongLineDirection = AlongLineDirection;
  92990. SuperMap.LabelBackShape = LabelBackShape;
  92991. SuperMap.LabelOverLengthMode = LabelOverLengthMode;
  92992. SuperMap.DirectionType = DirectionType;
  92993. SuperMap.OverlayOperationType = OverlayOperationType;
  92994. SuperMap.OutputType = OutputType;
  92995. SuperMap.SideType = SideType;
  92996. SuperMap.SupplyCenterType = SupplyCenterType;
  92997. SuperMap.TurnType = TurnType;
  92998. SuperMap.BufferEndType = BufferEndType;
  92999. SuperMap.SmoothMethod = SmoothMethod;
  93000. SuperMap.SurfaceAnalystMethod = SurfaceAnalystMethod;
  93001. SuperMap.DataReturnMode = DataReturnMode;
  93002. SuperMap.EditType = EditType;
  93003. SuperMap.TransferTactic = TransferTactic;
  93004. SuperMap.TransferPreference = TransferPreference;
  93005. SuperMap.GridType = GridType;
  93006. SuperMap.ColorSpaceType = ColorSpaceType;
  93007. SuperMap.LayerType = LayerType;
  93008. SuperMap.UGCLayerType = UGCLayerType;
  93009. SuperMap.StatisticMode = StatisticMode;
  93010. SuperMap.PixelFormat = PixelFormat;
  93011. SuperMap.SearchMode = SearchMode;
  93012. SuperMap.InterpolationAlgorithmType = InterpolationAlgorithmType;
  93013. SuperMap.VariogramMode = VariogramMode;
  93014. SuperMap.Exponent = Exponent;
  93015. SuperMap.ClientType = ClientType;
  93016. SuperMap.ChartType = ChartType;
  93017. SuperMap.ClipAnalystMode = ClipAnalystMode;
  93018. SuperMap.AnalystAreaUnit = AnalystAreaUnit;
  93019. SuperMap.AnalystSizeUnit = AnalystSizeUnit;
  93020. SuperMap.StatisticAnalystMode = StatisticAnalystMode;
  93021. SuperMap.SummaryType = SummaryType;
  93022. SuperMap.TopologyValidatorRule = TopologyValidatorRule;
  93023. SuperMap.BucketAggType = BucketAggType;
  93024. SuperMap.MetricsAggType = MetricsAggType;
  93025. SuperMap.GetFeatureMode = GetFeatureMode;
  93026. SuperMap.RasterFunctionType = RasterFunctionType;
  93027. SuperMap.ResourceType = ResourceType;
  93028. SuperMap.OrderBy = OrderBy;
  93029. SuperMap.OrderType = OrderType;
  93030. SuperMap.SearchType = SearchType;
  93031. SuperMap.AggregationTypes = AggregationTypes;
  93032. SuperMap.PermissionType = PermissionType;
  93033. SuperMap.EntityType = EntityType;
  93034. SuperMap.WebExportFormatType = WebExportFormatType;
  93035. SuperMap.WebScaleOrientationType = WebScaleOrientationType;
  93036. SuperMap.WebScaleType = WebScaleType;
  93037. SuperMap.WebScaleUnit = WebScaleUnit;
  93038. SuperMap.KnowledgeGraph = KnowledgeGraph;
  93039. ;// CONCATENATED MODULE: ./src/maplibregl/index.js
  93040. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  93041. * This program are made available under the terms of the Apache License, Version 2.0
  93042. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  93043. ;// CONCATENATED MODULE: ./src/maplibregl/namespace.js
  93044. function maplibregl_namespace_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
  93045. function maplibregl_namespace_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? maplibregl_namespace_ownKeys(Object(source), !0).forEach(function (key) { maplibregl_namespace_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : maplibregl_namespace_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
  93046. function maplibregl_namespace_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
  93047. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  93048. * This program are made available under the terms of the Apache License, Version 2.0
  93049. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  93050. (external_maplibregl_default()).supermap = maplibregl_namespace_objectSpread(maplibregl_namespace_objectSpread({}, SuperMap), (external_maplibregl_default()).supermap);
  93051. (external_maplibregl_default()).supermap.Graphic = Graphic;
  93052. (external_maplibregl_default()).supermap.Transform = Transform;
  93053. (external_maplibregl_default()).supermap.AddressMatchService = AddressMatchService;
  93054. (external_maplibregl_default()).supermap.ChartService = ChartService;
  93055. (external_maplibregl_default()).supermap.DataFlowService = DataFlowService;
  93056. (external_maplibregl_default()).supermap.DatasetService = DatasetService;
  93057. (external_maplibregl_default()).supermap.DatasourceService = DatasourceService;
  93058. (external_maplibregl_default()).supermap.FeatureService = FeatureService;
  93059. (external_maplibregl_default()).supermap.FieldService = FieldService;
  93060. (external_maplibregl_default()).supermap.GeoprocessingService = GeoprocessingService;
  93061. (external_maplibregl_default()).supermap.GridCellInfosService = GridCellInfosService;
  93062. (external_maplibregl_default()).supermap.ImageCollectionService = ImageCollectionService;
  93063. (external_maplibregl_default()).supermap.ImageService = ImageService;
  93064. (external_maplibregl_default()).supermap.LayerInfoService = LayerInfoService;
  93065. (external_maplibregl_default()).supermap.MapService = MapService;
  93066. (external_maplibregl_default()).supermap.MeasureService = MeasureService;
  93067. (external_maplibregl_default()).supermap.NetworkAnalyst3DService = NetworkAnalyst3DService;
  93068. (external_maplibregl_default()).supermap.NetworkAnalystService = NetworkAnalystService;
  93069. (external_maplibregl_default()).supermap.ProcessingService = ProcessingService;
  93070. (external_maplibregl_default()).supermap.QueryService = QueryService;
  93071. (external_maplibregl_default()).supermap.ServiceBase = ServiceBase;
  93072. (external_maplibregl_default()).supermap.SpatialAnalystService = SpatialAnalystService;
  93073. (external_maplibregl_default()).supermap.ThemeService = ThemeService;
  93074. (external_maplibregl_default()).supermap.TrafficTransferAnalystService = TrafficTransferAnalystService;
  93075. (external_maplibregl_default()).supermap.WebPrintingJobService = WebPrintingJobService;
  93076. (external_maplibregl_default()).supermap.KnowledgeGraphService = KnowledgeGraphService;
  93077. (external_maplibregl_default()).supermap.CommonUtil = Util_Util;
  93078. (external_maplibregl_default()).supermap.Util = core_Util_Util;
  93079. (external_maplibregl_default()).supermap.LogoControl = Logo;
  93080. (external_maplibregl_default()).supermap.Logo = Logo;
  93081. (external_maplibregl_default()).supermap.GraphMap = GraphMap;
  93082. (external_maplibregl_default()).supermap.MapvLayer = MapvLayer;
  93083. (external_maplibregl_default()).supermap.ThreeLayer = ThreeLayer;
  93084. (external_maplibregl_default()).supermap.DeckglLayer = DeckglLayer;
  93085. (external_maplibregl_default()).supermap.HeatMapLayer = HeatMapLayer;
  93086. (external_maplibregl_default()).supermap.GraphicLayer = GraphicLayer;
  93087. (external_maplibregl_default()).supermap.GraticuleLayer = GraticuleLayer;
  93088. (external_maplibregl_default()).supermap.FGBLayer = FGBLayer;
  93089. /***/ }),
  93090. /***/ 1351:
  93091. /***/ (function(__unused_webpack_module, exports) {
  93092. "use strict";
  93093. var __webpack_unused_export__;
  93094. __webpack_unused_export__ = ({
  93095. value: true
  93096. });
  93097. /*! *****************************************************************************
  93098. Copyright (c) Microsoft Corporation.
  93099. Permission to use, copy, modify, and/or distribute this software for any
  93100. purpose with or without fee is hereby granted.
  93101. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
  93102. REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  93103. AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
  93104. INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  93105. LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  93106. OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  93107. PERFORMANCE OF THIS SOFTWARE.
  93108. ***************************************************************************** */
  93109. /* global Reflect, Promise */
  93110. var _extendStatics = function extendStatics(d, b) {
  93111. _extendStatics = Object.setPrototypeOf || {
  93112. __proto__: []
  93113. } instanceof Array && function (d, b) {
  93114. d.__proto__ = b;
  93115. } || function (d, b) {
  93116. for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
  93117. };
  93118. return _extendStatics(d, b);
  93119. };
  93120. function __extends(d, b) {
  93121. _extendStatics(d, b);
  93122. function __() {
  93123. this.constructor = d;
  93124. }
  93125. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  93126. }
  93127. function __awaiter(thisArg, _arguments, P, generator) {
  93128. function adopt(value) {
  93129. return value instanceof P ? value : new P(function (resolve) {
  93130. resolve(value);
  93131. });
  93132. }
  93133. return new (P || (P = Promise))(function (resolve, reject) {
  93134. function fulfilled(value) {
  93135. try {
  93136. step(generator.next(value));
  93137. } catch (e) {
  93138. reject(e);
  93139. }
  93140. }
  93141. function rejected(value) {
  93142. try {
  93143. step(generator["throw"](value));
  93144. } catch (e) {
  93145. reject(e);
  93146. }
  93147. }
  93148. function step(result) {
  93149. result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
  93150. }
  93151. step((generator = generator.apply(thisArg, _arguments || [])).next());
  93152. });
  93153. }
  93154. function __generator(thisArg, body) {
  93155. var _ = {
  93156. label: 0,
  93157. sent: function sent() {
  93158. if (t[0] & 1) throw t[1];
  93159. return t[1];
  93160. },
  93161. trys: [],
  93162. ops: []
  93163. },
  93164. f,
  93165. y,
  93166. t,
  93167. g;
  93168. return g = {
  93169. next: verb(0),
  93170. "throw": verb(1),
  93171. "return": verb(2)
  93172. }, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
  93173. return this;
  93174. }), g;
  93175. function verb(n) {
  93176. return function (v) {
  93177. return step([n, v]);
  93178. };
  93179. }
  93180. function step(op) {
  93181. if (f) throw new TypeError("Generator is already executing.");
  93182. while (_) try {
  93183. if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
  93184. if (y = 0, t) op = [op[0] & 2, t.value];
  93185. switch (op[0]) {
  93186. case 0:
  93187. case 1:
  93188. t = op;
  93189. break;
  93190. case 4:
  93191. _.label++;
  93192. return {
  93193. value: op[1],
  93194. done: false
  93195. };
  93196. case 5:
  93197. _.label++;
  93198. y = op[1];
  93199. op = [0];
  93200. continue;
  93201. case 7:
  93202. op = _.ops.pop();
  93203. _.trys.pop();
  93204. continue;
  93205. default:
  93206. if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
  93207. _ = 0;
  93208. continue;
  93209. }
  93210. if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
  93211. _.label = op[1];
  93212. break;
  93213. }
  93214. if (op[0] === 6 && _.label < t[1]) {
  93215. _.label = t[1];
  93216. t = op;
  93217. break;
  93218. }
  93219. if (t && _.label < t[2]) {
  93220. _.label = t[2];
  93221. _.ops.push(op);
  93222. break;
  93223. }
  93224. if (t[2]) _.ops.pop();
  93225. _.trys.pop();
  93226. continue;
  93227. }
  93228. op = body.call(thisArg, _);
  93229. } catch (e) {
  93230. op = [6, e];
  93231. y = 0;
  93232. } finally {
  93233. f = t = 0;
  93234. }
  93235. if (op[0] & 5) throw op[1];
  93236. return {
  93237. value: op[0] ? op[1] : void 0,
  93238. done: true
  93239. };
  93240. }
  93241. }
  93242. function __values(o) {
  93243. var s = typeof Symbol === "function" && Symbol.iterator,
  93244. m = s && o[s],
  93245. i = 0;
  93246. if (m) return m.call(o);
  93247. if (o && typeof o.length === "number") return {
  93248. next: function next() {
  93249. if (o && i >= o.length) o = void 0;
  93250. return {
  93251. value: o && o[i++],
  93252. done: !o
  93253. };
  93254. }
  93255. };
  93256. throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
  93257. }
  93258. function __await(v) {
  93259. return this instanceof __await ? (this.v = v, this) : new __await(v);
  93260. }
  93261. function __asyncGenerator(thisArg, _arguments, generator) {
  93262. if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  93263. var g = generator.apply(thisArg, _arguments || []),
  93264. i,
  93265. q = [];
  93266. return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () {
  93267. return this;
  93268. }, i;
  93269. function verb(n) {
  93270. if (g[n]) i[n] = function (v) {
  93271. return new Promise(function (a, b) {
  93272. q.push([n, v, a, b]) > 1 || resume(n, v);
  93273. });
  93274. };
  93275. }
  93276. function resume(n, v) {
  93277. try {
  93278. step(g[n](v));
  93279. } catch (e) {
  93280. settle(q[0][3], e);
  93281. }
  93282. }
  93283. function step(r) {
  93284. r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r);
  93285. }
  93286. function fulfill(value) {
  93287. resume("next", value);
  93288. }
  93289. function reject(value) {
  93290. resume("throw", value);
  93291. }
  93292. function settle(f, v) {
  93293. if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]);
  93294. }
  93295. }
  93296. /** An error subclass which is thrown when there are too many pending push or next operations on a single repeater. */
  93297. var RepeaterOverflowError = /** @class */function (_super) {
  93298. __extends(RepeaterOverflowError, _super);
  93299. function RepeaterOverflowError(message) {
  93300. var _this = _super.call(this, message) || this;
  93301. Object.defineProperty(_this, "name", {
  93302. value: "RepeaterOverflowError",
  93303. enumerable: false
  93304. });
  93305. if (typeof Object.setPrototypeOf === "function") {
  93306. Object.setPrototypeOf(_this, _this.constructor.prototype);
  93307. } else {
  93308. _this.__proto__ = _this.constructor.prototype;
  93309. }
  93310. if (typeof Error.captureStackTrace === "function") {
  93311. Error.captureStackTrace(_this, _this.constructor);
  93312. }
  93313. return _this;
  93314. }
  93315. return RepeaterOverflowError;
  93316. }(Error);
  93317. /** A buffer which allows you to push a set amount of values to the repeater without pushes waiting or throwing errors. */
  93318. var FixedBuffer = /** @class */function () {
  93319. function FixedBuffer(capacity) {
  93320. if (capacity < 0) {
  93321. throw new RangeError("Capacity may not be less than 0");
  93322. }
  93323. this._c = capacity;
  93324. this._q = [];
  93325. }
  93326. Object.defineProperty(FixedBuffer.prototype, "empty", {
  93327. get: function get() {
  93328. return this._q.length === 0;
  93329. },
  93330. enumerable: false,
  93331. configurable: true
  93332. });
  93333. Object.defineProperty(FixedBuffer.prototype, "full", {
  93334. get: function get() {
  93335. return this._q.length >= this._c;
  93336. },
  93337. enumerable: false,
  93338. configurable: true
  93339. });
  93340. FixedBuffer.prototype.add = function (value) {
  93341. if (this.full) {
  93342. throw new Error("Buffer full");
  93343. } else {
  93344. this._q.push(value);
  93345. }
  93346. };
  93347. FixedBuffer.prototype.remove = function () {
  93348. if (this.empty) {
  93349. throw new Error("Buffer empty");
  93350. }
  93351. return this._q.shift();
  93352. };
  93353. return FixedBuffer;
  93354. }();
  93355. // TODO: Use a circular buffer here.
  93356. /** Sliding buffers allow you to push a set amount of values to the repeater without pushes waiting or throwing errors. If the number of values exceeds the capacity set in the constructor, the buffer will discard the earliest values added. */
  93357. var SlidingBuffer = /** @class */function () {
  93358. function SlidingBuffer(capacity) {
  93359. if (capacity < 1) {
  93360. throw new RangeError("Capacity may not be less than 1");
  93361. }
  93362. this._c = capacity;
  93363. this._q = [];
  93364. }
  93365. Object.defineProperty(SlidingBuffer.prototype, "empty", {
  93366. get: function get() {
  93367. return this._q.length === 0;
  93368. },
  93369. enumerable: false,
  93370. configurable: true
  93371. });
  93372. Object.defineProperty(SlidingBuffer.prototype, "full", {
  93373. get: function get() {
  93374. return false;
  93375. },
  93376. enumerable: false,
  93377. configurable: true
  93378. });
  93379. SlidingBuffer.prototype.add = function (value) {
  93380. while (this._q.length >= this._c) {
  93381. this._q.shift();
  93382. }
  93383. this._q.push(value);
  93384. };
  93385. SlidingBuffer.prototype.remove = function () {
  93386. if (this.empty) {
  93387. throw new Error("Buffer empty");
  93388. }
  93389. return this._q.shift();
  93390. };
  93391. return SlidingBuffer;
  93392. }();
  93393. /** Dropping buffers allow you to push a set amount of values to the repeater without the push function waiting or throwing errors. If the number of values exceeds the capacity set in the constructor, the buffer will discard the latest values added. */
  93394. var DroppingBuffer = /** @class */function () {
  93395. function DroppingBuffer(capacity) {
  93396. if (capacity < 1) {
  93397. throw new RangeError("Capacity may not be less than 1");
  93398. }
  93399. this._c = capacity;
  93400. this._q = [];
  93401. }
  93402. Object.defineProperty(DroppingBuffer.prototype, "empty", {
  93403. get: function get() {
  93404. return this._q.length === 0;
  93405. },
  93406. enumerable: false,
  93407. configurable: true
  93408. });
  93409. Object.defineProperty(DroppingBuffer.prototype, "full", {
  93410. get: function get() {
  93411. return false;
  93412. },
  93413. enumerable: false,
  93414. configurable: true
  93415. });
  93416. DroppingBuffer.prototype.add = function (value) {
  93417. if (this._q.length < this._c) {
  93418. this._q.push(value);
  93419. }
  93420. };
  93421. DroppingBuffer.prototype.remove = function () {
  93422. if (this.empty) {
  93423. throw new Error("Buffer empty");
  93424. }
  93425. return this._q.shift();
  93426. };
  93427. return DroppingBuffer;
  93428. }();
  93429. /** Makes sure promise-likes don’t cause unhandled rejections. */
  93430. function swallow(value) {
  93431. if (value != null && typeof value.then === "function") {
  93432. value.then(NOOP, NOOP);
  93433. }
  93434. }
  93435. /*** REPEATER STATES ***/
  93436. /** The following is an enumeration of all possible repeater states. These states are ordered, and a repeater may only advance to higher states. */
  93437. /** The initial state of the repeater. */
  93438. var Initial = 0;
  93439. /** Repeaters advance to this state the first time the next method is called on the repeater. */
  93440. var Started = 1;
  93441. /** Repeaters advance to this state when the stop function is called. */
  93442. var Stopped = 2;
  93443. /** Repeaters advance to this state when there are no values left to be pulled from the repeater. */
  93444. var Done = 3;
  93445. /** Repeaters advance to this state if an error is thrown into the repeater. */
  93446. var Rejected = 4;
  93447. /** The maximum number of push or next operations which may exist on a single repeater. */
  93448. var MAX_QUEUE_LENGTH = 1024;
  93449. var NOOP = function NOOP() {};
  93450. /** A helper function used to mimic the behavior of async generators where the final iteration is consumed. */
  93451. function consumeExecution(r) {
  93452. var err = r.err;
  93453. var execution = Promise.resolve(r.execution).then(function (value) {
  93454. if (err != null) {
  93455. throw err;
  93456. }
  93457. return value;
  93458. });
  93459. r.err = undefined;
  93460. r.execution = execution.then(function () {
  93461. return undefined;
  93462. }, function () {
  93463. return undefined;
  93464. });
  93465. return r.pending === undefined ? execution : r.pending.then(function () {
  93466. return execution;
  93467. });
  93468. }
  93469. /** A helper function for building iterations from values. Promises are unwrapped, so that iterations never have their value property set to a promise. */
  93470. function createIteration(r, value) {
  93471. var done = r.state >= Done;
  93472. return Promise.resolve(value).then(function (value) {
  93473. if (!done && r.state >= Rejected) {
  93474. return consumeExecution(r).then(function (value) {
  93475. return {
  93476. value: value,
  93477. done: true
  93478. };
  93479. });
  93480. }
  93481. return {
  93482. value: value,
  93483. done: done
  93484. };
  93485. });
  93486. }
  93487. /**
  93488. * This function is bound and passed to the executor as the stop argument.
  93489. *
  93490. * Advances state to Stopped.
  93491. */
  93492. function stop(r, err) {
  93493. var e_1, _a;
  93494. if (r.state >= Stopped) {
  93495. return;
  93496. }
  93497. r.state = Stopped;
  93498. r.onnext();
  93499. r.onstop();
  93500. if (r.err == null) {
  93501. r.err = err;
  93502. }
  93503. if (r.pushes.length === 0 && (typeof r.buffer === "undefined" || r.buffer.empty)) {
  93504. finish(r);
  93505. } else {
  93506. try {
  93507. for (var _b = __values(r.pushes), _d = _b.next(); !_d.done; _d = _b.next()) {
  93508. var push_1 = _d.value;
  93509. push_1.resolve();
  93510. }
  93511. } catch (e_1_1) {
  93512. e_1 = {
  93513. error: e_1_1
  93514. };
  93515. } finally {
  93516. try {
  93517. if (_d && !_d.done && (_a = _b["return"])) _a.call(_b);
  93518. } finally {
  93519. if (e_1) throw e_1.error;
  93520. }
  93521. }
  93522. }
  93523. }
  93524. /**
  93525. * The difference between stopping a repeater vs finishing a repeater is that stopping a repeater allows next to continue to drain values from the push queue and buffer, while finishing a repeater will clear all pending values and end iteration immediately. Once, a repeater is finished, all iterations will have the done property set to true.
  93526. *
  93527. * Advances state to Done.
  93528. */
  93529. function finish(r) {
  93530. var e_2, _a;
  93531. if (r.state >= Done) {
  93532. return;
  93533. }
  93534. if (r.state < Stopped) {
  93535. stop(r);
  93536. }
  93537. r.state = Done;
  93538. r.buffer = undefined;
  93539. try {
  93540. for (var _b = __values(r.nexts), _d = _b.next(); !_d.done; _d = _b.next()) {
  93541. var next = _d.value;
  93542. var execution = r.pending === undefined ? consumeExecution(r) : r.pending.then(function () {
  93543. return consumeExecution(r);
  93544. });
  93545. next.resolve(createIteration(r, execution));
  93546. }
  93547. } catch (e_2_1) {
  93548. e_2 = {
  93549. error: e_2_1
  93550. };
  93551. } finally {
  93552. try {
  93553. if (_d && !_d.done && (_a = _b["return"])) _a.call(_b);
  93554. } finally {
  93555. if (e_2) throw e_2.error;
  93556. }
  93557. }
  93558. r.pushes = [];
  93559. r.nexts = [];
  93560. }
  93561. /**
  93562. * Called when a promise passed to push rejects, or when a push call is unhandled.
  93563. *
  93564. * Advances state to Rejected.
  93565. */
  93566. function reject(r) {
  93567. if (r.state >= Rejected) {
  93568. return;
  93569. }
  93570. if (r.state < Done) {
  93571. finish(r);
  93572. }
  93573. r.state = Rejected;
  93574. }
  93575. /** This function is bound and passed to the executor as the push argument. */
  93576. function push(r, value) {
  93577. swallow(value);
  93578. if (r.pushes.length >= MAX_QUEUE_LENGTH) {
  93579. throw new RepeaterOverflowError("No more than " + MAX_QUEUE_LENGTH + " pending calls to push are allowed on a single repeater.");
  93580. } else if (r.state >= Stopped) {
  93581. return Promise.resolve(undefined);
  93582. }
  93583. var valueP = r.pending === undefined ? Promise.resolve(value) : r.pending.then(function () {
  93584. return value;
  93585. });
  93586. valueP = valueP["catch"](function (err) {
  93587. if (r.state < Stopped) {
  93588. r.err = err;
  93589. }
  93590. reject(r);
  93591. return undefined; // void :(
  93592. });
  93593. var nextP;
  93594. if (r.nexts.length) {
  93595. var next_1 = r.nexts.shift();
  93596. next_1.resolve(createIteration(r, valueP));
  93597. if (r.nexts.length) {
  93598. nextP = Promise.resolve(r.nexts[0].value);
  93599. } else {
  93600. nextP = new Promise(function (resolve) {
  93601. return r.onnext = resolve;
  93602. });
  93603. }
  93604. } else if (typeof r.buffer !== "undefined" && !r.buffer.full) {
  93605. r.buffer.add(valueP);
  93606. nextP = Promise.resolve(undefined);
  93607. } else {
  93608. nextP = new Promise(function (resolve) {
  93609. return r.pushes.push({
  93610. resolve: resolve,
  93611. value: valueP
  93612. });
  93613. });
  93614. }
  93615. // If an error is thrown into the repeater via the next or throw methods, we give the repeater a chance to handle this by rejecting the promise returned from push. If the push call is not immediately handled we throw the next iteration of the repeater.
  93616. // To check that the promise returned from push is floating, we modify the then and catch methods of the returned promise so that they flip the floating flag. The push function actually does not return a promise, because modern engines do not call the then and catch methods on native promises. By making next a plain old javascript object, we ensure that the then and catch methods will be called.
  93617. var floating = true;
  93618. var next = {};
  93619. var unhandled = nextP["catch"](function (err) {
  93620. if (floating) {
  93621. throw err;
  93622. }
  93623. return undefined; // void :(
  93624. });
  93625. next.then = function (onfulfilled, onrejected) {
  93626. floating = false;
  93627. return Promise.prototype.then.call(nextP, onfulfilled, onrejected);
  93628. };
  93629. next["catch"] = function (onrejected) {
  93630. floating = false;
  93631. return Promise.prototype["catch"].call(nextP, onrejected);
  93632. };
  93633. next["finally"] = nextP["finally"].bind(nextP);
  93634. r.pending = valueP.then(function () {
  93635. return unhandled;
  93636. })["catch"](function (err) {
  93637. r.err = err;
  93638. reject(r);
  93639. });
  93640. return next;
  93641. }
  93642. /**
  93643. * Creates the stop callable promise which is passed to the executor
  93644. */
  93645. function createStop(r) {
  93646. var stop1 = stop.bind(null, r);
  93647. var stopP = new Promise(function (resolve) {
  93648. return r.onstop = resolve;
  93649. });
  93650. stop1.then = stopP.then.bind(stopP);
  93651. stop1["catch"] = stopP["catch"].bind(stopP);
  93652. stop1["finally"] = stopP["finally"].bind(stopP);
  93653. return stop1;
  93654. }
  93655. /**
  93656. * Calls the executor passed into the constructor. This function is called the first time the next method is called on the repeater.
  93657. *
  93658. * Advances state to Started.
  93659. */
  93660. function execute(r) {
  93661. if (r.state >= Started) {
  93662. return;
  93663. }
  93664. r.state = Started;
  93665. var push1 = push.bind(null, r);
  93666. var stop1 = createStop(r);
  93667. r.execution = new Promise(function (resolve) {
  93668. return resolve(r.executor(push1, stop1));
  93669. });
  93670. // TODO: We should consider stopping all repeaters when the executor settles.
  93671. r.execution["catch"](function () {
  93672. return stop(r);
  93673. });
  93674. }
  93675. var records = new WeakMap();
  93676. // NOTE: While repeaters implement and are assignable to the AsyncGenerator interface, and you can use the types interchangeably, we don’t use typescript’s implements syntax here because this would make supporting earlier versions of typescript trickier. This is because TypeScript version 3.6 changed the iterator types by adding the TReturn and TNext type parameters.
  93677. var Repeater = /** @class */function () {
  93678. function Repeater(executor, buffer) {
  93679. records.set(this, {
  93680. executor: executor,
  93681. buffer: buffer,
  93682. err: undefined,
  93683. state: Initial,
  93684. pushes: [],
  93685. nexts: [],
  93686. pending: undefined,
  93687. execution: undefined,
  93688. onnext: NOOP,
  93689. onstop: NOOP
  93690. });
  93691. }
  93692. Repeater.prototype.next = function (value) {
  93693. swallow(value);
  93694. var r = records.get(this);
  93695. if (r === undefined) {
  93696. throw new Error("WeakMap error");
  93697. }
  93698. if (r.nexts.length >= MAX_QUEUE_LENGTH) {
  93699. throw new RepeaterOverflowError("No more than " + MAX_QUEUE_LENGTH + " pending calls to next are allowed on a single repeater.");
  93700. }
  93701. if (r.state <= Initial) {
  93702. execute(r);
  93703. }
  93704. r.onnext(value);
  93705. if (typeof r.buffer !== "undefined" && !r.buffer.empty) {
  93706. var result = createIteration(r, r.buffer.remove());
  93707. if (r.pushes.length) {
  93708. var push_2 = r.pushes.shift();
  93709. r.buffer.add(push_2.value);
  93710. r.onnext = push_2.resolve;
  93711. }
  93712. return result;
  93713. } else if (r.pushes.length) {
  93714. var push_3 = r.pushes.shift();
  93715. r.onnext = push_3.resolve;
  93716. return createIteration(r, push_3.value);
  93717. } else if (r.state >= Stopped) {
  93718. finish(r);
  93719. return createIteration(r, consumeExecution(r));
  93720. }
  93721. return new Promise(function (resolve) {
  93722. return r.nexts.push({
  93723. resolve: resolve,
  93724. value: value
  93725. });
  93726. });
  93727. };
  93728. Repeater.prototype["return"] = function (value) {
  93729. swallow(value);
  93730. var r = records.get(this);
  93731. if (r === undefined) {
  93732. throw new Error("WeakMap error");
  93733. }
  93734. finish(r);
  93735. // We override the execution because return should always return the value passed in.
  93736. r.execution = Promise.resolve(r.execution).then(function () {
  93737. return value;
  93738. });
  93739. return createIteration(r, consumeExecution(r));
  93740. };
  93741. Repeater.prototype["throw"] = function (err) {
  93742. var r = records.get(this);
  93743. if (r === undefined) {
  93744. throw new Error("WeakMap error");
  93745. }
  93746. if (r.state <= Initial || r.state >= Stopped || typeof r.buffer !== "undefined" && !r.buffer.empty) {
  93747. finish(r);
  93748. // If r.err is already set, that mean the repeater has already produced an error, so we throw that error rather than the error passed in, because doing so might be more informative for the caller.
  93749. if (r.err == null) {
  93750. r.err = err;
  93751. }
  93752. return createIteration(r, consumeExecution(r));
  93753. }
  93754. return this.next(Promise.reject(err));
  93755. };
  93756. Repeater.prototype[Symbol.asyncIterator] = function () {
  93757. return this;
  93758. };
  93759. // TODO: Remove these static methods from the class.
  93760. Repeater.race = race;
  93761. Repeater.merge = merge;
  93762. Repeater.zip = zip;
  93763. Repeater.latest = latest;
  93764. return Repeater;
  93765. }();
  93766. /*** COMBINATOR FUNCTIONS ***/
  93767. // TODO: move these combinators to their own file.
  93768. function getIterators(values, options) {
  93769. var e_3, _a;
  93770. var iters = [];
  93771. var _loop_1 = function _loop_1(value) {
  93772. if (value != null && typeof value[Symbol.asyncIterator] === "function") {
  93773. iters.push(value[Symbol.asyncIterator]());
  93774. } else if (value != null && typeof value[Symbol.iterator] === "function") {
  93775. iters.push(value[Symbol.iterator]());
  93776. } else {
  93777. iters.push(function valueToAsyncIterator() {
  93778. return __asyncGenerator(this, arguments, function valueToAsyncIterator_1() {
  93779. return __generator(this, function (_a) {
  93780. switch (_a.label) {
  93781. case 0:
  93782. if (!options.yieldValues) return [3 /*break*/, 3];
  93783. return [4 /*yield*/, __await(value)];
  93784. case 1:
  93785. return [4 /*yield*/, _a.sent()];
  93786. case 2:
  93787. _a.sent();
  93788. _a.label = 3;
  93789. case 3:
  93790. if (!options.returnValues) return [3 /*break*/, 5];
  93791. return [4 /*yield*/, __await(value)];
  93792. case 4:
  93793. return [2 /*return*/, _a.sent()];
  93794. case 5:
  93795. return [2 /*return*/];
  93796. }
  93797. });
  93798. });
  93799. }());
  93800. }
  93801. };
  93802. try {
  93803. for (var values_1 = __values(values), values_1_1 = values_1.next(); !values_1_1.done; values_1_1 = values_1.next()) {
  93804. var value = values_1_1.value;
  93805. _loop_1(value);
  93806. }
  93807. } catch (e_3_1) {
  93808. e_3 = {
  93809. error: e_3_1
  93810. };
  93811. } finally {
  93812. try {
  93813. if (values_1_1 && !values_1_1.done && (_a = values_1["return"])) _a.call(values_1);
  93814. } finally {
  93815. if (e_3) throw e_3.error;
  93816. }
  93817. }
  93818. return iters;
  93819. }
  93820. // NOTE: whenever you see any variables called `advance` or `advances`, know that it is a hack to get around the fact that `Promise.race` leaks memory. These variables are intended to be set to the resolve function of a promise which is constructed and awaited as an alternative to Promise.race. For more information, see this comment in the Node.js issue tracker: https://github.com/nodejs/node/issues/17469#issuecomment-685216777.
  93821. function race(contenders) {
  93822. var _this = this;
  93823. var iters = getIterators(contenders, {
  93824. returnValues: true
  93825. });
  93826. return new Repeater(function (push, stop) {
  93827. return __awaiter(_this, void 0, void 0, function () {
  93828. var advance, stopped, finalIteration, iteration, i_1, _loop_2;
  93829. return __generator(this, function (_a) {
  93830. switch (_a.label) {
  93831. case 0:
  93832. if (!iters.length) {
  93833. stop();
  93834. return [2 /*return*/];
  93835. }
  93836. stopped = false;
  93837. stop.then(function () {
  93838. advance();
  93839. stopped = true;
  93840. });
  93841. _a.label = 1;
  93842. case 1:
  93843. _a.trys.push([1,, 5, 7]);
  93844. iteration = void 0;
  93845. i_1 = 0;
  93846. _loop_2 = function _loop_2() {
  93847. var j, iters_1, iters_1_1, iter;
  93848. var e_4, _a;
  93849. return __generator(this, function (_b) {
  93850. switch (_b.label) {
  93851. case 0:
  93852. j = i_1;
  93853. try {
  93854. for (iters_1 = (e_4 = void 0, __values(iters)), iters_1_1 = iters_1.next(); !iters_1_1.done; iters_1_1 = iters_1.next()) {
  93855. iter = iters_1_1.value;
  93856. Promise.resolve(iter.next()).then(function (iteration) {
  93857. if (iteration.done) {
  93858. stop();
  93859. if (finalIteration === undefined) {
  93860. finalIteration = iteration;
  93861. }
  93862. } else if (i_1 === j) {
  93863. // This iterator has won, advance i and resolve the promise.
  93864. i_1++;
  93865. advance(iteration);
  93866. }
  93867. }, function (err) {
  93868. return stop(err);
  93869. });
  93870. }
  93871. } catch (e_4_1) {
  93872. e_4 = {
  93873. error: e_4_1
  93874. };
  93875. } finally {
  93876. try {
  93877. if (iters_1_1 && !iters_1_1.done && (_a = iters_1["return"])) _a.call(iters_1);
  93878. } finally {
  93879. if (e_4) throw e_4.error;
  93880. }
  93881. }
  93882. return [4 /*yield*/, new Promise(function (resolve) {
  93883. return advance = resolve;
  93884. })];
  93885. case 1:
  93886. iteration = _b.sent();
  93887. if (!(iteration !== undefined)) return [3 /*break*/, 3];
  93888. return [4 /*yield*/, push(iteration.value)];
  93889. case 2:
  93890. _b.sent();
  93891. _b.label = 3;
  93892. case 3:
  93893. return [2 /*return*/];
  93894. }
  93895. });
  93896. };
  93897. _a.label = 2;
  93898. case 2:
  93899. if (!!stopped) return [3 /*break*/, 4];
  93900. return [5 /*yield**/, _loop_2()];
  93901. case 3:
  93902. _a.sent();
  93903. return [3 /*break*/, 2];
  93904. case 4:
  93905. return [2 /*return*/, finalIteration && finalIteration.value];
  93906. case 5:
  93907. stop();
  93908. return [4 /*yield*/, Promise.race(iters.map(function (iter) {
  93909. return iter["return"] && iter["return"]();
  93910. }))];
  93911. case 6:
  93912. _a.sent();
  93913. return [7 /*endfinally*/];
  93914. case 7:
  93915. return [2 /*return*/];
  93916. }
  93917. });
  93918. });
  93919. });
  93920. }
  93921. function merge(contenders) {
  93922. var _this = this;
  93923. var iters = getIterators(contenders, {
  93924. yieldValues: true
  93925. });
  93926. return new Repeater(function (push, stop) {
  93927. return __awaiter(_this, void 0, void 0, function () {
  93928. var advances, stopped, finalIteration;
  93929. var _this = this;
  93930. return __generator(this, function (_a) {
  93931. switch (_a.label) {
  93932. case 0:
  93933. if (!iters.length) {
  93934. stop();
  93935. return [2 /*return*/];
  93936. }
  93937. advances = [];
  93938. stopped = false;
  93939. stop.then(function () {
  93940. var e_5, _a;
  93941. stopped = true;
  93942. try {
  93943. for (var advances_1 = __values(advances), advances_1_1 = advances_1.next(); !advances_1_1.done; advances_1_1 = advances_1.next()) {
  93944. var advance = advances_1_1.value;
  93945. advance();
  93946. }
  93947. } catch (e_5_1) {
  93948. e_5 = {
  93949. error: e_5_1
  93950. };
  93951. } finally {
  93952. try {
  93953. if (advances_1_1 && !advances_1_1.done && (_a = advances_1["return"])) _a.call(advances_1);
  93954. } finally {
  93955. if (e_5) throw e_5.error;
  93956. }
  93957. }
  93958. });
  93959. _a.label = 1;
  93960. case 1:
  93961. _a.trys.push([1,, 3, 4]);
  93962. return [4 /*yield*/, Promise.all(iters.map(function (iter, i) {
  93963. return __awaiter(_this, void 0, void 0, function () {
  93964. var iteration, _a;
  93965. return __generator(this, function (_b) {
  93966. switch (_b.label) {
  93967. case 0:
  93968. _b.trys.push([0,, 6, 9]);
  93969. _b.label = 1;
  93970. case 1:
  93971. if (!!stopped) return [3 /*break*/, 5];
  93972. Promise.resolve(iter.next()).then(function (iteration) {
  93973. return advances[i](iteration);
  93974. }, function (err) {
  93975. return stop(err);
  93976. });
  93977. return [4 /*yield*/, new Promise(function (resolve) {
  93978. advances[i] = resolve;
  93979. })];
  93980. case 2:
  93981. iteration = _b.sent();
  93982. if (!(iteration !== undefined)) return [3 /*break*/, 4];
  93983. if (iteration.done) {
  93984. finalIteration = iteration;
  93985. return [2 /*return*/];
  93986. }
  93987. return [4 /*yield*/, push(iteration.value)];
  93988. case 3:
  93989. _b.sent();
  93990. _b.label = 4;
  93991. case 4:
  93992. return [3 /*break*/, 1];
  93993. case 5:
  93994. return [3 /*break*/, 9];
  93995. case 6:
  93996. _a = iter["return"];
  93997. if (!_a) return [3 /*break*/, 8];
  93998. return [4 /*yield*/, iter["return"]()];
  93999. case 7:
  94000. _a = _b.sent();
  94001. _b.label = 8;
  94002. case 8:
  94003. return [7 /*endfinally*/];
  94004. case 9:
  94005. return [2 /*return*/];
  94006. }
  94007. });
  94008. });
  94009. }))];
  94010. case 2:
  94011. _a.sent();
  94012. return [2 /*return*/, finalIteration && finalIteration.value];
  94013. case 3:
  94014. stop();
  94015. return [7 /*endfinally*/];
  94016. case 4:
  94017. return [2 /*return*/];
  94018. }
  94019. });
  94020. });
  94021. });
  94022. }
  94023. function zip(contenders) {
  94024. var _this = this;
  94025. var iters = getIterators(contenders, {
  94026. returnValues: true
  94027. });
  94028. return new Repeater(function (push, stop) {
  94029. return __awaiter(_this, void 0, void 0, function () {
  94030. var advance, stopped, iterations, values;
  94031. return __generator(this, function (_a) {
  94032. switch (_a.label) {
  94033. case 0:
  94034. if (!iters.length) {
  94035. stop();
  94036. return [2 /*return*/, []];
  94037. }
  94038. stopped = false;
  94039. stop.then(function () {
  94040. advance();
  94041. stopped = true;
  94042. });
  94043. _a.label = 1;
  94044. case 1:
  94045. _a.trys.push([1,, 6, 8]);
  94046. _a.label = 2;
  94047. case 2:
  94048. if (!!stopped) return [3 /*break*/, 5];
  94049. Promise.all(iters.map(function (iter) {
  94050. return iter.next();
  94051. })).then(function (iterations) {
  94052. return advance(iterations);
  94053. }, function (err) {
  94054. return stop(err);
  94055. });
  94056. return [4 /*yield*/, new Promise(function (resolve) {
  94057. return advance = resolve;
  94058. })];
  94059. case 3:
  94060. iterations = _a.sent();
  94061. if (iterations === undefined) {
  94062. return [2 /*return*/];
  94063. }
  94064. values = iterations.map(function (iteration) {
  94065. return iteration.value;
  94066. });
  94067. if (iterations.some(function (iteration) {
  94068. return iteration.done;
  94069. })) {
  94070. return [2 /*return*/, values];
  94071. }
  94072. return [4 /*yield*/, push(values)];
  94073. case 4:
  94074. _a.sent();
  94075. return [3 /*break*/, 2];
  94076. case 5:
  94077. return [3 /*break*/, 8];
  94078. case 6:
  94079. stop();
  94080. return [4 /*yield*/, Promise.all(iters.map(function (iter) {
  94081. return iter["return"] && iter["return"]();
  94082. }))];
  94083. case 7:
  94084. _a.sent();
  94085. return [7 /*endfinally*/];
  94086. case 8:
  94087. return [2 /*return*/];
  94088. }
  94089. });
  94090. });
  94091. });
  94092. }
  94093. function latest(contenders) {
  94094. var _this = this;
  94095. var iters = getIterators(contenders, {
  94096. yieldValues: true,
  94097. returnValues: true
  94098. });
  94099. return new Repeater(function (push, stop) {
  94100. return __awaiter(_this, void 0, void 0, function () {
  94101. var advance, advances, stopped, iterations_1, values_2;
  94102. var _this = this;
  94103. return __generator(this, function (_a) {
  94104. switch (_a.label) {
  94105. case 0:
  94106. if (!iters.length) {
  94107. stop();
  94108. return [2 /*return*/, []];
  94109. }
  94110. advances = [];
  94111. stopped = false;
  94112. stop.then(function () {
  94113. var e_6, _a;
  94114. advance();
  94115. try {
  94116. for (var advances_2 = __values(advances), advances_2_1 = advances_2.next(); !advances_2_1.done; advances_2_1 = advances_2.next()) {
  94117. var advance1 = advances_2_1.value;
  94118. advance1();
  94119. }
  94120. } catch (e_6_1) {
  94121. e_6 = {
  94122. error: e_6_1
  94123. };
  94124. } finally {
  94125. try {
  94126. if (advances_2_1 && !advances_2_1.done && (_a = advances_2["return"])) _a.call(advances_2);
  94127. } finally {
  94128. if (e_6) throw e_6.error;
  94129. }
  94130. }
  94131. stopped = true;
  94132. });
  94133. _a.label = 1;
  94134. case 1:
  94135. _a.trys.push([1,, 5, 7]);
  94136. Promise.all(iters.map(function (iter) {
  94137. return iter.next();
  94138. })).then(function (iterations) {
  94139. return advance(iterations);
  94140. }, function (err) {
  94141. return stop(err);
  94142. });
  94143. return [4 /*yield*/, new Promise(function (resolve) {
  94144. return advance = resolve;
  94145. })];
  94146. case 2:
  94147. iterations_1 = _a.sent();
  94148. if (iterations_1 === undefined) {
  94149. return [2 /*return*/];
  94150. }
  94151. values_2 = iterations_1.map(function (iteration) {
  94152. return iteration.value;
  94153. });
  94154. if (iterations_1.every(function (iteration) {
  94155. return iteration.done;
  94156. })) {
  94157. return [2 /*return*/, values_2];
  94158. }
  94159. // We continuously yield and mutate the same values array so we shallow copy it each time it is pushed.
  94160. return [4 /*yield*/, push(values_2.slice())];
  94161. case 3:
  94162. // We continuously yield and mutate the same values array so we shallow copy it each time it is pushed.
  94163. _a.sent();
  94164. return [4 /*yield*/, Promise.all(iters.map(function (iter, i) {
  94165. return __awaiter(_this, void 0, void 0, function () {
  94166. var iteration;
  94167. return __generator(this, function (_a) {
  94168. switch (_a.label) {
  94169. case 0:
  94170. if (iterations_1[i].done) {
  94171. return [2 /*return*/, iterations_1[i].value];
  94172. }
  94173. _a.label = 1;
  94174. case 1:
  94175. if (!!stopped) return [3 /*break*/, 4];
  94176. Promise.resolve(iter.next()).then(function (iteration) {
  94177. return advances[i](iteration);
  94178. }, function (err) {
  94179. return stop(err);
  94180. });
  94181. return [4 /*yield*/, new Promise(function (resolve) {
  94182. return advances[i] = resolve;
  94183. })];
  94184. case 2:
  94185. iteration = _a.sent();
  94186. if (iteration === undefined) {
  94187. return [2 /*return*/, iterations_1[i].value];
  94188. } else if (iteration.done) {
  94189. return [2 /*return*/, iteration.value];
  94190. }
  94191. values_2[i] = iteration.value;
  94192. return [4 /*yield*/, push(values_2.slice())];
  94193. case 3:
  94194. _a.sent();
  94195. return [3 /*break*/, 1];
  94196. case 4:
  94197. return [2 /*return*/];
  94198. }
  94199. });
  94200. });
  94201. }))];
  94202. case 4:
  94203. return [2 /*return*/, _a.sent()];
  94204. case 5:
  94205. stop();
  94206. return [4 /*yield*/, Promise.all(iters.map(function (iter) {
  94207. return iter["return"] && iter["return"]();
  94208. }))];
  94209. case 6:
  94210. _a.sent();
  94211. return [7 /*endfinally*/];
  94212. case 7:
  94213. return [2 /*return*/];
  94214. }
  94215. });
  94216. });
  94217. });
  94218. }
  94219. __webpack_unused_export__ = DroppingBuffer;
  94220. __webpack_unused_export__ = FixedBuffer;
  94221. __webpack_unused_export__ = MAX_QUEUE_LENGTH;
  94222. exports.ZN = Repeater;
  94223. __webpack_unused_export__ = RepeaterOverflowError;
  94224. __webpack_unused_export__ = SlidingBuffer;
  94225. /***/ })
  94226. /******/ });
  94227. /************************************************************************/
  94228. /******/ // The module cache
  94229. /******/ var __webpack_module_cache__ = {};
  94230. /******/
  94231. /******/ // The require function
  94232. /******/ function __webpack_require__(moduleId) {
  94233. /******/ // Check if module is in cache
  94234. /******/ var cachedModule = __webpack_module_cache__[moduleId];
  94235. /******/ if (cachedModule !== undefined) {
  94236. /******/ return cachedModule.exports;
  94237. /******/ }
  94238. /******/ // Create a new module (and put it into the cache)
  94239. /******/ var module = __webpack_module_cache__[moduleId] = {
  94240. /******/ id: moduleId,
  94241. /******/ loaded: false,
  94242. /******/ exports: {}
  94243. /******/ };
  94244. /******/
  94245. /******/ // Execute the module function
  94246. /******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  94247. /******/
  94248. /******/ // Flag the module as loaded
  94249. /******/ module.loaded = true;
  94250. /******/
  94251. /******/ // Return the exports of the module
  94252. /******/ return module.exports;
  94253. /******/ }
  94254. /******/
  94255. /************************************************************************/
  94256. /******/ /* webpack/runtime/compat get default export */
  94257. /******/ !function() {
  94258. /******/ // getDefaultExport function for compatibility with non-harmony modules
  94259. /******/ __webpack_require__.n = function(module) {
  94260. /******/ var getter = module && module.__esModule ?
  94261. /******/ function() { return module['default']; } :
  94262. /******/ function() { return module; };
  94263. /******/ __webpack_require__.d(getter, { a: getter });
  94264. /******/ return getter;
  94265. /******/ };
  94266. /******/ }();
  94267. /******/
  94268. /******/ /* webpack/runtime/define property getters */
  94269. /******/ !function() {
  94270. /******/ // define getter functions for harmony exports
  94271. /******/ __webpack_require__.d = function(exports, definition) {
  94272. /******/ for(var key in definition) {
  94273. /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
  94274. /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
  94275. /******/ }
  94276. /******/ }
  94277. /******/ };
  94278. /******/ }();
  94279. /******/
  94280. /******/ /* webpack/runtime/global */
  94281. /******/ !function() {
  94282. /******/ __webpack_require__.g = (function() {
  94283. /******/ if (typeof globalThis === 'object') return globalThis;
  94284. /******/ try {
  94285. /******/ return this || new Function('return this')();
  94286. /******/ } catch (e) {
  94287. /******/ if (typeof window === 'object') return window;
  94288. /******/ }
  94289. /******/ })();
  94290. /******/ }();
  94291. /******/
  94292. /******/ /* webpack/runtime/hasOwnProperty shorthand */
  94293. /******/ !function() {
  94294. /******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
  94295. /******/ }();
  94296. /******/
  94297. /******/ /* webpack/runtime/node module decorator */
  94298. /******/ !function() {
  94299. /******/ __webpack_require__.nmd = function(module) {
  94300. /******/ module.paths = [];
  94301. /******/ if (!module.children) module.children = [];
  94302. /******/ return module;
  94303. /******/ };
  94304. /******/ }();
  94305. /******/
  94306. /************************************************************************/
  94307. /******/
  94308. /******/ // startup
  94309. /******/ // Load entry module and return exports
  94310. /******/ // This entry module is referenced by other modules so it can't be inlined
  94311. /******/ __webpack_require__(3123);
  94312. /******/ __webpack_require__(5023);
  94313. /******/ var __webpack_exports__ = __webpack_require__(4595);
  94314. /******/
  94315. /******/ })()
  94316. ;